Question: I am creating a customer registration rest service using ballerina and the use case related to this is when the customer get registered successfully I need to send a sms to the customer.When I used the Twilio Connector in ballerina to send the sms I get the following error.

```
404 Not Found-:The requested resource /2010-04-01/Accounts//SMS/ 
Messages.json was not found.        

```

Below shows the code related to the Twilio-integration,

```
import wso2/twilio;
twilio:Client twilioClient = new({
    accountSId: config:getAsString(TWILIO_ACCOUNT_SID),
    authToken: config:getAsString(TWILIO_AUTH_TOKEN)
});

```

I have included Twilio-Sid and Auth Token inside the ballerina.conf file as well.Below shows the function which I have written to send sms through Twilio-connector

```
function sendSmsToCustomers(string mobile) returns boolean {

    boolean isSuccess= false;
    string toMobile = mobile;
    string messageBody = config:getAsString(TWILIO_MESSAGE);
    string fromMobile = config:getAsString(TWILIO_FROM_MOBILE);
    string message = messageBody;
    var response = twilioClient->sendSms(fromMobile, toMobile,  message);
   if (response is twilio:SmsResponse) {
        if (response.sid != EMPTY_STRING) {
            log:printDebug("Twilio Connector -> SMS successfully sent to " + toMobile);
            return true;
        }
    } else {
        log:printDebug("Twilio Connector -> SMS failed sent to " + toMobile);
        log:printError(<string>response.detail().message);
    }
    return isSuccess;
}

```

The expected output should be to send a sms to the provided mobile number(toMobile)

Answer: 
You forgot about one little but important detail: The [JavaScript modifier](https://www.regular-expressions.info/javascript.html) `g`. You might want to consider `i` for case insensitivity as well.
for me this is the one its worked

```
                pasteCleanup: {
                custom: function (html)
                {
                    html = html.replace(/<\s*br\/*>/gi, '');
                    html = html.replace(/<\s*a.*href="(.*?)".*>(.*?)<\/a>/gi, " $2 (Link - $1) ");
                    html = html.replace(/<\s*\/*.+?>/ig, '');
                    html = html.replace(/ {2,}/gi, '');
                    html = html.replace(/\n+\s*/gi, '');
                    html = html.replace("&nbsp;", '');
                    html = html.replace(/&lt;.*?&gt;/g, '');
                    return html;
                }
            }

```