J
JS
Hi,
I'm trying to build a regex to put the department name into a variable
$dept and the rest of the line into another variable $stats:
E-Test 3 - 4 -
Health and Safety - 1 1 -
Finance - 3 - -
This is my regex:
($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;
but it doesn't work because of the \s- is not actually handled as a
string, but individual charaters.
Can anyone fix this for me please?
Thanks,
JS.
I'm trying to build a regex to put the department name into a variable
$dept and the rest of the line into another variable $stats:
E-Test 3 - 4 -
Health and Safety - 1 1 -
Finance - 3 - -
This is my regex:
($dept,$stats)=/^(.[^\s-|\d]*)\s+(.*)/;
but it doesn't work because of the \s- is not actually handled as a
string, but individual charaters.
Can anyone fix this for me please?
Thanks,
JS.