新聞中心
這里有您想知道的互聯網營銷解決方案
創(chuàng)新互聯鴻蒙OS教程:鴻蒙OSCommonPattern
CommonPattern

java.lang.Object
|---ohos.utils.CommonPattern
public class CommonPattern
extends Object提供獲取用于驗證常見模式的正則表達式的方法。
在對常用模式進行正則表達式驗證之前,需要先使用該類中的方法獲取匹配的正則表達式。
構造函數摘要
| 構造函數 | 描述 |
|---|---|
| CommonPattern() | 用于創(chuàng)建實例的默認構造函數 |
方法總結
| 修飾符和類型 | 方法 | 描述 |
|---|---|---|
| static Pattern | getDomainName() | 獲取驗證域名的正則表達式。 |
| static Pattern | getEmailAddress() | 獲取用于驗證電子郵件地址的正則表達式。 |
| static Pattern | getIpAddress() | 獲取用于驗證 IPv4 地址的正則表達式。 |
| static Pattern | getWebUrl() | 獲取驗證網址的正則表達式。 |
| 從類 java.lang.Object 繼承的方法 |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
構造函數詳細信息
CommonPattern
public CommonPattern()
用于創(chuàng)建實例的默認構造函數
方法詳情
getWebUrl
public static Pattern getWebUrl()
獲取驗證網址的正則表達式。
返回:
返回與 Web URL 模式匹配的正則表達式。
getIpAddress
public static Pattern getIpAddress()
獲取用于驗證 IPv4 地址的正則表達式。
返回:
返回匹配 IPv4 地址模式的正則表達式。
getDomainName
public static Pattern getDomainName()
獲取驗證域名的正則表達式。
返回:
返回匹配域名模式的正則表達式。
getEmailAddress
public static Pattern getEmailAddress()
獲取用于驗證電子郵件地址的正則表達式。
返回:
返回與電子郵件地址模式匹配的正則表達式。
本文標題:創(chuàng)新互聯鴻蒙OS教程:鴻蒙OSCommonPattern
文章鏈接:http://www.5511xx.com/article/cdjcedh.html


咨詢
建站咨詢
