ECMA262Regex

Module that provides support for ECMA262 regex notation

ECMA262Regex

image https://github.com/edumentab/p6-ecma262regex/actions/workflows/ci.yml/badge.svg not found

This module allows you parsing ECMA262 regex notation and use it in Perl 6.

SYNOPSIS

use v6;
use ECMA262Regex;

say ECMA262Regex.validate('\e'); # False;
say ECMA262Regex.validate('^fo+\n'); # True

# Translate regex into Perl 6 one (string form)
say ECMA262Regex.as-perl6('^fo+\n'); # '^fo+\n'
say ECMA262Regex.as-perl6('[^ab-d]'); # '<-[ab..d]>'

# Compile textual ECMA262 regex into Perl 6 Regex object
my $regex = ECMA262Regex.compile('^fo+\n');

say "foo\n"  ~~ $regex; # Success
say " foo\n" ~~ $regex; # Failure

ECMA262Regex v1.1.3

Module that provides support for ECMA262 regex notation

Authors

  • Jonathan Worthington
  • Alexander Kiryuhin

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • ECMA262Regex

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.