cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Regex Expression

mateus_chaves
Newcomer

guys i need help in this regex, check a string contains boths string example

 

mateus_chaves_0-1657650835115.png

 

2 REPLIES 2

Fin_Ubels
Dynatrace Champion
Dynatrace Champion

Hey Mateus,

 

What exactly are you trying to capture in this scenario? Is it what is between those 2 strings or is it the whole value? I ask as the regex input in this config is for capturing a specific value and not checking if it contains a certain value or values.

 

Fin_Ubels_0-1657667846726.png

In the example it provides above it would capture everything after /categories/ and not /categories/ itself. It isn't just checking for /categories/ it is extracting a substring.


If you want to capture the string of x and have it check for the 2 strings at the beginning and end then I would suggest using the very first configuration option which you can set to capture a substring between 2 strings.

Fin_Ubels_1-1657667990161.png

 

If you just want to check for the 2 strings but still capture the whole value then looking at the configuration options I'm not sure it can do that.

techean
Dynatrace Champion
Dynatrace Champion

someindicator: ([^ ]*+)

or

^(.*?\/)[^\/]++\/?$

 

Refer below solution if of any help

Solved: Can dynatrace possible to capture two pattern using regex ? - Dynatrace Community

Solved: Issue with clean URL regex - Dynatrace Community

The above should work!

KG

Featured Posts