Mobile over-stop input emoji expression implementation scheme

Source: Internet
Author: User

Recently, there is a need for the project on hand is the input box can not enter the expression, and then on the various online looking for information, many people on the Internet program is:

str = str.replace (/\ud83c[\udf00-\udfff]|\ud83d[\udc00-\ude4f]/g, "");

The usage is probably:

<= "This.value = Value.replace (/\ud83c[\udf00-\udfff]|\ud83d[\udc00-\ude4f]/g,"  ")">;

This is useful for sogou input method, but I changed the phone on the message fly input method tried, and no eggs, third-party calligraphy emoji Expression Unicode encoding range is really not OK.

So the reverse comes. You do not let the input expression, I can only input Chinese, English, numerals, punctuation does not realize the need?

<type= "text"  ID= "ipt1"  oninput= "VALUE = Value.replace (/[^\u4e00-\u9fa5|\d|\a-za-z|\r\n\s,.?!,.?! ...-&$= ()-+/*{}[\]]|\s/g, ")"/>

The pro-test is effective.

Mobile over-stop input emoji expression implementation scheme

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.