Interface JSRegExpFunctions

All Superinterfaces:
JSObjectFunctions
All Known Implementing Classes:
JSRegExp

public interface JSRegExpFunctions extends JSObjectFunctions
  • Method Details

    • exec

      JSArray exec(String string)
      function exec(string) general purpose pattern matching.

      Example

      var r = new RegExp("/\bJava\w*\b/g");
      var text = "JavaScript is not the same as Java";
      while((result = e.exec(text)) != null)
      {
        alert("Matched: " + result[0]);
      }
      
      Parameters:
      string - The string to be searched
      Since:
      Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
      See Also:
    • test

      JSBoolean test(String string)
      function test(string) test whether a string matches a pattern.

      Example

      var r = new RegExp("/java/i");
      r.test("JavaScript"); //returns true
      r.test("ECMAScript"); //returns false
      
      Parameters:
      string - The string to be tested
      Since:
      Standard ECMA-262 3rd. Edition, Level 2 Document Object Model Core Definition.
      See Also: