Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^2: Regex: finding all possible substringsby sauoq (Abbot) |
on Jun 01, 2012 at 00:01 UTC ( [id://973643]=note: print w/replies, xml ) | Need Help?? |
and see if it matches some permutation Of course, we're all kind of guessing here because that isn't exactly a well-written spec... but I think assuming he wants all permutations is a bit of a leap. I think it may also be a leap to assume he only wants to search for strings of a certain length. He just says that they are "user defined." I still think this is the right approach though, he just has to track the lengths of his needles and be sure to check substrings of each necessary length (so long as it doesn't go off the end of his haystack.) Something like this:
Update:
-sauoq "My two cents aren't worth a dime.";
In Section
Seekers of Perl Wisdom
|
|