Take the 2-minute tour ×
Graphic Design Stack Exchange is a question and answer site for professional graphic designers and non-designers trying to do their own graphic design. It's 100% free, no registration required.

I have a bulleted list with several entries, it's a list of keyboard shortcuts, similar to the text below:

  • alt+shift+ctrl+2 = Lock Others
  • alt+shift+ctrl+3 = Hide Others
  • alt+ctrl+b = Blend

I want to select all the text between the bullet and the equals symbol, no matter how many characters. Thought this:

(?<=•).+?(?=\=)

would work, but no luck.

share|improve this question
    
Are the bullet characters in the actual text, or are they added via a bullets and numbering paragraph style? If it's the latter, I seem to remember trying something similar and being frustrated that the added characters weren't included in the GREP as if they weren't part of the paragraph (or maybe they were included - either way, it wasn't what I wanted...). –  user568458 Jul 12 '13 at 12:35
add comment

3 Answers

Well, non of the above seemed to work, likely due to how InDesign does bullets, but this

^(.*)(?=\=)

seemed to work for what I needed. Thanks for helping though!

share|improve this answer
    
Note that that will match anything with an equals sign, so be careful. I found a reference that says inDesign uses ~8 as a metacharacter for regular expressions. –  horatio Apr 12 '13 at 17:17
add comment

If you used e.g. a hyphen as the bullet, the expression would probably match as you desire. The bullet is a unicode (hex U+2022) or Ansi (149; hex 95), so try replacing the bullet glyph with \x{95} in your regular expression.

EDIT:

http://help.adobe.com/en_US/indesign/cs/using/WSFB3603CC-8D84-48d8-9F77-F3E0644CB0B6a.html

I see that the bullet is ~8 when working with regular expressions.

share|improve this answer
add comment

If you use tabs for the spaces, this would work:

\t(\s|.*)\t

It would include the first tab, followed by all characters until the next tab.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.