regex - How to match the pattern regardless of the number of whitespaces -


not in regexp, how can match 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 true 

change pattern to: /\s+void\s+main$/


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -