From http://www.w3schools.com (Copyright Refsnes Data)

JavaScript RegExp [^abc] Modifier


RegExp Object Reference JavaScript RegExp Object

Definition and Usage

The [^abc] expression is used to find any character not between the brackets.

The characters inside the brackets can be any characters or span of characters.

Syntax

new RegExp("[^xyz]")

or simply:

/[^xyz]/


Example

Example

Do a global search for characters not inside the character-span [a-h]:

var str="Is this all there is?";
var patt1=/[^a-h]/g;

The marked text below shows where the expression gets a match:

Is this all there is?

Try it yourself »


RegExp Object Reference JavaScript RegExp Object

From http://www.w3schools.com (Copyright Refsnes Data)