Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I scanned a pdf with usuall hyphenation at the end of the lines and need to process the text.

Example:

There are these two young fish swim-
ming along and they happen to meet 
an older fish swimming the other 
way, who nods at them and says "Mor-
ning, boys". 

What I'd like to get by some regex-magic is obvious:

There are these two young fish swimming along and they happen to meet an older fish swimming the other way, who nods at them and says "Morning, boys".

I tried \([a-z]\)-$^\([a-z]\) , but that did not give any result.

share|improve this question
    
Are you on Linux? Will a sed or perl solution do? –  terdon Sep 13 '12 at 10:38
    
@terdon I solved my problem, see below, but yes, I'm on Linux and sed or perl were welcome. –  Keks Dose Sep 13 '12 at 11:08
    
Glad you solved it, please accept your answer, it gives you rep and reduces the unanswered questions :) –  terdon Sep 13 '12 at 13:37
add comment

1 Answer

up vote 3 down vote accepted

I found a solution. The trick is to insert a second line into the search regexp. This is done by typing C-q C-j on the search side. So what I typed was:

\([a-z]\)- C-q C-j \([a-z]\)

without any SPC before the C-q C-j, which resulted the minibuffer looking like this:

\([a-z]\)-
\([a-z]\)
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.