I’m trying to make a regex trying to find numbers between 1 and 3 digits, but I don’t want it to match numbers included in years (e.g. “202” in “2024”).
I’ve tried serveral regex, here’s a list :
(?<!20d{2})(?:nos*)?(d{1,3})(?!d)
(?<!20)(?:nos*)?(d{1,3})(?!d)
(?<!d)(?:nos*)?(d{1,3})(?!d)
(?<!b20d{2}b)(?:nos*)?(d{1,3})(?!d)
(?:nos*)?(d{1,3})(?!20d{2})(?!d)
b(?:nos*)?(d{1,3})b
For example, in this string : APUDNSLL-22-Nov-2022 or this one : CHUATDN-Sept-2022-20
I want it to find 22 and 20 but not parts of 2022.
Is there a way to make it work ?
JCH_bib is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.