SOLVED
Regex expression to extract characters between underscores
Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Travis_Ratliff
8 - Asteroid
‎09-12-2024
09:27 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I am trying to find a regex expression that will extract certain characters between two underscores. The problem I am currently having is that the regex outputs too many characters
Input | Output Wanted | Output Wanted 2 |
wave(ELBA_DS_SBGF_GH_DA_JNG_JGH) - wave(ELBA_DS_CDAS_GH_DA_FNG_JHIY) | SBGF | CDAS |
wave(ELBA_DS_MEBADGASW3_H_DA_JGK_KGHL) - wave(ELBA_DS_MRTYRTDV7FTW_H_DA_KGHJ_ITRY) | MEBADGASW3 | MRTYRTDV7FTW |
wave(ELBA_DS_AMBSPORT8ADK_GHJ_DA_PIK_ASG) - wave(ELBA_DS_EKHLGNSMILE5_GHJ_DA_ABC_MSG) | AMBSPORT8ADK | EKHLGNSMILE5 |
Currently to try and get the first Output I am using "\w{4}\w{2}\_(\w+)\_" which is giving me "SBGF_GH_DA_JNG" but I thought that the last \_ after the match group would make it stop and not include anything after that underscore.
Any help would be appreciated. Thanks
Solved! Go to Solution.
1 REPLY 1
16 - Nebula
‎09-12-2024
09:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Try this expression in a RegEx tool in Tokenize mode: (?:.*?)wave\(ELBA_DS_(.*?)_
 
Chris
