https://linen.dev logo
#help
Title
# help
s

Sai Srihitha Reddy Thummala

07/04/2023, 10:37 PM
Hi I'm trying to use json unit regex and i have two urls that i want to match - something along signin.qa.abc.com and the other one with signin.dev.abc.com I wrote
${json-unit.regex}^(<https://signin>.*.<http://abc.com|abc.com>)
as the pattern but it does not match the above two urls. is there any guide to follow for these regex?
other things i tried -
<https://signin>.${json-unit.regex}(qa)|(dev).<http://abc.com|abc.com>
o

Oleg Nenashev

07/05/2023, 9:17 AM
Hi. In which field do you perform the match? Is it the JSON body or something else?
s

Sai Srihitha Reddy Thummala

07/05/2023, 2:33 PM
@Oleg Nenashev I want to match the json responses using assertThatJson
I am putting the json-unit.regex in the json file - which would be used and loaded as expected response
On another note - how do I put json-unit.regex in the middle of a string? is that possible?
o

Oleg Nenashev

07/05/2023, 5:05 PM
No, I don't think so
s

Sai Srihitha Reddy Thummala

07/05/2023, 5:20 PM
for anyone having the same question - what worked for me was
"URL": "${json-unit.regex}^<https://signin>\\.(qa|dev)\\.abc\\.com"
I had to escape the dots
3 Views