J
Jack
Hi
I have strings : 'SA-QA TAR TEL-LL' and 'SA QA-TA REG TEL-LL'
and I want to test that this is a valid alphanumeric ; I will have
strings which vary the space and - position. Looking to find a matcher
that allows for a 0 or 1 spaces and 0 or more dashes throughout without
overly complicating the regex.. I tried this but it started getting too
case specific and complex:
$temp = 'SAQA TAR sd-f44TELLL';
if ($temp =~ m/^\w+\s?\w*\-*\w*\s?\w*\-*\w+\s?\w+$/) { print "
alphanum "; } #
# can try this also ! m/^\w+\s*w+$/
Does anyone have a solution that could handle all combinations of
alphanumeric and -, space
thank you
Jack
I have strings : 'SA-QA TAR TEL-LL' and 'SA QA-TA REG TEL-LL'
and I want to test that this is a valid alphanumeric ; I will have
strings which vary the space and - position. Looking to find a matcher
that allows for a 0 or 1 spaces and 0 or more dashes throughout without
overly complicating the regex.. I tried this but it started getting too
case specific and complex:
$temp = 'SAQA TAR sd-f44TELLL';
if ($temp =~ m/^\w+\s?\w*\-*\w*\s?\w*\-*\w+\s?\w+$/) { print "
alphanum "; } #
# can try this also ! m/^\w+\s*w+$/
Does anyone have a solution that could handle all combinations of
alphanumeric and -, space
thank you
Jack