U. Mutlu <email@example.com> wrote:
> the following regex expression works in perl-mode,
> but does not work in extented-mode.
It would help if you were more specific about what went wrong.
Did the constructor throw an exception?
Did the extended engine fail to match your input string?
If so, what input text are you using?
> I think I haven't used any perl-specific construct, or did I?
I only use the Perl-compatible engine myself. I check the POSIX
extended mode and did not see any obvious problems, though I did
wonder about this:
> #define WORD "[\\w\\-\\.~/]+"
I suspected that Perl would support the escape sequence \w
inside a  character set, but POSIX extended might not.
The tests I ran affirmed those suspicions.
I tested this regex in a Perl one-liner and it matched the
input string "alpha only". I tried the same regex in egrep
and it didn't work. egrep did match that input string when
I replaced "\w" with "a-z".
I find it much easier to program with regular expressions if
I test them using a command-line tool first.
|+| M a r k |+|
Business Application Services
Global Business Services Information Technology
880 Technology Drive
Billerica, MA 01821
This message contains information that may be confidential and privileged. Unless you are the addressee (or authorized to receive mail for the addressee), you should not use, copy or disclose to anyone this message or any information contained in this message. If you have received this message in error, please so advise the sender by reply e-mail and delete this message. Thank you for your cooperation.