test

Summary

Matches the regular expression pattern against some text and returns a Boolean representing whether the match succeeded.

Usage

public bool test(string value)

Returns

true if the match succeeded and false if the match failed.

Parameters

value

The string to match the regular expression pattern against.

Description

Matches the regular expression pattern against some text and returns true if the match succeeds and false otherwise.

Examples

Basic Usage
1
2
3
4
5
import System;
 
System.RegExp re = /^abc/;
Console.log(re.test("abc")); // true
Console.log(re.test("xyz")); // false

Share

HTML | BBCode | Direct Link