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

高校校园网网站内容如何建设技术外包网站

高校校园网网站内容如何建设,技术外包网站,网站建设公司列表网,海报生成免费cat /etc/redhat-release看到操作系统的版本是CentOS Linux release 7.6.1810 (Core)#xff0c;uname -r可以看到内核版本是3.10.0-957.21.3.el7.x86_64。 正则表达式是一种搜索字符串的模式#xff0c;通俗点理解#xff0c;也就是普通字符和元字符共同组成的字符集合匹…cat /etc/redhat-release看到操作系统的版本是CentOS Linux release 7.6.1810 (Core)uname -r可以看到内核版本是3.10.0-957.21.3.el7.x86_64。 正则表达式是一种搜索字符串的模式通俗点理解也就是普通字符和元字符共同组成的字符集合匹配模式。正则表达式的主要作用是文本搜索和字符串处理。 正则表达式有两种基本正则表达式扩展正则表达式。 元字符就是一些具有特殊含义的字符用于表示某种特定的字符类型或者行为它的含义就不是显示在计算机上的含义了。基本正则表达式具有如下的元字符 元字符名称作用举例.点.匹配除换行符之外的任意一个字符只能匹配一个字符234.6,就可以23416、23426、23436、23446、23456、23466、23476、234a6、234b6等这里有点多不一一列举了*星号匹配*前一个字符或者一个正则表达式0至若干次234*就可匹配23零个4或者多个4比如23、234、2344、234444、234444...而f[ae]*ll会匹配fall、fell、faall、faa...ll、fae...ll、feall、fea...ll、feell、fee...ll^脱字符插入符号折字符1.匹配一行的开始 2.否定正则表达式中一个字符串的意思1.^123会匹配每行以123开头的字符串2.[^a]会匹配没有a的字符串$美元符号匹配行尾456$会匹配以456结尾的字符串[]方框号匹配方括号内指定的字符集中的一个字符[an]会匹配a和n[b-d]会匹配b、c和d三个字符\反斜线转义一个特殊的字符使这个字符得到字面意义的解释\^就表示字符串^不再表示匹配一行开始的意义而\.就是表示字面含义的.不再能够匹配任意字符\\转义尖括号标记单词边界尖括号必须是转义的否则它们只有字符的字面含义。\you\就只能匹配you不能匹配your grep grep命令在 Linux 中用于在文件中搜索特定的文本模式。 接下来使用grep来验证上边元字符的使用实例 先使用下边的命令把一下字符串写到当前greptest.txt文件里边 echo god is good greptest.txt echo good greptest.txt echo good learning greptest.txt echo a good learner greptest.txt echo gold greptest.txt echo 1. gold jewelry greptest.txt echo 2. gold coins greptest.txt echo 3. gold medal greptest.txt echo 4. gold standard greptest.txt echo 5. gold mine greptest.txt echo 6. gold rush greptest.txt echo 7. goldsmith greptest.txt echo 8. gold bar greptest.txt echo 9. gold leaf greptest.txt echo 10. gold price greptest.txt echo 11. gold reserves greptest.txt echo 12. gold market greptest.txt echo 13. gold investment greptest.txt echo 14. gold necklace greptest.txt echo 15. gold watch greptest.txt echo 1 gold jewelry greptest.txt echo 2 gold coins greptest.txt echo 3 gold medal greptest.txt echo 4 gold standard greptest.txt echo 5 gold mine greptest.txt echo 6 gold rush greptest.txt echo 7 goldsmith greptest.txt echo 8 gold bar greptest.txt echo 9 gold leaf greptest.txt echo 10 gold price greptest.txt echo 11 gold reserves greptest.txt echo 12 gold market greptest.txt echo 13 gold investment greptest.txt echo 14 gold necklace greptest.txt echo 15 gold watch greptest.txtcat -n greptest.txt可以把行号在前内容在后显示出来。 grep . greptest.txt发现全部匹配了可以看到所有的字符都显示红色了需要注意的是grep会整行显示就是说一行中只有有匹配的字符串那么文件中这一行字符串都会显示但是匹配的字符串会以红色显示。 grep -n g.d greptest.txt可以看到匹配greptest.txt里边的godgrep g..d greptest.txt匹配的是good和gold注意冒号之前的绿色数字是文件内容里边对应的行号。 grep -n go*d greptest.txt可能匹配到god和good使用cat -n greptest.txt | grep go*d也可以匹配到god和good并且把内容中的行号也显示出来。这种显示格式有些不一样。 grep -n ^12 greptest.txt可以把以12开头的字符串匹配上同样的cat greptest.txt | grep ^12也可以转换格式输出但是可以实现相同的匹配功能cat -n greptest.txt | grep ^12就无法进行匹配了因为cat -n在使用时会先输出多个空格然后在输出内容行号之后再输出文件里边的内容。 grep e$ greptest.txt可以匹配以e结尾的字符串grep good$ greptest.txt可以匹配以good结尾的字符串。 grep -n go[ol]d greptest.txt能够匹配good和goldgrep -n 1[234] greptest.txt能够匹配12、13和14。 echo $ . greptest.txt echo * greptest.txt往greptest.txt里边写入$ .和*。 cat -n greptest.txt看一下内容。 grep \$ \. greptest.txt能够匹配到$ .grep -n \* greptest.txt能够匹配到*。 grep -n goo greptest.txt是匹配含有goo的字符串而grep -n \goo\ greptest.txt是完全匹配goo的字符串。 此文章为8月Day 4学习笔记内容来源于极客时间《Linux 实战技能 100 讲》。
http://www.dnsts.com.cn/news/210215.html

相关文章:

  • 环保设计院的网站建设好品质高端网站设计厂家
  • 电子商务网站建设过程范文嘉兴市南湖区建设街道网站
  • 将网站做成logo怎么做外贸出口网站建设
  • 邢台手机网站建设价格福建优化seo
  • 一个网站是怎么建立的网站点击排名优化
  • 网站建设图片大小打电话叫人做网站
  • 吉林网站开发公司怎么用凡科做网站
  • 高端网站建设的品牌cms站群管理系统
  • 网站开发中网站建设目的及意义
  • 网站排名优化方法讲解太平洋建设网站
  • 网站建设案例讯息江门市新会区
  • 本地wordpress怎么弄网站h5微网站建设多少钱
  • 深圳做网站网络营销公司哪家好罗湖做网站的公司
  • 西安网站制作计划海外市场营销
  • 建个网站有什么用网站制作综述
  • 怎么自己做网站推广福州电商网站建设
  • 百度免费网站如何建设wordpress 旅游足迹插件
  • 怎么评价一个网站设计做的好坏网站建设过程中准备的工作
  • node 做的大型网站seo整站优化服务
  • 专业网站建设阿里云asp.net 网站安装
  • 上海专业网站制作设计公司哪家好WordPress时间倒序
  • 推荐西安优秀的响应式网站建设公司暴雪国服
  • js网站跳转代码小程序公司
  • 黄冈建设信息网站上海企业注销一窗通
  • 哪里的网站建设好重庆龙华网站建设公司
  • 个人或主题网站建设网站后台统计
  • 手机网站制作流程图手机网站建设费用价格
  • 电子商务网站建设属性天津武清做网站的公司
  • 网站建设不好网站开发一般会用到什么语言
  • 孝感市门户网站管理中心合网站建设