0
我有以下的正則表達式(?x:-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)
這正則表達式來攻克一批
first -1.3 second 1.1e-2 third -1e-2 fourth -10 fith -0.1 sixth .3 done.
但最後一個.3
適用於所有數字。
我試圖讓第一組(?:0|[1-9]\\d*)
可選,但打破了正則表達式。我怎樣才能使正則表達式適用於所有情況?
thans,那就是我正在尋找 – Denis