Re: string search for '0' and/or '1'
- From: "tom.rmadilo" <tom.rmadilo@xxxxxxxxx>
- Date: Thu, 25 Jun 2009 12:46:21 -0700 (PDT)
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.
.
- References:
- string search for '0' and/or '1'
- From: Niv (KP)
- Re: string search for '0' and/or '1'
- From: dkf
- Re: string search for '0' and/or '1'
- From: Jonathan Bromley
- Re: string search for '0' and/or '1'
- From: tom.rmadilo
- Re: string search for '0' and/or '1'
- From: Cameron Laird
- string search for '0' and/or '1'
- Prev by Date: Re: variable storing name of variable
- Next by Date: TWAPI creating Remote Network Shares?
- Previous by thread: Re: string search for '0' and/or '1'
- Next by thread: Re: string search for '0' and/or '1'
- Index(es):
Relevant Pages
|