I have this sample of string Lorem ipsum 12 121 323 454 dolor sit amet
. Here is my RegEx ([0-9 ?\s])
but it includes outside spaces.
CodePudding user response:
Start with a nonspace and end with nonspace:
[0-9 ](?:([0-9 ?\s]*[0-9 ]))?
A digit or a plus, followed optionally by any number of digits, plusses or spaces, finally ending in a digit or a plus.