my $concat = "good times and fun (times) and bad (times)"; for my $string ('good times', 'bad times', 'fun (times)') { # if the index function returns -1, it is not a substring if (index($concat, $string) == -1) { $concat .= " and $string"; } } print $concat . "\n";
In reply to Re: Escaping parentheses in regexps
by perlguy
in thread Escaping parentheses in regexps
by Tanalis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |