\d means a digit
[0-9] means any character 0,1,2,3,4,5,6,7,8,9
the + means match as many as possible
the brackets mean store this as a set
as this was surrounded by the<p> and </p> then we mean only line that start <p>
have only digits (no other characters/symbols etc.) and then finishes with </p>
We replace the whole section (including the <p> and </p>) with the <h3>Chapter
and then stored set (as you said), then finishes it of closing the <h3>.
It's worth reading up and trying to understand, as regex's make some thing a lot easier, (such as what you wanted) but as powerful as they can be, they can cause undesired results unless you know what your doing, so when starting to use regex's save often and if needed, quit out and re-load.