Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 01-10-2011, 08:37 PM   #1
iblesq
Junior Member
iblesq began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Jan 2011
Device: none
RegEx find and replace

Task: find all strings (in html view), containing "XXX</p>", where XXX - any character, partial string, etc, but not ".</p>"; add an extra line break after </p> (but not after .</p>).

I need to use RegEx in "find and replace" dialog. I found the proper RegEx for searching - ([^\.](</p>)), but i cannot just add after the string I found a new string - <br/>, in the dialog, i.e. it just replace THE WHOLE string with what is written in "replace" field. in other words, the "replace with " field doesn't support RegEx.

Any ideas how just add something new (new string) using "find and replace" and RegEx?

Thanks.
iblesq is offline   Reply With Quote
Old 01-10-2011, 09:26 PM   #2
theducks
Grand Sorcerer
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 14,651
Karma: 5629001
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by iblesq View Post
Task: find all strings (in html view), containing "XXX</p>", where XXX - any character, partial string, etc, but not ".</p>"; add an extra line break after </p> (but not after .</p>).

I need to use RegEx in "find and replace" dialog. I found the proper RegEx for searching - ([^\.](</p>)), but i cannot just add after the string I found a new string - <br/>, in the dialog, i.e. it just replace THE WHOLE string with what is written in "replace" field. in other words, the "replace with " field doesn't support RegEx.

Any ideas how just add something new (new string) using "find and replace" and RegEx?

Thanks.
This should work.. Not tested

Minimal Match, (do not match case)

Find: ([a-z"]</p>)
Replace: \1<br />

I included a straight quote for phrases that end that way. remove if not wanted.
match a thru z or quote and a close p tag
replace with what we found and a <br />
theducks is offline   Reply With Quote
Reply

Tags
find and replace, regex, sigil

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need regex help search and replace schuster Calibre 4 01-10-2011 09:00 AM
Find and Replace the symbol ¬ oldbwl Workshop 5 12-30-2010 07:52 AM
Find / replace bremler Sigil 6 12-17-2010 03:26 PM
REGEX find and replace help please potestus Sigil 13 09-18-2010 04:14 PM
Using Find/Replace with BD Otter Sony Reader 7 02-28-2009 01:49 PM


All times are GMT -4. The time now is 12:30 AM.


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