I need one regex to rule them all.
\w{2}\d{3} works but it captures too much. Using the first example, it captures both PE015 (the desired target) and LM250. The challenge is that sometimes the ID is at the start of the line with a space, with a colon, or at the end in parentheses, etc.
RAW_TEXT | ID | |
PE015 - LM2500 GAS DIGITAL FUEL CONTROL | PE015 | |
GB003 - Twisted Rudder | GB003 | |
AASP WM018 | WM018 | |
GW055: SPEED LOGS | GW055 | |
CJ061 Titanium | CJ061 | |
Equipment Upgrades (DY006) | DY006 |
\b[a-zA-Z]{2}\d{3}\b
regex_replace([text],".*(\b[a-zA-Z]{2}\d{3}\b).*",'$1')
try it out and let me know
cheers
@hellyars
I can not really be sure but at least it works on the date set you procided.
.*?([A-Z]{2}\d{3})\W*.*