Skip to content

Instantly share code, notes, and snippets.

@asvechkar
Last active December 22, 2015 13:19
Show Gist options
  • Select an option

  • Save asvechkar/6478468 to your computer and use it in GitHub Desktop.

Select an option

Save asvechkar/6478468 to your computer and use it in GitHub Desktop.
регулярные выражения
# Matching a Username
/^[a-z0-9_-]{3,16}$/
# Matching a Password
/^[a-z0-9_-]{6,18}$/
# Matching a Hex Value
/^#?([a-f0-9]{6}|[a-f0-9]{3})$/
# Matching a Slug
/^[a-z0-9-]+$/
# Matching an Email
/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/
# Matching a URL
/^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/
# Matching an IP Address
/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
# Matching an HTML Tag
/^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/
# рязань.2013.09.клиенты.xlsx
/([^.]{7})/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment