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