Regex Match with javascript


I’m trying to do a javascript match for links that start with any number and end with the word Contents. Currently, I’m using:


which would then pull off “>0. Table of Contents” from:

<a class="sf-with-ul" href="/books/Partsch_1/Table_of_Contents/table_of_contents.php">0. Table of Contents

Truth be told, I just want “0. Table of Contents” as opposed to the opening “>”. While I know that I can just use the substr() method, I’d much rather improve my somewhat non-existent regex skills. My attempt was to use


which unfortunately pulled off

1/Table_of_Contents/table_of_contents.php">0. Table of Contents

Is there a cleaner regex solution?

Thank you,


Try with this regexp, which gets the text between ‘>’ and ‘<’:


Makes sense!

Thank you for the quick reply.