Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the ability to pass in a regEx string. #8

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

tkeithblack
Copy link
Contributor

Allow passing a custom regEx string to override the built-in regex used to detect urls and emails.

…regEx string used to detect emails and urls.
The previous regex string would flag numbers like 60.99 as a url, and it would flag any word with a dot like good.bye or anything with two dots like hello..there as urls.

This new version does not flag these false positives, however, it will only catch emails and urls with the following extensions.

.com
.ru
.org
.gov
.net
.ir
.in
.uk
.au
.de
.ua
.edu
.io
.co
@tkeithblack
Copy link
Contributor Author

Added to this push request an updated regEx string for detecting urls and email addresses. This was tested on the following text and correctly flags all valid emails.

I have tested it successfully against the string:

"This paragraph is testing embedded urls like www.example.io
and example.com and https://randomweb.io or maybe http://website.co
or maybe even api.website.com as well as email addresses like
[email protected] or [email protected] or [email protected] or website.gov
or somesite.org or university.edu but not something like
goofball@bobo since that has no .com on it also, it should not be fooled
by double dots like thank..you, or even single dots like love.you
That is one that gave me a really hard..time dude!!! I mean, really.
And finally, it should not be fooled by numbers like 200.12
That has been tough to fix :("

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.

1 participant