HI,
i am trying to create a variable which contains a reference number matched from within a text string.
example,
textstring = Michael please look at E123456
where E123456 is a reference number i need to look at. i want this reference number to be added to a variable called $lookatref. The string is always in the same format, NAME please look at REF. The ref can be either one letter followed by 6 numbers or just 7 numbers
the code im using is
$lookatref = ""; $mystring2 = 'please look at '; if ($reqtext =~ m/$mystring2(.*?) /i) {$lookatref = $1;}
$reqtext is the text i want to match. this is read into the variable earlier in the script. i think it is something to do with the regex syntax, but i just cant figure out what it wrong.
In reply to Regex, query by dmsparts
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |