Dramatically, sir?<br>
Dramatically! Hee! Ha!<br>
What would the regex be to capture the words everything before <br>?
Dramatically, sir?<br>
Dramatically! Hee! Ha!<br>
Regular expression to capture the words everything before <br>: ([\S\s]*?)(?=<br>)
Explaination: ([\S\s]*?) Matches everything and captures it.
* indicates 0 or more occurences.
? indicates what ever mentioned before.Greedly
(?=<br>) confirms that <br> is followed
Output matched as per your requirement thank you
Get Answers For Free
Most questions answered within 1 hours.