I have a long list of something like:
AllowedUsers [email protected] [email protected] [email protected] [email protected] .....
all in single line. Basically it's bunch of username@ip
I wanted to do a find and replace just by using its username (e.g. aaa) and replace it with nothing.
I tested my regex (RegExr) and it works as I expected. But when I try to do it on sed, it didn't work.
$ sed 's/bbbb11.*?(?= )//' test
AllowedUsers [email protected] [email protected] [email protected] [email protected] .....
I also tried using bbbb11.*?(?=[[:space:]]), it didn't work either.
Did I miss something?