- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 03:46 AM - edited 10-08-2024 03:50 AM
Hi,
I am trying to create a RexEx to be used inside an Event Rule.
My Regex works correctly when I test it with Regex101.com but I obtain an error message UNKNOW when using in my Event Rule. Unknown is displayed when I output the variable which contains my RegEx
Here is the Regex which works on Regex101
.*Azure SQL Database: (.*)\/.*
Here is a sample text:
Blablatoto
sql-test-MY-mssqllab/MyInstance The Data space used percent value of 77 % was above your custom threshold of 75 %.Azure SQL Database: sql-test-MY-mssqllab/MyInstance
Blablabla
-------------------------------------------------------------------------------------------------------------------------------------
I want to extract the name of the DB, it can be found of the keyword Azure SQL Database:
But I want to grab everything after Azure SQL Database: up until the /
Thank you
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 09:32 AM
Hi, Can you try with regex below?
(.+Azure SQL Database: )(.+?)(\/.*)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2024 09:32 AM
Hi, Can you try with regex below?
(.+Azure SQL Database: )(.+?)(\/.*)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2024 03:25 AM
Thank you for the quick reply Appli. Do you have any tricks on RegEx from ServiceNow?
So many times my RegEx works in Reg101, and then does not work inside ServiceNow.
Thanks again
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2024 04:07 AM
Hi, you are welcome! I believe in your regex, this part "(.*)" was wrong as it also captures the slash "/".