hi,
I’m having issues with multiple regex patterns failing to find a match in the pattern match step.
it appears to work with 2 patterns at the same time, but anymore it breaks. I use comma as a delimiter
i.e Severity={{Severity:/[a-zA-Z0-9%.-]+/}},PrincipalId={{PrincipalId:/[a-zA-Z0-9+.%]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}/}}
^will find a match. however,
Type={{Type:/[a-zA-Z0-9%.-]+/}},PrincipalId={{PrincipalId:/[a-zA-Z0-9+.%]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}/}}
^will fail
@jerusalem_strangely Let me play with this and see if I can find a solution for you. Do you have a sample string of what you are trying to match?
This worked for me to create four variables and find all of them.
Test String: PrincipalId=sample.emailhere@gmail.com,Severity=HIGH,Other=Another,Four=Five
RegEx: PrincipalId={{PrincipalId:/[a-zA-Z0-9+.%]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}/}},Severity={{Severity:/[a-zA-Z0-9%.-]+/}},Other={{Other:/[a-zA-Z0-9%.-]+/}},Four={{Four:/[a-zA-Z0-9%.-]+/}}
2 Likes
@jerusalem_strangely, what does breaking/failure look like specifically? A warning/error message, or just not matching?
does it display the output, however?
I tried to push the output to slack but it doesn’t return the value of the variable for multiple of the matches.
so i just retested it with the test string and it worked. the issue was the input i use to test it, it appears I need to strengthen my regex instead
RegEx is a giant pain, I like to use regex101.com to build out an RegEx I am trying to use.
1 Like