Earlier quoted context omitted.
Ignoring the flame bait, for me the only things I wish more regex engines supported (cough JavaScript) is the ability to ignore whitespace, and have named groups. Python has a flag to do this, and being able to have multi-line regexes with comments and named groups is phenomenal and greatly improves readability of more complex regexes. In general I would say ~70% of regexes are highly readable. With tools like the ab…
> Ignoring the flame bait, for me the only things I wish more regex engines supported (cough JavaScript) is the ability to ignore whitespace, and have named groups. Irregex? http://synthcode.com/scheme/irregex/
Learn RegEx step by step, from zero to advanced
111–114 of 114 posts
Re: Learn RegEx step by step, from zero to advanced
#112I don't remember why, but I learned regexes maybe my sophomore year of college because it seemed like such an interesting thing that I might need some day? I also started to learn SQL about the same time. Those feel like herculean efforts so foreign now because I've been using them for so long. One day at my second job out of college, I wrote a quick regex for something, and one of my more senior colleagues looked at…
Re: Learn RegEx step by step, from zero to advanced
#113Re: Learn RegEx step by step, from zero to advanced
#114But there are problems in all sorts of escaping. Without peeking into Stack Overflow, can you tell, how to escape properly in grep/sed? If it is running in bash/zsh? In cygwin? In your favorite text editor? In bash/zsh script? How many slashes would you need for an opening bracket? For a pipe?
You just never know. This frustrates heavily.
I don't even try to use sed or grep. Instead, I just write a small Python or Racket script to do the job. This is what I recommend. While learning Regular Expressions, just stick to your favorite programming language with RE support. Like Python or Perl. Use it for everything you need.
Then abide to a heavy burden of escaping in all sorts of exotic environments.