Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bug? RE: Un-patch: new pattern matching code
- X-seq: zsh-workers 7401
- From: "Andrej Borsenkow" <Andrej.Borsenkow@xxxxxxxxxxxxxx>
- To: "Peter Stephenson" <pws@xxxxxxxxxxxxxxxxx>, "Zsh hackers list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: Bug? RE: Un-patch: new pattern matching code
- Date: Mon, 9 Aug 1999 12:10:14 +0400
- Importance: Normal
- In-reply-to: <9908061547.AA37737@xxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
> Anyone who knows any computer science will probably notice that, while it's
> pretty much a finite state machine, some states are more finite than
> others. In particularly, backtracking on excluded matches, where in
> (foo~bar)rod the `bar' only has to match the `foo' and the `rod' is
> irrelevant, need some extra state recording, and I have retained the old
> trick that eliminates infinite loops and prevents exponential behaviour
> when failing to match against things like `(f#o#)#' (the version of perl
> here goes into an infinite loop when given `(f*o*)*', so it isn't trivial).
> This has meant leaving holes for pointers in the compiled expression, which
> ought to work (I've tried to make sure everything is aligned to pointer
> size anyway) but is probably the most dubious part of the proceedings.
>
bor@itsrm2:~%> foo=ab12xy
bor@itsrm2:~%> print ${foo/[[:digit:]]#}
abxy
bor@itsrm2:~%> print ${(S)foo/[[:digit:]]#}
ab12xy
bor@itsrm2:~%> print ${foo//[[:digit:]]#}
abxy
bor@itsrm2:~%> print ${(S)foo//[[:digit:]]#}
here zsh hangs completely.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author