On Fri, Mar 6, 2009 at 11:28 PM, Rick Dooling wrote: > > I'm no regex or pattern expert and I can't seem to get this matching > correctly. > > I'd like to have any line containing all UPPER CASE letters, spaces, > and punctuation to appear in a certain color. The highlighting works > fine, but my pattern is erratic and incomplete, I think. > > I can't seem to get the + or * work in the starting pattern. Nor can I > specify something like [^a-z] > > The closest I've come is something like: > > :syntax region String start="^[A-Z][A-Z\s]" end="[A-Z\.][A-Z\?\):\s]* > $" oneline
You can't include \s in a character class in vim's regex language, but you can use [:blank:] instead for the same effect. > If somebody could suggest the one true pattern, I would really > appreciate it. :syn match myString /^[A-Z[:blank:]]*$/ should do the trick. Note that I'm using 'match' instead of 'region', since you're looking for one particular pattern - not some set of markers around other text. ~Matt --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_use" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
