Hi!

----

The following example...
-- snip --
attrdata=$' aname=avalue '

dummy="${attrdata//~(Ex-p)(?:
[[:space:]]+
( # four different types of name=value syntax
        (?:([:_[:alnum:]-]+)=([^\"\'[:space:]]+?))|
        (?:([:_[:alnum:]-]+)=\"([^\"]*?)\")|    
        (?:([:_[:alnum:]-]+)=\'([^\']*?)\')|    
        (?:([:_[:alnum:]-]+))                   
)
)/D}"

print -u2 -v .sh.match
print "Nummatches=${#.sh.match[0][@]}"
-- snip --
... will print this with ast-ksh.2012-08-24:
-- snip --
(
        [0]=' aname=a'
        [1]=aname=a
        [2]=aname
        [3]=a
)
Nummatches=0
-- snip --

I'm puzzeled... IMO I would expect a "Nummatches=1" for the last line
since there is one match... or am I wrong ? AFAIK this looks like a
bug since if I use attrdata=$' aname=avalue bname=bbbbb ' I get
"Nummatches=2" (which is IMO correct).

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to