I would have to agree with
quidity on this. First, you would need to teach someone what a regex is. Then,
how they would represent it with your defined subset of English, then what the final product means. Seems
like an uneeded step. Basically, it is like having to learn OmniRegex, in order to learn Regex.. when noone else uses OmniRegex. :)
I learned the mastery of regex's by reading MRE, and literally sitting around figuring out how to get/match pieces of
strings. I would propose this as a better tool to teach REs...
Give a string(s), then give problems, such as:
* Use a RE to find how many occurences of 'X' are in the string
* Use s!!! to substitute the first occurence of 'X' with 'Y'
* Use s!!! to substitue the second occurence (only) of 'X' with 'Y'
* Use an RE to see if the string 'X' can be matched in 'Y', disregarding quotes..
* etc...
Basically, that's what I did (as well as reading MJD's article on how the RE engine works,
and other topical articles). And, I think that it worked quite well.. I haven't struggled with REs
ever since.
I would be happy to help anyone come up with such exercises. Just ask if anyone wants to do it.
Cheers,
KM
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.