Re: string search for '0' and/or '1'



On Jun 25, 8:30 am, cla...@xxxxxxxxx (Cameron Laird) wrote:
In article <49d46f15-dffe-4bfb-b6e3-92847b28d...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>,tom.rmadilo <tom.rmad...@xxxxxxxxx> wrote:
My personal preference is also to style propositions positively.

RE theory teaches us that that goal is often infeasible.

When I wrote it, I regarded it as a feature that the {[^01]}
pattern would not reject an empty line.

Right, and it is common to consider an empty string/line as a possible
match to types (maybe indicating a null value).
For instance, [string is "class"] requires the -strict option to
reject an empty string.

Anchoring combines with either positive or negative predicates,
depending on the details of what one chooses to include.  Yet
another pattern that might help in some situations is

   {[^01]|^$}

This is the actual negation of my expression. To include a blank line
in my expression, the negation of your original would be:

{\A[01]*\Z}

It also seems arbitrary for me to classify your expression as a
negative match. It really is just an expression which matches
unacceptable lines. Maybe the line can be cleaned up, possibly by char-
by-char parsing.
.



Relevant Pages

  • Re: Query: Classical conjugation pattern.
    ... 286, under the entry for `zu' (which expresses negation), here is ... A single form, ZU, conjugates independently in ... conjugation moved in a single column through the six bases, ... pattern that is otherwise established. ...
    (sci.lang.japan)
  • Re: RegExp pattern to scan for NO HTML tags - need help
    ... >>However, the catch is that, the way FormValidator class is written, I ... it must match the pattern ... >>to ONLY use the pattern to find the NEGATION of finding one!!! ... > them, then zero or more chars, then a '>'. ...
    (alt.php)
  • Re: RegExp pattern to scan for NO HTML tags - need help
    ... >>However, the catch is that, the way FormValidator class is written, I ... it must match the pattern ... >>to ONLY use the pattern to find the NEGATION of finding one!!! ... > them, then zero or more chars, then a '>'. ...
    (comp.lang.php)
  • Re: negative hex
    ... John, I've been sitting on the side wondering whether to put in 2c worth, and ... Surely it can't be "negative" if it is a pattern of bits. ... the negation of an integer which is itself expressed in hex. ... In 2's complement, if the most significant ...
    (sci.electronics.design)
  • Re: negative hex
    ... John, I've been sitting on the side wondering whether to put in 2c worth, and ... Surely it can't be "negative" if it is a pattern of bits. ... the negation of an integer which is itself expressed in hex. ... In 2's complement, if the most significant ...
    (sci.electronics.design)