On Mon, 24 Sep 2001, [EMAIL PROTECTED] wrote:
> 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"]).
Aren't there usually better ways to get what you're looking for?
$s = "regex test";
while ($s =~ /(.)*/ ) {
print $_;
push @mem, $_; # i forget push syntax, this looks right...
}
Or something like that. There are more idiomatic ways to do it, but
suffice to say that if you need to get the positions that's possible.
> 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?
Would the while-loop above, or something to that effect, do it?
--
Chris Devers [EMAIL PROTECTED]
- [Boston.pm] perl regex memory missing two dimentions [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... Kenneth Graves
- Re: [Boston.pm] perl regex memory missing two dimen... Chris Devers
- Re: [Boston.pm] perl regex memory missing two dimen... [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... Greg London
- Re: [Boston.pm] perl regex memory missing two dimen... Kenneth Graves
- Re: [Boston.pm] perl regex memory missing two dimen... [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... Greg London
- Re: [Boston.pm] perl regex memory missing two dimen... Greg London
- Re: [Boston.pm] perl regex memory missing two dimen... [EMAIL PROTECTED]
- Re: [Boston.pm] perl regex memory missing two dimen... Jerrad Pierce
