Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: find, then store functions into array problem

by Zaxo (Archbishop)
on May 04, 2003 at 22:42 UTC ( [id://255527]=note: print w/replies, xml ) Need Help??


in reply to find, then store functions into array problem

To extract the strings that are not + or -,

my @remaining = grep {defined} split /[+-]{2,}/, $righteq; # fixed 2nd arg error

I assume you don't mean for these functions to be in perl, since your ^ appears to be exponentiation.

A more detailed regex for your special case can be constructed. Left as an exercise for the reader.

Update: Ok, using your regex:

my @remaining = grep {defined} split / (e\^\(t\+-(\d+\.?\d*|\.\d+)\)) # the special, captured | # or else [+-]+ # filler, not captured /x, $righteq;

After Compline,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://255527]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found