in reply to Perl regex question
For example, is it possible to search with one regex statement and get the matched word?Yes. But I've no idea how why that fact is useful to you. Considering you need to know from every word whether it matches or not, it doesn't help you to know just one of them is matching.
Theoretically, you could do something like
but that will usually not be faster than/(word1|word2|word3|...){?{ push @matches, $^N })(*FAIL)/
/word1/ && ...; /word2/ && ...; /word3/ && ...;
|
|---|