Invalid regex handling is not specified, e.g ?invalid, *invalid and +invalid. They don't even satisfy the grammar provided by the kata description, and still expects some matches, so what is expected?
OK, now expressions like /?invalid/, /*invalid/ and /+invalid/ invalid and must raise error.
I've changed description.
Notably, groups aren't dropped from the result just because they don't participate in the match, but the kata expects them to be dropped, which screws over whoever using these groups, as now the index of the group can change.
For expression (\d+)([a-z]+(\d+))? expected groups with overlapsed ranges - [5..5, 6..8, 8..8].
For named groups with alternations expected hash - {"first"=>5..5, "second"=>6..8, "third"=>8..8}
I close the issue because I posted the solution and did not wait for feedback for several weeks.
I close the issue because I posted the solution and did not wait for feedback for several weeks.
I close the issue because I posted the solution and did not wait for feedback for several weeks.
What is the status of this issue?
What is the status of this issue?
@voile
OK, now expressions like
/?invalid/
,/*invalid/
and/+invalid/
invalid and must raise error.I've changed description.
Changed to:
Fixed. Thanks!
Fixed. Thanks!
Why?
(abc)+
expects["abc", "abcabc", "abcabcabc"]
a+
expects["a", "aa", "aaa"]
Am I right?
Why is it wrong with numbers?
Changed to:
Fixed. Thanks!
Alternation are only supported within a group!
I've added tests for this cases.
For expression
(\d+)([a-z]+(\d+))?
expected groups with overlapsed ranges -[5..5, 6..8, 8..8]
.For named groups with alternations expected hash -
{"first"=>5..5, "second"=>6..8, "third"=>8..8}
I've added this line to description
Yes, agree.
I've fixed solution and test cases.
Loading more items...