Support forum

Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_TopicIcon
How to remove the leading 0 on int numbers
sp_NewPost Add Reply sp_NewTopic Add Topic
March 22, 2019
12:09 am
Verified
Guest
Guests

Ok resolved this with

regex:[^\d]replace:template:640[64]########;640[64]#########;640[64]##########;640[64]###########

March 21, 2019
11:56 pm
Verified
Guest
Guests

Status 300, Error: Invalid sms number: :64:0271231234

March 21, 2019
11:51 pm
Verified
Guest
Guests

Hi Henk,

I tried your example but messages still didnt send. I have added this

:template:0[+64]########;0[+64]#########;0[+64]##########;0[+64]###########

to the gateway and the number shows in the log as +64 027 123 1234. Presumably the above translation is converting to +64271231234 but nothing came through.

Many thanks
paul

March 13, 2019
10:47 am
Henk Helmantel
Admin
Forum Posts: 1016
Member Since:
May 28, 2013
sp_UserOfflineSmall Offline

You can add a (list of) normal number template(s) after the regular expression to change the number format further, e.g.:

regex:[^\d]replace:template:0[+44]#########;0[+44]##########

This template first strips the number of all non-digits with the regex/replace combination and then replaces the leading 0 with +44 for any numbers that have 10 or 11 digits with the two normal number templates at the end.

It is probably possible to do this with a single regex/replace combination as well but that requires more skills than I possess on regular expressions.

Regards, Henk

March 12, 2019
12:23 am
Verified
Guest
Guests

Hi there we have set up the server with a gateway and the following number template:

regex:[^\d]replace:

However, sometimes the user also enters the leading 0 so we end up with +countrycode 0 number

How can we ensure that 0 is removed because it causes chaos with the gateway?

Many thanks

Forum Timezone: Europe/Amsterdam

Most Users Ever Online: 494

Currently Online:
6 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 522

Members: 0

Moderators: 0

Admins: 1

Forum Stats:

Groups: 2

Forums: 3

Topics: 823

Posts: 2835

Newest Members:

, Henk Helmantel

Administrators: Henk Helmantel: 1016