I am trying to extract a mime type from a Base64 string… Regex is giving me a nose bleed.
Here’s how it looks:
data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQEBw7KCIoOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O
I’d like to extract the image/jpeg which can, of course be different mime types…
So it makes sense to me to construct a regex expression that grabs anything between the : and the ; but I haven’t been able to make it work.
Any regex pros here? Or someone else with a better idea?