Skip to content

RE_ANCHORED incorrect for re_is_literal() #514

@katef

Description

@katef

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
; 

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions