You mean, like:my $string = "abba";And you're looking for "bb" given a regex "[.bb|bb.]" ?
Square-brackets '[...]' in regex's generally denote a character class and not a pattern - parentheses are used to denote alternate patterns - e.g.: /(.bb|bb.)/ - which can be simplified to just /bb/ in this case.However, I'm still not sure I understand the original question - perhaps a more verbose example might help elicit responses...
foo.htmbar.docbaz.pdfindex.htm.bashrcoutput_text...et cetera...
index.htm
if()
if( $my_deployed_files =~ m{index\.html?}g && $my_deployed_files !~ m{every other file NOT including index.html?}g ) { # do something...} # end if
Given a set of files...foo.htmbar.docbaz.pdfindex.htm.bashrcoutput_text...et cetera......we want to make certain that index.htm and only index.htm has been submitted in a workflow. The proposed solution to this is to determine the intersection of the set containing all files within the domain of discourse (potentially an open set, if I'm not mistaken) and the set containing only index.htm via an if() block, such as...if( $my_deployed_files =~ m{index\.html?}g && $my_deployed_files !~ m{every other file NOT including index.html?}g ) { # do something...} # end if
...if (@list == 1 && $list[0] =~ /index\.html$/){ # do something ...}...