flutter過濾emoji正則表達式

坑爹的flutter正則;

emoji過濾正則表達式:"[^\\u0020-\\u007E\\u00A0-\\u00BE\\u2E80-\\uA4CF\\uF900-\\uFAFF\\uFE30-\\uFE4F\\uFF00-\\uFFEF\\u0080-\\u009F\\u2000-\\u201f\r\n]"

RegExp regexp=RegExp("[^\\u0020-\\u007E\\u00A0-\\u00BE\\u2E80-\\uA4CF\\uF900-\\uFAFF\\uFE30-\\uFE4F\\uFF00-\\uFFEF\\u0080-\\u009F\\u2000-\\u201f\r\n]")

        TextField(
           controller: _textEditingController,
           focusNode: focusNode,
            inputFormatters: [BlacklistingTextInputFormatter(regexp)],
            textInputAction: TextInputAction.search,
            style: StringUtils.text_style(cr: ColorUtils.c333333),
            decoration: InputDecoration(
              hintText: '請輸入搜索內容',
            ),
            onChanged: (text) {
          
            },
          )

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章