s/(.)(?!=!=)/>=!=/g; # and close brackets that aren't adjacent to "<" @tokens = split( /=!=/ );