An expression

Programming, for all ages and all languages.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re:An expression

Post by Solar »

Neo wrote: Considering that the 'world' contains a valid hex digit ('d') would that explain anything?
It matches that line because of the 'd' alright, but not because it's a hexdigit, but because it is contained in [digtx]... ;)
Every good solution is obvious once you've found it.
User avatar
Neo
Member
Member
Posts: 842
Joined: Wed Oct 18, 2006 9:01 am

Re:An expression

Post by Neo »

AR wrote: I tried "egrep -o [:xdigit:] a.txt" and got:
x
x
d
So your assumption is probably correct
Hmm... so a hexdigit means anything with an 'x'? :o
Only Human
mystran

Re:An expression

Post by mystran »

No. What was said is that [:xdigit:] is broken, and grep doesn't understand that it has a special meaning, and therefore it works like a normal character group, which containts :, x, d, i, g, t and a duplicate of i and : which are ignored.

Btw... now that I tried it on localhost, I notice that even GNU grep seems not to understand those, at least not without some magick switch (which I'm too lazy to figure out right now for no good purpose).
Post Reply