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

Re: [StrongED] search mystery -- alpha vs anychar



In message <mpro.oil1um0075w2p0346.pittdj@xxxxxxxxxxxx>
          David Pitt <pittdj@xxxxxxxxxxxx> wrote:

> Jim Nagel, on 22 Dec, wrote:
> 
> > David Pitt  wrote on 22 Dec:
> > 
> > > Clues, brackets and spaces. {AD}+ [{" "} "(" {AD} ")"]  ":" \n Oh what
> > > fun!
> > 
> > Thanks.  I see that that, in effect, extends the predefined set {AD} to
> > include space and the openparenth and closeparenth characters.
> > 
> > But I still don't see why the predefined set {.} failed.  I thought it
> > meant "all characters except newline", and that that would have suited my
> > purpose OK.
> 
> The catch 22 thing is that {.} also hoovers up the ":". 
>
> {.} is everything up to the newline character, trying to include a further
> character in the search is simply a logical impossibility.

Correct, an unchecked {.} will consume all remaining characters on a
line. An alternative expression to do the same is: * >

The trick here is to make sure that the character you're trying to match
is excluded: \n\n {~":" .}+ ":"

The {~":" .}+ will match any character that isn't a ":" or a newline.
The following ":" is there to check that we stopped at a ":" and not a
newline.

Cheers,
Fred.

-- 
StrongED Developer
http://www.stronged.iconbar.com/

--=20
To unsubscribe send a mail to StrongED+unsubscribe@xxxxxxxxxxxxxx
List archives at http://www.Torrens.org.uk/RO/StrongED/index.html