javascript - What is the regex to find a single line of text preceding a question mark? -
In Javascript, I want to match all instances of the text between line breaks just before a question mark, such as:
This will not match this text.
How do I mail this text
I am trying to expose all the questions of Textarea automatically.
fairly simple:
^. * \? $
^
and $
start and end of anchor string . *
matches 0 + letters (excluding new lines) \?
matches a question mark before the end of the string in JavaScript, use:
var regex = /^.*\?$/ gm; Console.log ('This will not match this text.' Match (regesx)); Console.log ('How Do I Match This Text?' Match (Reggae));
and lieutenant; Script src = "https://getfirebug.com/firebug-lite-debug.js"> gt;
Comments
Post a Comment