3 ms·
Interesting. That's very subtle behavior. (Especially since it sometimes fools one into thinking /g option is not enabled when in reality, it's a CR+LF issue.
by jasode 11y ago
Interesting. That's very subtle behavior. (Especially since it sometimes fools one into thinking /g option is not enabled when in reality, it's a CR+LF issue.)
I'm not saying your site's interpretation of Windows CR+LF is "wrong" but the other 5 online[1] regex testers don't behave that way on Windows Chrome browser. I also tested the regex and target text on desktop JGSoft RegexBuddy[2]. None of those required "\s\s" instead of "\s".
Debuggex at the least, is very idiosyncratic since the majority of the other testers don't treat CR+LF that way.
[1]regex testers tried with "([A-Z])\w+\s\w(\d.\d)" on Windows:
http://regexr.com/3b22q http://regexr.com/3b22q
http://regviz.org/ http://regviz.org/
http://www.rexv.org/ http://www.rexv.org/
https://regex101.com/r/eB5jY1/1 https://regex101.com/r/eB5jY1/1
https://www.debuggex.com/r/mci3WLNmHGTEatf6 https://www.debuggex.com/r/mci3WLNmHGTEatf6
[2]http://i.imgur.com/t2L04mO.png http://i.imgur.com/t2L04mO.png
(http://www.regexbuddy.com/ http://www.regexbuddy.com/)
- tsergiu 11y agoNeither choice is great (the other ones that I've tried auto-convert \r\n to \n so it's impossible to test a \r\n string). I don't think there's anyone in particular that's at fault, \r\n causes a messy set of problems.