Search method on string refuse to search dot '.' ?

I am working on phone nr edtition and I would like add ‘.’ between part nr only if user does not input them.

var phone = ‘04/380.14.45’
var sep1 = phone.search(‘/’)
var sep2 = phone.search(‘.’)

if …

var sep1 becomes 2 but
var sep2 stay always 0

Why the function refuse to search the ‘.’ character ?

Thanks for your help.

DomTom

:?:

Could be because the dot is part of a regular expression control character. What happens when you search on ‘.’

It’s not working any more.

Thanks for trial.

DomTom.

I think you can use:

var sep2 = utils.stringPosition(phone,“.”,1,1)