Skip to content

Substitutions don't handle it happening 4x+ in the user input #140

@snoopyjc

Description

@snoopyjc

With this RiveScript:

+ a a a a
- Got a a a a

+ a a ab a
- Got a a ab a

! sub ab = a

and input "ab ab ab ab", the output should be "Got a a a a". Instead, the output is "Got a a ab a".

Problem is this line need to be executed as long as it makes a change:

msg = re.sub(cache["sub3"], r'\1' + placeholder + r'\2', msg)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions