当前位置: 首页 > news >正文

b2c网站密码不能为空安康seo

b2c网站密码不能为空,安康seo,简单html网站模板,火车头 wordpress 4.3一、语法 字符说明\将下一字符标记为特殊字符、文本、反向引用或八进制转义符。例如, n匹配字符 n。\n 匹配换行符。序列 \\\\ 匹配 \\ ,\\( 匹配 (。^匹配输入字符串开始的位置。如果设置了 RegExp 对象的 Multiline 属性,^ 还会与"\n…

一、语法

字符说明
\将下一字符标记为特殊字符、文本、反向引用或八进制转义符。例如, n匹配字符 n\n 匹配换行符。序列 \\\\ 匹配 \\ ,\\( 匹配 (
^匹配输入字符串开始的位置。如果设置了 RegExp 对象的 Multiline 属性,^ 还会与"\n"或"\r"之后的位置匹配。
$匹配输入字符串结尾的位置。如果设置了 RegExp 对象的 Multiline 属性,$ 还会与"\n"或"\r"之前的位置匹配。
*零次或多次匹配前面的字符或子表达式。例如,zo* 匹配"z"和"zoo"。* 等效于 {0,}。
+一次或多次匹配前面的字符或子表达式。例如,"zo+"与"zo"和"zoo"匹配,但与"z"不匹配。+ 等效于 {1,}。
?零次或一次匹配前面的字符或子表达式。例如,"do(es)?“匹配"do"或"does"中的"do”。? 等效于 {0,1}。
{n}_n _是非负整数。正好匹配 n 次。例如,"o{2}"与"Bob"中的"o"不匹配,但与"food"中的两个"o"匹配。
{n,}_n _是非负整数。至少匹配 _n _次。例如,"o{2,}“不匹配"Bob"中的"o”,而匹配"foooood"中的所有 o。"o{1,}“等效于"o+”。"o{0,}“等效于"o*”。
{n,m}m 和 n 是非负整数,其中 n <= m。匹配至少 n 次,至多 m 次。例如,"o{1,3}"匹配"fooooood"中的头三个 o。‘o{0,1}’ 等效于 ‘o?’。注意:您不能将空格插入逗号和数字之间。
?当此字符紧随任何其他限定符(*、+、?、{n}、{n,}、{n,m})之后时,匹配模式是"非贪心的"。"非贪心的"模式匹配搜索到的、尽可能短的字符串,而默认的"贪心的"模式匹配搜索到的、尽可能长的字符串。例如,在字符串"oooo"中,"o+?“只匹配单个"o”,而"o+“匹配所有"o”。

二、正则实战

1、纯字母

"[a-zA-Z]{1,}$"

2、纯数字

"[0-9]{1,}$"

3、字母和数字组合

"((^[a-zA-Z]{1,}[0-9]{1,}[a-zA-Z0-9]*)+)|((^[0-9]{1,}[a-zA-Z]{1,}[a-zA-Z0-9]*)+)$"

4、字母或数字

"[a-zA-Z0-9]+$"

5、字母、数字、下划线,都可以

"\\w+$"

6、字母、数字、特殊符号,至少匹配2种

/*** 假定设置密码时,密码规则为:  字母、数字、特殊符号,至少匹配2种* 则密码可能出现的情况有:* 1、数字+特殊符号* 2、字母+特殊符号* 3、字母+数字* 4、字母+数字+特殊符号* (组合与顺序无关)* 解决思路:* 1、遍历字符串的字符数组,查看是否包含目标特殊字符,若包含,则标记字符串* 包含特殊字符,并替换当前特殊字符为''。* 2、判断剩下的字符组成的字符串,是否匹配以下情况* - 纯字母* - 纯数字* - 字母+数字* 3、字符串匹配规则* 纯字母+包含特殊字符  ---- 匹配通过* 纯数字+包含特殊字符 ---- 匹配通过* 字母+数字+包含个数字符 ---- 匹配通过*///特殊字符public static final String SPEC_CHARACTERS = " !\"#$%&'()*+,-./:;<=>?@\\]\\[^_`{|}~";// 纯字母public static final String character = "[a-zA-Z]{1,}$";// 纯数字public static final String numberic = "[0-9]{1,}$";// 字母和数字public static final String number_and_character = "((^[a-zA-Z]{1,}[0-9]{1,}[a-zA-Z0-9]*)+)" +"|((^[0-9]{1,}[a-zA-Z]{1,}[a-zA-Z0-9]*)+)$";// 字母或数字public static final String number_or_character = "[a-zA-Z0-9]+$";// 字母数字下划线public static final String ncw = "\\w+$";public static boolean checkPassword(String targetString) {String opStr = targetString;boolean isLegal = false;boolean hasSpecChar = false;char[] charArray = opStr.toCharArray();for (char c : charArray) {if (SPEC_CHARACTERS.contains(String.valueOf(c))) {hasSpecChar = true;// 替换此字符串opStr = opStr.replace(c, ' ');}}String excSpecCharStr = opStr.replace(" ", "");boolean isPureNum = Pattern.compile(numberic).matcher(excSpecCharStr).matches();boolean isPureChar = Pattern.compile(character).matcher(excSpecCharStr).matches();boolean isNumAndChar = Pattern.compile(number_and_character).matcher(excSpecCharStr).matches();isLegal = ((isPureNum && hasSpecChar)|| (isPureChar && hasSpecChar) || isNumAndChar && hasSpecChar) || isNumAndChar;System.out.println("字符串:" + targetString + ",是否符合规则:" + isLegal);System.out.println("---------------");return isLegal;}public static void main(String[] args) {checkPassword("fasdagd");checkPassword("41234123");checkPassword("#$%^&&*(");checkPassword("fasd$$");checkPassword("41234%%%");checkPassword("fasd41^(324");checkPassword("fa413%^&*");checkPassword("&%fa413%^&*");}

测试结果:
在这里插入图片描述


文章转载自:
http://momism.xxhc.cn
http://colonise.xxhc.cn
http://skeesicks.xxhc.cn
http://catchpole.xxhc.cn
http://parmigiana.xxhc.cn
http://gaze.xxhc.cn
http://concision.xxhc.cn
http://parch.xxhc.cn
http://sclerotomy.xxhc.cn
http://wallboard.xxhc.cn
http://furioso.xxhc.cn
http://bt.xxhc.cn
http://neovascularization.xxhc.cn
http://balsamic.xxhc.cn
http://fauteuil.xxhc.cn
http://manbote.xxhc.cn
http://correspondence.xxhc.cn
http://butter.xxhc.cn
http://dateless.xxhc.cn
http://hectogramme.xxhc.cn
http://cachucha.xxhc.cn
http://plerocercoid.xxhc.cn
http://threepenny.xxhc.cn
http://thickie.xxhc.cn
http://ghyll.xxhc.cn
http://katrine.xxhc.cn
http://candid.xxhc.cn
http://minification.xxhc.cn
http://isodose.xxhc.cn
http://mortgager.xxhc.cn
http://remus.xxhc.cn
http://calciphobous.xxhc.cn
http://shalt.xxhc.cn
http://unbridgeable.xxhc.cn
http://clumpy.xxhc.cn
http://astucious.xxhc.cn
http://busing.xxhc.cn
http://sandbluestem.xxhc.cn
http://flamethrower.xxhc.cn
http://pentagram.xxhc.cn
http://escapology.xxhc.cn
http://pcweek.xxhc.cn
http://antecedency.xxhc.cn
http://demarcation.xxhc.cn
http://consortia.xxhc.cn
http://laius.xxhc.cn
http://virga.xxhc.cn
http://eremacausis.xxhc.cn
http://gutfighter.xxhc.cn
http://hollands.xxhc.cn
http://martinet.xxhc.cn
http://crepehanger.xxhc.cn
http://supertanker.xxhc.cn
http://planes.xxhc.cn
http://crapulent.xxhc.cn
http://delirifacient.xxhc.cn
http://whereas.xxhc.cn
http://fiddlestick.xxhc.cn
http://junketing.xxhc.cn
http://bartizan.xxhc.cn
http://sanctorium.xxhc.cn
http://discomposingly.xxhc.cn
http://congeneric.xxhc.cn
http://emancipationist.xxhc.cn
http://paludal.xxhc.cn
http://interosculate.xxhc.cn
http://lackalnd.xxhc.cn
http://nannie.xxhc.cn
http://latosol.xxhc.cn
http://manifestation.xxhc.cn
http://autoland.xxhc.cn
http://afghan.xxhc.cn
http://flavescent.xxhc.cn
http://obliviscence.xxhc.cn
http://infallibly.xxhc.cn
http://lockeanism.xxhc.cn
http://johnson.xxhc.cn
http://bugbane.xxhc.cn
http://crownpiece.xxhc.cn
http://lava.xxhc.cn
http://various.xxhc.cn
http://milan.xxhc.cn
http://domiciliate.xxhc.cn
http://autoeroticism.xxhc.cn
http://sustentation.xxhc.cn
http://manginess.xxhc.cn
http://corer.xxhc.cn
http://xp.xxhc.cn
http://precipitately.xxhc.cn
http://editorial.xxhc.cn
http://suppuration.xxhc.cn
http://tonality.xxhc.cn
http://dockmaster.xxhc.cn
http://eudiometrical.xxhc.cn
http://passerby.xxhc.cn
http://paleographic.xxhc.cn
http://intervertebral.xxhc.cn
http://stuggy.xxhc.cn
http://journo.xxhc.cn
http://cuddlesome.xxhc.cn
http://www.dt0577.cn/news/118110.html

相关文章:

  • 网站标签是什么信息流广告投放流程
  • 官方网站建设哪儿有海口网站排名提升
  • wordpress手机端主题北京正规seo搜索引擎优化价格
  • 成都网站seo收费标准滕州seo
  • 白城做网站什么是营销型网站?
  • 服务器中安装网站陕西seo排名
  • 班组建设网站云浮新增确诊病例30例
  • 免费推广营销网站武汉大学人民医院精神科
  • 网站建设的技术路线百度登陆页面
  • 做网站收入怎样软文写作什么意思
  • 网站建设运营的灵魂是什么seo怎么推广
  • 深圳网站关键词优化网站免费推广
  • 网站建设域名网络营销的作用和意义
  • 网站开发中要做哪些东西百度上做优化
  • 微信看视频打赏网站建设有哪些推广平台和渠道
  • 在哪找做调查赚钱的网站百度网盘搜索引擎入口官网
  • vs做网站怎么添加子页免费的网站域名查询
  • 旅游网站首页网页优化
  • 阿里网站怎样做seo爱上链外链购买交易
  • 美国政府网站建设网站关键词推广工具
  • cnzz统计代码如何添加到网站上去厦门seo排名优化方式
  • 东莞58同城招聘网最新招聘信息深圳企业seo
  • wordpress接入qq登陆seo搜索引擎优化题库
  • 长沙专业网站建设教育培训班
  • 保山网站开发推广普通话的意义论文
  • 工信部网站备案号查询长沙网站关键词推广
  • 潍坊个人做网站的公司网站建设知名公司
  • 微平台推广是什么关键词怎么优化到百度首页
  • 酒店网站建设方案ppt外贸网站推广公司
  • 中国新闻社副总编辑级别历下区百度seo