Cretezy / flutter_linkify

Turns text URLs and emails into clickable inline links in text for Flutter
https://pub.dartlang.org/packages/flutter_linkify
MIT License
262 stars 99 forks source link

Is there a way to detect links with commas? #138

Open Mounix99 opened 2 months ago

Mounix99 commented 2 months ago

I have the link with comma and I can't figure out what should be the RegEx for this type of links. Does anyone know ? link example: https://morecup.cups.nu/2024,nb/result/team/49286854 regEx for modifying: r'^(.?)((?:https?:\/\/|www.)[^\s/$.?#].[^\s])'

Mounix99 commented 2 months ago

For anyone who will struggle from the same problem, here is a RegEx for such types of links

RegExp(
  r'^(.*?)((?:https?:\/\/|www\.)[^\s/$.?#].\S+,+\S*)',
  caseSensitive: false,
  dotAll: true,
)