damian1301 has asked for the wisdom of the Perl Monks concerning the following question:

This question was moved to How to set a delimiter. (Moved from Q&A)

Please post your answers there.

Thank You -- Q&AEditors

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How to set a delimiter.
by eg (Friar) on Dec 09, 2000 at 03:54 UTC

    You probably want to use a question mark rather than a character class with the hyphen.

      if ( $info =~ /(hi|lo)\s+-?\d{1,3}°F/i ) {
        # whatever
      }
    

    If you want to capture the actual temperature, you're going to need to put parens around \d{1,3}

    Originally posted as a Categorized Answer.