Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: Regular expression

by JavaFan (Canon)
on Jun 05, 2009 at 15:23 UTC ( #768822=note: print w/replies, xml ) Need Help??

in reply to Re^2: Regular expression
in thread Regular expression

I presumed he meant the < and > characters when he mentioned "square brackets" - otherwise the example doesn't make much sense.

And considering the string starts with < and ends with >, the "between brackets" condition was ambigious. I just pointed out which meaning I was going to assume. It seems that is the same meaning as you assigned to it.

Replies are listed 'Best First'.
Re^4: Regular expression
by sandy1028 (Sexton) on Jun 08, 2009 at 04:38 UTC
    my $line = "<ci:Name> Lord: Of The $10Ring$s </ci:Name>"; my $words = ''; if ($line =~ m/<.*>(.*)<\/.*>/) { $words = $1; } print $words;
    How to match all the text outside the angle brackets. Here $10 and $s is not displayed on print. From the text "Lord: Of The $10Ring$s" I have to delete ':' and "$". Please help me to proceed. Thanks

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2023-11-28 09:22 GMT
Find Nodes?
    Voting Booth?

    No recent polls found