Search code examples
notepad++

How do I turn all words uppercase and in square brackets in Notepad++


I know it sounds weird but I have a list of names (excluding surnames) and I need them all uppercase within square brackets. For example from Michael to [MICHAEL] for all words in all lines in the entire document.

What code can I use to replace all in Regular expression Search Mode?


Solution

  • Search for whole words:

    ([A-Za-z0-9-]+)
    

    Replace them with this to add brackets and convert all letters to upper case:

    [\U\1]