Replace quote characters between two letters

Chip Jones
2012-11-05
2012-11-13
  • Chip Jones
    Chip Jones
    2012-11-05

    I need a method to replace one single quote character between letters with two single quote characters. For example, I need to replace all instances of l'attribute with l''attribute. This applies to many different letters combinations, but the common element is that the single quote has to be replaced with the two single quotes. I'm sure this is easy with a regular expression, but I'm stumped on the syntax for both find and replace. All help is appreciated.

     
  • Loreia2
    Loreia2
    2012-11-13

    Hi,

    try something like this:

    search for: ([a-zA-Z])'([a-zA-Z])  
    replace with: \1"\2  
    

    BR
    Loreia

     
    Last edit: Loreia2 2012-11-15
  • Chip Jones
    Chip Jones
    2012-11-13

    Yes, it worked perfectly! Thank you.

     
  • Chip Jones
    Chip Jones
    2012-11-13

    Technically, for the two single apostrophes I needed to replace the one single apostrophe, I had to change the replacement to \1''\2, but otherwise your suggestion was dead-on.