in reply to Re: REGEX Help
in thread REGEX Help

Your first regex only works in this case because of the quirk in the data that "3.1mp" happens to be at the end of the string. The greediness of (.+) causes it to actually remove the last "mp" in the string, regardless of its context. This also means that if the model is just "3.1" instead of "3.1mp", it will remove the "mp" in "Olympus".

The second regex is more reliable, but would get false positives if they released a line of cameras with "Super Duper T101x Zoominess(tm)", turning it into "Super Duper Tiness(tm)". It also leaves two consecutive spaces when removing a zoom specification. (Both of these can be fixed by adding a space at the beginning of the regex.)