You guys missed the point, I think. First,
Regexp::Common is just a module that provides common regexes instantly. Second, MRE does not contain a regex for matching email addresses from examples -- it builds the regex in pieces, so that it's easier to follow.
What Kyle wants is something I've wanted and realized is nigh impossible to create without HEAVY input from the user. Finding patterns is easy for humans, when we know what pattern we want. Telling computers to figure out a pattern is not so easy. The goal here is, given a set of input, determine the best pattern for matching the content. Phone numbers of the form 555-5555 are easy to generate a pattern for, if you know ahead of time that you're dealing with phone numbers!. And as soon as you get a 1-800 number, you're screwed.
The concept is good, and Kyle makes a good attempt, but the problem is very hard. I've not attempted a solution yet, and you can be sure that I would have had I had a good idea of how to approach this problem.
_____________________________________________________
Jeff[japhy]Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??;
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.