|
All words starting with the letter "n" and ending with "g", case insensitive
>> /^nw*g$/i
Yeah, seems like backslash got gobbled up in some sort of parsing before what gets displayed on the site. Should be `\w` here.Regarding your other point, characters like `*` won't need escaping within character class. Not sure why only those particular set of characters are deemed "special characters" - why not `-`, `=`, parentheses, curly braces, etc? Also, the site should specify which regex flavor is being generated, I'd guess JS. All said, it is good to see tools to help with regex, as long as the solutions will be tested to make sure it fits their particular problem. |
Really? Huh. I've been escaping them anyway, and I think I'll continue to do so just to avoid ambiguity when reading patterns.
I was about to end this post with "an extra backslash never hurt anybody" but then I realized that this is HN and writing that would surely prompt someone to reply with some bizarre case where an extra backslash caused a cascade of failures which cost a company fifteen million dollars and/or killed 43 people.