Function List for all lines that DONT have a character

Syntax highlighting, code folding, brace matching, code indenting, and function list

Function List for all lines that DONT have a character

Postby neisenbe » Tue Jan 18, 2005 5:56 pm

Hi!

I'm creating a simple wordfile section for CSS files. I want the function list to show any line that starts with a "." AND any lines that are not blank and DO NOT contain a colon.

I got the "." part, using
/Function String = "%.*"

but can't figure out the DOES NOT have a ":" part :? . Any ideas appreciated.

Thanx,
Nathan
User avatar
neisenbe
Newbie
 
Posts: 4
Joined: Tue Jan 18, 2005 12:00 am
Location: Montvale, NJ

Re: Function List for all lines that DONT have a character

Postby Mofi » Wed Jan 19, 2005 2:28 am

Try this: %.[~:^r^n]+$
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4055
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Function List for all lines that DONT have a character

Postby neisenbe » Wed Jan 19, 2005 10:24 am

Thanks for the quick response.

I modified my codes to this:
/Function String = "%.*"
/Function String 1 = "%[~:{}]+$"


I took the period out of the 2nd string since the lines I want are those that start with a period - w/or w/out colons and those without colons - whether they start with a period or not. I added the curly brackets to the NOT list.

This mostly works except for 2 things that show in the Function List that I DO NOT want:
:arrow: If the line is blank, it shows in the Function list. This would need a test for at least one char on the line
:arrow: If the line is a comment - noted by /* */ as Block Comment tags - it shows

To resolve item 2, I think a test to see that the first char on the line is ALPHA like [a-zA-Z] would work. My problem is that I'm not sure how to incorporate this test AND a test for at least one non blank in the above expressions.

Thanks,
Nathan
User avatar
neisenbe
Newbie
 
Posts: 4
Joined: Tue Jan 18, 2005 12:00 am
Location: Montvale, NJ

Re: Function List for all lines that DONT have a character

Postby neisenbe » Wed Jan 19, 2005 11:58 am

I played around with this a little and these seem to work pretty well for my purposes :D:

/Function String = "%.*"
/Function String 1 = "%[a-zA-Z]+[~:{}]+$"


Nathan
User avatar
neisenbe
Newbie
 
Posts: 4
Joined: Tue Jan 18, 2005 12:00 am
Location: Montvale, NJ

Re: Function List for all lines that DONT have a character

Postby Manni » Thu Jan 20, 2005 4:32 am

For what it's worth, here is my (admittedly quite complex) function string for CSS files. It works on any css file I come across.


Code: Select all
/Function String = "%[#.]++[ ^t]++^([a-z,A-Z,0-9>^-:_.^[^]*#=" ]+^)[^t ]++[^p]++[ ^t]++{"
User avatar
Manni
Advanced User
Advanced User
 
Posts: 58
Joined: Thu Jul 15, 2004 11:00 pm
Location: Europe

Re: Function List for all lines that DONT have a character

Postby neisenbe » Thu Jan 20, 2005 11:36 am

Thanks Manni.

Even though just looking at the string gave me a headache, it IS very effective and caught some of my styles that my strings missed. Very impressive.

I just have to go over your string to see what part does what.

Appreciate your help,
Nathan
User avatar
neisenbe
Newbie
 
Posts: 4
Joined: Tue Jan 18, 2005 12:00 am
Location: Montvale, NJ

Re: Function List for all lines that DONT have a character

Postby Manni » Thu Jan 20, 2005 11:46 am

No problem, Nathan.

Just don't think that I understand this beast. I spent one evening coming up with it a couple of month ago and I'm happy that he has kept on working since then. Should it ever need a change, I'm afraid I would have to start from scratch :-(


Manni
User avatar
Manni
Advanced User
Advanced User
 
Posts: 58
Joined: Thu Jul 15, 2004 11:00 pm
Location: Europe


Return to Syntax Highlighting