change substring search to regex