Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Access text fields and regular expressions
Old 10-01-2007, 02:49 PM Access text fields and regular expressions
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
I've got a rather strange question. I'm trying to build a variant of an anti-spam database, and what I'd like to do with it is to store regular expressions (e.g. V?agra for Viagra) and be able to query the database via the regular expression.

e.g. "Select Count (Pattern_ID) as Match_Count from Spam_Patterns where Pattern Like '%Viagra%'" would generate the V?agra as a match.

Is there any way to do it this way, or do I have to do it the other way around (i.e. use regular expressions in my query?)

Thanks.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
 
Register now for full access!
Old 10-01-2007, 06:12 PM Re: Access text fields and regular expressions
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Select Count(*) Where Pattern Like @Pattern

@Pattern = 'V_iagra'

Sorry, parameters in Access are [just an unknown field name].

MSDN says:
Quote:
There are a number of wildcard characters to choose from, and the following table details what they are and what they can be used for.
Wildcard character Description * or % Zero or more characters ? or _ (underscore) Any single character # Any single digit (0-9) [charlist] Any single character in charlist [!charlist] Any single character not in charlist
Note The % and _ (underscore) wildcard characters should be used only through the Jet OLE DB provider and ActiveX® Data Objects (ADO) code. They will be treated as literal characters if they are used though the Access SQL View user interface or Data Access Objects (DAO) code.
I don't think Access supports regular expressions, but has a baby version built in.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-01-2007, 06:14 PM Re: Access text fields and regular expressions
Learning Newbie's Avatar
Defies a Status

Latest Blog Post:
Astounding Republican Paranoia
Posts: 5,662
Name: John Alexander
Trades: 0
Dag, that was supposed to be a table.

* or % = Zero or more characters
? or _ (underscore) = Any single character
# = Any single digit (0-9)
[charlist] = Any single character in charlist
[!charlist] = Any single character not in charlist
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
Learning Newbie is offline
Reply With Quote
View Public Profile
 
Old 10-01-2007, 07:01 PM Re: Access text fields and regular expressions
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Thanks, dude. I'll have a poke at that later on if the tack I'm on now doesn't play out.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to Access text fields and regular expressions
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.23287 seconds with 12 queries