1

Suppose I have a link like this:

https://neculaifantanaru.com/en/the-continuity-of-the-work-of-art.html

How can I find all links (such as the one above) that doesn't have / (slash) after /en

The Output:

So, the regex should find all links such as:

https://neculaifantanaru.com/enthe-continuity-of-the-work-of-art.html

BUT NOT this kind of links:

https://neculaifantanaru.com/azerbaijan.html

So, only those that have https://neculaifantanaru.com/en

1

2 Answers 2

4

This regex does the job:

https://\S+/en(?!/)\S*

Explanation:

https://        # literally
\S+             # 1 or more non space characters
/en             # literally
(?!/)           # negative lookahead, make sure we haven't a slash after
\S*             # 0 or more non space characters

Demo & explanation

0
0

I find another method:

Use the following:

  • Ctrl+H
  • Find what: https://neculaifantanaru\.com/en\w{1,}
  • CHECK Match case
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all
1
  • 2
    Be aware that will not match https://neculaifantanaru.com/en
    – Toto
    Commented Dec 15, 2021 at 14:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .