Take the 2-minute tour ×
User Experience Stack Exchange is a question and answer site for user experience researchers and experts. It's 100% free, no registration required.

I have an application that presents a list of items and multiple filtering criteria.

Some of the filtering criteria take a string value for the filter, and the application currently supports basic wildcarding (* for anything, ? for any single character within a search term).

I've been asked to provide two changes to the syntax/capabilities for all fields that take a string:

  • Allow searching for reserved characters (treat ? as a ? rather than as a wildcarded character, same for *: have some way to treat it as an asterisk instead of a wildcard.

  • Support basic 'Or' functionality specified within the search term. That is, match it if the value is 'String A' or 'String B'

I was considering wrapping the string in quotes for treating it as a literal.

e.g. "Question?" would only match 'Question?' but not 'Questions' as it currently does.

I have only come up with ideas for the 'Or' functionality like using a pipe | character between search terms. I'd love something better.

Ultimately, I can do whatever, but I'm wondering if there's some sort of existing convention that would be simple, clear, obvious or ideally all of those.

So, my question is: is there an existing syntax convention for search terms that allows wildcarding, literals, and alternatives that I could use rather than coming up with my own?

The target user base would be something akin to a sysadmin. I don't want something as complicated as regular expressions, but the application won't be used by someone's grandma... unless that grandma is a sysadmin, I guess.

share|improve this question
2  
This really depends on who your customers are. The * and ? placeholders originate from DOS; programmers tend to favor regular expressions syntax. –  Pasha S Apr 3 '13 at 18:14
    
They're not developers. It would be closer to sysadmin types, and regex would be too complicated. I'm looking for something simple. –  Shawn D. Apr 3 '13 at 18:30
add comment

4 Answers

up vote 1 down vote accepted

When it comes to search - there can be only one reference (sorry Bing and Yahoo). Google have a well documented guide what to use, and implicitly what not to use. Typically the asterix (*) means filling in the blank which is the same as wildcard, so that'll do. But using a question mark is not accounted for, so don't use that.

Quotations (" ") for an entire phrase, OR-statements, minus sign (-) for exclude, tilde sign (~) for similar, and two dots (..) for number range can also be used.

However, I'd be very careful to use a lot of characters for different "clever" meanings. I'd use quotations and wildcard only and skip the rest. But to be certain, and really know what is used, consult your search query log to know what your users use. That's the only way to be really sure.

share|improve this answer
add comment

In programming (or doing anything with special characters), there is often a way in which you can escape the special character so that it reverts to just being text. Often this is done by prepending the character with a special symbol (often \). (Note: you have to be able to escape the escape - often this is just the special character repeated twice).

In your case, I could see this method working out - the question is whether or not your default interpretation of special characters should be as text or the commands they represent (i.e., should * mean wildcard by default, or should \* mean wildcard). The answer is probably whichever usage is more common and convenient for your users.

share|improve this answer
add comment

If the audience is System Admins and similar types - consider using a distilled form of SQL. That should be very familiar to admins and sysops

share|improve this answer
add comment

Have a look at the Advanced Search of CSA Illumina. It uses boolean as well as positional operators and wildcards. To search for the wildcards themselves, the terms are simply put into quotes, as you did. That is quite intuitive.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.