- ISBN:9787564119317
- 装帧:暂无
- 册数:暂无
- 重量:暂无
- 开本:16开
- 页数:493
- 出版时间:2010-01-01
- 条形码:9787564119317 ; 978-7-5641-1931-7
内容简介
本书提供了超过100条的锦囊妙计,帮助你利用正则表达式处理数据、操纵文本。每位程序员都能找到正则表达式的用武之地,但想要充分发挥它的威力却未必容易。纵使经验丰富的用户也常会遇到性能不佳、误判、漏判或者令人费解的错误。《正则表达式cookbook》对涉及此工具的*常见任务做了逐步讲解,此外还包括在c#、java、javascipt、perl、php、python、ruby和vb.net语言中使用正则表达式的诀窍。
阅读本书,你将:
·通过简洁的教程理解正则表达式的基本原理
·在多种编程和脚本语言中高效地应用正则表达式
·学习如何验证和格式化输入
·操纵单词、行、特殊字符和数值
·找到在url、路径、标记和数据交换中使用正则表达式的方法
·学习更高级的正则表达式特性
·理解在不同语言中正则表达式的应用程序接口、语法和行为的不同
·针对特定需要,编写更加优化的正则表达式
无论你是初学者还是经验丰富的用户,《正则表达式cookbook》都将有助于你对这一独特而不可替代的工具的理解。你将学到功能强大的新技巧,避免和语言相关的陷阱,利用这一经过实践检验的方法解决现实世界中的难题,从而节省宝贵的时间。
目录
1. introduction to regular expressions
regular expressions defined
searching and replacing with regular expressions
tools for working with regular expressions
2. basic regular expression skills
2.1 match literal text
2.2 match nonprintable characters
2.3 match one of many characters
2.4 match any character
2.5 match something at the start and/or the end of a line
2.6 match whole words
2.7 unicode code points, properties, blocks, and scripts
2.8 match one of several alternatives
2.9 group and capture parts of the match
2.10 match previously matched text again
2.11 capture and name parts of the match
2.12 repeat part of the regex a certain number of times
2.13 choose minimal or maximal repetition
2.14 eliminate needless backtracking
2.15 prevent runaway repetition
2.16 test for a match without adding it to the overall match
2.17 match one of two alternatives based on a condition
2.18 add comments to a regular expression
2.19 insert literal text into the replacement text
2.20 insert the regex match into the replacement text
2.21 insert part of the regex match into the replacement text
2.22 insert match context into the replacement text
3. programming with regular expressions
programming languages and regex flavors
3.1 literal regular expressions in source code
3.2 import the regular expression library
3.3 creating regular expression objects
3.4 setting regular expression options
3.5 test whether a match can be found within a subject string
3.6 test whether a regex matches the subject string entirely
3.7 retrieve the matched text
3.8 determine the position and length of the match
3.9 retrieve part of the matched text
3.10 retrieve a list of all matches
3.11 iterate over all matches
3.12 validate matches in procedural code
3.13 find a match within another match
3.14 replace all matches
3.15 replace matches reusing parts of the match
3.16 replace matches with replacements generated in code
3.17 replace all matches within the matches of another regex
3.18 replace all matches between the matches of another regex
3.19 split a string
3.20 split a string, keeping the regex matches
3.21 search line by line
4. validation and formatting
4.1 validate email addresses
4.2 validate and format north american phone numbers
4.3 validate international phone numbers
4.4 validate traditional date formats
4.5 accurately validate traditional date formats
4.6 validate traditional time formats
4.7 validate iso 8601 dates and times
4.8 limit input to alphanumeric characters
4.9 limit the length of text
4.10 limit the number of lines in text
4.11 validate affirmative responses
4.12 validate social security numbers
4.13 validate isbns
4.14 validate zip codes
4.15 validate canadian postal codes
4.16 validate u.k. postcodes
4.17 find addresses with post office boxes
4.18 reformat names from "firstname lastname" to "lastname, firstname"
4.19 validate credit card numbers
4.20 european vat numbers
5. words, lines, and special characters
5.1 find a specific word
5.2 find any of multiple words
5.3 find similar words
5.4 find all except a specific word
5.5 find any word not followed by a specific word
5.6 find any word not preceded by a specific word
5.7 find words near each other
5.8 find repeated words
5.9 remove duplicate lines
5.10 match complete lines that contain a word
5.11 match complete lines that do not contain a word
5.12 trim leading and trailing whitespace
5.13 replace repeated whitespace with a single space
5.14 escape regular expression metacharacters
6. numbers
6.1 integer numbers
6.2 hexadecimal numbers
6.3 binary numbers
6.4 strip leading zeros
6.5 numbers within a certain range
6.6 hexadecimal numbers within a certain range
6.7 floating point numbers
6.8 numbers with thousand separators
6.9 roman numerals
7. urls, paths, and internet addresses
7.1 validating urls
7.2 finding urls within full text
7.3 finding quoted urls in full text
7.4 finding urls with parentheses in full text
7.5 turn urls into links
7.6 validating urns
7.7 validating generic urls
7.8 extracting the scheme from a url
7.9 extracting the user from a url
7.10 extracting the host from a url
7.11 extracting the port from a url
7.12 extracting the path from a url
7.13 extracting the query from a url
7.14 extracting the fragment from a url
7.15 validating domain names
7.16 matching ipv4 addresses
7.17 matching ipv6 addresses
7.18 validate windows paths
7.19 split windows paths into their parts
7.20 extract the drive letter from a windows path
7.21 extract the server and share from a unc path
7.22 extract the folder from a windows path
7.23 extract the filename from a windows path
7.24 extract the file extension from a windows path
7.25 strip invalid characters from filenames
8. markup and data interchange
8.1 find xml-style tags
8.2 replace tags with
8.3 remove all xml-style tags except and
8.4 match xml names
8.5 convert plain text to html by adding
-
硅谷之火-人与计算机的未来
¥13.7¥39.8 -
造神:人工智能神话的起源和破除 (精装)
¥32.7¥88.0 -
专业导演教你拍好短视频
¥13.8¥39.9 -
数学之美
¥41.0¥69.0 -
系统性创新手册(管理版)
¥42.6¥119.0 -
计算机网络技术
¥24.1¥33.0 -
Excel函数.公式与图表
¥16.4¥48.0 -
.NET安全攻防指南(下册)
¥89.0¥129.0 -
.NET安全攻防指南(上册)
¥89.0¥129.0 -
人工智能的底层逻辑
¥55.3¥79.0 -
数据挖掘技术与应用
¥52.0¥75.0 -
计算
¥92.2¥128.0 -
MIDJOURNEY AI绘画从入门到精通
¥71.5¥98.0 -
商业产品分析:从用户数据获得商业洞见的数据科学方法
¥89.0¥129.0 -
老年人学电脑
¥34.9¥49.9 -
超简单:用python+ ChatGPT让excel飞起来
¥48.4¥79.0 -
人工智能AI摄影与后期修图从小白到高手:MIDJOURNEY+PHOTOSHOP
¥56.9¥98.0 -
人月神话(纪念典藏版)
¥68.6¥98.0 -
十堂极简人工智能课
¥31.9¥49.0 -
精益数据分析 珍藏版
¥69.5¥119.8