X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

JavaScript RegExp \f Metacharacter

RegExp Object Reference JavaScript RegExp Object

Example

Search for a form feed character in a string:

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

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

Visit W3Schools.\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

Internet Explorer Firefox Opera Google Chrome Safari

The \f metacharacter is supported in all major browsers.


Syntax

new RegExp("\\f")

or simply:

/\f/


RegExp Object Reference JavaScript RegExp Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook