I want to parse out each modified file that is reported during FCIV’s verification process.
It comes out like this:
“Microsoft Windows XP [Version 5.1.2600]\r\n(C) Copyright 1985-2001 Microsoft Corp.\r\n\r\nC:\MD5Checksum>C:\MD5Checksum\fciv.exe -v -xml db.xml\r\n//\r\n// File Checksum Integrity Verifier version 2.05.\r\n//\r\nStarting checksums verification : 09/10/2009 at 11h19’30\r\r\n\r\r\nList of modified files:\r\r\n———————–\r\r\nc:\md5checksum\readme.txt \r\r\n\tHash is\t\t: e2c6d562bd35352b73c00a744e9c07c6\r\r\n\tIt should be\t: 79ac8d043dc8739f661c45cc33fc07ac\r\r\n\r\nc:\md5checksum\fciv.exe \r\r\n\tHash is\t\t: 79ac8d043dc8739f661c45cc33fc07ac\r\r\n\tIt should be\t: e2c6d562bd35352b73c00a744e9c07c6\r\r\n\r\n\r\r\nEnd Verification : 09/10/2009 at 11h19’30\r\r\n\r\r\n\r\nC:\MD5Checksum>”
Right now I’m using this as the Regex (which works fine), but I’m wondering if there is a simpler way?
".*(\r\r\n\t)(Hash)( )(is)[\t]{2}(:)( )[a-zA-Z0-9]{32}(\r\r\n\t)(It)( )(should)( )(be)[\t](:)( )[a-zA-Z0-9]{32}"
I suggest you to try this:
First, you don’t need to “(..)” or “[…]” one every token.
Second, since I don’t think you care about “Here is” or “It should be”, you can simply look for “:” just before the number you are looking.
I really hope this help.