perl_topic7_regex1

perl_topic7_regex1

ID:40087274

大小:139.15 KB

页数:28页

时间:2019-07-20

perl_topic7_regex1_第1页
perl_topic7_regex1_第2页
perl_topic7_regex1_第3页
perl_topic7_regex1_第4页
perl_topic7_regex1_第5页
资源描述:

《perl_topic7_regex1》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库

1、7) Regular Expressions Ma3 Webster IMBIM, BMC ma3hew.webster@imbim.uu.se Regular expressions •Very powerful and useful part of perl •similar to find and replace in word, or grep in unix•used for pa3ern matching $_="ACGCGCTGCGTAGACATGGTAGACGAT";!if(/ATG/){!!pri

2、nt"Ifoundastartcodon";!}•a simple regular expression is something inside //!•you can use all the normal backlash codes e.g. /TGtchr10t128182/!!# a snp and it's posiIon? Metacharacterscharacters with a special meaning .! a dot  is the wildcard (matches o

3、ne of everything except )  !!backslash changes any metacharacter into a normal character !/./!/t/!matches anything matches tab !!/./!/\t/!matches a dot matchest!!!/\/!/.t./!matches a backlash matches two characters with a tab in the middle More metac

4、haracters*!a star matches previous characters zero or more Ime !+!a plus matches previous characters one or more Imes ?!quesIon mark matches previous character zero or one Ime /Maja*/!matches Maj or Maja or Majaaaaa!!/Maj+a/!matches Maja or Majjjjjja!!/M?aja/

5、!matches Maja or aja!More metacharacters()!parentheses can be used to group parts of the pa3ern /(Maja)*/!matches nothing or Maja or MajaMaja or MajaMajaMajaMajaMaja!!/(Maj)+a/!matches Maja or MajMajMajMaja!!/M*(aja)+/!matches aja or MMMajaor MMMMajaajaajaaja

6、aja!More metacharacters12!backslash number is used to refer back to a parentheses that matches $_="EmmaIvansson";!!/(.)1/!matches two characters next to each other 'mm'!!/(E)mm(a).+2/!matches 'EmmaIva'!!/(E)mm(a).+1/!doesn't match!character classes []!a 

7、list of possible characters goes inside square brackets /[a-z]/!matches one lowercase le3er (not åäö)!!/[a-zA-Z]/!matches one upper or lowercase le3er (not ÅÖÄåöä)!!/[ATGC]+/!matches a DNA sequence of any length !

8、ers (^ negates) /[A-Z]+/!matches strings containing 'A', '-' and 'Z' (backslash stops dash being a special character) e.g. AAA---A---A----Z---Z----A----A-Z-AAAZAZ!character classes d!a 

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。
相关文章
更多
相关标签