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!"
Olga
--
, _ _ ,
{ \/`o;====- Olga Kryzhanovska -====;o`\/ }
.----'-/`-/ [email protected] \-`\-'----.
`'-..-| / http://twitter.com/fleyta \ |-..-'`
/\/\ Solaris/BSD//C/C++ programmer /\/\
`--` `--`
_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers