###現実と理想
現実
javascript
1var txt = '{! id("local", "page-title")} | {! id("global", "site-title")}'; 2txt.match(/{!.*}/g); 3 4// 結果 5// [ 6// '{! id("local", "page-title")} | {! id("global", "site-title")}' 7// ]
理想
javascript
1var txt = '{! id("local", "page-title")} | {! id("global", "site-title")}'; 2txt.match(/{!.*}/g); 3 4// 結果(こうなってほしい) 5// [ 6// '{! id("local", "page-title")}', 7// '{! id("global", "site-title")}' 8// ]
###質問
なぜ理想の結果にならないのでしょうか。
正規表現が間違っていますか?
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/07/28 10:47