DEV Community

macnux
macnux

Posted on

2

Regular expressions Tutorial For Linux

In order to successfully work with the Linux sed editor and the awk command in your shell scripts, you have to understand regular expressions or in short regex. Since there are many engines for regex, we will use the shell regex and see the bash power in working with regex.

First, we need to understand what regex is, then we will see how to use it.

1 What is regex
2 Types of regex
3 Define BRE Patterns
4 Special Characters
5 Anchor Characters
6 The dot Character
7 Character Classes
8 Negating Character Classes
9 Using Ranges
10 Special Character Classes
11 The Asterisk
12 Extended Regular Expressions
12.1 The question mark
12.2 The Plus Sign
12.3 Curly Braces
12.4 Pipe Symbol
13 Grouping Expressions
14 Practical examples
14.1 Counting Directory Files
14.2 Validating E-mail Address

https://likegeeks.com/regex-tutorial-linux/

Hope you like it.

Regards,

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs