Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

JE::Object::RegExp
JavaScript regular expression class

JE::Object::RegExp - JavaScript regular expression class


NAME

JE::Object::RegExp - JavaScript regular expression (RegExp object) class


SYNOPSIS


  use JE;

  use JE::Object::RegExp;

  $j = new JE;

  $js_regexp = new JE::Object::RegExp $j, "(.*)", 'ims';

  $perl_qr = $js_regexp->value;

  $some_string =~ $js_regexp; # You can use it as a qr//


DESCRIPTION

This class implements JavaScript regular expressions for JE.

See the JE::Types manpage for a description of most of the interface. Only what is specific to JE::Object::RegExp is explained here.

A RegExp object will stringify the same way as a qr//, so that you can use =~ on it. This is different from the return value of the to_string method (the way it stringifies in JS).

Since JE's regular expressions use Perl's engine underneath, the features that Perl provides that are not part of the ECMAScript spec are supported, except for (?s) and (?m), which don't do anything.


METHODS

value
Returns a Perl qr// regular expression.

If the regular expression or the string that is being matched against it contains characters outside the Basic Multilingual Plane (whose character codes exceed 0xffff), the behavior is undefined--for now at least. I still need to solve the problem caused by JS's unintuitive use of raw surrogates. (In JS, /../ will match a surrogate pair, which is considered to be one character in Perl. This means that the same regexp matched against the same string will produce different results in Perl and JS.)

class
Returns the string 'RegExp'.


SEE ALSO

JE
JE::Types
JE::Object
Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy