firasdib / Regex101

This repository is currently only used for issue tracking for www.regex101.com
3.2k stars 198 forks source link

What exactly is then Exact Regular Expression? #2291

Closed sunilpandya closed 3 weeks ago

sunilpandya commented 3 weeks ago

Bug Description

I am testing following Regular expression for testing email /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+.[a-zA-Z]{2,}$/gm email sunilpandya@hotmail.com sunil.pandya02@gmail.com But your Tester says no match found then what is the exact regular expression, all programmer for php Regular expression suggest above Regular Expression for PHP

Reproduction steps

Expected Outcome

Browser

Include browser name and version

OS

Include OS name and version

working-name commented 3 weeks ago

Hi @sunilpandya,

The regular expression you pasted has ^ and $ which mean start of line and end of line respectively, given that the /m flag is on. Therefore you'd have to have a single email address per line, to test if it matches.

If you need further help with regex, please use the social button at the top right and pick your favorite platform. Github issues are more suited for bugs and feature requests rather than help with understanding or coming up with a regex.