rescript-lang / rescript

ReScript is a robustly typed language that compiles to efficient and human-readable JavaScript.
https://rescript-lang.org
Other
6.77k stars 453 forks source link

Syntax for RegExp literals #6287

Closed cknitt closed 4 months ago

cknitt commented 1 year ago

JS has the following syntax for RegExp literals:

const myRegExp = /ab+c/;

In ReScript, this would currently be expressed as

let myRegExp = %re("/ab+c/")

It would be nice if ReScript also had dedicated syntax for regexp literals, if possible identical to the JS version:

let myRegExp = /ab+c/
texastoland commented 1 year ago

May I add regex support for extended x flag (currently Stage 3) with flexible whitespace and comments 🙏🏼 https://github.com/tc39/proposal-regexp-modifiers https://github.com/tc39/proposal-regexp-x-mode