So, you want to compare :) and :-) , but they should not be preceded by 0 or should it follow yet ) ? Then this is the template:
(?<!0):-?\)(?!\))
Mainly
(?<!0) : negative lookbehind; must not be preceded by 0 :-?\) : smiley with optional nose (?!\)) : negative lookforward; must not be followed by )
Example:
$ echo ':) :-) ok 0:) :)) :-)) 0:-)) 0:-) : )' | \ > perl -lne'print $1 while /(?<!0)(:-?\))(?!\))/g' :) :-)
polygenelubricants
source share