View Single Post
Old 09-16-2010, 06:28 PM   #5
Perkin
Guru
Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.Perkin calls his or her ebook reader Vera.
 
Perkin's Avatar
 
Posts: 639
Karma: 64171
Join Date: Sep 2010
Location: Kent, England, Sol 3, ZZ9 plural Z Alpha
Device: Sony PRS-300, Kobo Aura HD
\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.
Perkin is offline   Reply With Quote