I am currently using this regex to isolate 5 digit values not preceded/followed by a number, a dash, and a period. I am trying to figure out a way in addition, to account for - also excluding those that contain a WO or PO with case sensitivity in mind. I just have tried different variations on where to put SO AND PO as a conditions to check against but fail at every turn.
(?<![-0-9.])[0-9]{5}(?![-0-9.])
Current output - Not desired
asdkjflsdf 12345 good
asdfsdf 1234asdfsdf bad
12345 good
.12345. bad
-12345 bad
SO 12345 good
123456 ppp bad
1234 bad
PO12345 good <--
Wo 12345 good <--
Output - Desired
asdkjflsdf 12345 good
asdfsdf 1234asdfsdf bad
12345 good
.12345. bad
-12345 bad
SO 12345 good
123456 ppp bad
1234 bad
PO12345 bad <--
Wo 12345 bad <--
Any help would be greatly appreciated. Thank you