| View previous topic :: View next topic |
| Author |
Message |
Joy2DWorld
Joined: 04 Dec 2006 Posts: 400 Location: Galil, Israel
|
Posted: Sun Jul 01, 2007 1:32 am Post subject: tiny but helpful doc fix... \R = "R" inside chara |
|
|
doc: | Quote: | | In v1.0.46.06+, \R means "any single newline of any type" (namely `r, `n, or `r`n). |
should be...
| Quote: | | In v1.0.46.06+, \R means "any single newline of any type" (namely `r, `n, or `r`n) but not inside a character set ("[\R]") where is means "R" |
_________________ Joyce Jamce |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Thu Jul 05, 2007 1:43 am Post subject: |
|
|
I'm not a PCRE or RegEx expert, this seems like a PCRE bug or quirk. If it's a bug, I think it should be reported and fixed. If it's intentional, I'd like an explanation if anyone knows one.
Thanks. |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5009 Location: imaginationland
|
Posted: Thu Jul 05, 2007 8:32 am Post subject: |
|
|
I think it's intentional, most control chars have special meaning in sets e.g. \b is usually a zero-width word boundary but as [\b] it means a backspace character. _________________
RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10463
|
Posted: Thu Jul 05, 2007 1:06 pm Post subject: |
|
|
| Thanks. I found this mentioned in the PCRE docs, so I've revised the wording to be: \R means "any single newline of any type", namely `r, `n, or `r`n (except inside a character set, where \R is the same as the letter "R"). |
|
| Back to top |
|
 |
|