Thread: regex question
View Single Post
Old 11-21-2014, 05:46 AM   #1
DrChiper
Bookish
DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.DrChiper ought to be getting tired of karma fortunes by now.
 
DrChiper's Avatar
 
Posts: 1,018
Karma: 2003162
Join Date: Jun 2011
Device: PC, t1, t2, t3, Clara BW, Clara HD, Libra 2, Libra Color, Nxtpaper 11
regex question

The new regex-function works great, the section numbering was just something what I needed. However, I stumbled onto some expressions which were not handled properly:
Code:
<h1 class="center"><a href="chapter001.xhtml#start">Test</a></h1>
<h1 class="center" id="" ><span class="something">Test</span></h1>
<h1 class="center" id="" ><b><span class="something">Test</span></b></h1>
The default find construct is not enough:
Code:
(<h1[^<>]*>)([^<>]+</h1>)
I tried to enhance it but either got no match at all, or, very greedy, it selected almost everything

Can somebody teach me how to select "just enough"?
DrChiper is offline   Reply With Quote