octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #59992] regexp: behaviour of \> (end of a word


From: Rik
Subject: [Octave-bug-tracker] [bug #59992] regexp: behaviour of \> (end of a word) inconsistent with MATLAB
Date: Tue, 2 Feb 2021 14:27:01 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36

Update of bug #59992 (project octave):

                  Status:                    None => Confirmed              
        Operating System:               GNU/Linux => Any                    

    _______________________________________________________

Follow-up Comment #2:

Confirmed.

Octave uses the PCRE library (Perl Compatible Regular Expressions) for regular
expressions.  There is no end of word assertion in PCRE, so Octave substitutes
'\b' which detects a Word Boundary.  A Word Boundary, however, is defined as
word character followed by a non-word character.  Since '!' is not a word
character the test fails between '!' and '+'.

It may be that Matlab is using a positive lookahead assertion for a non-word
character such as '(?:\W)'.  That seems to work for this example.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?59992>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]