regexp matching simplified to permit more replaces.