Use backrefs:
/^([\w-.]+) ([\w-.]+) (\1\.\2@([\w-]+.)+[\w-]{2,4})?$/
More Related Contents:
- Not able to get Regular Expression in javascript
- Need Pattern for password field?
- Regular Expression jquery validation1 [duplicate]
- Regular expression to match non-ASCII characters?
- jQuery selector regular expressions
- Including a hyphen in a regex character bracket?
- Regex to replace multiple spaces with a single space
- Extract hostname name from string
- Remove whitespace and line breaks between HTML elements using jQuery
- How to pull the file name from a url using javascript/jquery?
- Get URL from background-image Property
- Wrap tags around http text
- javascript regex for password containing at least 8 characters, 1 number, 1 upper and 1 lowercase [duplicate]
- How can I select an element by ID with jQuery using regex?
- Regex to Match Symbols: !$%^&*()_+|~-=`{}[]:”;’?,./
- Javascript regex returning true.. then false.. then true.. etc [duplicate]
- Split a string based on multiple delimiters
- Insert dash after every 4th character in input
- Highlight current page in jquery
- jQuery Youtube URL Validation with regex
- How to convert a Title to a URL slug in jQuery?
- JavaScript Regex to match a URL in a field of text
- Regex in JavaScript for validating decimal numbers
- Regular expression for only characters a-z, A-Z
- regular expression to validate datetime format (MM/DD/YYYY) [duplicate]
- Why this regex is not working for german words?
- Remove everything within script and style tags
- Match all URLs in string and return in array in JavaScript
- Regular Expression to MATCH ALL words in a query, in any order
- Find and replace nth occurrence of [bracketed] expression in string