Loredana Petrea
09/15/2021, 12:04 PMv[0..9]
e.g:
<https://baseurl.test/v1/example/{id}>
the result should be only <https://baseurl.test/>
Where the version number can be 1,2....9
Is there a way to do this?Tiago Nunes
09/15/2021, 4:33 PMRegex("v[0-9]").split(url).firstOrNull()
Tiago Nunes
09/15/2021, 4:33 PMVampire
09/15/2021, 4:49 PMRegex("^.*?/(?=v[0-9]/)").find(url)?.value
Loredana Petrea
09/16/2021, 1:24 PM