View Single Post
Old 03-03-2010, 12:21 PM   #1
zelda_pinwheel
zeldinha zippy zeldissima
zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.zelda_pinwheel ought to be getting tired of karma fortunes by now.
 
zelda_pinwheel's Avatar
 
Posts: 27,827
Karma: 921169
Join Date: Dec 2007
Location: Paris, France
Device: eb1150 & is that a nook in her pocket, or she just happy to see you?
More fun with regex / wildcards

I'm trying to automate a find and replace routine to change chapter numbers from paragraphs to headings. in other words, currently, they look like this : <p>1</p> and i want them to look like this : <h3>1</h3>

i first tried to do this with wildcards and i have no troubles finding the numbers, but unfortunately if i put <h3>?</h3> in the "replace" box, it replaces the number with "?". not helpful.

so now i'm trying regex search. i looked on the regex page here to find the code : http://doc.trolltech.com/4.6/qregexp.html#introduction

i should say, i know nothing about regex, but i'm trying to learn a bit.

this expression <p>[0-9]{1,3}</p> finds what i want, but when i replace, i have the same problem as with the wildcards...

can someone tell me, what is the regex (or wildcard !) code for "don't touch the stuff in the middle, change only the tags" ??? there must be a way to do this !
zelda_pinwheel is offline   Reply With Quote