I've seen such an JS regexp: /hover_cursor\s(.*?);/i
And am trying to find out why apparently this regexp doesn't match this string (it should match): "hover_cursor pointer;"
var string = '"hover_cursor pointer;"';
var notetag = '/hover_cursor\s(.*?);/i'
a = string.match(notetag);
writeln(String(a)); // null
The one part I don't understand in this regexp is this one: (.*?)
Except for this (.*?)
everything should match: the string hover_cursor
in the beginning: check. \s
whitespace: check. Semicolon in the end: check.
So I'm assuming that the problem lies in this (.*?)
What does this even mean? Any non-whitespace character (.
) in any quantity (.*
) repeated zero or one time?? This question mark seems superflous to me since *
allows zero repetitions anyway??