in reply to Non White space function

It would be unusual to find strings which did match that regex since it's a schema part of a URL and then a bunch of uppercase letter Ss with a space in between and a space at the end. But you haven't shown your input, so who knows what you are really trying to achieve? I could guess that you meant to put a backslash before the S and maybe not have those spaces in there but instead here's an SSCCE which you can tailor to your needs should you need to refine your question.

use strict; use warnings; use Test::More; my @good = ( 'http:// S ', 'We will all go to http:// SSSSSSSS ', ); my @bad = ( 'foo', 'http:// foo ', 'https:// SSS ', 'http:// SSS', 'http://SSS ', 'HTTP:// SSS ', 'http:// SSS ', "http://\tSSS ", "http:// SSS\t", ); my $re = qr{http:// (S+) }; plan tests => @good + @bad; for my $str (@good) { like ($str, $re, "$str matched"); } for my $str (@bad) { unlike ($str, $re, "$str not matched"); }

Replies are listed 'Best First'.
Re^2: Non White space function
by AnomalousMonk (Archbishop) on Jul 18, 2020 at 15:25 UTC