regexr icon indicating copy to clipboard operation
regexr copied to clipboard

Wrong explanation for dot character class

Open mumbomedia opened this issue 3 years ago • 1 comments

Screenshot 2021-07-08 at 08-53-34 RegExr Learn, Build, Test RegEx

As you can see from the screenshot, when using the dot character class the text shown in the Tools section is wrong. . Matches any character except linebreaks. Equivalent to [^\n\r]. So the text "Dot. Matches any character including line brea... is definitly wrong. Instead of including is has to be except.

mumbomedia avatar Jul 08 '21 06:07 mumbomedia

This is because you have the s (aka dotall) flag enabled, which allows . to match line breaks. The dynamic hints recognize that, but the documentation is static. We should add a note about dotall to the docs though.

gskinner avatar Jul 09 '21 15:07 gskinner