RegEx Parse return text between 2 specific words
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello - I have a block of text that I am trying to pull a specific string that is between 2 words. What I think is the problem is that "ID:" occurs multiple times within the string of text however I just need it to return whatever comes after ORIG: and before the first instance of ID:
"some text with random words and numbers 12351 more words ORIG: text I need to pull 1235 words ID: 190355 more words ID: 13565 more words ID: 65168"
I want the results to be "text I need to pull 1235 words"
This is the expression that I'm using. I'm successfully parsing after the ORIG: however, it's pulling everything up until the last ID instead of the first one.
(?<=ORIG:)(.*)(?=\sID:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@elclark does this help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Howdy @elclark you can use the Regex tool in Parse mode with this expression and it should do the trick:
ORIG:\s*(.*?)\s*ID:
