Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: find, then store functions into array problem

by Zaxo (Archbishop)
on May 04, 2003 at 22:42 UTC ( #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
Node Status?
node history
Node Type: note [id://255527]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-05-09 16:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (101 votes). Check out past polls.

    Notices?