You are not logged in.
I have been learning to use regular expressions to modify some of my text files. I noticed that on my ARCH box the Character Class shortcuts do not work e.g. [[:digit:]] in an expression works but \d does not. Is this normal or is my installation broken in some way?
---for there is nothing either good or bad, but only thinking makes it so....
Hamlet, W Shakespeare
Offline
I don't see \d in man ed. Maybe \d is for perl regexp only?
Offline
There are several regexp "dialects". It's quite painful actually For instance, as far as I know, \d works in perl, but not in sed or grep.
So, yes, this is normal.
Last edited by Bebo (2008-06-10 09:29:04)
Offline
Thanks bebo.
---for there is nothing either good or bad, but only thinking makes it so....
Hamlet, W Shakespeare
Offline
There are several regexp "dialects". It's quite painful actually For instance, as far as I know, \d works in perl, but not in sed or grep.
So, yes, this is normal.
Yeah -- Henry Spencer's regexp stuff is always generally considered the portable form for sed, awk, since they're all based from it. Newer versions of grep though do allow for a -P flag for perl-regexps to be used, but this is non-portable, obviously.
-- Thomas Adam
Offline