Thread overview | ||||||
---|---|---|---|---|---|---|
|
January 31, 2005 Regular Expression problems... | ||||
---|---|---|---|---|
| ||||
On the Regular Expression "help" guide, it says that "\char" means to match that "char" literally. However, when I do this, I get a warning similar to this: undefined escape sequence \{ What do I do? |
January 31, 2005 Re: Regular Expression problems... | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | > undefined escape sequence \{ > What do I do? Try to use following sequence [{] instead. I am not sure though will it work or not in this particular implementation. Andrew Fedoniouk. http://terrainformatica.com |
January 31, 2005 Re: Regular Expression problems... | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | Out of curiousity, are your regexp's in WYSIWYG strings or escaped (aka double-quoted) strings? If using escaped strings, that could be the problem. -- Chris Sauls In article <ctk8pt$a54$1@digitaldaemon.com>, kinghajj says... > >On the Regular Expression "help" guide, it says that "\char" means to match that "char" literally. However, when I do this, I get a warning similar to this: > >undefined escape sequence \{ > >What do I do? |
January 31, 2005 Re: Regular Expression problems... | ||||
---|---|---|---|---|
| ||||
Posted in reply to kinghajj | kinghajj wrote:
[...]
> undefined escape sequence \{
> What do I do?
Seems you want to esacpe the escape character "\" by writing "\\" instead.
Because first the lexical phase scans your source into tokens the character seqence " \{" is recognized as space followed by the escape sequence '\{', which has no meaning to the lexical phase.
But the character sequence " \\{" is recognized as space followed by '\\' and '{' from which '\\' is recognized as valid escape sequence with the meaning '\'. Therefore the chracters " \{" are passed to the RE-programs which then can recognize the "\{" as escaped sequence.
-manfred
|
Copyright © 1999-2021 by the D Language Foundation