Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
The stupid question is the question not asked
 
PerlMonks  

Re: Regex Update: Chapters 1-3 rough draft

by TheoPetersen (Priest)
on May 10, 2001 at 19:07 UTC ( [id://79526]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Regex Update: Chapters 1-3 rough draft

The preface will explain how much Perl the reader is expected to know, right?. Given the topic, I suggest that you assume they haven't worked with Perl regular expressions at all, in which case you should explain the s and m operators before you use them.

You don't have to spend a lot of time at it, but when I see "Learning..." in the title of a book, I expect the basics of the subject matter to be covered early, and re-emphasized in new sections (or new contexts). In chapter 2 you could say,

Perl's m operator is used to match patterns in a string, such as
m/Hello, world!/
The / marks delimit the pattern; any of Perl's quoting or bracketting characters can be used as well, though the / is the most traditional, and in fact the m operator can be left out if you use them.

Replies are listed 'Best First'.
Re: Re: Regex Update: Chapters 1-3 rough draft
by japhy (Canon) on May 10, 2001 at 19:22 UTC
    Well, right now, I have:
    When learning a programming language, usually the first example you are taught is how to print the statement "Hello, world!" to the screen. Regexes are a language unto themselves, so it's only fitting you see how to match a string containing the phrase, "Hello, world!":
    m/Hello, world!/
    That was simple enough. But it requires some explaining; the / characters are the default regex delimiters. The m preceeding them is optional if you are using / as the delimiter. For now, we'll leave it in, but you should get used to seeing regexes without that leading m.
    I'll work in some variant of what you've said. The preface is going to be like most prefaces, with some introductory text, followed by what you're expected to know, and "conventions used in this book".

    japhy -- Perl and Regex Hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://79526]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.