[pcre-dev] [Bug 1380] Report match when doesn't match and vi…

Page principale
Supprimer ce message
Auteur: Philip Hazel
Date:  
À: pcre-dev
Sujet: [pcre-dev] [Bug 1380] Report match when doesn't match and vice-versa
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1380

Philip Hazel <ph10@???> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX





--- Comment #5 from Philip Hazel <ph10@???> 2013-08-26 11:49:29 ---
On the matter of your original suggestion: The problem with matching "not X" is
knowing how long "not X" is. We already have [^a] (for example) to match "not
'a'", and that is exactly one character long. We also have negative assertions
such as (?!X) and they are exactly zero characters long. But how long is (for
example) "not X and not Y and not Z" (where X, Y, Z are complex patterns)?

However, your comment "only the reported result is reversed" makes me think
that you are thinking differently. You want to match the "negated" subpattern,
but then fail (or backtrack) if it matches - this is exactly the situation that
(*FAIL), (*SKIP) etc. are designed for, as Zoltan has pointed out. That allows
you to determine where matching restarts, which solves the "how long is not X?"
issue.

I don't think there is anything more to say on this, so I am going to close the
bug.


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email