fork download
  1. #!/usr/bin/perl
  2. use warnings;
  3. use feature 'say';
  4.  
  5. $s = "1x2 22x10 1x23 23x23 300x200 300x100 300x400";
  6. my @matches;
  7. while ($s =~ /\b(\d+)x(\d+)\b(?(?{$1 >= $2})(*FAIL))/g) {
  8. push(@matches, $&);
  9. }
  10. say "@matches";
  11.  
Success #stdin #stdout 0.01s 5500KB
stdin
Standard input is empty
stdout
1x2 1x23 300x400