Menu

(Newbie) Find and Replace question

Wondering
2009-08-05
2012-11-14
  • Wondering

    Wondering - 2009-08-05

    There are many lines in the .xml file I am editing that are like this:

    <FLAGS>lmhbyv</FLAGS>

    What I am trying to do is remove the y's if and only if it is between <FLAGS> and </FLAGS>

    So it would look like this: <FLAGS>lmhbv</FLAGS>
    but no y would be removed if it was not between <FLAGS> and </FLAGS>

    Thank you! :)

     
    • cchris

      cchris - 2009-08-06

      I assume each matching <FKAGS> /  </FLAGS> tag pair is on a single physical line.

      Then:
      Search for: <FKAGS>([^y]*)y(.*)</FLAGS>
      Replace with: <FLAGS>\1\2</FLAGS>
      Mode: Regular xpressions
      Replace All

      Do thisseveral times  till it fails. Each pass removes the first y between matching tags.

      HTH
      CChris