Javascript RegExp

From Yate Documentation
Revision as of 17:31, 3 March 2016 by Marian (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Javascript RegExp.

Constructor

  • new RegExp(pattern [, flags])

Create a RegExp object.
Parameters:
pattern: Regexp pattern
flags: Optional list of flags:
'i': Enable case insensitive match. Disabled by default
'b': Enable basic POSIX regexp usage. Disabled by default (e.g. default is to use POSIX Extended Expression syntax)

NOTE: Flags parsing stops on unknown flag. E.g. 'iab' will apply 'i' but not 'b'.

Methods

  • test(str)

Test for matching.
Parameters:
str: String to test
Return:
TRUE if matched, FALSE if not.

  • valid()

Check if the pattern given in constructor is a valid regexp expression.
Return:
TRUE if the RegExp holds a valid pattern, FALSE if not.

NOTE: An invalid pattern won't match anything.

Properties

  • ignoreCase

Boolean. True if case insensitive was enabled, false otherwise.

  • basicPosix

Boolean. True if basic POSIX usage was enabled, false otherwise.

Personal tools
Namespaces

Variants
Actions
Preface
Configuration
Administrators
Developers