Skip to content

match with regex doesn't set variable correctly when backtracking. #367

@adam-antonik

Description

@adam-antonik

Changing the example from the from the front-page slightly to match "f(o*)obar"

match "foobar" with
| 'f(?<os>o*)obar' -> os
| _               -> "???"

will evaluate to "oo", not "o". Similarly, if we use 'f(?.*)bar', then os = "oobar".

Metadata

Metadata

Assignees

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