Regular matching operation example in Android programming development

This paper describes the regular matching operation in Android programming. Share with you for your reference, as follows:

In Android development, you may also encounter the legitimacy verification of the input box. At this time, the most commonly used regular expression should be used to do some matching. The commonly used regular matching is introduced below

1. Verification of mobile phone number

According to the latest statistics of actual development on September 7, 2009: China Telecom released China 3G number segment: China Unicom 185186; China Mobile 188187; China Telecom 189180 has 6 signal segments in total.

Mobile: 134, 135, 136, 137, 138, 139, 150, 151, 157 (TD), 158, 159, 187, 188

Unicom: 130, 131, 132, 152, 155, 156, 185, 186

Telecommunications: 133, 153, 180, 189, (1349 SATCOM)

Matching code (at present, the number segment may be added. We can write regular expressions according to the actual situation)

2. Email verification

3. Verification of IP address

PS: here are two very convenient regular expression tools for your reference:

JavaScript regular expression online test tool: http://tools.jb51.net/regex/javascript

Regular expression online generation tool: http://tools.jb51.net/regex/create_ reg

More readers interested in Android related content can view the special topics of this site: Android control usage summary, Android development introduction and advanced tutorial, Android view skill summary, activity operation skill summary of Android programming, Android database operation skill summary and Android resource operation skill summary

I hope this article will help you in Android programming.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>