0

I try to find all in one golang regexp rules/specification/accepted syntax. However as it turned out - it's not simple task. There is some resource I've found:

There first one it is almost what I need, but there is so many complicated moments where I just doesn't understand what's going on (no legenda and no explanations - only for those who already know something). See some examples below:

\d  Perl character class #what does it have with Perl?
[[:name:]]  named ASCII class inside character class (≡ [:name:])

Could anybody help me?

Timur Fayzrakhmanov
  • 13,720
  • 17
  • 54
  • 78

1 Answers1

2

The official documentation is http://golang.org/pkg/regexp/syntax/

Perl in particular is a programming language. From the Wikipedia entry on Perl:

Perl 5 gained widespread popularity in the late 1990s as a CGI scripting language, in part due to its unsurpassed regular expression and string parsing abilities.

Logiraptor
  • 1,458
  • 10
  • 14
  • Good! Big thanks you! Answer was very close)) could you tell me why everywhere there is Perl word. How Perl is related to regexp? – Timur Fayzrakhmanov Feb 14 '15 at 17:07
  • 1
    @TimurFayzrakhmanov "Perl Compatible Regular Expressions (PCRE) is a regular expression C library inspired by the regular expression capabilities in the Perl programming language, written by Philip Hazel, starting in summer 1997.[1] PCRE's syntax is much more powerful and flexible than either of the POSIX regular expression flavors and many classic regular expression libraries. The name is misleading, because PCRE and Perl each have capabilities not shared by the other." From http://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions – Intermernet Feb 15 '15 at 06:02
  • Great!) Very good answer, thank you) – Timur Fayzrakhmanov Feb 15 '15 at 08:16
  • Of note, Go does NOT use PCRE. They prefer to promise better performance in exchange for no backtracking. You can use PCRE packages, but not from the standard library. – Palu Macil Nov 01 '16 at 12:35