I want a regular expression which catches every time +other
appears as well as everything until the next comma.
With
(word),+(other)(word),(code),(word),(other)(code),(example)
(code),+(other),+(other)(code)(word)(example),(example),+(example)
+(code),(other)(code)(word),(code),(word)
I want to return
+(other)(word)
+(other)
+(other)(code)(word)(example)
My command that I would use looks something like egrep -o '\+\(other).*,
.
The only problem is that the comma in this regex isn't necessarily the next comma. Right now the command returns
+(other)(word),(code),(word),(other)(code),
+(other),+(other)(code)(word)(example),(example),