データベースにつぶやきがたくさんあるので、 "RT @username:... rest of tweet"のRTを[RT]に置き換えたいが、 RT "はツイートの先頭に立つ。だから、文字列が "RT"で始まるときはいつでも
に(関数は、大文字小文字が区別されない):入力は、例えば
RT @username I'm having one jolly good time!!
RT @username RT @username this is fun
I am not using RT as a label - I use my own "retweet" label :P
rt @name here rt is lowercase
出力のようになります。
[RT] @username I'm having one jolly good time!!
[RT] @username RT @username this is fun
I am not using RT as a label - I use my own "retweet" label :P (no changes)
[RT] @name here rt is lowercase
これは正規表現または正規phpのための仕事ですか?任意のヒントをいただければ幸いです!