It\'s easy when you understand...unfortunately, I don\'t! I will deeply appreciate you if you can guide me to the answer, thanks.
I want to capture a string, using just
Your Regexp would look something like that. The acutal Syntax depends on your programming language / tool.
First you need to match the <td ..>
part. Then you capute everything upto (
. then to be sure match everything in brackets followed by </td>
.
/<td[^>].*>\([^(]*\)(.*)</td>/
You should read the Book: Mastering Regular Expressions by Jeffrey Friedl.
Okay, so remove the HTML first, then do something like this to remove the (...) part:
\s+\(.*?\)
If you know the (...) part is the very last thing in the string (i.e. there's nothing after it), you can use this to check that it's at the end, too:
\s+\(.*?\)$
Just use a Regex find and replace function, find the expression above, and replace with nothing.