in reply to Re: Perl treats period as space in string
in thread Perl treats period as space in string

Thanks!
  • Comment on Re^2: Perl treats period as space in string

Replies are listed 'Best First'.
Re^3: Perl treats period as space in string
by ikegami (Patriarch) on Jul 22, 2021 at 04:03 UTC

    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