#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2017
    Posts
    2
    Rep Power
    0

    Question Replace ' with " in text files


    I have 100's of lines of code such as these...

    language("A","BUYER","WQUERYON",padr('Query On ',langwidth),"R",STA_DISPLANG) +" "+;
    {|| language("A","BUYER","WPREMKICK",padr('Premium Kicker',langwidth),"R",STA_DISPLANG) } ;
    language("A","BUYER","WSURCHARGE",padr('Surch/Disc.',langwidth),"R",STA_DISPLANG) ;

    I need to replace all the single quotes in:

    padr('Query On ',

    with double quotes.

    I don't want to change any other single quotes in the code except those occurring within the padr()

    the length of the text between the two quotes is variable.

    I'm using Multi-edit as my editor, so this is a one time search and replace. it has regex built-in..

    I can use regular, UNIX or perl regex expressions.

    please help before all my hair turns gray..
  2. #2
  3. Lazy Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    16,383
    Rep Power
    9645
    Sounds like just
    Code:
    paddr\('(.*?)\',
    to
    Code:
    paddr("$1",
    (or \1)
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2017
    Posts
    2
    Rep Power
    0
    Originally Posted by requinix
    Sounds like just
    Code:
    paddr\('(.*?)\',
    to
    Code:
    paddr("$1",
    (or \1)
    Thank you so much.. worked great...

    Much better than what i struiggled to come up with:

    (padr\()(\')(\S*\s*\S*\s*\S*)(\')

IMN logo majestic logo threadwatch logo seochat tools logo