I want to validate a text string for a specific value:
- All numeric except for a decimal.
- The decimal cannot be the first or last character.
- It can have any number of digits but only one decimal.
I am trying to find a reference that will describe the mask below as it does not fit my needs.
NSString *myRegex = @"^\\d+(?:[:](?:[0-5]?\\d)|\\.\\d)$";
Please lead me to the documentation that describes the above characters.
That’s a regular expression.
How about:
Have you thought about commas, dollar signs, negative or positive signs? If those are allowed then you should probably try to parse the string as a number using an iOS library method.