Article Preview
Buy Now
FEATURE
Numbers Please! Part 3
Creating a numbers-only field
Issue: 17.4 (July/August 2019)
Author: Markus Winter
Author Bio: Markus is a Molecular Biologist who taught himself REALbasic programming in 2003 to let the computer deal with some exceedingly tedious lab tasks. Some call it lazy, he thinks it smart. He still thinks of himself as an advanced beginner at best.
Article Description: No description available.
Article Length (in bytes): 22,355
Starting Page Number: 12
Article Number: 17402
Related Link(s): None
Excerpt of article text...
RegEx has a reputation for being powerful but tricky and, let's be honest: it is fully- deserved. But people usually forget one thing: to use RegEx successfully it is not sufficient to know RegEx—you also have to understand the source text you want to process with RegEx.
This is particularly important with regard to numbers, which is what we're going to explore in today's article as we attempt to create a RegEx pattern that will identify valid numbers for our text-only field project.
What numbers do we want to support?
Negative numbers:
- To allow the entry of negative numbers will require an
optional minus sign at the start. For those wanting to explicitly mark positive numbers we should also allow a plus sign at the start.Integer numbers:
...End of Excerpt. Please purchase the magazine to read the full article.