Reputation: 703
Got something like this
<[email protected]>[email protected]
<[email protected]>[email protected]
I want to select all the text that is between every <> in the whole script and replace it with a definite value. I also want to leave out all the text that is not in between <> unaffected.
Tried using this expression <.*> but then the whole script got selected, including the text that is not between <>
Upvotes: 5
Views: 24651
Reputation: 91385
(?<=<).+?(?=>)
New_value
. matches newline
Explanation:
(?<=<) # positive lookbehind, make sure we have "<" before
.+? # 1 or more any character but newline
(?=>) # positive lookahead, make sure we have ">" after
Screen capture:
Upvotes: 9