Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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
Replies are listed 'Best First'.
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 lurking in the Monastery: (14)
As of 2015-07-31 13:27 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 (277 votes), past polls