Adapt Kindle Fire regex changes by dmolsen from main branch