Forum Moderators: coopster
111 222 333 444... etc.
I have created the following expressions, but they don't work properly:
[fixed]
/^[0-9\ ]+$/
/^([0-9]+)[\s]([0-9]+)$/
[/fixed] The first allows multiple spaces between numbers, and the second doesn't seem to work at all. As the title suggests, the goal is to allow only one space between the number groups.
Any suggestions? Thanks.
[fixed]
preg_match("/^[0-9]+$/",$variable)
[/fixed] This is used in a larger function which validates information as it is passed through an array. Because I have set the function to include the spaces in between when formatting the array, removing the space from the preg_match() function was the only way to ensure the data being passed is not tainted. (You can never be too extreme with regards to PHP security).
Peace,
Mohamed