0

I created the following regex:

(?=(?<![^\p{Alnum}\p{Punct}])(\p{Punct}\p{Alnum}+\p{Punct}))

I'm using this regex against the string "https://www.google.com/mail/"

I am getting the tokens as:

/www., .google., .com/, /mail/

But, when I modified the regex to

(?=(?<![^\p{Alnum}\p{Punct}])(\p{Punct}\p{Alnum}+\p{Punct}){2})

to get the expected output as:

/www.google.

It is showing that there is no match for this pattern. I want to capture the token where the above pattern occurs twice.

The fourth bird
  • 127,136
  • 16
  • 45
  • 63
DareToDead
  • 31
  • 5

0 Answers0