Regex for a value mapping

Looking for a regex to use within a value mapping

I have data in this format


Looking for a regex to prefix a string before the last 2 digits. Possible?

Output would be

1/1/2/5/1 → 1/1/2/ONT5.PON1
1/1/1/7/16 → 1/1/1/ONT7.PON16

any help would be appreciated


What is the data source this is coming from?

Coming from mysql. I don’t think the data source really matters. This is a value mapping which works when I apply a simple regex I just don’t know regex for what I need

why go through the regex gyration when you can do it on the query, so yes data source does really matter

Try this
Match: (\d+/\d+/\d+)/(\d+)/(\d+)
Replace: $1/ONT$2.PON$3

1 Like