0

I need to find regex pattern for url and use regex.test() so only string like this:

http://*.margonem.pl/

so it's exactly like above string and where * must appear and can be string which only contains a-z letters without any signs.

1
  • Either ^http://(?:[a-z]+\.)?margonem\.pl/$ or ^http:\/\/(?:[a-z]+\.)?margonem\.pl\/$ (depending on the usage). Commented Oct 18, 2019 at 13:31

1 Answer 1

1

That would be http:\/\/[a-z]+\.margonem\.pl\/:

Matches

http://a.margonem.pl/
http://foo.margonem.pl/

Does not match

http://hello-world.margonem.pl/
http://abcq443435u4531.margonem.pl/
Sign up to request clarification or add additional context in comments.

2 Comments

@dopeCode Why not? www can be a subdomain.
Sorry nevermind

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.