Simple: just use ^ to anchor the regex to the start of the string:
$txt =~ /^Label1 : (\S+)/i;Update: This only works if the value doesn't contain spaces, as McDarren correctly notes below.
--
David Serrano
In reply to Re: RegEx question
by Hue-Bond
in thread RegEx question
by mariuspopovici
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |