Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Quick Regex quesiton

by eversuhoshin (Sexton)
on Apr 08, 2011 at 18:08 UTC ( #898415=note: print w/ replies, xml ) Need Help??


in reply to Re: Quick Regex quesiton
in thread Quick Regex quesiton

I just did that as an example. I want to capture what follows. So it would be deferred gross profit blah blah. blah blah. blah. So I want to capture the rest.And I don't know how :(

Does this work?

<code> if ($test=~m/(deferred|gross)(.*)(\.)(.*)(\.)(.*)(\.)) { print "$1, $2, $4, $6"; }

Or is there a more elegant way to do it?

Thank you so much :)


Comment on Re^2: Quick Regex quesiton
Replies are listed 'Best First'.
Re^3: Quick Regex quesiton
by chakreey (Acolyte) on Apr 08, 2011 at 18:17 UTC
    Your code doesn't work ! (.*) seems to consider real full stop (.) as any-character.

    btw wind's code works !

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-08-30 12:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (348 votes), past polls