![]() |
|
The stupid question is the question not asked | |
PerlMonks |
Two-dimensional match/regex? (2)by rsFalse (Chaplain) |
on Nov 28, 2014 at 22:23 UTC ( #1108671=perlquestion: print w/replies, xml ) | Need Help?? |
rsFalse has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I tried to make a primitive subroutine, which could match some two-dimensional set of characters. And my questions are: 1) have you used two-dimensional search and where? 2) what are good approaches of making match more affective and more fast? I've find similar, but old node Two-dimensional match/regex?, almost all links there are non-working. Below is my try. My example search is: And subroutine searches all occurrences of such combination of these 4 chars. In usual one-dimension search matches can not overlap if we use /g modifier and do not change pos(), but here I'm changing pos() and matches can overlap. http://ideone.com/O1j7vp I think that speed complexity of this search is slow, maybe O(size_of_data * size_of_search_pattern).
Back to
Seekers of Perl Wisdom
|
|