Skip to content

Instantly share code, notes, and snippets.

@ctkjose
Last active September 12, 2018 01:45
Show Gist options
  • Select an option

  • Save ctkjose/defd0f39a4b879acbfd8853f922dfb83 to your computer and use it in GitHub Desktop.

Select an option

Save ctkjose/defd0f39a4b879acbfd8853f922dfb83 to your computer and use it in GitHub Desktop.
Reg EX

Selector

(([\.\#]{1}[a-zA-Z0-9_\-\:]+)((\[[a-zA-Z0-9_\-]+\])?|(\[[a-zA-Z0-9_\-]+[\^\*\$\~\|]?\=['"a-zA-Z0-9_\-]+\])?)?)

Double Quoted Value

("(?:[^"\\]|\\.)*")

Single Quote Value

('(?:[^'\\]|\\.)*')

String Value

(("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*'))

Literal Values

(("(?:[^"\\]|\\.)*")|('(?:[^'\\]|\\.)*')|([\+\-]?[0-9\.]+)|true|false|null|undefined)

Variable Name

([a-zA-Z\_\$]{1}[a-zA-Z0-9\_\-]+)

Basic contents of a tag

<([\w]+)[^>]*>(.*?)<\/\1>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment