fork(1) download
  1. #!/usr/bin/perl
  2. use strict;
  3. use warnings;
  4. use feature 'say';
  5.  
  6. my $regex = qr/(?=\p{Lu})(?i:daisy|john|fred|june)/;
  7.  
  8. my $test = 'Later John said blah and JOHN said ignore john .....';
  9.  
  10. while( $test =~ /($regex)/g ) {
  11. say $1;
  12. }
Success #stdin #stdout 0.01s 7972KB
stdin
Standard input is empty
stdout
John
JOHN