Latest web development tutorials
 

JavaScript RegExp \f Metacharacter

< JavaScript RegExp Object

Example

Search for a form feed character in a string:

var str = "Visit w3ii.\fLearn Javascript.";
var patt1 = /\f/;

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

Visit w3ii.\fLearn Javascript.
Try it Yourself »

Definition and Usage

The \f metacharacter is used to find a form feed character.

\f returns the position where the form feed character was found. If no match is found, it returns -1.


Browser Support

Expression
\f Yes Yes Yes Yes Yes

Syntax

new RegExp("\\f")

or simply:

/\f/

< JavaScript RegExp Object