Displaying 3 results from an estimated 3 matches for "tre_expand_ast".
2024 Aug 01
1
Question about regexp edge case
...o = 3}.
>>
>> Compiling with TRE_DEBUG, I see it parsed correctly:
>>
>> catenation, sub 0, 0 tags
>> assertions: bol
>> iteration {-1, 2}, sub -1, 0 tags, greedy
>> literal (0, 9) (48, 57), pos 0, sub -1, 0 tags
>>
>> ...but after tre_expand_ast I see
>>
>> catenation, sub 0, 1 tags
>> assertions: bol
>> catenation, sub -1, 1 tags
>> tag 0
>> union, sub -1, 0 tags
>> literal empty
>> catenation, sub -1, 0 tags
>> literal (0, 9) (48, 57), pos...
2024 Aug 09
1
Question about regexp edge case
...mpiling with TRE_DEBUG, I see it parsed correctly:
>>>
>>> catenation, sub 0, 0 tags
>>> ??? assertions: bol
>>> ??? iteration {-1, 2}, sub -1, 0 tags, greedy
>>> ????? literal (0, 9) (48, 57), pos 0, sub -1, 0 tags
>>>
>>> ...but after tre_expand_ast I see
>>>
>>> catenation, sub 0, 1 tags
>>> ??? assertions: bol
>>> ??? catenation, sub -1, 1 tags
>>> ????? tag 0
>>> ????? union, sub -1, 0 tags
>>> ??????? literal empty
>>> ??????? catenation, sub -1, 0 tags
>>> ??...
2024 Jul 29
1
Question about regexp edge case
On StackOverflow (here:
https://stackoverflow.com/questions/78803652/why-does-gsub-in-r-match-one-character-too-many)
there was a question about this result:
> gsub("^([0-9]{,5}).*","\\1","123456789")
[1] "123456"
The OP expected "12345" as the result. Several points were raised:
- The R docs don't mention the case of {,5} for the