"Stephen J. Turnbull" <[email protected]> writes:

> Jason Dagit writes:
>> Similarly, (\.[0-9]+|)$ is odd to me.
>
> That's an optional fractional part at the end of the line.  The
> alternative is empty.  Somebody pretty ancient probably wrote that;
> it's an idiom from POSIX "basic regular expressions" where the '?'
> operator didn't exist.

Modern POSIX BREs have ? -- it's just escaped.  The ERE

    (\.[[:digit:]]+)?

is equivalent to the BRE

    \(\.[[:digit:]]\+\)\?

> Nowadays people would usually write that "(\.[0-9]+)?$", I think.

It could well have come about because I was tired and using Emacs'
regexp-opt instead of using my brain.

_______________________________________________
darcs-users mailing list
[email protected]
http://lists.osuosl.org/mailman/listinfo/darcs-users

Reply via email to