Regular Expressions 101

Single lone digits

Open Workspace
  • PCRE (Legacy)
  • Substitution
1

Regular Expression

/
(?<!\d)(\d)(?!\d)
/
g

Description

Find single digits that are not part of an integer. For example, "27" should not match, but "27.1" will match the "1". "27.11" won't match.

Submitted by Conan Dombroski