Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 142955

Re: GREP #123456 or #123456-78

$
0
0

If you want to include the # sign I would use #\d{6}(-\d{2})*(?=\s) which is a little more compact (the numbers in {} tell how many you need to match, the (-\d{2})* says it should match the # plus six digits and the dash plus two more if they are there, but they don't need to be, and the (?=\s) says whatever is matched needs to be followed by some sort of whitespace which prevents matches to other odd strings that are part of a longer string. You can add a lookbehind for whitespace as well as long as your # sign isn't the first character in the story. In that case there would be no whitespace before and there would be no match for the first number.

 

Best reference for GREP I know is GREP in InDesign - O'Reilly Media


Viewing all articles
Browse latest Browse all 142955

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>