1

I have many documents consisting of text where words hav become incorrectly hyphenated. Like;

be-come; mons-ter; any-thing etc

I can search for the place where this has happened using;

\l-\l

any lowercase character and any other lowercaser character with a '-' in between.

How do I code the replacement to just remove the '-' character ?

Thanks for reading.

2 Answers2

1

Find what: (\l)-(\l)
Replace with: $1$2

enter image description here

ZygD
  • 2,577
1
  • Ctrl+H
  • Find what: (?<!-)\b(\l+)-(\l+)\b(?!-)
  • Replace with: $1$2
  • CHECK Match case
  • CHECK Wrap around
  • CHECK Regular expression
  • Replace all

Explanation:

(?<!-)      # negative lookbehind, make sure we haven't an hyphen before
\b          # word boundary
(\l+)       # group 1, 1 or more small letters
-           # an hyphen
(\l+)       # group 2, 1 or more small letters
\b          # word boundary
(?!-)       # negative lookahead, make sure we haven't an hyphen after

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Toto
  • 19,304