Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^5: Regex fun

by JavaFan (Canon)
on Dec 16, 2009 at 10:54 UTC ( #813003=note: print w/replies, xml ) Need Help??


in reply to Re^4: Regex fun
in thread Regex fun

I think that the (??{...}) would be best choice as repositioning the pos() is probably not a good idea in general.
What's the problem with setting pos()? (??{...}) and (?{...}) have their share of problems (many related to scoping of variables), and I avoid them as much as possible - and if I use them, I keep the code it in as simple as possible.

What I don't understand is your use of 'last'. It means that if you have "+2A." in your string, nothing following it will change.

Replies are listed 'Best First'.
Re^6: Regex fun
by Hena (Friar) on Dec 16, 2009 at 11:57 UTC
    What's the problem with setting pos()?
    Yes the pos() can be set, however I "feel" I'm changing things which I shouldn't if I can avoid it. My opinion is that the (??{...}) construct is better.

    What I don't understand is your use of 'last'. It means that if you have "+2A." in your string, nothing following it will change.
    I have a test later which will inform me that the cleaning wasn't complete (string length comparison as I have another string which should be equal length after this, base quality column in the input). As input like that is an error and shouldn't be there so I need to know that and not try to fix it in script.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2021-05-06 00:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Perl 7 will be out ...





    Results (69 votes). Check out past polls.

    Notices?