Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re^2: Regex for simple parsing job

by toadi (Chaplain)
on Jul 27, 2004 at 09:53 UTC ( #377696=note: print w/ replies, xml ) Need Help??


in reply to Re: Regex for simple parsing job
in thread Regex for simple parsing job

In the file I don't have ENDTITLE ass ending but just TITLE until next TITLE until next TITLE. How do I match that? Update Seems split does the job :)



--
My opinions may have changed,
but not the fact that I am right


Comment on Re^2: Regex for simple parsing job
Re^3: Regex for simple parsing job
by davorg (Chancellor) on Jul 27, 2004 at 10:10 UTC

    Won't "split" give you an extra empty title?

    I fixed the second regex like this:

    my @titles = /TITLE(.*?)(?=TITLE|$)/sg;

    Update: regex re-fixed

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

      Yes it did. But I just did next when the title was empty. Not very clean, but it does the job :)

      Like I said I'm no wizzard with regexes



      --
      My opinions may have changed,
      but not the fact that I am right

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (12)
As of 2014-09-22 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (198 votes), past polls