Find the answer to your Linux question:
Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    what does below code do ??


    I have below code in perl :
    my($abc) = "fred<hello>3hello";
    $abc =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;
    if (defined($1)) {
    print "$1\n";
    } else {
    print "not found\n";
    What is the code doing ?? what function of the regular expression

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


  2. #2
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Seattle, WA, USA
    This sounds like a homework question. Homework questions are not allowed as per the forum rules:

    You can look this up for yourself by Googling for information on regular expressions in general, and Perl regular expressions in particular.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts