Skip to content

" compiles to \" which prevent using npm:regex library #7777

@hackwaly

Description

@hackwaly
@unboxed
type interpolation =
  | S(string)
  | R(RegExp.t)

@module("regex") @taggedTemplate
external regex: (array<string>, array<interpolation>) => RegExp.t = "regex"

Console.log(regex`"`) // This compiles to "console.log(regex`\"`)" which causes "Invalid regular expression: invalid escaped character for Unicode pattern: /\"/v"

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