In computer programming one often needs to parse character strings that might represent floating point numbers. These numbers might even be in scientific notation (e.g., 1.23e-4). For example, the program might need to parse a macro language consisting of operators, variables, and numbers, in which case some way of recognizing the numbers is needed.

Here is C code that accepts a standard null-terminated C string and returns how many characters represent a number (returns 0 if no number is present):