Grep: Difference between revisions
From Andreida
(Created page with "It depends on your linux/grep, how you have to build your regular expressions. Search for letter/digit combinations of a certain length: <pre> grep -oe 'alnum:\{17\}' m...") |
No edit summary |
||
Line 1: | Line 1: | ||
It depends on your linux/grep, how you have to build your regular expressions. |
It depends on your linux/grep, how you have to build your regular expressions. |
||
Search for letter/digit combinations of a certain length |
=== Search for letter/digit combinations of a certain length === |
||
<pre> |
<pre> |
||
grep -oe '[[:alnum:]]\{17\}' my_data.txt |
grep -oe '[[:alnum:]]\{17\}' my_data.txt |
||
</pre> |
</pre> |
||
=== E-Mail addresses === |
|||
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" rejectlog* | sort -u |
Latest revision as of 16:11, 20 March 2021
It depends on your linux/grep, how you have to build your regular expressions.
Search for letter/digit combinations of a certain length
grep -oe '[[:alnum:]]\{17\}' my_data.txt
E-Mail addresses
grep -E -o "\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}\b" rejectlog* | sort -u