FAQ
Hi,

Any option in golang regexp like the singleline mode in .Net, which can
change the means of "." as any char including the "\n" ?

Thanks

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Jan Mercl at Nov 6, 2014 at 8:37 am

    On Thu, Nov 6, 2014 at 9:31 AM, Bicen Zhu wrote:
    Any option in golang regexp like the singleline mode in .Net, which can
    change the means of "." as any char including the "\n" ?
    Use the s flag defined at http://golang.org/pkg/regexp/syntax/

    """"
    (re) numbered capturing group (submatch)
    (?P<name>re) named & numbered capturing group (submatch)
    (?:re) non-capturing group (submatch)
    (?flags) set flags within current group; non-capturing
    (?flags:re) set flags during re; non-capturing

    Flag syntax is xyz (set) or -xyz (clear) or xy-z (set xy, clear z).
    The flags are:

    i case-insensitive (default false)
    m multi-line mode: ^ and $ match begin/end line in
    addition to begin/end text (default false)
    s let . match \n (default false)
    U ungreedy: swap meaning of x* and x*?, x+ and x+?, etc
    (default false)
    """"

    -j

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedNov 6, '14 at 8:31a
activeNov 6, '14 at 8:37a
posts2
users2
websitegolang.org

2 users in discussion

Bicen Zhu: 1 post Jan Mercl: 1 post

People

Translate

site design / logo © 2022 Grokbase