Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Regular expression

by targetsmart (Curate)
on Jun 05, 2009 at 13:28 UTC ( #768795=note: print w/ replies, xml ) Need Help??


in reply to Regular expression

if I have understood you correctly, this will do

$line =~ s/\$\d+|\$|<.*?>//g;
will make $line to
Lord: Of The Rings
BTW perlretut is your friend.
Please form your question correctly, I am not clear with your question. :(

Vivek
-- In accordance with the prarabdha of each, the One whose function it is to ordain makes each to act. What will not happen will never happen, whatever effort one may put forth. And what will happen will not fail to happen, however much one may seek to prevent it. This is certain. The part of wisdom therefore is to stay quiet.


Comment on Re: Regular expression
Download Code
Re^2: Regular expression
by JavaFan (Canon) on Jun 05, 2009 at 14:36 UTC
    The OP only wants to delete dollars that aren't inside brackets, and aren't followed by digits. You delete everything between brackets (including the brackets), and any following digits.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2014-07-28 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (193 votes), past polls