Skip to content

RegExp slash escapes not parsed correctly #68

@cartant

Description

@cartant

Using the following snippet in the ESQuery demo:

var f = "foo/bar";

None of these queries is parsed correctly and all fail with an error:

[value=/foo\/bar/]

Invalid regular expression: /foo/: \ at end of pattern

[value=/foo\\/bar/]

Expected " " or "]" but "b" found.

[value=/foo\\\\/bar/]

Expected " " or "]" but "b" found.

I'm using tsquery to write an import-location-specific TSLint rule for RxJS and the RegExp issue appears to be an upstream problem with this package.

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