Re pattern fix and option/value delimiter fix

patterns have been modified to match the first occurrence of '=' or ':' rather than the last. 
spaces around the '=' while writing back have been removed as some packages have issues with spaces.