
Announcement
Collapse
No announcement yet.
Help with Regular Expression
Collapse
X
-
Let's get back to basics
Here is a website that will allow you to test your Regex.
https://regex101.com/
Here is a site with cheatsheet of Regex syntax.
https://www.rexegg.com/regex-quickstart.html#chars
Here is the text String I utilized to test the regex: "Midway was recently added to TV sHows temPa MovIes "
The Regex that will identify the wanted terms regardless of case is: \b((?i)(?<!Temp\s)Movies|Sports|TV\sShows|TV\sRecordings)\b
In the test, It identified both "TV sHows" and "Movies". This is because Temp did not precede Movies but temPa did. If you delete the a it will find TV sHows only.
I think this will work in the long run regardless of text before or after.
- Likes 1
Leave a comment:
-
Originally posted by ServiceXp View Post
Thanks for you help, neither seemed to work. Would not fire the event.
Code:(Movies|Sports|TV|Shows|TV Recordings)$
Code:added to (Movies|Sports|TV|Shows|TV Recordings)$
- Likes 1
Leave a comment:
-
Originally posted by AllHailJ View PostDo you want to test a string that just contains movies, Sports, TV Shows, TV Recordings?
Can you Share the Strings you are trying to parse?
Yes, here is what a possible string would look like.. They could contain other/additional verbiage but this is the jist of it.
Midway was recently added to Movies
Leave a comment:
-
Try
Code:^(Movies|Sports|TV|Shows|TV Recordings)$
Code:^Movies$|^Sports$|^TV Shows$|^TV Recordings$
Leave a comment:
-
Do you want to test a string that just contains movies, Sports, TV Shows, TV Recordings?
Can you Share the Strings you are trying to parse?
Leave a comment:
-
Originally posted by AllHailJ View PostTry this- This is searching for words on a word boundary.
\b(Movies|Sports|TV|Shows|Recordings)\b
HOWEVER
It fires on any word in the group and not on the exact statements below.
Example: If the status is Temp Movies, it firing (I'm guessing because it has the work Movie in it), but I need to only fire on the full Strings
Movies
Sports
TV Shows
TV Recordings
Leave a comment:
-
Try this- This is searching for words on a word boundary.
\b(Movies|Sports|TV|Shows|Recordings)\b
Leave a comment:
-
Help with Regular Expression
I'm trying to match these possible strings inside a device status within a longer string. I've been at this for a few hours and I'm calling uncle...
Any help is much appreciated.
Movies
Sports
TV Shows
TV RecordingsTags: None
Leave a comment: