I want a match
my @array = ( 'Tree' , 'JoeTree'); foreach (@array ) { if ( $_ =~ /^(Joe)Tree/gi) { print "matched $_"; } }
This only matches JoeTree. Does this not match the tree?
Try:
if (/^(?:Joe)?Tree/gi)
Joe
(..)
(?:...)
$_ =~
$_
You missed ?:/^(Joe)?Tree/gi
?
/^(Joe)?Tree/gi
Source: https://habr.com/ru/post/1765796/More articles:Mercurial: concrete examples of problems using hg pull --rebase - rebaseVS2010 Winforms Usercontrol changes are not displayed in the parent form - visual-studio-2010Escaping command parameters passed to xp_cmdshell in dtexec - sqlExtract text from PDF: PDFLib vs PDF extract vs pdf2xml - javaHow to use a column alias in an Informix database table - informixBlack screen before my screensaver screen loads iphone - iphoneamazon s3 + paperclip - AWS :: S3 :: NoSuchBucket - amazon-s3Просмотр совместимости с Internet Explorer нарушает мой дизайн сайта - internet-explorer.htaccess to prevent folder browsing - apacheSQL: select one record for each day closest to a specific time - sqlAll Articles