in reply to How to set a delimiter.
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.
|
|---|