Hi all,
I'm getting strange kind of spam, where the email body only contains this:
4606142 5801100 2704743
How can I grep this with regex?
It's 3x7 numbers, separated with space.
thx
Hi all,
I'm getting strange kind of spam, where the email body only contains this:
4606142 5801100 2704743
How can I grep this with regex?
It's 3x7 numbers, separated with space.
thx
Try this
(\d{7} ?){3}
or, if that whitespace makes a difference (just like Al said in comments)
(\d{7} ){2}\d{7}
Try this
[0-9]{7}\s[0-9]{7}\s[0-9]{7}
[0-9]{7}: 7 occurences of the characters '0' to '9'
\s: whitespace character
You might want to capture arbitrary combinations of digits and whitespace:
^[\d\s]*$
Would this do? (\d{1,7}\s{0,})+
The reason I conclude the \s
with a quantifier is it will fail when it reaches the end of the line where the last character after that may not be a space but a carriage return.
Hope this helps, Best regards, Tom.