Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

RE: Update: Parsing and \G and /g and Stupid User Tricks

by jlistf (Monk)
on Aug 08, 2000 at 19:04 UTC ( [id://26799]=note: print w/replies, xml ) Need Help??


in reply to Parsing and \G and /g and Stupid User Tricks: Correction
in thread Parsing and \G and /g and Stupid User Tricks

that should be:
m/\G.*(MEH|MED|MMD|MMS|CR1|FR1)/ig
or
m/\G.*(?:MEH|MED|MMD|MMS|CR1|FR1)/ig
if you don't want to capture it. just a minor point, but that could break the code.

also, instead of iterating repeatedly with the loop to find pos(), you could set pos() to $currpos and work from there (you'd have to match two more times, i think). that'll make it a little faster.

jeff

Replies are listed 'Best First'.
Parsing and \G and /g and Stupid User Tricks:pos() = $currpos
by THuG (Beadle) on Aug 08, 2000 at 20:04 UTC
    I can set pos() to $currpos? Rock on! I knew there had to be a way to start from where I left off, and not the beginning of the file.

    -Travis

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-20 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found