You have a multidimensional array where the elements’ keys/values are each on their own line.

0

You want to remove all elements that have the same key. In this case let’s lose the 'Key2' elements. In the Find and Replace dialogue box check “Use regular expression” and type \s'Key2'.*\n

1

That’s it. Replace all.

Explained:

  • \s is the character class of White Space (spaces and/or tab characters)
  • 'Key2' is the Key and the double or single quote marks that wrap it
  • .* is for any number of characters (the dot for any character, the asterisk for any number of)
  • \n is for the line break

Done:

2

Then you might want to tidy up – but that’s easy too…

3

Now it’s all tidy again.

4

 

Last updated on 5th September 2018