--
____________________________________________________________________
/ It now costs more to amuse a child than it once did to educate his \
\ father. /
--------------------------------------------------------------------
\ ,__,
\ (oo)____
(__) )\
>>--|| *
actually the lookahead can be a little simpler here, (?=.*=) does the
trick, or did I miss any particular edge case you had in mind.
Please note that [^=]*= can *always* be expressed as .*??= and often,
that is unless backtracking can occur, as .*?=.
There is an edge case in which neither of our regexen might deliver
the required result, "a.b=c.d=e", but as there is no spec, there is no
solution
Cheers
Robert
···
On Sat, Apr 23, 2011 at 7:38 PM, Roy Zuo <roylzuo@gmail.com> wrote:
actually the lookahead can be a little simpler here, (?=.*=) does the
trick, or did I miss any particular edge case you had in mind.
Sorry I git confused below
Please note that [^=]*= can *always* be expressed as .*??= and often,
With .*?? I meant (?>.*?)=, which is not really worth of replacing
[^=]*= (but might come in handy if = were a complex subexpression). I
am not so sure about *always* either as there might be further context
which forces the .*? part to be too greedy, maybe.
···
On Sun, Apr 24, 2011 at 9:33 AM, Robert Dober <robert.dober@gmail.com> wrote:
On Sat, Apr 23, 2011 at 7:38 PM, Roy Zuo <roylzuo@gmail.com> wrote:
--
The 1,000,000th fibonacci number contains '42' 2039 times; that is
almost 30 occurrences more than expected (208988 digits).
N.B. The 42nd fibonacci number does not contain '1000000' that is
almost the expected 3.0e-06 times.