flutter_parsed_text
flutter_parsed_text copied to clipboard
Commas in URL
Trying to parse a URL with a ,
in it can mess it up pretty bad:
(It detected the first bit, then it stopped, then it detected a bunch of phone numbers).
Is there anything that can be done about this? Thank you!
You could setup a custom Regex for this.
I didn't spent much time on the default one that comes bundle with the package so some edge cases could be a problem.
MatchText(
type: ParsedType.CUSTOM,
pattern:
r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+',
regexOptions: RegexOptions(
multiLine: true,
dotAll: true
),)
@xJon @fayeed i change pattern and it fixed. You can use it
MatchText( type: ParsedType.CUSTOM, pattern: r'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', regexOptions: RegexOptions( multiLine: true, dotAll: true ),)
@xJon @fayeed i change pattern and it fixed. You can use it
So thanks for the pattern, I had a problem with the "%" T-T