Live data from Hacker News

Detailed guide on Regex

github.com

1–6 of 6 posts

Re: Detailed guide on Regex

#2
"Just like above example the regular expression ar[.] means: an lowercase character a, followed by letter r, followed by any character."

A period inside a character class is just a period. So that's only going to match "ar."

Re: Detailed guide on Regex

#3
Haven't read the guide, but off the bat it would benefit by at least mentioning the potential for regex with poor performance characteristics or even catastrophic backtracking, and give a few tips on how to avoid them. Neither performance nor backtracking appear in the text anywhere, nor do possessive or atomic.

Re: Detailed guide on Regex

#4

Haven't read the guide, but off the bat it would benefit by at least mentioning the potential for regex with poor performance characteristics or even catastrophic backtracking, and give a few tips on how to avoid them. Neither performance nor backtracking appear in the text anywhere, nor do possessive or atomic.

Word boundaries aren't mentioned either. I use \b quite a bit, was surprised to see it skipped.

Re: Detailed guide on Regex

#5
There are many incompatible regexp dialects. This describes one of the dialects, but it doesn't even say which one.

It is full of errors and omissions. It's certainly not "detailed".

I don't recommend this as a learning source. Sorry.

Re: Detailed guide on Regex

#6
post #2

"Just like above example the regular expression ar[.] means: an lowercase character a, followed by letter r, followed by any character." A period inside a character class is just a period. So that's only going to match "ar."

the example is even worse: the string should match three times, not two. (it misses the a, followed by r, followed by space)