GNU regcomp(3), regexec(3): '\w'
John Wildberger
wildberger-iRg7kjdsKiH3fQ9qLvQP4Q at public.gmane.org
Sun Jan 4 16:51:34 UTC 2004
On January 4, 2004 02:11 pm, William Park wrote:
> On Sun, Jan 04, 2004 at 12:19:22PM -0500, Ian Goldberg wrote:
> > On Fri, Jan 02, 2004 at 04:24:10PM -0500, William Park wrote:
> > > $ cc test.c -o test
> > > $ ./test
> > > -- test={abc_123}, match={abc_}
> > >
> > > What I expected is
> > > -- test={abc_123}, match={abc_123}
> >
> > What are your various LOCALE settings? This seems like just the kind of
> > problem that an incorrect setting would cause.
I think the problem is more compiler related than related to LOCAL settings.
It appears that gcc compilers with versiojn 3.x.x interpret the regex \w as
'word' characters that do not include digits. You can try to use any test
word you like and you will find that match will stop at the first encounter
of a digit.
There might be a good reason for this, but nowhere have I found any
explanation in documents related to gcc 3.x.x.
No problems with any distro that has gcc 2.x.x.
John
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list