On 07/03/09 08:24, Matt Wozniski wrote:
> 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
To match for lines containing anything except lowercase letters, you
could try
syntax match myString /^[^[:lower:]]*\C$/
hi def link myString String
Best regards,
Tony.
--
Clarke's Third Law:
Any sufficiently advanced technology is indistinguishable from
magic.
G's Third Law:
In spite of all evidence to the contrary, the entire universe
is composed of only two basic substances: magic and bullshit.
H's Dictum:
There is no magic ...
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---