D
D
Dmitry Bashinsky2018-04-04 11:22:11
Regular Expressions
Dmitry Bashinsky, 2018-04-04 11:22:11

Replacing the domain with *?

Hello!
We have a domain "test.ua"
I need to find all links in the text that are not in our domain and replace this domain with "*".
Links can be without http\https, but can be with them
Expected result:
goolge.com -> http://******.com
https://goolge.com/test -> https://* *****.com/test
goolge.com -> ******.com
test.ua -> test.ua

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nick Sdk, 2018-04-04
@lidacriss

domain search
https://regex101.com/r/wJqhj6/1

goolge.com -> http://******.com
https://goolge.com/test -> https://******.com/test
goolge.com -> ******.com
test.ua -> test.ua

https://regex101.com/r/hS2yXN/1
https://regex101.com/r/qwhhZs/1
https://regex101.com/r/qwhhZs/2
and how to replace - it's you yourself on "your "language :)
ps: you have C# in your signature. I don't really remember the syntax, how to replace it with

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question