Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition
- Autorzy:
- Jan Goyvaerts, Steven Levithan
- Ocena:
- Bądź pierwszym, który oceni tę książkę
- Stron:
- 612
- Dostępne formaty:
-
ePubMobi
Opis ebooka: Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition
Take the guesswork out of using regular expressions. With more than 140 practical recipes, this cookbook provides everything you need to solve a wide range of real-world problems. Novices will learn basic skills and tools, and programmers and experienced users will find a wealth of detail. Each recipe provides samples you can use right away.
This revised edition covers the regular expression flavors used by C#, Java, JavaScript, Perl, PHP, Python, Ruby, and VB.NET. You’ll learn powerful new tricks, avoid flavor-specific gotchas, and save valuable time with this huge library of practical solutions.
- Learn regular expressions basics through a detailed tutorial
- Use code listings to implement regular expressions with your language of choice
- Understand how regular expressions differ from language to language
- Handle common user input with recipes for validation and formatting
- Find and manipulate words, special characters, and lines of text
- Detect integers, floating-point numbers, and other numerical formats
- Parse source code and process log files
- Use regular expressions in URLs, paths, and IP addresses
- Manipulate HTML, XML, and data exchange formats
- Discover little-known regular expression tricks and techniques
Wybrane bestsellery
-
Wyrażenie regularne (ang. regexp) to inaczej wzorzec, który określa zbiór dopasowanych łańcuchów znaków. Brzmi to prosto. Jednak przy pierwszym spotkaniu z wyrażeniami wcale tak nie jest. Zbiór znaków i symboli składający się na wyrażenie regularne w niczym nie przypomina rzeczy, którą chciałbyś ...(24.90 zł najniższa cena z 30 dni)
39.50 zł
79.00 zł(-50%) -
Jak sądzisz, co stanowi bazę informatyki? Od czego powinien zacząć przyszły programista? Może od opanowania jednego z najpopularniejszych języków programowania? Oczywiście mógłby od tego rozpocząć, tyle że to trochę tak, jakby uczyć się korzystać z narzędzia bez świadomości, do czego ono właściwi...
Informacja i kodowanie. Krótkie wprowadzenie z przykładami zastosowań Informacja i kodowanie. Krótkie wprowadzenie z przykładami zastosowań
(47.20 zł najniższa cena z 30 dni)41.30 zł
59.00 zł(-30%) -
Książkę szczególnie docenią analitycy bezpieczeństwa, którzy chcą się zapoznać z zestawem poleceń ARM i zdobyć wiedzę umożliwiającą im efektywne korzystanie z technik inżynierii wstecznej. Poza zestawem potrzebnych poleceń znalazło się w niej mnóstwo przydatnych informacji. Znajdziesz tu przegląd...
Niebieski lis. Polecenia procesorów Arm i inżynieria wsteczna Niebieski lis. Polecenia procesorów Arm i inżynieria wsteczna
(57.84 zł najniższa cena z 30 dni)62.30 zł
89.00 zł(-30%) -
Ewolucja formularzy internetowych zaczęła się od prostych znaczników języka HTML 2.0 opublikowanego w 1993 roku. Z czasem HTML oferował bardziej zaawansowane funkcje obsługi formularzy. Późniejsze wersje, HTML4, a następnie HTML5, wprowadziły nowe typy pól, takie jak pola daty, koloru czy też adr...
Angular i formularze reaktywne. Praktyczny przewodnik Angular i formularze reaktywne. Praktyczny przewodnik
(44.85 zł najniższa cena z 30 dni)48.30 zł
69.00 zł(-30%) -
Jeśli w swojej pracy masz lub miewasz do czynienia z danymi, z pewnością orientujesz się, że do tego celu stworzono dotąd całkiem sporo narzędzi. Nic dziwnego – przy tej liczbie danych, z jaką spotykamy się w dzisiejszym cyfrowym świecie, zdolność do ich sprawnego analizowania i wyciągania ...
Grafana. Kurs video. Monitorowanie, analiza i wizualizacja danych w czasie rzeczywistym Grafana. Kurs video. Monitorowanie, analiza i wizualizacja danych w czasie rzeczywistym
(39.90 zł najniższa cena z 30 dni)39.90 zł
139.00 zł(-71%) -
Tę książkę docenią praktycy: inżynierowie uczenia maszynowego i analitycy danych, poszukujący sposobu praktycznego zaadaptowania modeli transformacyjnych do swoich potrzeb. Autorzy skupili się na praktycznej stronie tworzenia aplikacji językowych, a w poszczególnych rozdziałach ujęto wszystkie na...
Przetwarzanie języka naturalnego z wykorzystaniem transformerów. Budowanie aplikacji językowych za pomocą bibliotek Hugging Face Przetwarzanie języka naturalnego z wykorzystaniem transformerów. Budowanie aplikacji językowych za pomocą bibliotek Hugging Face
(59.40 zł najniższa cena z 30 dni)69.30 zł
99.00 zł(-30%) -
Czym jest inżynieria wymagań? To systematyczne podejście do pozyskiwania i dokumentowania wymagań, a także zarządzania nimi. Polega na zrozumieniu potrzeb i oczekiwań interesariuszy, a następnie opisaniu, za pomocą wymagań, systemu, który je spełnia.
Certyfikowany inżynier wymagań. Na podstawie IREB CPRE. Poziom podstawowy Certyfikowany inżynier wymagań. Na podstawie IREB CPRE. Poziom podstawowy
(41.40 zł najniższa cena z 30 dni)48.30 zł
69.00 zł(-30%) -
To drugie, zaktualizowane wydanie przewodnika po systemie Prometheus. Znajdziesz w nim wyczerpujące wprowadzenie do tego oprogramowania, a także wskazówki dotyczące monitorowania aplikacji i infrastruktury, tworzenia wykresów, przekazywania ostrzeżeń, bezpośredniej instrumentacji kodu i pobierani...
Prometheus w pełnej gotowości. Jak monitorować pracę infrastruktury i wydajność działania aplikacji. Wydanie II Prometheus w pełnej gotowości. Jak monitorować pracę infrastruktury i wydajność działania aplikacji. Wydanie II
(53.40 zł najniższa cena z 30 dni)62.30 zł
89.00 zł(-30%) -
Czy wiesz, że większość ruchu w sieci pochodzi z urządzeń mobilnych? Smartfon stał się wiodącym urządzeniem do przeglądania Internetu i nadal przybiera na sile. Dzięki tej popularności dynamicznie rozwija się także rynek aplikacji mobilnych. W sklepach takich jak App Store i Google Play mamy do w...
iOS Developer. Kurs video. Opanuj Swift, framework UIKit i środowisko Xcode iOS Developer. Kurs video. Opanuj Swift, framework UIKit i środowisko Xcode
(39.90 zł najniższa cena z 30 dni)58.04 zł
129.00 zł(-55%) -
Power Apps to platforma stworzona przez Microsoft, umożliwiająca łatwe projektowanie, tworzenie i dostosowywanie aplikacji bez konieczności posiadania głębokiej wiedzy programistycznej. Z użyciem Power Apps można budować niestandardowe aplikacje, które efektywnie wspierają i automatyzują różne pr...
Power Apps. Kurs video. Tworzenie biznesowych aplikacji no-code Power Apps. Kurs video. Tworzenie biznesowych aplikacji no-code
(39.90 zł najniższa cena z 30 dni)69.65 zł
199.00 zł(-65%)
Ebooka "Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition" przeczytasz na:
-
czytnikach Inkbook, Kindle, Pocketbook, Onyx Boox i innych
-
systemach Windows, MacOS i innych
-
systemach Windows, Android, iOS, HarmonyOS
-
na dowolnych urządzeniach i aplikacjach obsługujących formaty: PDF, EPub, Mobi
Masz pytania? Zajrzyj do zakładki Pomoc »
Audiobooka "Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition" posłuchasz:
-
w aplikacji Ebookpoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych
-
na dowolnych urządzeniach i aplikacjach obsługujących format MP3 (pliki spakowane w ZIP)
Masz pytania? Zajrzyj do zakładki Pomoc »
Kurs Video "Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition" zobaczysz:
-
w aplikacjach Ebookpoint i Videopoint na Android, iOS, HarmonyOs
-
na systemach Windows, MacOS i innych z dostępem do najnowszej wersji Twojej przeglądarki internetowej
Szczegóły ebooka
- ISBN Ebooka:
- 978-14-493-2748-4, 9781449327484
- Data wydania ebooka:
- 2012-08-13 Data wydania ebooka często jest dniem wprowadzenia tytułu do sprzedaży i może nie być równoznaczna z datą wydania książki papierowej. Dodatkowe informacje możesz znaleźć w darmowym fragmencie. Jeśli masz wątpliwości skontaktuj się z nami sklep@ebookpoint.pl.
- Język publikacji:
- angielski
- Rozmiar pliku ePub:
- 5.1MB
- Rozmiar pliku Mobi:
- 13.7MB
Spis treści ebooka
- Regular Expressions Cookbook
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Preface
- Caught in the Snarls of Different Versions
- Intended Audience
- Technology Covered
- Organization of This Book
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgments
- 1. Introduction to Regular Expressions
- Regular Expressions Defined
- Many Flavors of Regular Expressions
- Regex Flavors Covered by This Book
- Regular Expressions Defined
- Search and Replace with Regular Expressions
- Many Flavors of Replacement Text
- Tools for Working with Regular Expressions
- RegexBuddy
- RegexPal
- RegexMagic
- More Online Regex Testers
- RegexPlanet
- regex.larsolavtorvik.com
- Nregex
- Rubular
- myregexp.com
- More Desktop Regular Expression Testers
- Expresso
- The Regulator
- SDL Regex Fuzzer
- grep
- PowerGREP
- Windows Grep
- RegexRenamer
- Popular Text Editors
- 2. Basic Regular Expression Skills
- 2.1. Match Literal Text
- Problem
- Solution
- Discussion
- Variations
- Block escape
- Case-insensitive matching
- See Also
- 2.1. Match Literal Text
- 2.2. Match Nonprintable Characters
- Problem
- Solution
- Discussion
- Variations on Representations of Nonprinting Characters
- The 26 control characters
- The 7-bit character set
- See Also
- 2.3. Match One of Many Characters
- Problem
- Solution
- Calendar with misspellings
- Hexadecimal character
- Nonhexadecimal character
- Discussion
- Variations
- Shorthands
- Case insensitivity
- Flavor-Specific Features
- .NET character class subtraction
- Java character class union, intersection, and subtraction
- See Also
- 2.4. Match Any Character
- Problem
- Solution
- Any character except line breaks
- Any character including line breaks
- Discussion
- Any character except line breaks
- Any character including line breaks
- Dot abuse
- Variations
- See Also
- 2.5. Match Something at the Start and/or the End of a Line
- Problem
- Solution
- Start of the subject
- End of the subject
- Start of a line
- End of a line
- Discussion
- Anchors and lines
- Start of the subject
- End of the subject
- Start of a line
- End of a line
- Zero-length matches
- Variations
- See Also
- 2.6. Match Whole Words
- Problem
- Solution
- Word boundaries
- Nonboundaries
- Discussion
- Word boundaries
- Nonboundaries
- Word Characters
- See Also
- 2.7. Unicode Code Points, Categories, Blocks, and Scripts
- Problem
- Solution
- Unicode code point
- Unicode category
- Unicode block
- Unicode script
- Unicode grapheme
- Discussion
- Unicode code point
- Unicode category
- Unicode block
- Unicode script
- Unicode grapheme
- Variations
- Negated variant
- Character classes
- Listing all characters
- See Also
- 2.8. Match One of Several Alternatives
- Problem
- Solution
- Discussion
- See Also
- 2.9. Group and Capture Parts of the Match
- Problem
- Solution
- Discussion
- Variations
- Noncapturing groups
- Group with mode modifiers
- See Also
- 2.10. Match Previously Matched Text Again
- Problem
- Solution
- Discussion
- See Also
- 2.11. Capture and Name Parts of the Match
- Problem
- Solution
- Named capture
- Named backreferences
- Discussion
- Named capture
- Named backreferences
- Groups with the same name
- See Also
- 2.12. Repeat Part of the Regex a Certain Number of Times
- Problem
- Solution
- Googol
- Hexadecimal number
- Hexadecimal number with optional suffix
- Floating-point number
- Discussion
- Fixed repetition
- Variable repetition
- Infinite repetition
- Making something optional
- Repeating groups
- See Also
- 2.13. Choose Minimal or Maximal Repetition
- Problem
- Solution
- Discussion
- See Also
- 2.14. Eliminate Needless Backtracking
- Problem
- Solution
- Discussion
- See Also
- 2.15. Prevent Runaway Repetition
- Problem
- Solution
- Discussion
- Variations
- See Also
- 2.16. Test for a Match Without Adding It to the Overall Match
- Problem
- Solution
- Discussion
- Lookaround
- Negative lookaround
- Different levels of lookbehind
- Matching the same text twice
- Lookaround is atomic
- Alternative to Lookbehind
- Solution Without Lookbehind
- See Also
- 2.17. Match One of Two Alternatives Based on a Condition
- Problem
- Solution
- Discussion
- See Also
- 2.18. Add Comments to a Regular Expression
- Problem
- Solution
- Discussion
- Free-spacing mode
- Java has free-spacing character classes
- Variations
- 2.19. Insert Literal Text into the Replacement Text
- Problem
- Solution
- Discussion
- When and how to escape characters in replacement text
- .NET and JavaScript
- Java
- PHP
- Perl
- Python and Ruby
- More escape rules for string literals
- See Also
- 2.20. Insert the Regex Match into the Replacement Text
- Problem
- Solution
- Regular expression
- Replacement
- Discussion
- See Also
- 2.21. Insert Part of the Regex Match into the Replacement Text
- Problem
- Solution
- Regular expression
- Replacement
- Discussion
- Replacements using capturing groups
- $10 and higher
- References to nonexistent groups
- Solution Using Named Capture
- Regular expression
- Replacement
- Flavors that support named capture
- See Also
- 2.22. Insert Match Context into the Replacement Text
- Problem
- Solution
- Discussion
- See Also
- 3. Programming with Regular Expressions
- Programming Languages and Regex Flavors
- Languages Covered in This Chapter
- More Programming Languages
- Programming Languages and Regex Flavors
- 3.1. Literal Regular Expressions in Source Code
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.2. Import the Regular Expression Library
- Problem
- Solution
- C#
- VB.NET
- XRegExp
- Java
- Python
- Discussion
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- 3.3. Create Regular Expression Objects
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Compiling a Regular Expression Down to CIL
- C#
- VB.NET
- Discussion
- See Also
- 3.4. Set Regular Expression Options
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Additional Language-Specific Options
- .NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.5. Test If a Match Can Be Found Within a Subject String
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- C# and VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.6. Test Whether a Regex Matches the Subject String Entirely
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- C# and VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.7. Retrieve the Matched Text
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.8. Determine the Position and Length of the Match
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.9. Retrieve Part of the Matched Text
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Named Capture
- C#
- VB.NET
- Java
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.10. Retrieve a List of All Matches
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.11. Iterate over All Matches
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.12. Validate Matches in Procedural Code
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- See Also
- 3.13. Find a Match Within Another Match
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- See Also
- 3.14. Replace All Matches
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.15. Replace Matches Reusing Parts of the Match
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Named Capture
- C#
- VB.NET
- Java 7
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.16. Replace Matches with Replacements Generated in Code
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.17. Replace All Matches Within the Matches of Another Regex
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- See Also
- 3.18. Replace All Matches Between the Matches of Another Regex
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- Perl and Ruby
- Python
- See Also
- 3.19. Split a String
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- C# and VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.20. Split a String, Keeping the Regex Matches
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- Discussion
- .NET
- Java
- JavaScript
- XRegExp
- PHP
- Perl
- Python
- Ruby
- See Also
- 3.21. Search Line by Line
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- PHP
- Perl
- Python
- Ruby
- Discussion
- See Also
- Construct a Parser
- Problem
- Solution
- C#
- VB.NET
- Java
- JavaScript
- XRegExp
- Perl
- Python
- PHP
- Ruby
- Discussion
- See Also
- 4. Validation and Formatting
- 4.1. Validate Email Addresses
- Problem
- Solution
- Simple
- Simple, with restrictions on characters
- Simple, with all valid local part characters
- No leading, trailing, or consecutive dots
- Top-level domain has two to six letters
- Discussion
- About email addresses
- Regular expression syntax
- Building a regex step-by-step
- 4.1. Validate Email Addresses
- Variations
- See Also
- 4.2. Validate and Format North American Phone Numbers
- Problem
- Solution
- Regular expression
- Replacement
- C# example
- JavaScript example
- Other programming languages
- Discussion
- Variations
- Eliminate invalid phone numbers
- Find phone numbers in documents
- Allow a leading 1
- Allow seven-digit phone numbers
- See Also
- 4.3. Validate International Phone Numbers
- Problem
- Solution
- Regular expression
- JavaScript example
- Discussion
- Variations
- Validate international phone numbers in EPP format
- See Also
- 4.4. Validate Traditional Date Formats
- Problem
- Solution
- Discussion
- Variations
- See Also
- 4.5. Validate Traditional Date Formats, Excluding Invalid Dates
- Problem
- Solution
- C#
- Perl
- Pure regular expression
- Discussion
- Regex with procedural code
- Pure regular expression
- Variations
- See Also
- 4.6. Validate Traditional Time Formats
- Problem
- Solution
- Discussion
- Variations
- See Also
- 4.7. Validate ISO 8601 Dates and Times
- Problem
- Solution
- Dates
- Weeks
- Times
- Date and time
- XML Schema dates and times
- Discussion
- See Also
- 4.8. Limit Input to Alphanumeric Characters
- Problem
- Solution
- Regular expression
- Ruby example
- Discussion
- Variations
- Limit input to ASCII characters
- Limit input to ASCII noncontrol characters and line breaks
- Limit input to shared ISO-8859-1 and Windows-1252 characters
- Limit input to alphanumeric characters in any language
- See Also
- 4.9. Limit the Length of Text
- Problem
- Solution
- Regular expression
- Perl example
- Discussion
- Variations
- Limit the length of an arbitrary pattern
- Limit the number of nonwhitespace characters
- Limit the number of words
- See Also
- 4.10. Limit the Number of Lines in Text
- Problem
- Solution
- Regular expression
- PHP (PCRE) example
- Discussion
- Variations
- Working with esoteric line separators
- See Also
- 4.11. Validate Affirmative Responses
- Problem
- Solution
- Regular expression
- JavaScript example
- Discussion
- See Also
- 4.12. Validate Social Security Numbers
- Problem
- Solution
- Regular expression
- Python example
- Discussion
- Variations
- Find Social Security numbers in documents
- See Also
- 4.13. Validate ISBNs
- Problem
- Solution
- Regular expressions
- JavaScript example, with checksum validation
- Python example, with checksum validation
- Discussion
- ISBN-10 checksum
- ISBN-13 checksum
- Variations
- Find ISBNs in documents
- Eliminate incorrect ISBN identifiers
- See Also
- 4.14. Validate ZIP Codes
- Problem
- Solution
- Regular expression
- VB.NET example
- Discussion
- See Also
- 4.15. Validate Canadian Postal Codes
- Problem
- Solution
- Discussion
- See Also
- 4.16. Validate U.K. Postcodes
- Problem
- Solution
- Discussion
- See Also
- 4.17. Find Addresses with Post Office Boxes
- Problem
- Solution
- Regular expression
- C# example
- Discussion
- See Also
- 4.18. Reformat Names From FirstName LastName to LastName, FirstName
- Problem
- Solution
- Regular expression
- Replacement
- JavaScript example
- Discussion
- Variations
- List surname particles at the beginning of the name
- See Also
- 4.19. Validate Password Complexity
- Problem
- Solution
- Length between 8 and 32 characters
- ASCII visible and space characters only
- One or more uppercase letters
- One or more lowercase letters
- One or more numbers
- One or more special characters
- Disallow three or more sequential identical characters
- Example JavaScript solution, basic
- Example JavaScript solution, with x out of y validation
- Example JavaScript solution, with password security ranking
- Discussion
- Example JavaScript solutions
- Variations
- Validate multiple password rules with a single regex
- See Also
- 4.20. Validate Credit Card Numbers
- Problem
- Solution
- Strip spaces and hyphens
- Validate the number
- Example web page with JavaScript
- Discussion
- Strip spaces and hyphens
- Validate the number
- Incorporating the solution into a web page
- Extra Validation with the Luhn Algorithm
- See Also
- 4.21. European VAT Numbers
- Problem
- Solution
- Strip whitespace and punctuation
- Validate the number
- Discussion
- Strip whitespace and punctuation
- Validate the number
- Variations
- See Also
- 5. Words, Lines, and Special Characters
- 5.1. Find a Specific Word
- Problem
- Solution
- Discussion
- See Also
- 5.1. Find a Specific Word
- 5.2. Find Any of Multiple Words
- Problem
- Solution
- Using alternation
- Example JavaScript solution
- Discussion
- Using alternation
- Example JavaScript solution
- See Also
- 5.3. Find Similar Words
- Problem
- Solution
- Color or colour
- Bat, cat, or rat
- Words ending with phobia
- Steve, Steven, or Stephen
- Variations of regular expression
- Discussion
- Use word boundaries to match complete words
- Color or colour
- Bat, cat, or rat
- Words ending with phobia
- Steve, Steven, or Stephen
- Variations of regular expression
- See Also
- 5.4. Find All Except a Specific Word
- Problem
- Solution
- Discussion
- Variations
- Find words that dont contain another word
- See Also
- 5.5. Find Any Word Not Followed by a Specific Word
- Problem
- Solution
- Discussion
- Variations
- See Also
- 5.6. Find Any Word Not Preceded by a Specific Word
- Problem
- Solution
- Lookbehind you
- Words not preceded by cat
- Simulate lookbehind
- Discussion
- Fixed, finite, and infinite length lookbehind
- Simulate lookbehind
- Variations
- See Also
- 5.7. Find Words Near Each Other
- Problem
- Solution
- Discussion
- Variations
- Using a conditional
- Match three or more words near each other
- Exponentially increasing permutations
- The ugly solution
- Exploiting empty backreferences
- JavaScript backreferences by its own rules
- Multiple words, any distance from each other
- See Also
- 5.8. Find Repeated Words
- Problem
- Solution
- Discussion
- Variations
- See Also
- 5.9. Remove Duplicate Lines
- Problem
- Solution
- Option 1: Sort lines and remove adjacent duplicates
- Option 2: Keep the last occurrence of each duplicate line in an unsorted file
- Option 3: Keep the first occurrence of each duplicate line in an unsorted file
- Discussion
- Option 1: Sort lines and remove adjacent duplicates
- Option 2: Keep the last occurrence of each duplicate line in an unsorted file
- Option 3: Keep the first occurrence of each duplicate line in an unsorted file
- See Also
- 5.10. Match Complete Lines That Contain a Word
- Problem
- Solution
- Discussion
- Variations
- See Also
- 5.11. Match Complete Lines That Do Not Contain a Word
- Problem
- Solution
- Discussion
- See Also
- 5.12. Trim Leading and Trailing Whitespace
- Problem
- Solution
- Discussion
- Variations
- See Also
- 5.13. Replace Repeated Whitespace with a Single Space
- Problem
- Solution
- Clean any whitespace characters
- Clean horizontal whitespace characters
- Discussion
- Clean any whitespace characters
- Clean horizontal whitespace characters
- See Also
- 5.14. Escape Regular Expression Metacharacters
- Problem
- Solution
- Built-in solutions
- Regular expression
- Replacement
- Example JavaScript function
- Discussion
- Variations
- See Also
- 6. Numbers
- 6.1. Integer Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.1. Integer Numbers
- 6.2. Hexadecimal Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.3. Binary Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.4. Octal Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.5. Decimal Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.6. Strip Leading Zeros
- Problem
- Solution
- Regular expression
- Replacement
- Getting the numbers in Perl
- Stripping leading zeros in PHP
- Discussion
- See Also
- 6.7. Numbers Within a Certain Range
- Problem
- Solution
- Discussion
- See Also
- 6.8. Hexadecimal Numbers Within a Certain Range
- Problem
- Solution
- Discussion
- See Also
- 6.9. Integer Numbers with Separators
- Problem
- Solution
- Discussion
- See Also
- 6.10. Floating-Point Numbers
- Problem
- Solution
- Discussion
- See Also
- 6.11. Numbers with Thousand Separators
- Problem
- Solution
- Discussion
- See Also
- 6.12. Add Thousand Separators to Numbers
- Problem
- Solution
- Basic solution
- Match separator positions only, using lookbehind
- Discussion
- Introduction
- Basic solution
- Match separator positions only, using lookbehind
- Variations
- Dont add commas after a decimal point
- Use infinite lookbehind
- Search-and-replace within matched numbers
- Dont add commas after a decimal point
- See Also
- 6.13. Roman Numerals
- Problem
- Solution
- Discussion
- Convert Roman Numerals to Decimal
- See Also
- 7. Source Code and Log Files
- Keywords
- Problem
- Solution
- Discussion
- Variations
- See Also
- Keywords
- Identifiers
- Problem
- Solution
- Discussion
- See Also
- Numeric Constants
- Problem
- Solution
- Discussion
- See Also
- Operators
- Problem
- Solution
- Discussion
- Single-Line Comments
- Problem
- Solution
- Discussion
- See Also
- Multiline Comments
- Problem
- Solution
- Discussion
- Variations
- See Also
- All Comments
- Problem
- Solution
- Discussion
- See Also
- Strings
- Problem
- Solution
- Discussion
- Variations
- See Also
- Strings with Escapes
- Problem
- Solution
- Discussion
- Variations
- See Also
- Regex Literals
- Problem
- Solution
- Discussion
- See Also
- Here Documents
- Problem
- Solution
- Discussion
- See Also
- Common Log Format
- Problem
- Solution
- Discussion
- Variations
- See Also
- Combined Log Format
- Problem
- Solution
- Discussion
- See Also
- Broken Links Reported in Web Logs
- Problem
- Solution
- Discussion
- See Also
- 8. URLs, Paths, and Internet Addresses
- 8.1. Validating URLs
- Problem
- Solution
- Discussion
- See Also
- 8.1. Validating URLs
- 8.2. Finding URLs Within Full Text
- Problem
- Solution
- Discussion
- See Also
- 8.3. Finding Quoted URLs in Full Text
- Problem
- Solution
- Discussion
- See Also
- 8.4. Finding URLs with Parentheses in Full Text
- Problem
- Solution
- Discussion
- See Also
- 8.5. Turn URLs into Links
- Problem
- Solution
- Discussion
- See Also
- 8.6. Validating URNs
- Problem
- Solution
- Discussion
- See Also
- 8.7. Validating Generic URLs
- Problem
- Solution
- Discussion
- See Also
- 8.8. Extracting the Scheme from a URL
- Problem
- Solution
- Extract the scheme from a URL known to be valid
- Extract the scheme while validating the URL
- Discussion
- See Also
- 8.9. Extracting the User from a URL
- Problem
- Solution
- Extract the user from a URL known to be valid
- Extract the user while validating the URL
- Discussion
- See Also
- 8.10. Extracting the Host from a URL
- Problem
- Solution
- Extract the host from a URL known to be valid
- Extract the host while validating the URL
- Discussion
- See Also
- 8.11. Extracting the Port from a URL
- Problem
- Solution
- Extract the port from a URL known to be valid
- Extract the port while validating the URL
- Discussion
- See Also
- 8.12. Extracting the Path from a URL
- Problem
- Solution
- Discussion
- See Also
- 8.13. Extracting the Query from a URL
- Problem
- Solution
- Discussion
- See Also
- 8.14. Extracting the Fragment from a URL
- Problem
- Solution
- Discussion
- See Also
- 8.15. Validating Domain Names
- Problem
- Solution
- Discussion
- See Also
- 8.16. Matching IPv4 Addresses
- Problem
- Solution
- Regular expression
- Perl
- Discussion
- See Also
- 8.17. Matching IPv6 Addresses
- Problem
- Solution
- Standard notation
- Mixed notation
- Standard or mixed notation
- Compressed notation
- Compressed mixed notation
- Standard, mixed, or compressed notation
- Discussion
- Standard notation
- Mixed notation
- Standard or mixed notation
- Compressed notation
- Compressed mixed notation
- Standard, mixed, or compressed notation
- See Also
- 8.18. Validate Windows Paths
- Problem
- Solution
- Drive letter paths
- Drive letter and UNC paths
- Drive letter, UNC, and relative paths
- Discussion
- Drive letter paths
- Drive letter and UNC paths
- Drive letter, UNC, and relative paths
- See Also
- 8.19. Split Windows Paths into Their Parts
- Problem
- Solution
- Drive letter paths
- Drive letter and UNC paths
- Drive letter, UNC, and relative paths
- Discussion
- Drive letter paths
- Drive letter and UNC paths
- Drive letter, UNC, and relative paths
- See Also
- 8.20. Extract the Drive Letter from a Windows Path
- Problem
- Solution
- Discussion
- See Also
- 8.21. Extract the Server and Share from a UNC Path
- Problem
- Solution
- Discussion
- See Also
- 8.22. Extract the Folder from a Windows Path
- Problem
- Solution
- Discussion
- See Also
- 8.23. Extract the Filename from a Windows Path
- Problem
- Solution
- Discussion
- See Also
- 8.24. Extract the File Extension from a Windows Path
- Problem
- Solution
- Discussion
- See Also
- 8.25. Strip Invalid Characters from Filenames
- Problem
- Solution
- Regular expression
- Replacement
- Discussion
- See Also
- 9. Markup and Data Formats
- Processing Markup and Data Formats with Regular Expressions
- Basic Rules for Formats Covered in This Chapter
- Processing Markup and Data Formats with Regular Expressions
- 9.1. Find XML-Style Tags
- Problem
- Solution
- Quick and dirty
- Allow > in attribute values
- (X)HTML tags (loose)
- (X)HTML tags (strict)
- XML tags (strict)
- Discussion
- A few words of caution
- Quick and dirty
- Allow > in attribute values
- (X)HTML tags (loose)
- (X)HTML tags (strict)
- XML tags (strict)
- Skip Tricky (X)HTML and XML Sections
- Outer regex for (X)HTML
- Outer regex for XML
- See Also
- 9.2. Replace <b> Tags with <strong>
- Problem
- Solution
- Discussion
- Variations
- Replace a list of tags
- See Also
- 9.3. Remove All XML-Style Tags Except <em> and <strong>
- Problem
- Solution
- Solution 1: Match tags except <em> and <strong>
- Solution 2: Match tags except <em> and <strong>, and any tags that contain attributes
- Discussion
- Variations
- Whitelist specific attributes
- See Also
- 9.4. Match XML Names
- Problem
- Solution
- XML 1.0 names (approximate)
- XML 1.1 names (exact)
- Discussion
- XML 1.0 names
- XML 1.1 names
- Variations
- See Also
- 9.5. Convert Plain Text to HTML by Adding <p> and <br> Tags
- Problem
- Solution
- Step 1: Replace HTML special characters with named character references
- Step 2: Replace all line breaks with <br>
- Step 3: Replace double <br> tags with </p><p>
- Step 4: Wrap the entire string with <p></p>
- Example JavaScript solution
- Discussion
- Step 1: Replace HTML special characters with named character references
- Step 2: Replace all line breaks with <br>
- Step 3: Replace double <br> tags with </p><p>
- Step 4: Wrap the entire string with <p></p>
- See Also
- 9.6. Decode XML Entities
- Problem
- Solution
- Regular expression
- Replace matches with their corresponding literal characters
- Example JavaScript solution
- Discussion
- See Also
- 9.7. Find a Specific Attribute in XML-Style Tags
- Problem
- Solution
- Tags that contain an id attribute (quick and dirty)
- Tags that contain an id attribute (more reliable)
- <div> tags that contain an id attribute
- Tags that contain an id attribute with the value my-id
- Tags that contain my-class within their class attribute value
- Discussion
- See Also
- 9.8. Add a cellspacing Attribute to <table> Tags That Do Not Already Include It
- Problem
- Solution
- Solution 1, simplistic
- Solution 2, more reliable
- Insert the new attribute
- Discussion
- See Also
- 9.9. Remove XML-Style Comments
- Problem
- Solution
- Discussion
- How it works
- When comments cant be removed
- Variations
- Find valid XML comments
- Find valid HTML comments
- See Also
- 9.10. Find Words Within XML-Style Comments
- Problem
- Solution
- Two-step approach
- Single-step approach
- Discussion
- Two-step approach
- Single-step approach
- Variations
- See Also
- 9.11. Change the Delimiter Used in CSV Files
- Problem
- Solution
- Example web page with JavaScript
- Discussion
- See Also
- 9.12. Extract CSV Fields from a Specific Column
- Problem
- Solution
- Example web page with JavaScript
- Discussion
- Variations
- Match a CSV record and capture the field in column 1 to backreference 1
- Match a CSV record and capture the field in column 2 to backreference 1
- Match a CSV record and capture the field in column 3 or higher to backreference 1
- Replacement string
- See Also
- 9.13. Match INI Section Headers
- Problem
- Solution
- Discussion
- Variations
- See Also
- 9.14. Match INI Section Blocks
- Problem
- Solution
- Discussion
- See Also
- 9.15. Match INI Name-Value Pairs
- Problem
- Solution
- Discussion
- See Also
- Index
- About the Authors
- Colophon
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Copyright
O'Reilly Media - inne książki
-
Software as a service (SaaS) is on the path to becoming the de facto model for building, delivering, and operating software solutions. Adopting a multi-tenant SaaS model requires builders to take on a broad range of new architecture, implementation, and operational challenges. How data is partiti...(237.15 zł najniższa cena z 30 dni)
245.65 zł
289.00 zł(-15%) -
Great engineers don't necessarily make great leaders—at least, not without a lot of work. Finding your path to becoming a strong leader is often fraught with challenges. It's not easy to figure out how to be strategic, successful, and considerate while also being firm. Whether you're on the...(118.15 zł najniższa cena z 30 dni)
126.65 zł
149.00 zł(-15%) -
Data science happens in code. The ability to write reproducible, robust, scaleable code is key to a data science project's success—and is absolutely essential for those working with production code. This practical book bridges the gap between data science and software engineering,and clearl...(211.65 zł najniższa cena z 30 dni)
220.15 zł
259.00 zł(-15%) -
With the massive adoption of microservices, operators and developers face far more complexity in their applications today. Service meshes can help you manage this problem by providing a unified control plane to secure, manage, and monitor your entire network. This practical guide shows you how th...(194.65 zł najniższa cena z 30 dni)
211.65 zł
249.00 zł(-15%) -
Get practical advice on how to leverage AI development tools for all stages of code creation, including requirements, planning, design, coding, debugging, testing, and documentation. With this book, beginners and experienced developers alike will learn how to use a wide range of tools, from gener...(164.25 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
Rust's popularity is growing, due in part to features like memory safety, type safety, and thread safety. But these same elements can also make learning Rust a challenge, even for experienced programmers. This practical guide helps you make the transition to writing idiomatic Rust—while als...(164.25 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
Advance your Power BI skills by adding AI to your repertoire at a practice level. With this practical book, business-oriented software engineers and developers will learn the terminologies, practices, and strategy necessary to successfully incorporate AI into your business intelligence estate. Je...(211.65 zł najniższa cena z 30 dni)
220.15 zł
259.00 zł(-15%) -
Microservices can be a very effective approach for delivering value to your organization and to your customers. If you get them right, microservices help you to move fast by making changes to small parts of your system hundreds of times a day. But if you get them wrong, microservices will just ma...(203.15 zł najniższa cena z 30 dni)
211.65 zł
249.00 zł(-15%) -
JavaScript gives web developers great power to create rich interactive browser experiences, and much of that power is provided by the browser itself. Modern web APIs enable web-based applications to come to life like never before, supporting actions that once required browser plug-ins. Some are s...(186.15 zł najniższa cena z 30 dni)
186.15 zł
219.00 zł(-15%) -
How will software development and operations have to change to meet the sustainability and green needs of the planet? And what does that imply for development organizations? In this eye-opening book, sustainable software advocates Anne Currie, Sarah Hsu, and Sara Bergman provide a unique overview...(169.14 zł najniższa cena z 30 dni)
177.65 zł
209.00 zł(-15%)
Dzieki opcji "Druk na żądanie" do sprzedaży wracają tytuły Grupy Helion, które cieszyły sie dużym zainteresowaniem, a których nakład został wyprzedany.
Dla naszych Czytelników wydrukowaliśmy dodatkową pulę egzemplarzy w technice druku cyfrowego.
Co powinieneś wiedzieć o usłudze "Druk na żądanie":
- usługa obejmuje tylko widoczną poniżej listę tytułów, którą na bieżąco aktualizujemy;
- cena książki może być wyższa od początkowej ceny detalicznej, co jest spowodowane kosztami druku cyfrowego (wyższymi niż koszty tradycyjnego druku offsetowego). Obowiązująca cena jest zawsze podawana na stronie WWW książki;
- zawartość książki wraz z dodatkami (płyta CD, DVD) odpowiada jej pierwotnemu wydaniu i jest w pełni komplementarna;
- usługa nie obejmuje książek w kolorze.
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.
Książka, którą chcesz zamówić pochodzi z końcówki nakładu. Oznacza to, że mogą się pojawić drobne defekty (otarcia, rysy, zagięcia).
Co powinieneś wiedzieć o usłudze "Końcówka nakładu":
- usługa obejmuje tylko książki oznaczone tagiem "Końcówka nakładu";
- wady o których mowa powyżej nie podlegają reklamacji;
Masz pytanie o konkretny tytuł? Napisz do nas: sklep[at]helion.pl.
Książka drukowana
Oceny i opinie klientów: Regular Expressions Cookbook. Detailed Solutions in Eight Programming Languages. 2nd Edition Jan Goyvaerts, Steven Levithan (0) Weryfikacja opinii następuję na podstawie historii zamówień na koncie Użytkownika umieszczającego opinię. Użytkownik mógł otrzymać punkty za opublikowanie opinii uprawniające do uzyskania rabatu w ramach Programu Punktowego.