I have a string variable which contains
"A regular expression is an object that describes a pattern of characters.
<strong>Regular expressions are used to perform pattern-matching.</strong> and "search-and-replace" functions on text.
I have to extract
"<strong>Regular expressions are used to perform pattern-matching</strong>"
For this i am using
^<strong>([A-Za-z0-9-\s]+)</strong>$
regular expression.
But it is not working.
Any idea why?
try this
or this
Your expression does not work because of the following:
<strong>and nothing is after</strong>. In your case you have text after</strong>