Saturday, 10 August 2013

How to match the pattern regardless of the number of whitespaces

How to match the pattern regardless of the number of whitespaces

Not good in regexp, how can i match the pattern regardless of how many
whitespaces there is?
var pattern = / void main$/; //here
var pool1 = "abdodfo void main";
var pool2 = "abdodfo void main";
console.log(pattern.test(pool1)); // true
console.log(pattern.test(pool2)); // must also be true

No comments:

Post a Comment