in reply to Perl treats period as space in string

if ($string =~ m/\Q$phrase\E/i){

Replies are listed 'Best First'.
Re^2: Perl treats period as space in string
by htmanning (Friar) on Jul 20, 2021 at 20:29 UTC
    Thanks!

      Note that this also matches fooclub.market. Not sure if that's what you want. If you want to perform an exact case-insensitive comparison, use

      if ($string =~ /^\Q$phrase\E\z/i)
      or
      use feature qw( fc ); if (fc($string) eq fc($phrase))

      The second is probably faster.

      Seeking work! You can reach me at ikegami@adaelis.com