regexpu.1 1.43 KB
.Dd September 1, 2014
.Dt regexpu 1
.Sh NAME
.Nm regexpu
.Nd transpile ES6 Unicode regular expressions to equivalent ES5
.Sh SYNOPSIS
.Nm
.Op Fl -c | -code Ar snippet
.br
.Op Fl -f | -file Ar file
.br
.Op Fl v | -version
.br
.Op Fl h | -help
.Sh DESCRIPTION
.Nm
transpiles ES6 Unicode regular expressions to equivalent ES5.
.Sh OPTIONS
.Bl -ohang -offset
.It Sy "-c, --code <snippet>"
Print a transpiled version of the given ES6 snippet.
.It Sy "-f, --file <file>"
Print a transpiled version of the given ES6 file.
.It Sy "-v, --version"
Print regexpu's version.
.It Sy "-h, --help"
Show the help screen.
.El
.Sh EXIT STATUS
The
.Nm regexpu
utility exits with one of the following values:
.Pp
.Bl -tag -width flag -compact
.It Li 0
.Nm
successfully transpiled the input and printed the result.
.It Li 1
.Nm
wasn't instructed to transpile anything (for example, the
.Ar --help
flag was set); or, an error occurred.
.El
.Sh EXAMPLES
.Bl -ohang -offset
.It Sy "regexpu -f foo-es6.js > foo-es5.js"
Transpile `foo-es6.js` to valid ES5 and save the result as `foo-es5.js`.
.It Sy "regexpu -c 'var x = /foo.bar/u;'"
Print the transpiled version of the given ES6 snippet.
.It Sy "echo 'var x = /foo.bar/u;' | regexpu -c"
Print the transpiled version of the ES6 snippet that gets piped in.
.El
.Sh BUGS
regexpu's bug tracker is located at <https://github.com/mathiasbynens/regexpu/issues>.
.Sh AUTHOR
Mathias Bynens <https://mathiasbynens.be/>
.Sh WWW
<https://mths.be/regexpu>