Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@matildepark
Copy link
Contributor

Our regex processes true, and sends a message as a URL, if any part of
the string is a URL starting with a URI schema.
We pass this function strings cut up by spaces. If a link was enclosed
in quotes, or in brackets, this would still process as true.

This adds ^ to the regex to only process strings that START with
a schema.

What's the difference? Before, all these have a match somewhere in them, so they get send as URL letters:
image

After, only the first matches:
image

Now it gets positives only when it's quite clearly a pasted link.

image

Our regex processes true, and sends a message as a URL, if any part of
the string is a URL starting with a URI schema.
We pass this function strings cut up by spaces. If a link was enclosed
in quotes, or in brackets, this would still process as true.

This adds ^ to the regex to only process strings that START with
a schema.
Copy link
Contributor

@liam-fitzgerald liam-fitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@matildepark matildepark merged commit 048de06 into master Apr 29, 2020
@matildepark matildepark deleted the mp/jank-regex branch April 29, 2020 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants