Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
([-\.\w]+:\/{2,3})(?!.*[.]{2})(?![-.*\.])((?!.*@\.)[-_\w@^=%&:;~+\.]+(?<![-\.]))(\/[-_\w@^=%&:;/~+\.]+(?<!\.))?\??([-_\w=&@$!|~+]+)*#?([-_\w=&@$!|~+]+)*
/
igum

Description

  • This version has a very high accuracy - few extraneous char matches.
  • Very verbose, heavy usage of look-aheads, look-behinds, and mostly 'inclusive' character class matching. (as opposed to the exclusion strategy in this example)
Submitted by DanLevy.net - 4 days ago