Replacing Duped Words across a block block of text, respecting {}

  • Since i finished my files, I just took the main original version and first ran it though the validator, 1876 errors, after running the script over it and validator. It got every single one. Only one Minor minor issue that doesn’t really have to be fixed, is it strips the last two closing } brackets at the very end of the file, that takes all of 5 seconds to re-add, i consider this a completed script. I very much appreciate the help for the last 24 hours, it probably saved me double if not more.

  • @guy038 For some reason this script has stopped working for me… its now just wiping the entire file.

    Find what : (?si)(?:^|\h+)("?)[’.,]?(\w[\w ‘.-]\w)[’.,]?\1(?=(?:\h+|\R)(?:[^{}](?:\h+|\R))?("?)[’.,]?\2[’.,]?\3(?:\h|\R))
    replacing with nothing

    wrap around
    regular expression

    and its blanking the file… (replace all: 1 occurrence was replaced)

    nvm ?..? seems a extra space worked into the code…

  • Hi, Marc and All,

    IMHO, I supposed that your current file contains too much data ! I, very often, verified that complicated regexes totally fail when applied to huge amounts of text with the result that, only, one wrong match of all the file contents, occurs :-((

    May be, try to slice your file in smaller parts ! It could help ?!

    Generally, this problem often occurs when using recursion feature in regexes. But, it’s quite difficult to fully understand the limitations of the Boost regex engine, used in N++ !



Log in to reply