FAQ
I have written a modest introduction to the regexp-package.

It is written in Markdown on Github; creation of a HTML- or PDF-version
would be easy.

I am looking for feedback, esp. from beginners (that try to use the
regexp-package) and
from experts (who can point out mistakes or propose improvements).

I might be willing to go through all the steps necessary to contribute it
to the official project,
depending on the feedback.

https://github.com/StefanSchroeder/Golang-Regex-Tutorial

Thank you.
Stefan Schroeder


--

Search Discussions

  • Kevin Gillette at Oct 29, 2012 at 8:29 am
    I'd suggest that everywhere you use the phrase "error code", you instead
    use "error value", since "code" historically suggests that the error is
    represented as an integer, which is almost never the case in Go.
    --
  • Ondekoza at Oct 29, 2012 at 4:57 pm
    Thank you for the suggestion. I will apply that change.
    On Monday, October 29, 2012 4:29:36 AM UTC-4, Kevin Gillette wrote:

    I'd suggest that everywhere you use the phrase "error code", you instead
    use "error value", since "code" historically suggests that the error is
    represented as an integer, which is almost never the case in Go.
    --
  • Martin Wright at Oct 29, 2012 at 3:18 pm
    the third example doesn't compile

    .\r3.go:8: syntax error: unexpected package
    .\r3.go:16: syntax error: unexpected )
    .\r3.go:43: syntax error: nested func not allowed
    .\r3.go:51: syntax error: unexpected }
    .\r3.go:57: non-declaration statement outside function body
    .\r3.go:58: non-declaration statement outside function body
    .\r3.go:59: non-declaration statement outside function body
    .\r3.go:60: non-declaration statement outside function body
    .\r3.go:61: syntax error: unexpected )
    .\r3.go:87: main redeclared in this block
    previous declaration at .\r3.go:6
    .\r3.go:87: too many errors

    On Sunday, 28 October 2012 03:24:34 UTC, Ondekoza wrote:

    I have written a modest introduction to the regexp-package.

    It is written in Markdown on Github; creation of a HTML- or PDF-version
    would be easy.

    I am looking for feedback, esp. from beginners (that try to use the
    regexp-package) and
    from experts (who can point out mistakes or propose improvements).

    I might be willing to go through all the steps necessary to contribute it
    to the official project,
    depending on the feedback.

    https://github.com/StefanSchroeder/Golang-Regex-Tutorial

    Thank you.
    Stefan Schroeder

    --
  • Ondekoza at Oct 29, 2012 at 4:56 pm
    You tried to compile the two self-sufficient programs in chapter 3 in one
    go-file.
    Thus, you have two main packages. That is not supposed to work. To try the
    two programs in chapter 3 copy&paste them individually into separate files.


    On Monday, October 29, 2012 7:36:08 AM UTC-4, martin...@gmail.com wrote:

    the third example doesn't compile

    .\r3.go:8: syntax error: unexpected package
    .\r3.go:16: syntax error: unexpected )
    .\r3.go:43: syntax error: nested func not allowed
    .\r3.go:51: syntax error: unexpected }
    .\r3.go:57: non-declaration statement outside function body
    .\r3.go:58: non-declaration statement outside function body
    .\r3.go:59: non-declaration statement outside function body
    .\r3.go:60: non-declaration statement outside function body
    .\r3.go:61: syntax error: unexpected )
    .\r3.go:87: main redeclared in this block
    previous declaration at .\r3.go:6
    .\r3.go:87: too many errors

    On Sunday, 28 October 2012 03:24:34 UTC, Ondekoza wrote:

    I have written a modest introduction to the regexp-package.

    It is written in Markdown on Github; creation of a HTML- or PDF-version
    would be easy.

    I am looking for feedback, esp. from beginners (that try to use the
    regexp-package) and
    from experts (who can point out mistakes or propose improvements).

    I might be willing to go through all the steps necessary to contribute it
    to the official project,
    depending on the feedback.

    https://github.com/StefanSchroeder/Golang-Regex-Tutorial

    Thank you.
    Stefan Schroeder

    --
  • Thomas Kappler at Oct 30, 2012 at 6:46 am

    On Sunday, October 28, 2012 4:24:34 AM UTC+1, Ondekoza wrote:

    I have written a modest introduction to the regexp-package.

    I just went through it quickly, and I like it. You put a lot effort into it.

    I'd change ignoring the error from regexp.Compile. We shouldn't encourage
    people to ignore error return values, ever. The regexp package already has
    the convenience regexp.MustCompile function if your regexps need to be
    correct.

    I like the idea of chapter 4 that addresses the limitations of regexps.
    Maybe you could add a section that gives some pointers to the more general
    problems with regexps: performance, maintenance, being limited to regular
    grammars (no or very expensive lookbehind and lookahead). Lexers can be a
    good alternative. Rob Pike wrote [1] and talked [2] about that.

    [1]
    http://commandcenter.blogspot.ch/2011/08/regular-expressions-in-lexing-and.html
    [2] www.youtube.com/watch?v=HxaD_trXwRE





    It is written in Markdown on Github; creation of a HTML- or PDF-version
    would be easy.

    I am looking for feedback, esp. from beginners (that try to use the
    regexp-package) and
    from experts (who can point out mistakes or propose improvements).

    I might be willing to go through all the steps necessary to contribute it
    to the official project,
    depending on the feedback.

    https://github.com/StefanSchroeder/Golang-Regex-Tutorial

    Thank you.
    Stefan Schroeder

    --

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedOct 28, '12 at 3:24a
activeOct 30, '12 at 6:46a
posts6
users4
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase