1
有沒有一種簡單的方法,以取代智能引號直引號Actionscript:用直接引用替換智能報價? (?彎引號)
我已經試過:
var the_string = example.text;
example.htmlText = the_string.replace("\"", """);
但它似乎並沒有做出報價捲髮。
有沒有一種簡單的方法,以取代智能引號直引號Actionscript:用直接引用替換智能報價? (?彎引號)
我已經試過:
var the_string = example.text;
example.htmlText = the_string.replace("\"", """);
但它似乎並沒有做出報價捲髮。
也許你正在尋找使用左,右雙引號實體引號內替換文本:
「 = “
」 = ”
使用正則表達式,這可以實現如:
var the_string:String = "\"This\" is the \"text\".";
trace(the_string.replace(/"([^"]+)"/g, "“$1”"));
這個例子會產生:
「這」是「文字」。
感謝這解釋了很多。加號表示無限字符嗎? – redconservatory
加號是重複的,試圖匹配前一個令牌一次或多次。 –
我改編了這個PHP:'preg_replace('/「([^」] +)「/','“ $ 1 ”',$ text);'現在如何嵌套另一個正則表達式來替換簡單的單引號省略號...嗯。 – cbmtrx