This is a follow-up to a previous question. I have a string “Test 999-99-9”, how would I match on everything except the last -9 part? Keep in mind, the last -9 may or may not be there, but if it is, I want to ignore it and match on the rest of the string. Any suggestions?
Alternatively, if it ignored the entire 999-99-9 or 999-99 part, and just returned the “Test” part, that would be fine, too. It seems like that may be easier to do. I basically want to take the following expression and invert it to return the other half of the string: (\d{3}-\d{2}|\d{3}-\d{2}-\d{1})$
RegEx to ignore 999-99-9 and just return “Test” part:
OCR Software supports groups:
http://www.laserfiche.com/NewsPortal/Article/2012/05/21/tech-tip-pattern-matching-with-regular-expressions