Regular Expressions and file formatting

Source: Internet
Author: User
Regular Expressions and file formatting

A regular expression is used to [Search/replace/delete] one or more strings by arranging special characters in a column. In short, a regular expression is an expression used for string processing.

Common grep commands for Regular Expressions

Grep: searches for strings in the data and retrieves them in an integer unit.

 

 

Grep is a powerful string processing tool with many parameter settings and usage,

You can read more books p350

The ^ symbol is different from the inside and outside of the character set ([]). In [], it indicates "reverse selection". In [], it indicates the meaning of locating the beginning of a row.

 

1. Use brackets [] to search for collection characters

2. start and end of a line ^ $

3. Any character. Repeated characters *

4. Limit the continuous re character range {}

Summary of special characters in Regular Expressions:

 

 

 

Sed Tool

Sed: analyzes standard input data and replaces, adds, deletes, and retrieves data.

 

File formatting and Processing

Printf: easy-to-use data display tool for formatting and Printing

Awk: An easy-to-use data processing tool

File comparison tools: diff, CMP, patch

PR: file Printing

 

Important Review

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.