- 2
- 0
- 约1.53万字
- 约 50页
- 2016-12-31 发布于江西
- 举报
Regular Expression与Java.ppt
Regular Expression與Java 蕭宇程 swanky.hsiao@ / Introduction to Regular Expressions Regular Expression Syntax Object Models Using regexes in Java Part 1:Introduction to Regular Expressions Regular expressions are the key to powerful, flexible, and efficient text processing. Searching Text Files: egrep The Filename Analogy In DOS/Windows dir *.txt *、?:file globs or wildcards * :match anything ? :match any one character Generalized Pattern Language Regular Experssions: Powerful pattern language(generalized pattern language) and the patterns themselves The Language Analogy Regular Expressions are composed of: Metacharacters (special characters) Literal (normal text characters) Literal text acting as the words and metacharacters as the grammar. Part 2Regular Expression Syntax Regular Expression測試小程式 .tw/blog/archives/ciyawasay/000381.html Regular Experssion的投影片與範例檔 .tw/blog/archives/ciyawasay/000394.html Start and End of the Line Start:^ (caret) End: $ (dollar) cat 、^cat 、cat$ Match a position in the line rather than any actual text characters themselves. Question:^cat$ 、^$ 、^各代表什麼意思? Character Classes Matching any one of several characters […] Negated character classes [^…] Matching any one of several characters […] grey、gray ? gr[ea]y [0-9]character-class metacharacter ‘-’ (dash) h[123456] ? h[1-6] [0-9a-fA-F] = [A-Fa-f0-9] A dash is a metacharacter only within a character class – otherwise it matches the normal dash character. Negated character classes [^…] Matches any character that isn’t listed. [^1-6] matches a character that’s not 1 through 6. Question:Why doesn’t q[^u] match ‘Qantas’ or ‘Iraq’ Character Class Notes A character class, even negated, still requires a character to match. Consider character classes as their own mini language. The rules regarding which metacharacters are supported (and what they do) are completely different inside and outside of character classes. Matching Any Character with Dot . (dot 、point) Matches any character 03
您可能关注的文档
- 第四章 配气机构90152.ppt
- 商场调查.ppt
- 第一章 经济法概论21721.ppt
- 22、爱莲说ppt.ppt
- 2.2 方势阱.ppt
- 七上九2《防范侵害、保护自己》修改.ppt
- Standard 2-Lane-Summary - CH.ppt
- 1 经济法概述--杨群.ppt
- 5 勘查地球物理.ppt
- 2025-2026学年湖南省高二(上)期末物理试卷(含答案).docx
- 2025-2026学年天津市和平区高三(上)期末数学试卷(含解析).pdf
- 2025-2026学年云南省楚雄州高三(上)期末数学试卷(含答案).pdf
- 2025-2026学年甘肃省天水市张家川实验中学高三(上)期末数学试卷(含答案).docx
- 2025-2026学年福建省厦门市松柏中学高二(上)期末数学试卷(含答案).docx
- 2025-2026学年广西钦州市高一(上)期末物理试卷(含答案).docx
- 2025-2026学年河北省邯郸市临漳县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省石家庄二十三中七年级(上)期末历史试卷(含答案).docx
- 2025-2026学年海南省五指山市九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省唐山市玉田县九年级(上)期末化学试卷(含答案).docx
- 2025-2026学年河北省邢台市市区九年级(上)期末化学试卷(含答案).docx
最近下载
- (苏教版)数学五年级上册寒假“天天练”作业设计,含30份题组,附参考答案.doc
- 有限空间作业注意事项.pptx VIP
- 从明代土地产权制度弊端剖析古代土地制度的困境与启示.docx
- 工贸企业常见安全生产隐患诊断检查指导书.pdf VIP
- 麓山景区2006-2020详细规划.doc VIP
- 《地基与基础培训》课件.ppt VIP
- 2026年村卫生室基本公共卫生服务工作计划.docx VIP
- 阿姆斯壮Armstrong--THE BRAIN® DMC80再循环水温控制样本.pdf
- 《地下工程建设疏干排水水资源论证导则》.pdf VIP
- GB 17167-2025用能单位能源计量器具配备和管理通则.pdf
原创力文档

文档评论(0)