Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript regex .test

const str = 'hello world!';
const result = /^hello/.test(str);

console.log(result); // true

/**
The test() method executes a search for a match between 
a regular expression and a specified string
*/
 
PREVIOUS NEXT
Tagged: #javascript #regex
ADD COMMENT
Topic
Name
6+2 =