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

Document RegEx with links to online service #558

Open
rugk opened this issue Jul 1, 2018 · 2 comments
Open

Document RegEx with links to online service #558

rugk opened this issue Jul 1, 2018 · 2 comments
Assignees

Comments

@rugk
Copy link

rugk commented Jul 1, 2018

E.g. as for the RegExes here:

var simpleURLRegex = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+?\.[^'">\s]+?)()(\1)?(?=\s|$)(?!["<>])/gi,
simpleURLRegex2 = /([*~_]+|\b)(((https?|ftp|dict):\/\/|www\.)[^'">\s]+\.[^'">\s]+?)([.!?,()\[\]])?(\1)?(?=\s|$)(?!["<>])/gi,
delimUrlRegex = /()<(((https?|ftp|dict):\/\/|www\.)[^'">\s]+)()>()/gi,
simpleMailRegex = /(^|\s)(?:mailto:)?([A-Za-z0-9!#$%&'*+-/=?^_`{|}~.]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(?=$|\s)/gmi,
delimMailRegex = /<()(?:mailto:)?([-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)>/gi,

For the URL examples I have this here:
https://regex101.com/r/8nasII/2

It has some unit tests from https://mathiasbynens.be/demo/url-regex.

@tivie tivie self-assigned this Jul 5, 2018
@tivie
Copy link
Member

tivie commented Jul 5, 2018

thanks. You should issue a PR for develop branch.

@rugk
Copy link
Author

rugk commented Jul 5, 2018

Well… one needs to add regex and some useful examples for all other links there, too. My one was just one example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants