- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Martin, Thanks for offering your help. By researching and playing with http://www.regexr.com/ I have found my answer and by working more with Regexr tool I have found answers to a lot more questions.
This is my solution:
index="main" interaction.type=twitter | regex interaction.content="((word1)\W+(?:\w+\W+){1,8}?(word2)W)"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following regex may be more than you need, but has a few extra facets:
- Matches the two words in either order.
- Matches the words when they are adjacent.
Uses word boundary anchors for matches at the beginning or end of the field.
index="main" interaction.type=twitter | regex interaction.content="(?:\bword1\b\W(?:\w+\W+){0,6}?\bword2\b|\bword2\b\W(?:\w+\W+){0,6}?\bword1\b)"
Hope it's useful.
Barry
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Martin, Thanks for offering your help. By researching and playing with http://www.regexr.com/ I have found my answer and by working more with Regexr tool I have found answers to a lot more questions.
This is my solution:
index="main" interaction.type=twitter | regex interaction.content="((word1)\W+(?:\w+\W+){1,8}?(word2)W)"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Correction - for some reason the backslash did't show above:
index="barclays" interaction.type=twitter | regex interaction.content="((word1)\W+(?:\w+\W+){1,8}?(word2)\W)"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

How is "word" defined in your context?
Got Sample data?
What's not working in your own solution?
