check the standard regex REG_NEWLINE description
for ~(E) REG_NEWLINE is off by default
'm' turns it on: ~(Em)

$ x=$'one\ntwo'
$ print ${x/~(E)one.*two/AHA}
AHA
$ print -r "${x/~(Em)one.*two/AHA}"
one
two
$ print -r "${x/~(E)one$/AHA}" 
one
two
$ print -r "${x/~(Em)one$/AHA}"     
AHA
two
$

On Sun, 31 Oct 2010 18:43:44 +0100 =?KOI8-R?B?z8zYx8Egy9LZ1sHOz9fTy8HR?= wrote:
> I need an example how I can use y="${x/~(E)regex/\1}" to do pattern
> matching and extraction across more than one line, i.e. if $x is a
> string which contains many lines.
> If ~(P) is able to do this I need an example for it, too.

> Olga

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

Reply via email to