in reply to a regex which can detect if a string have all of some characters
Update: Well, I guess I was wrong, and it can be done in a single regex. Now I'm going to have to start thinking about how else I can use lookaheads.sub has_all { my $text = shift; for my $c ('a', 'r', 'z', 'x') { return 0 unless $text =~ m/$c/; } 1; }
|
|---|