Timeline for Faster regex to match all worded numbers from 1 to 99
Current License: CC BY-SA 4.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 26 at 8:08 | comment | added | greybeard | I expect REs to get "compiled" into small automatons, with many expressions resulting in the same automaton. | |
Sep 25 at 21:14 | vote | accept | Bobby234 | ||
Sep 25 at 21:14 | answer | added | Bobby234 | timeline score: 1 | |
Sep 23 at 22:27 | comment | added | Cary Swoveland |
I expect that maintaining a set of 99 strings would be best in terms of execution speed, readability and time required for testing. In Ruby (think pseudo-code), suffixes = ["one", "two", ..., "nine"] , prefixes = ["twenty", "thirty", ..., "ninety"] , teens = ["ten", "eleven", ..., "nineteen"] , cartesian_product = prefixes.product(['-'], suffices).map(&:join) #=> ["twenty-one", "twenty-two", ..., "twenty-nine", "thirty-one", ..., "ninety-nine"] , then create a constant that holds a set of 99 strings: ONE_TO_ONE_HUNDRED = Set[suffices + teens + prefixes + cartesian_product] .
|
|
Sep 23 at 20:28 | answer | added | Jdm | timeline score: 3 | |
Sep 23 at 15:29 | history | edited | Bobby234 | CC BY-SA 4.0 |
added 6 characters in body
|
Sep 23 at 15:23 | history | edited | toolic | CC BY-SA 4.0 |
deleted 5 characters in body
|
S Sep 23 at 15:18 | history | suggested | fdomn-m | CC BY-SA 4.0 |
Removed comment about getting around the rules
|
Sep 23 at 15:18 | review | Suggested edits | |||
S Sep 23 at 15:18 | |||||
S Sep 23 at 15:16 | review | First questions | |||
Sep 23 at 15:23 | |||||
S Sep 23 at 15:16 | history | asked | Bobby234 | CC BY-SA 4.0 |