fork download
  1. #!/usr/bin/perl
  2. use feature 'say';
  3. use strict;
  4. use warnings;
  5.  
  6. my $str = "vs or Vs or vs. or VS. or etc avs and metch";
  7. say $str =~ s/\b(vs|etc)\b\.?/\L$1./gir;
  8. # => vs. or vs. or vs. or vs. or etc. avs and metch
Success #stdin #stdout 0.01s 5484KB
stdin
Standard input is empty
stdout
vs. or vs. or vs. or vs. or etc. avs and metch