R"09"^0 * S"13579" does not work because R"09"^0 will consume all digits and S"13579" will have nothing to match.
Asked
Active
Viewed 20 times
0
-
I find this can work P{ "Odd", Odd = R"09" * V"Odd" + S"1357", } Is There any better way? – Jason Wang Jun 09 '22 at 09:12
1 Answers
0
Normally, odd <- [0-9] odd / [1357]
is correct enough to match small numbers. Alternatively, you could first check it's not last digit of an odd number, before consuming it:
odd <- (!([1357] ![0-9]) [0-9])* [1357]

Brynne Taylor
- 116
- 7