{"id":1804,"date":"2022-03-02T17:06:15","date_gmt":"2022-03-02T11:36:15","guid":{"rendered":"https:\/\/smarttech101.com\/?p=1804"},"modified":"2022-03-04T06:50:20","modified_gmt":"2022-03-04T01:20:20","slug":"regular-expression-regex-and-regexp-in-linux-ft-grep","status":"publish","type":"post","link":"https:\/\/smarttech101.com\/regular-expression-regex-and-regexp-in-linux-ft-grep\/","title":{"rendered":"Regular Expression (Regex, and Regexp) in Linux Ft. Grep"},"content":{"rendered":"\n

A regular expression (also known as regex, and regexp) is a sequence of characters used by various programming languages such as python, Linux tools such as grep, awk, sed, etc. to match one or more strings. <\/p>\n\n\n\n

For instance, the regex “R.*x<\/code>” matches with strings “Regex<\/code>“, and “Regular Expression in Linux<\/code>“, etc.<\/p>\n\n\n\n

Despite being super useful, there is not a single standard that is followed everywhere. For example, we have GNU Regex, POSIX Regex, Perl Regex, etc.<\/p>\n\n\n\n

However, there are very few variations across these standards. For instance, sed<\/code> in Linux and Mac OS follow standards slightly different from each other. Here, in this article, I will be focusing mainly on the GNU Regex<\/strong> using grep command in Linux<\/a>. At the same time, I will also be mentioning these variations which come to my mind.<\/p>\n\n\n\n

Table of Contents<\/h2>\n\n\n\n