Jump to content
Storyist Forums

Booleans and Variables in Find/Change function.


Steve E

Recommended Posts

By search variables, do you mean wildcards?

 

IF

By "search variables" I mean symbols that can stand in for any element of a pre-defined domain (i.e., a variable), which, in this case we will use for searching. But yes, Isaac, I do believe some folk call them "wildcards". (Yep. I'm sure I heard that somewhere.) Wildcards with ranges and a multiplier would be ideal. Eg. 3(a-c,t) yields CAT, CAB and so forth. C+T yielding CAT or COT but not COAT. CA*T yielding CAT or CARROT. 1+9(#) yields a one followed by exactly nine digits. I'd also like variables for punctuation. But I think you know where I'm coming from.

 

-√Thoth

Link to comment
Share on other sites

By "search variables" I mean symbols that can stand in for any element of a pre-defined domain (i.e., a variable), which, in this case we will use for searching. But yes, Isaac, I do believe some folk call them "wildcards". (Yep. I'm sure I heard that somewhere.) Wildcards with ranges and a multiplier would be ideal. Eg. 3(a-c,t) yields CAT, CAB and so forth. C+T yielding CAT or COT but not COAT. CA*T yielding CAT or CARROT. 1+9(#) yields a one followed by exactly nine digits. I'd also like variables for punctuation. But I think you know where I'm coming from.

 

The name wildcard is the correct technical term and comes from card games. Think, "Jokers wild." It is the any card. Variable has a different meaning in the context of searching for developers. The most common wildcard symbols are "*", which represents any number of characters, and "?", which represents a single character.

 

For what you describe for ranged searches, "3(a-c,t)", is usually accomplished with regular expressions (regex), which I think Steve and I talked about adding over a year ago, but I don't think it made it in. In Posix regex, your search there would look something like this:

 

[a-c,t]{3,3}.

 

Ugly, huh? The stuff in brackets is obviously your character range, and the numbers in braces represent the "minimum,maximum" number of characters to match.

 

Finally, variables appear in regular expressions (which is probably why your original request confused me a bit), and can be quite useful for pattern matches. You can specify something like:

 

(the|a|an|these) \1

 

This searches for double instances of any of the words in parenthesis. The "\1" is a variable that expands to what ever word was matched in the parenthesis.

 

Regular expressions are one of the more evil realms of software development (and one of my favorite), and definitely not for everyone. The wildcard request doesn't sound too bad, though. Of course, it's up to Steve.

 

IF

Link to comment
Share on other sites

The name wildcard is...blah blah blah...

Potaytoes, potahtoes. As I've mentioned elsewhere, I'm not a developer. My definition of variable stands inviolable.

 

The wildcard request doesn't sound too bad, though.

Thank you. Your approval means everything to me.

 

Of course, it's up to Steve.

Obviously.

 

-Thoth.

Link to comment
Share on other sites

Potaytoes, potahtoes. As I've mentioned elsewhere, I'm not a developer. My definition of variable stands inviolable.

 

Should I mention that wildcard is the correct term for both Windows and OS X (and Linux and BSD and Solaris, etc.) for matching file names and resources?

 

Nyah, nyah.

 

IF

Link to comment
Share on other sites

Should I mention that wildcard is the correct term for both Windows and OS X (and Linux and BSD and Solaris, etc.) for matching file names and resources?

Nyah, nyah.

No. You shouldn't. Even assuming all five have more in common than just *. We're not talking OS file name searches, we're talking WP file content searches. A different and more complex issue.

 

Nyah, nyah, back atcha.

 

Inviolable dammit,

-Thoth.

 

BTW: I'm glad we're not paying for the forum's disk space.

BTWjr: I looked over your Search Enhancements thread from 5/5/07. You might want to look at it again yourself.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...