Skip to content

Instantly share code, notes, and snippets.

@katopz
Last active December 7, 2022 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save katopz/5dcac9ee9e17bb5ee33a2d2f6b6cc5e9 to your computer and use it in GitHub Desktop.
Save katopz/5dcac9ee9e17bb5ee33a2d2f6b6cc5e9 to your computer and use it in GitHub Desktop.
handy regular expression

Find 3 space before any word.

^\s{3}(?=\w)

Find text between tag <h2>$1.1</h2>

const matched_values = text.match(/(">\$)(.*?)</gm)
const value = matched_values.length === 3 ? matched_values[2] : NaN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment