[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #49451] matching beginning/end of a word does
From: |
Mike Miller |
Subject: |
[Octave-bug-tracker] [bug #49451] matching beginning/end of a word does not work |
Date: |
Thu, 27 Oct 2016 16:09:54 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:49.0) Gecko/20100101 Firefox/49.0 |
Follow-up Comment #1, bug #49451 (project octave):
Yeah, this is confusing to me as well. I remembered that I had submitted a fix
for this a while ago.
Turns out that single-quoted strings and double-quoted strings are processed
differently in Octave regexp functions. There are certain escape sequences
that are handled only when the pattern string is a single-quoted string.
These include
* \b means a literal backspace character (while it means word boundary in
PCRE syntax)
* \< \> mean word boundaries
* \oNNN means a specific octal character
So as a workaround, if you use single quotes, then the angle-bracket word
boundary anchors will work. Or use the PCRE word boundary anchor which is just
\b .
Anyone else care to comment on the reason for relegating these certain escapes
to single quoted strings only?
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?49451>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/