Text Processing with JavaScript

Saved in:
Bibliographic Details
Main Author: Kelhini, Faraz K
Format: eBook
Language:English
Published: La Vergne Pragmatic Programmers, LLC, The 2024
Edition:1
ISBN:9798888650332
Online Access:Get full text
Tags: Add Tag
No Tags, Be the first to tag this record!
Table of Contents:
  • Cover -- Table of Contents -- Acknowledgments -- Preface -- Who Is This Book For? -- What You Should Know -- What's in This Book? -- Online Resources -- 1. Part I: Text Processing with Built-in JavaScript Methods -- Recipe 1. Determining If a Value Is a String with the typeof Operator -- Recipe 2. Checking a String for Specific Words with includes() -- Recipe 3. Matching the Beginning or End of a String with startsWith() and endsWith() -- Recipe 4. Extracting Lists from Text with slice() -- Recipe 5. Converting Color Names to Hexadecimal Values with the Canvas Element -- Recipe 6. Adding Transparency to Hex Colors -- Recipe 7. Removing HTML Tags from Text with DOMParser() -- Recipe 8. Converting HTML Markup to HTML Entities with replaceAll() -- Recipe 9. Intersecting HTML Tables with filter() -- Recipe 10. Generating HTML Tables from an Array of Arrays -- Recipe 11. Generating HTML Tables from an Array of Objects -- Recipe 12. Displaying Tabular Data in Console with console.table() -- Recipe 13. Formatting Dates with Intl.DateTimeFormat() -- Recipe 14. Formatting Currencies with Intl.NumberFormat() -- Recipe 15. Adding Thousand Separators to Numbers with Intl.NumberFormat() -- Recipe 16. Creating Language-Sensitive Lists with Intl.ListFormat() -- Recipe 17. Determining Letter Case with charAt() -- Recipe 18. Counting Unicode Characters with Intl.Segmenter() -- Recipe 19. Counting Words in a String with Intl.Segmenter() -- Recipe 20. Counting the Number of a Specific Word with split() -- Recipe 21. Equalizing Incompatible Characters with normalize() -- Recipe 22. Copying Text to Clipboard with the Clipboard API -- 2. Part II: Text Processing with Regular Expressions -- Recipe 23. Creating Your First Regular Expression -- Recipe 24. Asserting the Start or End of a String with ^ and
  • Recipe 25. Looking For Whole Words Only with the Word Boundary (\b) -- Recipe 26. Matching One of Several Alternatives with the Vertical Bar (|) -- Recipe 27. Matching One of Several Characters with the Character Class -- Recipe 28. Matching a Range of Characters with Character Classes -- Recipe 29. Repeating Part of a Regex with Quantifiers -- Recipe 30. Treating Multiple Characters as a Single Unit with the Capturing Group -- Recipe 31. Extracting a Matched Value with the Capturing Group -- Recipe 32. Excluding Groups from Result with the Non-capturing Group -- Recipe 33. Reading Groups with Ease Using Named Capturing Groups -- Recipe 34. Using Special Replacement Patterns -- Recipe 35. Taking Away the Special Meaning of Replacement Patterns -- Recipe 36. Using a Function as the Replacement Pattern -- Recipe 37. Escaping Metacharacters with the Backslash -- Recipe 38. Creating Lazy Quantifiers with the Question Mark -- Recipe 39. Global and Case-Insensitive Matching with the g and i Flags -- Recipe 40. Generating Indices for Matches with the d Flag -- Recipe 41. Forcing ^ and to Match at the Start and End of a Line with the m Flag -- Recipe 42. Forcing . to Match Newline Characters with the s Flag -- Recipe 43. Enabling Unicode Features with the u Flag -- Recipe 44. Searching from a Specific Index with the y Flag -- Recipe 45. Modifying an Existing Regex Literal -- Recipe 46. Referencing a Matched String with the Backreference -- Recipe 47. Testing a Pattern with the Positive Lookahead -- Recipe 48. Testing a Pattern with the Negative Lookahead -- Recipe 49. Testing a Pattern with the Positive Lookbehind -- Recipe 50. Testing a Pattern with the Negative Lookbehind -- Recipe 51. Matching Non-ASCII Numerals with the Unicode Property Escape -- Recipe 52. Matching Non-ASCII Words with the Unicode Property Escape
  • V - -- - W - -- - X - -- - Y - -- - Z -
  • Recipe 53. Matching Unicode Word Boundaries with the Unicode Property Escape -- 3. Part III: Mastering Text Processing in JavaScript -- Recipe 54. Validating Email Addresses -- Recipe 55. Validating Password Strength -- Recipe 56. Validating Social Security Numbers -- Recipe 57. Validating ZIP Codes -- Recipe 58. Validating Canadian Postal Codes -- Recipe 59. Removing Duplicate Lines -- Recipe 60. Removing Duplicate Lines Separated by Other Lines -- Recipe 61. Removing Duplicate Spaces -- Recipe 62. Removing Duplicate Whitespaces -- Recipe 63. Replacing Duplicate Whitespaces with the Same Type -- Recipe 64. Extracting Text Enclosed in Double Quotes -- Recipe 65. Extracting Text Enclosed in Single Quotes -- Recipe 66. Escaping a String for Use in a Regex -- Recipe 67. Striping Invalid Characters from Filenames -- Recipe 68. Matching Floating-Point Numbers -- Recipe 69. Matching Formatted Numbers with Thousand Separators -- Recipe 70. Matching Nearby Words -- Recipe 71. Highlighting Sentences Containing a Specific Word -- Recipe 72. Highlighting Text in Real Time -- Recipe 73. Converting Plain Text into HTML-Ready Markup -- Wrapping Up -- May I Request a Favor from You? -- A1. What Is Unicode? -- A2. Implementing Regex in JavaScript -- test() -- exec() -- match() -- matchAll() -- search() -- replace() -- replaceAll() -- split() -- Conclusion -- A3. Testing Regex with Specialized Tools -- RegexPal -- RegExr -- Regex101 -- RegexBuddy -- Regex Vis -- A4. Regular Expression Cheat Sheet -- Character Classes -- Quantifiers -- Boundary Assertions -- Lookaround Assertions -- Groups and Backreferences -- Flags -- Unicode Property Escapes -- Index -- - SYMBOLS - -- - DIGITS - -- - A - -- - B - -- - C - -- - D - -- - E - -- - F - -- - G - -- - H - -- - I - -- - J - -- - K - -- - L - -- - M - -- - N - -- - O - -- - P - -- - Q - -- - R - -- - S - -- - T - -- - U -