我有我my_string的my_text_field(但其隱藏),例如,法國USA_ILANDS德國(這些國家之間的空間/單詞.....實際上,所有這些國家的名稱是文本字段/下拉菜單/複選框的名稱在my_form上),就像我在大約200個國家連接一樣,好吧。
現在,我想搜索在my_string匹配,例如說,我期待搜索匹配美國的,所以我把下面的JS,
var myCountryName = /USA/;
var returnValue = my_text_field.search(myCountryName);
if(returnValue != -1){; // This Country/field/object is found in the my_text_field, hence greyed out with readOnly
this.ui.oneOfChild.border.fill.color.value = "192,192,192";
this.access = "readOnly";
};
我期待的返回值應該是假的。
但是,它的確如此!
https://stackoverflow.com/questions/447250/matching-exact-string-with-j avascript
上午在與佔位符一樣,變種R =/^ $一個/其工作FONE第一建議選擇對我來說
PLS。讓我知道這是安全的嗎?好? recommendabale?或任何其他幫助找出完全匹配的單詞?
謝謝
它是語法錯誤嗎?請。如何闡述它的? – user1754195