in reply to Re: Creating spacers in regex match
in thread Creating spacers in regex match

ah I got you. can you just explain what the xdigit means? I'm new to perl and I want to learn. How is this different than the ?s:.

Replies are listed 'Best First'.
Re^3: Creating spacers in regex match
by JavaFan (Canon) on Jul 08, 2011 at 15:24 UTC
    [[:xdigit:]] is a character class that matches a hex digit. See man perlrecharclass. (?s:.) matches any single character; (?s:.*) matches any possible string of characters.
      I tried the xdigit line you gave me and it didnt work.
      my $str = "06 03 01 0f 0e 0b"; if ($str=~ /06 03 01 [[:xdigit:]]{2} [[:xdigit:]]{2} 0b/){ print "hi"; }
        Can you be a bit more specific than "didn't work"? When I try, it prints hi.