http://www.perlmonks.org?node_id=168388

osfameron has asked for the wisdom of the Perl Monks concerning the following question:

I've recently got very interested in Ascii art and animation.

I've stumbled across an interesting problem: how to search for one Ascii picture within another. e.g. does the picture:

MM oo < -/ contain /^\ ? /^\ C : C : 8===8 |^| ||| -~-~
In pseudocode the best algorithm I've found is:

Data

Main sub

submatch sub

This is of course just a search for a 2 dimensional literal string, but it would be as easy to search for a list of regexes. Is there any practical use for that?

Is there already a module for doing this type of match? Or can anyone suggest a better algorithm? (I think that recursing makes sense for this problem, but I'm open to suggestions!)

Cheerio!
Osfameron
http://osfameron.perlmonk.org/chickenman/