View Single Post
Old 02-20-2012, 08:34 AM   #1
flameproof
Member
flameproof began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Dec 2011
Device: Sony PRS-T1
Regex - replace only part of a string - how?

I have often problems with books that were auto-converted by Calibre. Here is one issue:

Text has often wrong line breaks.

Example:

Code:
  <p class="calibre2">This is just a sample</p>

  <p class="calibre2">text with no meaning.</p>
I can find it with the string:

Code:
 [a-z]</p>

  <p class="calibre2">
But when I replace it then (of course) the last letter is missing. Without the [a-z] I would catch normal end of sentence line breaks.

Is there a way?


DOH! I found it!


Search string: (\w+)</p>

<p class="calibre2">

Replace with: \1

Last edited by flameproof; 02-20-2012 at 08:45 AM.
flameproof is offline   Reply With Quote