Docs probabaly shouldn't specify because the programming environment and language probably won't give you much choice in the matter.
–
FrustratedWithFormsDesignerSep 14 '11 at 15:32

1

@Rook I'm thinking along the same lines as FrustratedWithFormsDesigner. Somewhere, it's specified that a language uses PCRE or some other variant. I know it's in the Java docs, and I'm pretty sure it's in the MSDN docs for C#, and so on. I'm curious as to what tools or languages don't specify it somewhere. Besides, many are similar to each other - knowing one flavor makes it fairly straightforward to read and write another.
–
Thomas Owens♦Sep 14 '11 at 15:35

1

@JW01 Can you reword or update your question, then? Your title question and closing question don't match. One is asking why tools/languages don't document the syntax they use, and in my experiences, they all do. The second is asking what syntax people expect. Exactly what do you want answered here?
–
Thomas Owens♦Sep 14 '11 at 16:14

1

@FrusteratedWithFormsDesigner - I think you hit the nail on the head with that. You should post it as an answer.
–
CraigeSep 14 '11 at 16:29

2

I'm possibly being over-pedantic here, but it's most likely that the documentation should be talking about regexes rather than regular expressions anyway. Most languages use regex flavours which aren't regular, and some of them aren't even context-free. In fact I think the latest revisions of Perl have regexes which are Turing-complete.
–
Peter TaylorOct 14 '12 at 22:18

2 Answers
2

I suspect Documentation does not specify which flavour of regular expression to use, because it's rarely a choice. The choice is usually specified by the language that has been chosen (unless the language implements more than one flavour, in which case it might be valid to specifiy a preference for one of them in the docs, to keep things consistent), or by other constraints of the programming environment.

So, as a php developer (where there's been a choice of pattern for years) I find it weird that the flavour is not specified. But, for most people, there is often no choice within a particular context so its weirder to specify it. Aaaaagh. I geddit now. Cheers for that.
–
JW01Sep 14 '11 at 18:28

@JW01: Maybe it's up to the developer if they want to use ereg or preg (which as far as I can tell is the only way to "switch flavours" in PHP), and simply saying in the document "we will use PHP" restricts the number of flavours to 2 - and after that the developer can choose.
–
FrustratedWithFormsDesignerSep 14 '11 at 18:41

@JW01: "But, for most people, there is often no choice". Stronger than that. Except in very, very weird edge cases, there is no choice. It's not "most". It's "nearly all".
–
S.LottSep 14 '11 at 19:57

Thanks for the reassuring reply. I must have wasted hours trying to discover which syntax and like you say it almost always ends up as PCRE... I think i'll just go with it from now on and save time.
–
JW01Sep 14 '11 at 15:33