JavaScript RegExp \v (vertical tab character) Metacharacter

Last Updated : 5 Aug, 2025

The RegExp \v Metacharacter in JavaScript is used to find the vertical tab character. If it is found it returns the position else it returns -1. 

JavaScript
let str = "G\vFG@_123_$";
let regex = /\v/;
let match = str.search(regex);
if (match == -1) {
    console.log("No vertical tab character present. ");
} else {
    console.log("Index of vertical tab character: " + match);
}

Output
Index of vertical tab character: 1

Syntax: 

/\v/ 
// or
new RegExp("\\v")

Example 1: Searches for the vertical tab character in the string. 

JavaScript
let str = "GeeksforGeeks@_123_$";
let regex = /\v/;
let match = str.search(regex);
if (match == -1) {
    console.log("No vertical tab character present. ");
} else {
    console.log("Index of vertical tab character: " + match);
}

Output
No vertical tab character present. 

Example 2: Searches the position of the vertical tab character in the string. 

JavaScript
let str = "123ge\veky456";
let regex = new RegExp("\\v");
let match = str.search(regex);
console.log(" Index of vertical tab character: "+ match);
Comment

Explore