Mark R Stallard wrote, On 02/16/2015 02:57 PM:
U. Mutlu
wrote: Thank you. But on the "POSIX Extended Regular Expression Syntax" page the escape sequence \w is very well listed:
I should have explained this more thoroughly. I did not say that POSIX does not support \w at all. What I said was:
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.
POSIX extended supports \w, but NOT inside a [] character set. For POSIX extended, the regex [\w\-\.~/]+ is the same as [w\-\.~/]+. Inside of [], POSIX extended sees \w as a literal "w".
Ok, I see, then one better should (generally) use the equivalent, [[:word:]], inside []. Thx for clarification. cu Uenal
You can test this yourself if you have an up-to-date version of the egrep shell command.
|+| M a r k |+|
Mark Stallard Business Application Services Global Business Services Information Technology Raytheon Company