How is the ?: syntax used in a regex? What does this actually do?
This is a debug account.
var regex = /(?:^|\s|$)([a-zA-Z0-9.\+_-]+@[a-zA-Z0-9._-]+)/gi;
The regex wants to make sure that there is whitespace before the email, but wants to match
"email@example.com" with a leading space.
The entire match will always be group 0, you need to access that specific group (group 1 in this case since the first group is non-capture).
More on non-capturing groups:
More on regexes:
Sir, I can do you a nice SEO.
Post a New Comment
Do you like having a good time?
Register an Account
Read Quality Articles
Read some quality articles. If you can manage to not get banned for like five minutes, you can even post your own articles.
Argue with People on the Internet
Use your account to explain why people are wrong on the Internet forum.
Vandalize the Wiki
Or don't. I'm not your dad.
Ask and/or Answer Questions
If someone asks a terrible question, post a LMGTFY link.
Make Some Money
Hire freelancers and/or advertise your goods and/or services. Hire people directly. We're not a middleman or your dad. Manage your own business transactions.
Answers— Read More
Find more related content below!
- [Solved] How to un-shorten/resolve Twitter's t.co links using Python
- [Solved] Running Selenium with a Proxy (Python, FireFox)
- [Solved] Python - Getting the remote/server IP address and port from an HTTP response using the requests libra...
- [Solved] Scraping Number of Search Results from Bing with Google Sheets
- [Solved] Color code HTTP status codes in Python
- What is a regex non-capturing group?
- What is ScrapeBox used for?
- Is there a way to solve "error in ogrlistlayers(dsn = dsn) : cannot open data source?"
- How to install the R programming language on Ubuntu?
- How to replace NA with 0 in R?