• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Regex match until a comma

suklee

Diamond Member
I have a SQL dump of content, and I'm trying to fix these links to image popups.

I am using Textmate and figured regex would be the best way.

Basically I want to change this:

jpg&title=o2_xda_atom_crystal_case.jpg&mode=basic&imgwidth=320&imgheight=480&print=0&save=0\',\'Popup

into this:

jpg\',\'Popup

How can I quickly match everything from "jpg" until I get to a \', ?
 
Ah, I see, you didn't want the jpg in the match, is that the problem?

(?<=jpg).*(?=\\')

Should match 0 or more characters, but as few as possible, that are proceeded by jpg and followed by \'
 
Back
Top