On Sunday 16 December 2007 11:21, namotco wrote: > > Let's say I want to search some text for "abc123". However, we know > people can make typos and so they could have entered avc123 or abc223 > or sbc123 or bc123 many other combinations... > So I want to search for those possibilities as well. So how would I > go about creating the proper regex?
Regular expressions are about matching patterns so you have to define what kind of pattern you are searching for. >From your example you may want something like: / \b (?: .?bc | a.?c | ab.? ) (?: .23 | 1.3 | 12. ) \b /x However much depends on the actual data and the variations that you are expecting. If you are searching for words like those used in the English language then you may want to look at how spell checking software works. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/