Regex To Match Any Numbers But The Last X Digits

Category: Numbers

A regular expression that allows you to match any numbers but the last x digits (last 4 digits in this regex) in a string.



  • 12345
  • 123456
  • r12345


  • 1234
  • Regex 134
  • Regex Pattern

See Also:

Rate This Regex
User Review
0 (0 votes)

Expression Flags

Flags Description
i Ignore case sensitive.
g Allows global search.
m Allows multiline search.