Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-08-2011, 06:18 AM   #1
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
Look ahead & look behind

I've tried to use look ahead & look behind regex's in Sigil Find dialog like:

<p/> <p>(?=[a-z]) or (?<!\.)<p/>

but they did not work for me.
Also expressions like
.*? or \s*? do not seem to work.
Is there a way to make them work?
I would very much appreciate any help wit this.
kamanza is offline   Reply With Quote
Old 11-08-2011, 06:56 AM   #2
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
0.4.x does not support look ahead or look behind. This is a limitation of QRegExp that Sigil uses. 0.5 (no release date yet) changes to using PCRE and supports look ahead and behind expressions.
user_none is offline   Reply With Quote
Advert
Old 11-08-2011, 01:06 PM   #3
kamanza
Zealot
kamanza began at the beginning.
 
Posts: 115
Karma: 10
Join Date: Jan 2011
Device: none
Thanks for the speedy answer, but i was wrong.
I've just manageed to correct all the broken lines with:

</p>

<p>(?=[a-z])

replaced with nothing. Only somehow this doesn't always work. I had to write, then clear, then write the code again a few times until it eventually did the job.
I wander, why is it like that?
kamanza is offline   Reply With Quote
Old 11-10-2011, 02:48 AM   #4
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Yeah, I'm pretty sure I've successfully used lookahead/lookbehind too. But overall I find Sigil's regex quite weird, so looking forward to PCRE.

As far as .*? or \s*? goes, the trick seems to be to never use the question mark, and to check the 'minimal matching' checkbox under the regex options - the makes all */+ act as if there is a question mark.
ldolse is offline   Reply With Quote
Old 11-10-2011, 06:41 AM   #5
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
Quote:
Originally Posted by ldolse View Post
Yeah, I'm pretty sure I've successfully used lookahead/lookbehind too.
My mistake. QRegExp supports lookahead. It's look behind it doesn't support.
user_none is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Road Ahead borisb enTourage Archive 17 04-06-2011 09:48 PM
PRS-950 Infrequent jumps ahead?? petercreasey Sony Reader 4 03-26-2011 05:41 PM
Skipping ahead / Index LucentBeam Amazon Kindle 5 10-28-2010 09:08 PM
Wait or go ahead? julon2000 Which one should I buy? 19 03-13-2009 10:13 PM
went ahead and got a 505 sigma8 Which one should I buy? 0 02-26-2009 11:38 AM


All times are GMT -4. The time now is 11:52 AM.


MobileRead.com is a privately owned, operated and funded community.