Answer the question
In order to leave comments, you need to log in
[[+content_image]]
What should the correct regular expression look like to search for a hostname?
Groovy
def URL = "sdfgsdfg https://inclouds.bizmail.ru hgfghfhgfhgf gfhgf"
print(URL.findAll(/\/\/(\w+.\w+.\w+)/))
[//inclouds.bizmail.ru][[://inclouds.bizmail, inclouds.bizmail]]
inclouds.bizmail.ru
. Answer the question
In order to leave comments, you need to log in
At least the dot is not escaped, which means it is "any character". But this is so, by the way.
And the answer is:
def URL = "sdfgsdfg https://inclouds.bizmail.ru hgfghfhgfhgf gfhgf"
print(URL.findAll(/(?<=:\/\/)[\w\d.]+/))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question