StealthRT StealthRT - 1 year ago 147 Question RegEX number and letter with period format

Hey all I am trying to find a REGEX that will allow me to find these types of numbers/letters in this formats:


Example: DT.3 or SV.32 or TF.1


Example: 8920.17 or 8477.1 or 1699.22

Can anyone lend a helping hand?

Answer Source

First format - ([A-Z]{2}\.[0-9]{1,2})

Second format - ([0-9]{4}\.[0-9]{1,2})

Combined - ((?:[A-Z]{2}\.[0-9]{1,2})|(?:([0-9]{4}\.[0-9]{1,2})))

Regex101 breaks up the regex and explains every part. So if you need to, customise the regex further according to your needs.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download