flutter_parsed_text icon indicating copy to clipboard operation
flutter_parsed_text copied to clipboard

Commas in URL

Open xJon opened this issue 4 years ago • 3 comments

Trying to parse a URL with a , in it can mess it up pretty bad: Screenshot_3 (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!

xJon avatar Jul 12 '20 17:07 xJon

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.

fayeed avatar Jul 17 '20 08:07 fayeed

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

beheobong avatar Jan 28 '21 03:01 beheobong

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

pablotardio avatar Aug 09 '21 01:08 pablotardio