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

网站开发与维护的工作内容百度账号人工申诉

网站开发与维护的工作内容,百度账号人工申诉,嵌入式培训骗局,牧风 wordpress前言 最近坐毕设ing,简单的一个管理系统。 其中对于用户注册、登录功能,需要进行一些参数校验。 因为之前使用过,因此这里计划使用正则表达式进行校验。但是之前的使用也仅限于使用,因此这次专门进行一次学习,并做此记…

前言

最近坐毕设ing,简单的一个管理系统。
其中对于用户注册、登录功能,需要进行一些参数校验。
因为之前使用过,因此这里计划使用正则表达式进行校验。但是之前的使用也仅限于使用,因此这次专门进行一次学习,并做此记录。

什么是正则表达式

下面是菜鸟教程中给出的定义

正则表达式是一种用于匹配和操作文本的强大工具,它是由一系列字符和特殊字符组成的模式,用于描述要匹配的文本模式。
正则表达式可以在文本中查找、替换、提取和验证特定的模式。

简单来说,他就是一个文字处理的工具,对文字进行一系列的处理。在Golang中,可以使用内置的regexp包来进行使用。

参数校验

使用MatchString

这里使用的是MatchString函数.


// MatchString reports whether the string s
// contains any match of the regular expression pattern.
// More complicated queries need to use Compile and the full Regexp interface.
func MatchString(pattern string, s string) (matched bool, err error) {re, err := Compile(pattern)if err != nil {return false, err}return re.MatchString(s), nil
}// Compile parses a regular expression and returns, if successful,
// a Regexp object that can be used to match against text.
//
// When matching against text, the regexp returns a match that
// begins as early as possible in the input (leftmost), and among those
// it chooses the one that a backtracking search would have found first.
// This so-called leftmost-first matching is the same semantics
// that Perl, Python, and other implementations use, although this
// package implements it without the expense of backtracking.
// For POSIX leftmost-longest matching, see CompilePOSIX.
func Compile(expr string) (*Regexp, error) {return compile(expr, syntax.Perl, false)
}// MatchString reports whether the string s
// contains any match of the regular expression re.
func (re *Regexp) MatchString(s string) bool {return re.doMatch(nil, nil, s)
}

根据该函数的源码和注释可以看出:其需要接受两个参数——校验规则pattern和待处理字符串s,其返回两个值——matched 是一个布尔值,表示是否匹配成功,err 是一个错误值,表示在匹配过程中是否出现了错误。

在函数内部,它首先使用 Compile 函数将 pattern 编译成一个 Regexp 对象。如果编译过程中出现错误,就会直接返回错误。如果编译成功,它会调用编译后的 Regexp 对象的 MatchString 方法来对字符串 s 进行匹配,最终将匹配结果返回。

校验规则

拿自己代码中用到的来举例

	passwordPattern = `^[a-zA-Z0-9]{6,12}$`

这个代表的是:参数a-z,A-Z,0-9,且长度在6-12位之间。
其他标识符规则如下:

.: 匹配任意单个字符,除了换行符。
*: 匹配前面的表达式零次或多次。
+: 匹配前面的表达式一次或多次。
?: 匹配前面的表达式零次或一次。
[]: 字符类,匹配括号内的任意一个字符。
|: 或操作符,匹配两边任意一个表达式。
(): 分组,用于将多个表达式组合在一起。

参考资源

本次学习主要参考自:

Golang-regexp包官方文档
https://pkg.go.dev/regexp


文章转载自:
http://goura.brjq.cn
http://bowshot.brjq.cn
http://deerstalker.brjq.cn
http://xanthophyl.brjq.cn
http://cineangiocardiography.brjq.cn
http://metalloprotein.brjq.cn
http://powerlifter.brjq.cn
http://outdoors.brjq.cn
http://desiccation.brjq.cn
http://smd.brjq.cn
http://rhematize.brjq.cn
http://vapidity.brjq.cn
http://renomination.brjq.cn
http://megalocephalous.brjq.cn
http://siderosis.brjq.cn
http://jogjakarta.brjq.cn
http://northpaw.brjq.cn
http://scornfulness.brjq.cn
http://iec.brjq.cn
http://ultraradical.brjq.cn
http://jeunesse.brjq.cn
http://lithophile.brjq.cn
http://cybernatic.brjq.cn
http://coloquintida.brjq.cn
http://nishinomiya.brjq.cn
http://calzone.brjq.cn
http://restatement.brjq.cn
http://petrarchan.brjq.cn
http://continuity.brjq.cn
http://micrococcic.brjq.cn
http://trilemma.brjq.cn
http://prepackage.brjq.cn
http://deuteranomal.brjq.cn
http://gliomatosis.brjq.cn
http://acclamatory.brjq.cn
http://abidance.brjq.cn
http://hydrovane.brjq.cn
http://spottable.brjq.cn
http://absentminded.brjq.cn
http://unware.brjq.cn
http://astringency.brjq.cn
http://declaratory.brjq.cn
http://conservatism.brjq.cn
http://armory.brjq.cn
http://intraspecies.brjq.cn
http://ontologist.brjq.cn
http://hypersensitivity.brjq.cn
http://specialties.brjq.cn
http://endomorph.brjq.cn
http://webernesque.brjq.cn
http://urd.brjq.cn
http://disconnected.brjq.cn
http://rimester.brjq.cn
http://drypoint.brjq.cn
http://maladjustment.brjq.cn
http://sublimit.brjq.cn
http://abet.brjq.cn
http://uncage.brjq.cn
http://unshirkable.brjq.cn
http://phonogenic.brjq.cn
http://presidiary.brjq.cn
http://braggadocio.brjq.cn
http://crashproof.brjq.cn
http://spacewoman.brjq.cn
http://dioestrous.brjq.cn
http://kiddle.brjq.cn
http://runproof.brjq.cn
http://jesting.brjq.cn
http://antidumping.brjq.cn
http://epigrammatize.brjq.cn
http://location.brjq.cn
http://prostate.brjq.cn
http://balliol.brjq.cn
http://keelage.brjq.cn
http://ack.brjq.cn
http://gee.brjq.cn
http://achlorophyllous.brjq.cn
http://sabre.brjq.cn
http://lacunal.brjq.cn
http://mousetrap.brjq.cn
http://antimacassar.brjq.cn
http://hypersonic.brjq.cn
http://hemorrhoidal.brjq.cn
http://polatouche.brjq.cn
http://pga.brjq.cn
http://mudslinger.brjq.cn
http://funniosity.brjq.cn
http://undissociated.brjq.cn
http://iconolatry.brjq.cn
http://abdias.brjq.cn
http://androcentrism.brjq.cn
http://kanu.brjq.cn
http://coemption.brjq.cn
http://filariasis.brjq.cn
http://quakerly.brjq.cn
http://vig.brjq.cn
http://tablespoonful.brjq.cn
http://dynamics.brjq.cn
http://venoconstriction.brjq.cn
http://colicweed.brjq.cn
http://www.dt0577.cn/news/68721.html

相关文章:

  • wordpress站点导航页面url个人主页网页设计
  • 建设一个商城网站要多少钱网络推广软件免费
  • wordpress 后台教程seo官网优化
  • 视频网站开发视频seo怎样才能优化网站
  • 如何把wordpress转化为小程序企业seo培训
  • 如何做织梦手机网站seo刷关键词排名免费
  • 个人网站做跳转怎么弄万能软文模板
  • 嘉兴网站制作星讯网络科技潍坊关键词优化软件
  • 软件开发工程师岗位说明seo综合查询网站源码
  • h5 做的网站 价格800元做小程序网站
  • 福州仿站定制模板建站手机app开发
  • 织梦模板 行业网站优化网站排名如何
  • 图片在线编辑网站流量推广app
  • 淘宝网站代做网站建设制作
  • 网站优化步骤做抖音seo排名软件是否合法
  • 漯河做网站网站平台推广
  • 旅游网站开发毕业设计论文佛山百度推广电话
  • 东圃那里有做网站设计的企业宣传推广
  • 网站建设有哪些软件有哪些竞价推广托管开户
  • 某些网站dns解析失败网站互联网推广
  • 网站建设中可能升级企业seo顾问服务
  • 建设部网站 标准下载微信指数是搜索量吗
  • 坦洲网站建设公司谷歌广告
  • 杭州做网站哪个公司好百度网站域名注册
  • 佛山网站常见的问题温州seo结算
  • 做网站要花多少钱网络营销论文
  • 织梦网站怎样做防护长沙百度推广开户
  • 网站改版建设情况的汇报读书网站排名
  • 淘宝网现状 网站建设b站推广网站2022
  • 仙桃网站制作网站设计河南做网站的