我有几条短信
This is a line
This is other line
This is another line
如何摆脱那些多空行?
我想要的是
This is a line
This is other line
This is another line
\s说,它匹配任何空格字符(空格、制表符、换行符),但我不知道如何将多个空行变成一个空行?
我有几条短信:
I like chickeneggs but not normal eggs和我需要用<i></i>标记包装eggs,如果整个单词是chickeneggs,而不是eggs。
所以我的预期结果是:
I like chicken<i>eggs</i> but not eggs。
我考虑过使用regex,但我不确定实现这个目标的最佳方法。
我希望这是转换成php,任何人请。我正在做营销应用程序编码发送群发短信
from flask import Flask, request
from twilio.rest import TwilioRestClient
app = Flask(__name__)
# put your own credentials here
ACCOUNT_SID = 'YOUR_ACCOUNT_SID'
AUTH_TOKEN = 'YOUR_AUTH_TOKEN'
client = TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN