So \d+(?:\.\d+)? matches a group of digits, optionally followed by a dot and more digits. So, it matches an integer or a float.(?: - group, but don't generate back ref \. - a dot \d+ - followed by one or more digits )? - and the whole thing is optional
If you want to allow things like "20." (no numbers after the dot) you would have it to \d+(?:\.\d*) (asterisk instead of plus sign after the second \d).
--ZZamboni
In reply to RE: RE: Re: Regex trouble
by ZZamboni
in thread Regex trouble
by cyclone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |