Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

Re^2: Regular expression

by John M. Dlugosz (Monsignor)
on Jun 05, 2009 at 14:54 UTC ( #768815=note: print w/replies, xml ) Need Help??

in reply to Re: Regular expression
in thread Regular expression

Re:Because in your example strong [sic], all the dollars are between brackets.

I don't see any square brackets in his post, and the string is not inside the angle brackets that form the tags.

Replies are listed 'Best First'.
Re^3: Regular expression
by JavaFan (Canon) on Jun 05, 2009 at 15:23 UTC
    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.

      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://768815]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2023-12-02 03:00 GMT
Find Nodes?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?

    Results (13 votes). Check out past polls.