Gossamer Forum
Home : Products : DBMan : Discussions :

Can this wildcard search be executed in DBman ?

Quote Reply
Can this wildcard search be executed in DBman ?
If I did a wildcard search on a document in say, MS Word using;
<???>

I would get these results;
the
cat
dog
etc

< =begining of word
> =end of word
? =any character

Does anyone know of an equivalent to <???> that I can use in a DBman search?

THX
Dezire

Quote Reply
Re: Can this wildcard search be executed in DBman ? In reply to
Please visit the FAQ noted below and check the section on "Searching". You will find many useful thread references there which will provide you with options for searching.

You can use the "*" when searching to search for "All". But you will find additional options in the FAQ.

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Can this wildcard search be executed in DBman ? In reply to
Thanks for that.
There's a lot of great information there, however, nothing on an 'any character' also known as a '?' search.
Unless I've missed something, I also haven't been able to locate info on an 'exclude' character/s search criteria.

e.g in MSword 'Not' = [!]

Any help is appreciated.
I'll put this query in the 'customization' area if nobody else has a suggestion.

Thanks
Dezire

Quote Reply
Re: Can this wildcard search be executed in DBman ? In reply to
You need to forget MSWord's interpretation of a regular expression and learn Perl's.

^ : begin of line
$ : end of line
[] : character class (ie, [\w])
[^] : negated character class (ie, [^\w])
. : match any character once (excludes whitespace)
? : the match is optional (ie, 'x?', or '(\w+)?')
() : grouping (ie, '(\w+)')
+ : one or more times (greedy if not used properly)
* : zero or more times (greedy if not used properly)
(?) : grouping, non-greedy (ie, 'x(\w+?)x')
| : or (ie, 'this|that')

character classes:
\d : digits (0 - 9)
\D : non-digits (same as [^\d])
\w : word character (0 - 9, a -z, _)
\W : non-word character (same as [^\w])
\s : white space (spaces, tabs, etc.; excludes '\n' by default)
\n : new line
(there are others)

special variables:
any grouped match will be assigned a special variable, numbered begining with '1'. To reference a match while inside in the regexp pattern match, use '\1' for the first match, '\2' for the second, and so on. If you are in a search and replace, then in the 'replace' part, you must use '$1' and '$2', and so on. References to these matches outside of the regexp must be in the second for mentioned. You cannot modify these variabls, or manually assign 'numbered' variabls; you must do "$match1 = $1;", etc.

There are quite a bit more things to say about regex'es in Perl, but you should do some reading in the 'perlre' man page for a better understanding.

Happy coding,

--Drew
http://www.camelsoup.com
ftp://ftp.camelsoup.com
Quote Reply
Re: Can this wildcard search be executed in DBman ? In reply to
Thanks Junko. That's helped me BIG time.

Dezire