Skip to content

Useful regular expressions

  • Published: 2023-03-20 22:09
  • Updated: 2024-01-25 11:34

regex ain’t part of my daily routine. Figuring out a working expression can be a bit of a tedious process for me. These are one’s I found useful, and may want to use them again.

Useful regular expressions

Match a version number and everything appended ‘til EOL—eg v1*:

  \v\d\N+

Match any term from a list of terms:

\-(term1|term2|term3|)

Match entire line incl. a specific term:

\N+(\[term\])\N+

Further resources

  • Regex101.com
    • Webtool for writing and testing regular expressions in real-time