2010/12/27 ольга крыжановская <[email protected]>:
> I'd like to request a "free-spacing and comments" regex mode in ksh so
> that regular expressions, i.e. ~(G), ~(E), ~(X), ~(P), can span
> multiple lines like in perl, JAVA or VB.NET. "Free-spacing and
> comments" in this context means that white spaces are ignored for
> pattern patching and any thing between a "#" character and the end of
> the line is treated as comment, i.e. are "removed" at regex compile
> time, and white spaces and "#" can only be used for matching if
> explicitly addressed with [[:space:]], [[:blank:]] or octal
> addressing.
>
> Below is an example for the proposed functionality, using modifier "f"
> to enable the free-spacing and comments mode:
>
> [[ "aaa bbb 123 ccc" == ~(Ef)
>          (...)
>          [[:blank:]]+
>          [[:alnum:]]+
>          [[:blank:]]+
>          ([[:digit:]]+)
>          [[:blank:]]+
>          ]] && printf "match!\n"
>
> This example should print "match!"

I think this would be a great feature but I fear it may not be
possible to implement. How should the parser differ between ]] in
[[:class:]] and ]] as the end of the [[ test ]] if all space, tab,
newline characters are collapsed?

Irek

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to