The latest small form verification requirement: "Only enter Chinese characters, and must include the words "branch", "branch", "bank", and "credit union" and need to be verified using regular expressions.
Therefore, the following expression was written
var patt1=new RegExp(/^[\u0391-\uFFE5]*(([\u652f]{1}[\u884c]{1})|([\u5206]{1}[\u884c]{1})|([\u94f6]{1}[\u884c]{1})|([\u4fe1]{1}[\u7528]{1}[\u793e]{1}))+[\u0391-\uFFE5]*$/); (("Credit Union works hard"));
Chinese character encoding uses Unicode, and then the output is of course true. The total rules are divided into three parts:
1. ^[\u0391-\uFFE5]* means that the beginning must contain zero or more Chinese characters
2. (([\u652f]{1}[\u884c]{1})|([\u5206]{1}[\u884c]{1})|([\u94f6]{1}[\u884c]{1})|([\u4fe1]{1}[\u7528]{1}[\u793e]{1}))+ means that one must include "branch", "branch", "bank", "credit union" and may be repeatedly included
3. [\u0391-\uFFE5]*$ means that the end must contain zero or more Chinese characters.
The above method of verifying the specified string of js regular expression is all the content I share with you. I hope you can give you a reference and I hope you can support me more.