hi everyone,

  i use perl for it's great regex support though one thing has always
bothered me and now it's grown to more than annoyance. the memory
variables $1 - $9 i think are odd. i don't know why the are scalars as
opposed to an array. the regex positions (@+,@-) arrays do exist and i
plan on using those in my next task, but there is still another demention
missing in the regex memory variables. something in parens can match more
than one piece of the input. perl simply tosses it out an keeps the last
one. i would like to keep all of them. for example

$s = "regex tesT";
$s =~ /(.)*/;
print $1;           #prints "T"

i wish $1 could be an array containing ("r", "e", "g", "e", "x", ... ,
"T") or better yet, a two dementional array @mem = (["r" ... "T"]). i also
prefer to work with the positions as upposed to the strings themselves as
it is much less memory intensive. does anyone know a way to store either
the string or the positions of all text matching a memory slot as upposed
to just the last piece?

-mike

Reply via email to