Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Bug? RE: Un-patch: new pattern matching code



> 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