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

Re: regular expression for getting text between 1. and 2.

by si_lence (Deacon)
on Apr 12, 2013 at 14:33 UTC ( #1028383=note: print w/ replies, xml ) Need Help??


in reply to regular expression for getting text between 1. and 2.

I see two options: Either use anchors /^1[).](.*?)2[).]$/
or use a greedy match /1[).](.*)2[).]/

btw. In the character class you don't need the pipe for an or. Your regex would also match 1| some text 2|

hope this helps


Comment on Re: regular expression for getting text between 1. and 2.
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2015-03-06 17:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (171 votes), past polls