Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Regex Question

by Ratazong (Prior)
on Jan 22, 2013 at 11:47 UTC ( #1014638=note: print w/ replies, xml ) Need Help??


in reply to Regex Question

The following could be a start:

$data =~ /^Subject.*\*\*(.*?)\*/; print "$1\n";
See here how it works.

HTH, Rata


Comment on Re: Regex Question
Download Code
Re^2: Regex Question
by Anonymous Monk on Jan 22, 2013 at 15:10 UTC
    Ratazong,
    I think is good practice to always check "match" m// string. Incase, the match string fails, one can know.
      The link posted in Re^2 by AnonyMonk points to an elderly post which links to the (sorely outdated) docs here on-site.

      A better way to do this is [docs://perlre] which produces a link, perlre, (to the perlre page http://perldoc.perl.org/) and the current docs.

      Though, I suppose, if directing one's suggestions to someone who hasn't updated/upgraded his or her installed Perl since 1999, the Monastery docs might be more appropriate.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2015-07-07 13:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls