what does below code do ??

Hi,

I have below code :

my($abc) = "fred3hello";
$abc =~ /^[^d]{2,4}<([^>]+)>d?1$/;

if (defined($1)) {
print "$1
";
} else {
print "not found
";

}
}

What is the code doing ?? what function of the regular expression

$abc =~ /^[^d]{2,4}<([^>]+)>d?1$/;

??

Comments

  • ^ - beginning of the string
    [^d]{2,4} - 2 to 4 characters not containing a digit
    ([^>]+) - 1 will be one or more characters until '>'
    d? - zero or one digit
    1 - match word '1' (hello)
    $ - final of the string

    What is the code doing?
    - Matches a string.
  • This post has been deleted.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion