We can even shorten this with character class []
use strict; use warnings; use Data::Dumper; while(<DATA>) { print "$1\n" if($_ =~ /([><=!]+)/g) } __DATA__ $this vinoth $that $this >= $that $this gt $that $this != $that $this ne $that $this == $that $this eq $that
In reply to Re^2: How to extract special charachetrs like <=, >= != from string
by vinoth.ree
in thread How to extract special charachetrs like <=, >= != from string
by gjoshi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |