E
es_
Hi,
On other javascript group I didn't get answer. Maybe You'll know...
There's a strange problem with variables. It feels that they work only
after second call. It looks like this:
js> a="1"
1
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
1
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
2
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
2
etc.
And here even stranger:
js> a="444"
444
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
1
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
445
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
2
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
446
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
3
etc.
Do anyone know why it is like this? And how to eliminate this effect?
greetz,
T
On other javascript group I didn't get answer. Maybe You'll know...
There's a strange problem with variables. It feels that they work only
after second call. It looks like this:
js> a="1"
1
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
1
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
2
js> a=a.replace(/(\d)/, Number(RegExp.$1)+1)
2
etc.
And here even stranger:
js> a="444"
444
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
1
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
445
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
2
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
446
js> a=a.replace(/(\d+)/, Number(RegExp.$1)+1)
3
etc.
Do anyone know why it is like this? And how to eliminate this effect?
greetz,
T