© Zsolt Nagy 2018
Zsolt NagyRegex Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-3876-9_7

7. Substring Extraction from Regular Expressions

Zsolt Nagy1 
(1)
Berlin, Germany
 
You read about many different use cases of regular expressions in Chapter 1. Let me repeat some of these use cases:
  • To test whether a string matches a search expression

  • To find some characters in a string

  • To replace substrings in a string matching a regex

  • To process and format user input

  • To extract information from server logs, configuration files, and text files

  • To validate input in web applications and in the terminal

Many of the use cases require that we find a substring of a string and extract it, reorder it, remove it, or replace it.

Regular expressions provide us with some ...

Get Regex Quick Syntax Reference: Understanding and Using Regular Expressions now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.