I’m trying to decipher this regexp formal definition of floating point numbers (from php.net)
LNUM [0-9]+
DNUM ([0-9]*[\.]{LNUM}) | ({LNUM}[\.][0-9]*)
EXPONENT_DNUM [+-]?(({LNUM} | {DNUM}) [eE][+-]? {LNUM})
LNUM means one or more occurrences of the digits 0 to 9.
DNUM means zero or more occurrences of the digits 0 to 9, followed by a decimal point. I don’t know how to interpret {LNUM}. From what I’ve read, the braces mean repetition, but then wouldn’t
[\.]{LNUM}
mean LNUM occurrences of the decimal point (which wouldn’t make sense). And then in the second part of the alternation (after the | character), {LNUM} occurs at the beginning, and I don’t find a definition for that usage of braces in regexp syntax (POSIX or Perl). Can someone clear this up for me?
Thank you,
Bill
This is not strict regular expressions syntax.
{LNUM}is a placeholder for the definition of LNUM. For example, the second line in strict regexp syntax is