Comment: Within this DEFINE block, we'll define many subroutines
Comment: They build on each other like lego until we can define
Comment: a "big number"
Group one_to_9(?<one_to_9>
# The basic regex:
# one|two|three|four|five|six|seven|eight|nine
# We'll use an optimized version:
# Option 1: four|eight|(?:fiv|(?:ni|o)n)e|t(?:wo|hree)|
# s(?:ix|even)
# Option 2:
(?:f(?:ive|our)|s(?:even|ix)|t(?:hree|wo)|(?:ni|o)ne|eight)
) Comment: The basic regex:
Comment: one|two|three|four|five|six|seven|eight|nine
Comment: We'll use an optimized version:
Comment: Option 1: four|eight|(?:fiv|(?:ni|o)n)e|t(?:wo|hree)|
Comment: s(?:ix|even)
Comment: Option 2:
Non-Capturing Group(?:f(?:ive|our)|s(?:even|ix)|t(?:hree|wo)|(?:ni|o)ne|eight) 1st Alternativef(?:ive|our) fthe literal f (10210 / 1468 / 6616) (case sensitive)
Non-Capturing Group(?:ive|our) ivethe literal text ive (case sensitive) ourthe literal text our (case sensitive) 2nd Alternatives(?:even|ix) sthe literal s (11510 / 1638 / 7316) (case sensitive)
Non-Capturing Group(?:even|ix) eventhe literal text even (case sensitive) ixthe literal text ix (case sensitive) 3rd Alternativet(?:hree|wo) tthe literal t (11610 / 1648 / 7416) (case sensitive)
Non-Capturing Group(?:hree|wo) hreethe literal text hree (case sensitive) wothe literal text wo (case sensitive) 4th Alternative(?:ni|o)ne Non-Capturing Group(?:ni|o) nithe literal text ni (case sensitive) othe literal o (11110 / 1578 / 6F16) (case sensitive)
nethe literal text ne (case sensitive) eightthe literal text eight (case sensitive) Comment: end one_to_9 definition
Group ten_to_19(?<ten_to_19>
# The basic regex:
# ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|
# eighteen|nineteen
# We'll use an optimized version:
# Option 1: twelve|(?:(?:elev|t)e|(?:fif|eigh|nine|(?:thi|fou)r|
# s(?:ix|even))tee)n
# Option 2:
(?:(?:(?:s(?:even|ix)|f(?:our|if)|nine)te|e(?:ighte|lev))en|
t(?:(?:hirte)?en|welve))
) Comment: The basic regex:
Comment: ten|eleven|twelve|thirteen|fourteen|fifteen|sixteen|seventeen|
Comment: eighteen|nineteen
Comment: We'll use an optimized version:
Comment: Option 1: twelve|(?:(?:elev|t)e|(?:fif|eigh|nine|(?:thi|fou)r|
Comment: s(?:ix|even))tee)n
Comment: Option 2:
Non-Capturing Group(?:(?:(?:s(?:even|ix)|f(?:our|if)|nine)te|e(?:ighte|lev))en|
t(?:(?:hirte)?en|welve)) 1st Alternative(?:(?:s(?:even|ix)|f(?:our|if)|nine)te|e(?:ighte|lev))en Non-Capturing Group(?:(?:s(?:even|ix)|f(?:our|if)|nine)te|e(?:ighte|lev)) 1st Alternative(?:s(?:even|ix)|f(?:our|if)|nine)te 2nd Alternativee(?:ighte|lev) enthe literal text en (case sensitive) 2nd Alternative
t(?:(?:hirte)?en|welve) Comment: end ten_to_19 definition
Group two_digit_prefix(?<two_digit_prefix>
# The basic regex:
# twenty|thirty|forty|fifty|sixty|seventy|eighty|ninety
# We'll use an optimized version:
# Option 1: (?:fif|six|eigh|nine|(?:tw|sev)en|(?:thi|fo)r)ty
# Option 2:
(?:s(?:even|ix)|t(?:hir|wen)|f(?:if|or)|eigh|nine)ty
) Comment: end two_digit_prefix definition
Group one_to_99(?<one_to_99>
(?&two_digit_prefix)(?:[- ](?&one_to_9))?|(?&ten_to_19)|
(?&one_to_9)
) Comment: end one_to_99 definition
Group one_to_999(?<one_to_999>
(?&one_to_9)[ ]hundred(?:[ ](?:and[ ])?(?&one_to_99))?|
(?&one_to_99)
) Comment: end one_to_999 definition
Group one_to_999_999(?<one_to_999_999>
(?&one_to_999)[ ]thousand(?:[ ](?&one_to_999))?|
(?&one_to_999)
) Comment: end one_to_999_999 definition
Group one_to_999_999_999(?<one_to_999_999_999>
(?&one_to_999)[ ]million(?:[ ](?&one_to_999_999))?|
(?&one_to_999_999)
) Comment: end one_to_999_999_999 definition
Group one_to_999_999_999_999(?<one_to_999_999_999_999>
(?&one_to_999)[ ]billion(?:[ ](?&one_to_999_999_999))?|
(?&one_to_999_999_999)
) Comment: end one_to_999_999_999_999 definition
Group one_to_999_999_999_999_999(?<one_to_999_999_999_999_999>
(?&one_to_999)[ ]trillion(?:[ ](?&one_to_999_999_999_999))?|
(?&one_to_999_999_999_999)
) Comment: end one_to_999_999_999_999_999 definition
Comment: ==== MORE ====
Group one_to_quadrillion(?<one_to_quadrillion>
(?&one_to_999)[ ]quadrillion(?:[ ](?&one_to_999_999_999_999_999))?|
(?&one_to_999_999_999_999_999)
) Comment: end one_to_quadrillion definition
Group one_to_quintillion(?<one_to_quintillion>
(?&one_to_999)[ ]quintillion(?:[ ](?&one_to_quadrillion))?|
(?&one_to_quadrillion)
) Comment: end one_to_quintillion definition
Group one_to_sextillion(?<one_to_sextillion>
(?&one_to_999)[ ]sextillion(?:[ ](?&one_to_quintillion))?|
(?&one_to_quintillion)
) Comment: end one_to_sextillion definition
Group one_to_septillion(?<one_to_septillion>
(?&one_to_999)[ ]septillion(?:[ ](?&one_to_sextillion))?|
(?&one_to_sextillion)
) Comment: end one_to_septillion definition
Group one_to_octillion(?<one_to_octillion>
(?&one_to_999)[ ]octillion(?:[ ](?&one_to_septillion))?|
(?&one_to_septillion)
) Comment: end one_to_octillion definition
Group one_to_nonillion(?<one_to_nonillion>
(?&one_to_999)[ ]nonillion(?:[ ](?&one_to_octillion))?|
(?&one_to_octillion)
) Comment: end one_to_nonillion definition
Group one_to_decillion(?<one_to_decillion>
(?&one_to_999)[ ]decillion(?:[ ](?&one_to_nonillion))?|
(?&one_to_nonillion)
) Comment: end one_to_decillion definition
Group bignumber(?<bignumber>
zero|(?&one_to_decillion)
) Comment: end bignumber definition
Group zero_to_9(?<zero_to_9>
(?&one_to_9)|zero
) Comment: end zero to 9 definition
Comment: (?<decimals>
Comment: point(?:[ ](?&zero_to_9))+
Comment: ) # end decimals definition