https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=291172
Bug ID: 291172
Summary: regexp.h routines behave differently for my program
and in the base grep
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: [email protected]
Reporter: [email protected]
Created attachment 265589
--> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=265589&action=edit
Test program
I have a little program that tries to match the "domain/foo" string against the
"^domain/[a-z]\+$" regexp. For some reason it prints "regex doesn't match:
domain/foo" for me.
The strange thing is that the same regex works in grep:
# cat input
domain/foo
# dtrace -q -n 'pid$target::regcomp:entry { printf("%s(m,\"%s\",%d)\n",
probefunc, copyinstr(arg1), arg2); }' -c 'grep ^domain/[a-z]\+$ input'
domain/foo
regcomp(m,"^domain/[a-z]\+$",12)
We can see that regcomp() gets called with exactly the same arguments as in my
program, but for some reason the consecutive regexec() returns REG_NOMATCH in
my case and 0 for grep.
I should be missing something obvious, but I can't figure it.
--
You are receiving this mail because:
You are the assignee for the bug.