Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: Regex for simple parsing job

by toadi (Chaplain)
on Jul 27, 2004 at 09:53 UTC ( [id://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

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://377696]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-19 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found