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

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

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


    "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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://377696]
[Corion]: Your Mother: I think that's because (in the west) the Nazi-Germans are recognized as universally evil. Of course, you could do some number games to calculate other measures of evil than "historic losers of second world war" to come up with other evils:)
[Corion]: I've heard "Troll" described as the new Punk, and in a way, it can be as destructive as living the Punk lifestyle, and you don't have to sit out in the cold...
[LanX]: Anti-Germans
[LanX]: Socrates was a Troll
[Your Mother]: It's very, very dangerous... Thinking that a group is intrinsically evil... buries the fact that all humans can be so deep that it starts to become likely they will be.
[Your Mother]: LanX++
[Corion]: (also the "troll for trolls sake" could seen be much like the "punk for punks beer")
[Your Mother]: I'm completely (historically anyway) a troll in real life. It's not fun online, you can't really win. :P
Happy-the-monk orders a Punk IPA.
[Your Mother]: Also, I'm too old to start fights with strangers anymore.

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2018-03-19 13:45 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.