HiveBrain v1.2.0
Get Started
← Back to all entries
snippetjavascriptTip

Regular Expressions Cheat Sheet

Submitted by: @import:30-seconds-of-code··
0
Viewed 0 times
javascriptexpressionsregularcheatsheet

Problem


  • ^: start of the string or the start of a line in a multiline pattern
  • $: end of the string or the end of a line in a multiline pattern
  • \b: word boundary
  • \B: not word boundary (opposite of \b)


> [!NOTE]

Solution


  • \b: word boundary
  • \B: not word boundary (opposite of \b)


> [!NOTE]
>
> Anchors are non-quantifiable (i.e. cannot be followed by a quantifier).
  • .: any character except line breaks

Context

From 30-seconds-of-code: regexp-cheatsheet

Revisions (0)

No revisions yet.