regex to find number in quotes with more than once space before in javascript

You can use the following regular expression pattern in JavaScript to find numbers in quotes with more than one space before it:

index.tsx
/"\s{2,}\d+"/g
15 chars
2 lines

Explanation:

  • /" matches the opening quote of the string

  • \s{2,} matches two or more whitespace characters

  • \d+ matches one or more digits

  • " matches the closing quote of the string

  • g is a flag used to match all occurrences in the string, not just the first one

gistlibby LogSnag