Regular expressions cookbook:
If you're a programmer, you've undoubtedly needed to search or manipulate text at some point. Regular expressions provide a flexible and concise means to complete most such tasks, but their power does not come without its problems. Addressing hundreds of tasks, this title covers many of th...
Gespeichert in:
Hauptverfasser: | , |
---|---|
Format: | Buch |
Sprache: | German |
Veröffentlicht: |
Beijing [u.a.]
O'Reilly
2009
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis Klappentext |
Zusammenfassung: | If you're a programmer, you've undoubtedly needed to search or manipulate text at some point. Regular expressions provide a flexible and concise means to complete most such tasks, but their power does not come without its problems. Addressing hundreds of tasks, this title covers many of the main programming languages. |
Beschreibung: | Ill. |
Beschreibung: | 491 S. |
ISBN: | 9780596520687 |
Internformat
MARC
LEADER | 00000nam a2200000 c 4500 | ||
---|---|---|---|
001 | BV035501278 | ||
003 | DE-604 | ||
005 | 20100723 | ||
007 | t | ||
008 | 090520s2009 |||| 00||| ger d | ||
015 | |a 09,N14,0016 |2 dnb | ||
016 | 7 | |a 993157025 |2 DE-101 | |
020 | |a 9780596520687 |c : EUR 38.00 (freier Pr.), EUR 41.10 (AT) (freier Pr.), sfr 64.90 (freier Pr.) |9 978-0-596-52068-7 | ||
024 | 3 | |a 9780596520687 | |
035 | |a (OCoLC)297148670 | ||
035 | |a (DE-599)DNB993157025 | ||
040 | |a DE-604 |b ger |e rakddb | ||
041 | 0 | |a ger | |
049 | |a DE-703 |a DE-11 |a DE-898 |a DE-188 |a DE-2174 | ||
050 | 0 | |a QA76.7 | |
082 | 0 | |a 004 | |
084 | |a ST 240 |0 (DE-625)143625: |2 rvk | ||
084 | |a 004 |2 sdnb | ||
100 | 1 | |a Goyvaerts, Jan |e Verfasser |4 aut | |
245 | 1 | 0 | |a Regular expressions cookbook |c Jan Goyvaerts and Steven Levithan |
264 | 1 | |a Beijing [u.a.] |b O'Reilly |c 2009 | |
300 | |a 491 S. | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
500 | |a Ill. | ||
520 | |a If you're a programmer, you've undoubtedly needed to search or manipulate text at some point. Regular expressions provide a flexible and concise means to complete most such tasks, but their power does not come without its problems. Addressing hundreds of tasks, this title covers many of the main programming languages. | ||
650 | 4 | |a Computer programming | |
650 | 4 | |a Programming languages (Electronic computers) |v Handbooks, manuals, etc | |
650 | 0 | 7 | |a Regulärer Ausdruck |0 (DE-588)4506116-6 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Programmiersprache |0 (DE-588)4047409-4 |2 gnd |9 rswk-swf |
689 | 0 | 0 | |a Regulärer Ausdruck |0 (DE-588)4506116-6 |D s |
689 | 0 | |5 DE-604 | |
689 | 1 | 0 | |a Programmiersprache |0 (DE-588)4047409-4 |D s |
689 | 1 | 1 | |a Regulärer Ausdruck |0 (DE-588)4506116-6 |D s |
689 | 1 | |5 DE-188 | |
700 | 1 | |a Levithan, Steven |e Verfasser |4 aut | |
856 | 4 | 2 | |m Digitalisierung UB Bayreuth |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000003&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
856 | 4 | 2 | |m Digitalisierung UB Bayreuth |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000004&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA |3 Klappentext |
999 | |a oai:aleph.bib-bvb.de:BVB01-017557502 |
Datensatz im Suchindex
_version_ | 1804139120419667968 |
---|---|
adam_text | Table
of
Contents
Preface
..................................................................... ix
1.
Introduction to Regular Expressions
........................................1
Regular Expressions Defined
1
Searching and Replacing with Regular Expressions
5
Tools for Working with Regular Expressions
7
2.
Basic Regular Expression Skills
...........................................25
2.1
Match Literal Text
26
2.2
Match Nonprintable Characters
28
2.3
Match One of Many Characters
30
2.4
Match Any Character
34
2.5
Match Something at the Start and/or the End of a Line
36
2.6
Match Whole Words
41
2.7
Unicode Code Points, Properties, Blocks, and Scripts
43
2.8
Match One of Several Alternatives
55
2.9
Group and Capture Parts of the Match
57
2.10
Match Previously Matched Text Again
60
2.11
Capture and Name Parts of the Match
62
2.12
Repeat Part of the Regex a Certain Number of Times
64
2.13
Choose Minimal or Maximal Repetition
67
2.14
Eliminate Needless Backtracking
70
2.15
Prevent Runaway Repetition
72
2.16
Test for a Match Without Adding It to the Overall Match
75
2.17
Match One of Two Alternatives Based on a Condition
81
2.18
Add Comments to a Regular Expression
83
2.19
Insert Literal Text into the Replacement Text
85
2.20
Insert the Regex Match into the Replacement Text
87
2.21
Insert Part of the Regex Match into the Replacement Text
88
2.22
Insert Match Context into the Replacement Text
92
3. Programming
with Regular Expressions
...................................95
Programming Languages and Regex Flavors
95
3.1
Literal Regular Expressions in Source Code
100
3.2
Import the Regular Expression Library
Ю6
3.3
Creating Regular Expression Objects
108
3.4
Setting Regular Expression Options
114
3.5
Test Whether a Match Can Be Found Within a Subject String
121
3.6
Test Whether a Regex Matches the Subject String Entirely
127
3.7
Retrieve the Matched Text
132
3.8
Determine the Position and Length of the Match
138
3.9
Retrieve Part of the Matched Text
143
3.10
Retrieve a List of All Matches
150
3.11
Iterate over All Matches
155
3.12
Validate Matches in Procedural Code
161
3.13
Find a Match Within Another Match
165
3.14
Replace All Matches
169
3.15
Replace Matches Reusing Parts of the Match
176
3.16
Replace Matches with Replacements Generated in Code
181
3.17
Replace All Matches Within the Matches of Another Regex
187
3.18
Replace All Matches Between the Matches of Another Regex
189
3.19
Split a String
195
3.20
Split a String, Keeping the Regex Matches
203
3.21
Search Line by Line
208
4.
Validation and Formatting
............................................. 213
4.1
Validate Email Addresses
213
4.2
Validate and Format North American Phone Numbers
219
4.3
Validate International Phone Numbers
224
4.4
Validate Traditional Date Formats
226
4.5
Accurately Validate Traditional Date Formats
229
4.6
Validate Traditional Time Formats
234
4.7
Validate ISO
8601
Dates and Times
237
4.8
Limit Input to Alphanumeric Characters
241
4.9
Limit the Length of Text
244
4.10
Limit the Number of Lines in Text
248
4.11
Validate Affirmative Responses
253
4.12
Validate Social Security Numbers
254
4.13
Validate ISBNs
257
4.14
Validate ZIP Codes
264
4.15
Validate Canadian Postal Codes
265
4.16
Validate U.K. Postcodes
266
4.17
Find Addresses with Post Office Boxes
266
ri I Table of Contents
4.18
Reformat
Names From FirstName LastName to LastName,
FirstName
268
4.19
Validate Credit Card Numbers
271
4.20
European VAT Numbers
278
5.
Words, Lines, and Special Characters
.....................................285
5.1
Find a Specific Word
285
5.2
Find Any of Multiple Words
288
5.3
Find Similar Words
290
5.4
Find All Except a Specific Word
294
5.5
Find Any Word Not Followed by a Specific Word
295
5.6
Find Any Word Not Preceded by a Specific Word
297
5.7
Find Words Near Each Other
300
5.8
Find Repeated Words
306
5.9
Remove Duplicate Lines
308
5.10
Match Complete Lines That Contain a Word
312
5.11
Match Complete Lines That Do Not Contain a Word
313
5.12
Trim Leading and Trailing Whitespace
314
5.13
Replace Repeated Whitespace with a Single Space
317
5.14
Escape Regular Expression Metacharacters
319
6.
Numbers
............................................................ 323
6.1
Integer Numbers
323
6.2
Hexadecimal Numbers
326
6.3
Binary Numbers
329
6.4
Strip Leading Zeros
330
6.5
Numbers Within a Certain Range
331
6.6
Hexadecimal Numbers Within a Certain Range
337
6.7
Floating Point Numbers
340
6.8
Numbers with Thousand Separators
343
6.9
Roman Numerals
344
7.
URLs, Paths, and Internet Addresses
..................................... 347
7.1
Validating URLs
347
7.2
Finding URLs Within Full Text
350
7.3
Finding Quoted URLs in Full Text
352
7.4
Finding URLs with Parentheses in Full Text
353
7.5
Turn URLs into Links
356
7.6
Validating URNs
356
7.7
Validating Generic URLs
358
7.8
Extracting the Scheme from a URL
364
7.9
Extracting the User from a URL
366
7.10
Extracting the Host from a URL
367
Table of Contents I vH
7.11
Extracting the Port from
a
URL 369
7.12
Extracting the Path from a URL
371
7.13
Extracting the Query from a URL
374
7.14
Extracting the Fragment from a URL
376
7.15
Validating Domain Names
376
7.16
Matching
IPv4
Addresses
379
7.17
Matching
IPv6
Addresses
381
7.18
Validate Windows Paths
395
7.19
Split Windows Paths into Their Parts
397
7.20
Extract the Drive Letter from a Windows Path
402
7.21
Extract the Server and Share from a UNC Path
403
7.22
Extract the Folder from a Windows Path
404
7.23
Extract the Filename from a Windows Path
406
7.24
Extract the File Extension from a Windows Path
407
7.25
Strip Invalid Characters from Filenames
408
8.
Markup and Data Interchange
..........................................411
8.1
Find XML-Style Tags
417
8.2
Replace <b> Tags with <strong>
434
8.3
Remove All XML-Style Tags Except <em> and <strong>
438
8.4
Match XML Names
441
8.5
Convert Plain Text to HTML by Adding <p> and <br> Tags
447
8.6
Find a Specific Attribute in XML-Style Tags
450
8.7
Add a cellspacing Attribute to <table> Tags That Do Not Already
Include It
455
8.8
Remove XML-Style Comments
458
8.9
Find Words Within XML-Style Comments
462
8.10
Change the Delimiter Used in CSV Files
466
8.11
Extract CSV Fields from a Specific Column
469
8.12
Match INI Section Headers
473
8.13
Match INI Section Blocks
475
8.14
Match INI Name-Value Pairs
476
Index
.....................................................................479
viii
I Table of Contents
Software
Development/Programming
O REILLY
Regular Expressions Cookbook
This cookbook provides more than
100
recipes
to help you crunch data and manipulate text with
regular expressions. Every programmer can find
uses for regular expressions, but their power
doesn t come worry-free. Even seasoned users often suffer
from poor performance, false positives, false negatives, or
perplexing bugs. Regular Expressions Cookbook offers step-
by-step instructions for some of the most common tasks
involving this tool, with recipes for O, Java, JavaScript, Perl,
PHP, Python, Ruby, and VB.NET.
With this book, you will:
•
Understand the basics of regular expressions through a
concise tutorial
•
Use regular expressions effectively in several
programming and scripting languages
•
Learn how to validate and format input
•
Manage words, lines, special characters, and numerical
values
•
Find solutions for using regular expressions in URLs,
paths, markup, and data exchange
•
Learn the nuances of more advanced regex features
•
Understand how regular expressions APIs, syntax, and
behavior differ from language to language
•
Write better regular expressions for custom needs
Whether you re a novice or an experienced user. Regular
Expressions Cookbook will help deepen your knowledge of
this unique and irreplaceable tool. You ll learn powerful new
tricks, avoid language-specific gotchas, and save valuable time
with this huge library of proven solutions to difficult, real-
world problems.
This is a well-researched
book, full
ofinformation.
I learned a number of
new tricks just by reading
the introductory chapter.
—Nikolaj
Lindberg,
computational
linguist, STTS Speech
Technology Services
Regular Expressions
Cookbook provides
elegant solutions for
immediate problems.
Overall, I am stunned
at the attention to detail
in the recipes.
—Zak
Gréant,
open
technology advocate
and strategist
Jan Goyvaerts runs Just Great
Software, where he designs
and develops some of the most
popular regular expressions
software.
Steven Levithan is a leading
JavaScript regular expressions
expert who also runs a
popular regular expressions-
centric blog.
|
any_adam_object | 1 |
author | Goyvaerts, Jan Levithan, Steven |
author_facet | Goyvaerts, Jan Levithan, Steven |
author_role | aut aut |
author_sort | Goyvaerts, Jan |
author_variant | j g jg s l sl |
building | Verbundindex |
bvnumber | BV035501278 |
callnumber-first | Q - Science |
callnumber-label | QA76 |
callnumber-raw | QA76.7 |
callnumber-search | QA76.7 |
callnumber-sort | QA 276.7 |
callnumber-subject | QA - Mathematics |
classification_rvk | ST 240 |
ctrlnum | (OCoLC)297148670 (DE-599)DNB993157025 |
dewey-full | 004 |
dewey-hundreds | 000 - Computer science, information, general works |
dewey-ones | 004 - Computer science |
dewey-raw | 004 |
dewey-search | 004 |
dewey-sort | 14 |
dewey-tens | 000 - Computer science, information, general works |
discipline | Informatik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>02414nam a2200505 c 4500</leader><controlfield tag="001">BV035501278</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20100723 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">090520s2009 |||| 00||| ger d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">09,N14,0016</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">993157025</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9780596520687</subfield><subfield code="c">: EUR 38.00 (freier Pr.), EUR 41.10 (AT) (freier Pr.), sfr 64.90 (freier Pr.)</subfield><subfield code="9">978-0-596-52068-7</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9780596520687</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)297148670</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB993157025</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rakddb</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">ger</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-703</subfield><subfield code="a">DE-11</subfield><subfield code="a">DE-898</subfield><subfield code="a">DE-188</subfield><subfield code="a">DE-2174</subfield></datafield><datafield tag="050" ind1=" " ind2="0"><subfield code="a">QA76.7</subfield></datafield><datafield tag="082" ind1="0" ind2=" "><subfield code="a">004</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 240</subfield><subfield code="0">(DE-625)143625:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">004</subfield><subfield code="2">sdnb</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Goyvaerts, Jan</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Regular expressions cookbook</subfield><subfield code="c">Jan Goyvaerts and Steven Levithan</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Beijing [u.a.]</subfield><subfield code="b">O'Reilly</subfield><subfield code="c">2009</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">491 S.</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">Ill.</subfield></datafield><datafield tag="520" ind1=" " ind2=" "><subfield code="a">If you're a programmer, you've undoubtedly needed to search or manipulate text at some point. Regular expressions provide a flexible and concise means to complete most such tasks, but their power does not come without its problems. Addressing hundreds of tasks, this title covers many of the main programming languages.</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Computer programming</subfield></datafield><datafield tag="650" ind1=" " ind2="4"><subfield code="a">Programming languages (Electronic computers)</subfield><subfield code="v">Handbooks, manuals, etc</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Regulärer Ausdruck</subfield><subfield code="0">(DE-588)4506116-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Programmiersprache</subfield><subfield code="0">(DE-588)4047409-4</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Regulärer Ausdruck</subfield><subfield code="0">(DE-588)4506116-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="1" ind2="0"><subfield code="a">Programmiersprache</subfield><subfield code="0">(DE-588)4047409-4</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2="1"><subfield code="a">Regulärer Ausdruck</subfield><subfield code="0">(DE-588)4506116-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2=" "><subfield code="5">DE-188</subfield></datafield><datafield tag="700" ind1="1" ind2=" "><subfield code="a">Levithan, Steven</subfield><subfield code="e">Verfasser</subfield><subfield code="4">aut</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Bayreuth</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000003&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">Digitalisierung UB Bayreuth</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000004&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Klappentext</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-017557502</subfield></datafield></record></collection> |
id | DE-604.BV035501278 |
illustrated | Not Illustrated |
indexdate | 2024-07-09T21:39:02Z |
institution | BVB |
isbn | 9780596520687 |
language | German |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-017557502 |
oclc_num | 297148670 |
open_access_boolean | |
owner | DE-703 DE-11 DE-898 DE-BY-UBR DE-188 DE-2174 |
owner_facet | DE-703 DE-11 DE-898 DE-BY-UBR DE-188 DE-2174 |
physical | 491 S. |
publishDate | 2009 |
publishDateSearch | 2009 |
publishDateSort | 2009 |
publisher | O'Reilly |
record_format | marc |
spelling | Goyvaerts, Jan Verfasser aut Regular expressions cookbook Jan Goyvaerts and Steven Levithan Beijing [u.a.] O'Reilly 2009 491 S. txt rdacontent n rdamedia nc rdacarrier Ill. If you're a programmer, you've undoubtedly needed to search or manipulate text at some point. Regular expressions provide a flexible and concise means to complete most such tasks, but their power does not come without its problems. Addressing hundreds of tasks, this title covers many of the main programming languages. Computer programming Programming languages (Electronic computers) Handbooks, manuals, etc Regulärer Ausdruck (DE-588)4506116-6 gnd rswk-swf Programmiersprache (DE-588)4047409-4 gnd rswk-swf Regulärer Ausdruck (DE-588)4506116-6 s DE-604 Programmiersprache (DE-588)4047409-4 s DE-188 Levithan, Steven Verfasser aut Digitalisierung UB Bayreuth application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000003&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis Digitalisierung UB Bayreuth application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000004&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA Klappentext |
spellingShingle | Goyvaerts, Jan Levithan, Steven Regular expressions cookbook Computer programming Programming languages (Electronic computers) Handbooks, manuals, etc Regulärer Ausdruck (DE-588)4506116-6 gnd Programmiersprache (DE-588)4047409-4 gnd |
subject_GND | (DE-588)4506116-6 (DE-588)4047409-4 |
title | Regular expressions cookbook |
title_auth | Regular expressions cookbook |
title_exact_search | Regular expressions cookbook |
title_full | Regular expressions cookbook Jan Goyvaerts and Steven Levithan |
title_fullStr | Regular expressions cookbook Jan Goyvaerts and Steven Levithan |
title_full_unstemmed | Regular expressions cookbook Jan Goyvaerts and Steven Levithan |
title_short | Regular expressions cookbook |
title_sort | regular expressions cookbook |
topic | Computer programming Programming languages (Electronic computers) Handbooks, manuals, etc Regulärer Ausdruck (DE-588)4506116-6 gnd Programmiersprache (DE-588)4047409-4 gnd |
topic_facet | Computer programming Programming languages (Electronic computers) Handbooks, manuals, etc Regulärer Ausdruck Programmiersprache |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000003&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=017557502&sequence=000004&line_number=0002&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT goyvaertsjan regularexpressionscookbook AT levithansteven regularexpressionscookbook |