Steven Vona
asked on
Regular expression to find illegal ipv6 information
I do not know bash, but I am familiar with regex in perl. I need a command like regex to find the following things within a bunch of text files:
1) domain.com without a trailing dot. So the text files should have domain.com. in them but should NOT have domain.com (without trailing dot). So I need to find any domain.com without the trailing dot.
2) I need to find any ipv6 reverse record node that is not formed correctly. If it is formed correctly it will have 16 hex digitals seperated by a dot. (ex. 1.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0)
I would like to simply run grep -regex- * if possible.
Thanks
1) domain.com without a trailing dot. So the text files should have domain.com. in them but should NOT have domain.com (without trailing dot). So I need to find any domain.com without the trailing dot.
2) I need to find any ipv6 reverse record node that is not formed correctly. If it is formed correctly it will have 16 hex digitals seperated by a dot. (ex. 1.0.0.0.0.0.0.0.0.0.0.0.0.
I would like to simply run grep -regex- * if possible.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
2) You'll need to give some details as to what counts as being "not formed correctly" - if there's a line in a file containing "hello", do you want that picked up because you were expecting 1.0.0.0.0.0.0.0.0.0.0.0.0. 0.0.0 instead? Or must there be, say, at least 10 . characters on the line before attention is paid to it?
ASKER
This question can be deleted.
I believe I gave a correct answer to at least the first part of question, so in my view, points should be awarded.
ASKER
I would agree with you if every domain was domain.com. unfortunately there are hundreds of domains non of which are domain.com. your regex would return none.