String Pattern Matching: regex and Python regex documentation

Discussion in 'Perl Misc' started by Xah Lee, Sep 17, 2006.

  1. Xah Lee

    Xah Lee Guest

    the Python regex documentation is available at:
    http://xahlee.org/perl-python/python_re-write/lib/module-re.html

    Note that, i've just made the terms of use clear.

    Also, can anyone answer what is the precise terms of license of the
    official python documentation? The official python.org doc site is not
    clear.

    Note also, that the regex syntax used by Perl is the same as Python.
    So, this section
    http://xahlee.org/perl-python/python_re-write/lib/re-syntax.html
    which contains clear explanation of regex syntax, will be of interest
    to Perl programers as well.

    If you are studying regex, you might also be interested in this lisp
    doc:
    http://xahlee.org/elisp/Regular-Expressions.html

    Also note, that the regex syntax, is one of unix's $free$ fuckup that
    has damaged a entire computer industry for decades. ($free$ as drugs
    given to children)

    For some examples of corrective steps, see:

    • Scsh manual, Chapter 6: Pattern-matching strings with regular
    expressions
    http://www.scsh.net/docu/html/man-Z-H-7.html

    • Mathematica Book, section 2.8.4 String Patterns
    http://documents.wolfram.com/mathematica/book/section-2.8.4

    Xah

    ∑ http://xahlee.org/
    Xah Lee, Sep 17, 2006
    #1
    1. Advertising

  2. [followup to c.l.py]

    Xah Lee wrote:
    > the Python regex documentation is available at:
    > http://xahlee.org/perl-python/python_re-write/lib/module-re.html
    >
    > Note that, i've just made the terms of use clear.
    >
    > Also, can anyone answer what is the precise terms of license of the
    > official python documentation? The official python.org doc site is not
    > clear.


    I would be interested in this information, too.

    > Note also, that the regex syntax used by Perl is the same as Python.
    > So, this section
    > http://xahlee.org/perl-python/python_re-write/lib/re-syntax.html
    > which contains clear explanation of regex syntax, will be of interest
    > to Perl programers as well.

    ....

    Your tutorial has helped me to write my first regular expression:

    http://dev.lazaridis.com/base/changeset/60

    your notes about documentation are interesting, too:

    http://xahlee.org/perl-python/re-write_notes.html

    I have some notes, too:

    http://case.lazaridis.com/wiki/Docu

    -

    I would like to read more on your website, but the usability is
    terrible, mainly due to the missing navigation.

    What about an exchange?

    I assist you with the navigation. you will just need apache
    server-side-include and one file "navigation.html", which will contail
    all of the navigation, very simple.

    And you make an real life example for a python regular expression use-case:

    i want to scan a text for this line:

    [[CustomAttributes(this=4,that=34,name='peter')]]

    picking "this=4" ...

    and add the attributes to an object.

    object = addCustomAttributes(text)

    (ok, the regex part would be enouth).

    ..

    --
    http://lazaridis.com
    Ilias Lazaridis, Sep 22, 2006
    #2
    1. Advertising

  3. Xah Lee

    Xah Lee Guest

    Xah Lee wrote:
    « the Python regex documentation is available at:
    http://xahlee.org/perl-python/python_re-write/lib/module-re.html ...»

    Jürgen Exner wrote:
    «Yeah, sure, and the Perl regex documentation is available at 'perldoc
    perlre'. So what? Is that anything new or surprising?»

    It is of interest and new, because it is a rewrite of Python's
    documentation. And it is of interest to Perlers, because Perl and
    Python uses the same regex syntax.

    The purpose of this rewrite, is to fix Python's lousy documentation,
    and to demonstrate a style of technical writing, where precision and
    clarity is the prime directive.

    It demonstrates a style of documentation, where the philosophy is
    task-oriented and uses examples sans misgivings. (in this aspect, it
    is similar to the style of Perl's official documentation.)

    Further, the exposition style focuses on the manifestation of the
    language elements, as a piece of mathematics, a style often found in
    functional language's documentations. It is opposed to, treating the
    language as a state machine or compiler engine, which are often
    necessarily the approach of imperative languages's documentations.

    This project was undertaken as a response to a challenge put forth to
    me with a $100 reward, on 2005-04-12 on comp.lang.python newsgroup. I
    never received the due reward.

    Thanks.

    Xah

    ∑ http://xahlee.org/
    Xah Lee, Sep 25, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Xah Lee
    Replies:
    1
    Views:
    931
    Ilias Lazaridis
    Sep 22, 2006
  2. Xah Lee
    Replies:
    8
    Views:
    458
    Ilias Lazaridis
    Sep 26, 2006
  3. Marc Bissonnette

    Pattern matching : not matching problem

    Marc Bissonnette, Jan 8, 2004, in forum: Perl Misc
    Replies:
    9
    Views:
    221
    Marc Bissonnette
    Jan 13, 2004
  4. Bobby Chamness
    Replies:
    2
    Views:
    215
    Xicheng Jia
    May 3, 2007
  5. Replies:
    2
    Views:
    384
Loading...

Share This Page