Search code examples
regexnotepad++

How to remove characters only near letters or numbers


I want to remove the characters < only at the letters and numbers, if there are no numbers or letters keep < symbol.

/<  
<apple
<organes
<\

Transform to

    /<  
    apple
    organes
    <\

Solution

  • Find this:

    <(?=[a-zA-Z0-9])(.*)

    then replace with $1 (this is 'space' followed by '$1').