Do a global search for the numbers 1, 2, 3 and 4 in a string:
The marked text below shows where the expression gets a match:
The [0-9] expression is used to find any digit between the brackets.
The digits inside the brackets can be any numbers or span of numbers from 0 to 9.
Tip: Use the [^0-9] expression to find any digit NOT between the brackets.
The [0-9] expression is supported in all major browsers.
Do a global search for the number "1" in a string:
The marked text below shows where the expression gets a match: