libfsm icon indicating copy to clipboard operation
libfsm copied to clipboard

RE_ANCHORED incorrect for re_is_literal()

Open katef opened this issue 1 month ago • 0 comments

the -b here should cause implicit anchoring. instead it cases re_is_literal() to categorise the regex as not a literal:

; ./build/bin/re -br pcre -t 'a[b]c{1}'
; echo $?
1
; 
; ./build/bin/re -br pcre -t '^a[b]c{1}\z'
; echo $?                                 
1
; 

correctly:

; ./build/bin/re -r pcre -t '^a[b]c{1}\z' 
anchors: ^$
literal: abc
; echo $?                                
0
; 

katef avatar Nov 17 '25 19:11 katef