So here is what I have:
regex="^([A-Z]{2,8}-[0-9]{1,4}[[:space:]])+[[:alnum:]]+$"
message="TEST-121 Testing"
echo $message | grep -qE "$regex"
This works. However, I need something like below:
message="TEST-132 Testing is going on".
My current regex, return 1 and this should return 0. And the below one as well:
message+"TEST-111 TEST-132 Stack overflow rocks "
The above regex only suffices one word after the first string, so need help in updating [[:alnum:]] to something which can parse more words and not just one.
Thanks in advance.
Add a
[:space:]
to the last character class as