Function strings with A OR B OR C ?

Find, replace, find in files, replace in files, regular expressions

Function strings with A OR B OR C ?

Postby Vorpal » Fri Mar 24, 2006 10:05 pm

Hi all,
I want to do a regular expression that find any one of 3 words.

Specifically, I want to find:
Property, Sub or Function

This is so I can have the function list include the Property functions of a class

In my wordfile, I currently have:

/Function String = "^{Sub^}^{Function^} [',a-z,A-Z,0-9,_, ,(,)]+$"

The best I've been able to do on my own is:
/Function String = "%[ ^t]++[FPS][ur][nobi][a-z]++ [',a-z,A-Z,0-9,_, ,(,)]+$"

besides being extremely obscure, I must include a comment after every private variable declaration with an illegal character in it (I use =) so those variable declarations don't get confused w/ comments


Is there any way to do something akin to:
"^{Sub^}^{Function^} ^{Property^}

Regards,
Vorpal
User avatar
Vorpal
Newbie
 
Posts: 4
Joined: Fri Mar 24, 2006 12:00 am

Re: Function strings with A OR B OR C ?

Postby mjcarman » Sat Mar 25, 2006 3:16 pm

You can define up to six function strings in the wordfile.

Code: Select all
/Function String = ...
/Function String 1 = ...
...
/Function String 5 = ...


Unless you've already used the other five, it would be simplest (and clearest) to define multiple rules instead of forcing everything into one.
User avatar
mjcarman
Power User
Power User
 
Posts: 123
Joined: Thu Feb 10, 2005 12:00 am


Return to Find/Replace/Regular Expressions