40 likes | 164 Views
Dive into the world of Regular Expressions (RegEx) with Susan Lukose’s comprehensive guide tailored for sed and awk users. This introduction covers essential concepts such as matching text patterns with precision, utilizing quantifiers to specify exact match conditions, and grouping with parentheses for complex searches. Learn to define character classes for flexible matching and how to negate matches effectively. Gain insights into using special characters and the importance of syntax in RegEx. Perfect for beginners aiming to enhance their text-processing skills.
E N D
Introduction to Regular Expression for sed & awk by Susan Lukose
Regular Expression • Regular Expression way to match text with patterns
Regular Expression • {n} Match exactly n times {n,} Match at least n times {n,m} Match at least n but not more than m times
Regular Expression • Grouping could be done with () • (ab) • gg(ab)*gg • Class could be specified [] • [abc] Match any of a, b, and c. • [a-z] Match any character between a and z. (ASCII order) • [^abc] A caret ^ at the beginning indicates "not". In this case, match anything other than a, b, or c. • regular expression should be specified between // • Special characters like ^, $, . etc.. Could be matched by escaping with \