Regex type incorporate for list of types

Could any please help in getting regex for below type to incorporate in to the existing type.

I have below list of type with numbers. I have existing regex code for the below list, I need to add one more type to the existing code. Could you please help to alter the existing regex code to incorporate the existing and new type.

Existing Type with Number
OP-XXXXXXXXXX
RR-XXXXXXXXX
QFR-XXXXXXXXXX
AA-XXXXXXXXXX
SR-XXXXXXX
DAT-XXXXXXXXXX
HUIP-XXXXXXXX
IGOL-XXXXXXXXXX
TUOQ-XXXXXXXXXX
WIN-XXXXXXXXXX
FIG-XXXXXXXXXX
LLOC- XX/XXX/XXX/XXX/XXX/XXX/XXX/XXX/XXX/XXX

First charters are types and followed by - or / with XXXXX(Numbers). I need to add below type.
SALESTUOQ_XXXXXXXXXX.

Regex code -
.?(?=-) to get the Type. The outcome is example WIN,FIG,LLOC
(?<=-).
?(?=(|$)) to get the Number(XXXXX) for the above types.

Need the above code to be modified for SALESTUOQ_XXXXXXXXXX. Which will be incorporated with the above list of types.

Please check this…

To get SALESTUOQ

To get XXXXXXXXX after _ try this…

Hope this helps…

Hey @suresh_panneer_selva

Welcome back to the forums :wave:

You are in the right place for Regex :wink:… the forums! Plenty of excellent people here to help.

Thank you for the sample and information on the pattern. Expected output is just single character BEFORE and AFTER the dash or underline. If so, I have some potential solutions below.

Updated Regex Pattern 1 - grab last character BEFORE dash or underline
image

Updated Regex Pattern 2 - grab first character AFTER dash or underline
I have made a small update to your pattern. I didn’t think you needed the extra set of brackets.
image

If you do need to grab the whole line you can replace the “?” with a “*” in each Regex pattern.

I’m certain you will have a solution from the forums soon :blush:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.