4+ years of programming.

Still have no clue how to make my own regex pattern.

Every single time I need to, I always open 4 cheat sheets and/or stackoverflow.

  • 13
  • 18
    I don't see what's wrong with that
  • 16
    I can do lots with regex, but I'll be damned if I know what version. Sed, perl, grep, they all seem to use a different standardization for things like back-references. Sometimes they don't even like the + operator for god knows what reason. I just throw syntax at them until something sticks.
  • 20
  • 18
    regex101.com is quite good too
  • 19
    I think that being a programmer is more a matter of knowing how to read the docs rather than knowing stuff by heart.
  • 5
    @Gcir I think you're right, but I'll have to check the manual. (:
  • 2
    I once took an Oracle Development course and the instructor is a senior oracle dev and he has loads of files with Regex, I asked him why all this, is it hard to memorize them, he showed me one file and its content is +100000, those regex are not easy to do ma man :)
  • 3
    Regex ain't that complicated you just need practice, I remember the first time I saw it was while making a website on Django and since I didn't know there where libraries out there with tons of regex examples I ended up writing each pattern and testing it on paper.
  • 3
    Practice, practice!
  • 3
    try 20 years and I still look it up when i have write regex..never learn useless things only learn useful concepts..as long as you know what it means you are good..someones gotto keep SO web traffic going
  • 6
    Think about what you want to do and how you'd implement a FSM to recognice it. The writing then is just a "formality". However with regex you'll never finish learning.
    Post a question with what you try to achive and what you tried so far on SO and then, as @arcadesdude suggested head over to regex101.com and let the page explain you the various regex people suggested you.

    Bonus, use regex101.com on your own regex, to verify it.
  • 4
    I once managed to solve one easy task with regex without Internet! Never felt more proud!
  • 0
    Just leaving this here. ๐Ÿ˜
  • 2
    As long as you don't use regex for fucking everything.
  • 2
    @bondman knowing the basics is important regardless of what you do, but I think knowing the basics of regular expressions is essential for CS and Informatics engineers since it's part of computer theory and automatons.
    @Wack regex101 is an awesome tool, use it every time I need Regex.
  • 1
    @JKyll hmm i dont deal with informatics but I spend 2 days of every other sprint on regex related validations, so deal with it regularly and never had trouble picking up only when i wanted to..i understand your take on it though
  • 1
    @arcadesdude love this site. I use it every time I do regex
  • 1
    It took me a long time to understand the syntax of regex. Like others have said, regex101.com is an excellent resource ๐Ÿ‘๐Ÿป
  • 0
    Read the JavaScript Ninja it was the only thing that successfully taught me regex to a point that since reading that book I never had to open a reference page again
  • 1
    Regex is meant to be forgotten
  • 1
    I like that regex101 is popular. It's such a neat thing.
    @baskaros try using regex for all things even simple find and replace if you want motivation. It helps if you're working with legacy code and you need to edit a lot.
  • 0
    @dr-ant I'll try that, thanks for the tip! ;)
  • 2
    Regex is what you call "write-only".
Add Comment