mvdan / xurls

Extract urls from text
BSD 3-Clause "New" or "Revised" License
1.19k stars 116 forks source link

Relaxed mode wrong matching #40

Closed mseld closed 4 years ago

mseld commented 4 years ago

Description

Input

Hello User you have been chosen to win journey to City,Country for 7 day(s)
##enjoy.it
Please Visit our website shopping.com/profile/joe 

Actual Detection enjoy.it shopping.com/profile/joe

Expected shopping.com/profile/joe

More examples

echo "##google.com" | xurls -r
echo "##enjoy.it" | xurls -r
mvdan commented 4 years ago

This looks correct, though - enjoy.it is a valid URL. There isn't any character that you can add to its left to not make it a valid URL that we pick up.

If this is markdown or HTML, you might have more success if you only use xurls on paragraph bodies, and not on titles.