regular expressions
torhu
fake at address.dude
Sun Mar 11 14:15:45 PDT 2007
0ffh wrote:
> Hi,
>
> just as a short note, is seems as if either
>
> a. the regex parser does not work as documented, or
> b. I have somehow messed up.
>
> To be precise, http://www.digitalmars.com/ctg/regular.html says
> that "." matches any character. I seem to have found at least
> one exception, the newline character "\n".
> Example the string "abc\ndef" is not matched by "^\".*\"$",
> but is by "^\"(.|\n)*\"$".
>
> Can anyone confirm?
It's standard in regex syntax that the dot doesn't match a newline.
Should probably have been mentioned in the docs, though.
Usually there's modifier than makes the dot match newlines too, but I
can't see one on that page.
More information about the Digitalmars-d
mailing list