megah
June 18, 2022, 11:40am
1
Looking for a regex to use within a value mapping
I have data in this format
1/1/2/5/1
1/1/2/7/16
etc
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
etc
any help would be appreciated
Welcome
What is the data source this is coming from?
megah
June 18, 2022, 6:04pm
3
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