# HG changeset patch # User Mike Miller # Date 1366483165 14400 # Node ID ab46b5c77669934edfe50cd02b23d93089a179b5 # Parent 4bbc4b703fe4cdf33dded840bc5f1f402a81fd11 Fix word boundary handling in regexp pattern (bug #38778) * libinterp/corefcn/regexp.cc (do_regexp_ptn_string_escapes): Expand both '\<' and '\>' sequences to '\b' for PCRE to handle correctly. diff --git a/libinterp/corefcn/regexp.cc b/libinterp/corefcn/regexp.cc --- a/libinterp/corefcn/regexp.cc +++ b/libinterp/corefcn/regexp.cc @@ -70,6 +70,13 @@ retval[i] = '\b'; break; + // Translate \< and \> to PCRE word boundary + case '<': // begin word boundary + case '>': // end word boundary + retval[i] = '\\'; + retval[++i] = 'b'; + break; + #if 0 // FIXME : To be complete, we need to handle \oN, \o{N}. // The PCRE library already handles \N where N