Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Training non-programmers in Perl regexps

by Zaxo (Archbishop)
on Jul 09, 2005 at 02:48 UTC ( [id://473635]=note: print w/replies, xml ) Need Help??


in reply to Training non-programmers in Perl regexps

For that kind of student, I like to introduce them in three stages, leaving out fancy stuff like extended constructs.

  1. literal matches, easy for everyone
  2. builtin character classes and escaped characters, give them a little power
  3. user character classes and anchors, separate the sheep from the goats

The omission of alternation is intentional. Unsophisticated users overuse them and can easily land themselves in a computational tarpit.

The postgraduate course is to point out some of the other things possible and refer to perlretut and perlre.

The key is to show them new things that are useful to them right away. Don't demand big conceptual leaps without motivation, and allow them to practice before demanding another.

An editor which does incremental regex searches with highlighting is valuable for illustrating how regexen work, live. Emacs incremental search is documented in info emacs Incremental Search. Vim documents its version in the "pattern.txt" manual chapter.

After Compline,
Zaxo

Replies are listed 'Best First'.
Re^2: Training non-programmers in Perl regexps
by etm117 (Pilgrim) on Jul 09, 2005 at 11:57 UTC
    Speaking towards an editor that does incremental regex searching with highlighting...
    Eclipse Perl Intergration
    It is a Perl plugin for Eclipse. I have only used it for the Regexp highlighting that you speak of. When I have a complicated regexp, it is nice to be able to step through it piecemeal with this plugin and see where it works and were it doesn't.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://473635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2024-03-28 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found