/    Sign up×
Community /Pin to ProfileBookmark

flexible string matching reg exp

If I have a mysql database of words, is there a function or regular expression that would match anything that is one or two characters off? I know with mysql LIKE you can have a wildcard character “_“, so would I just have to test all permutations like _XXX, X_XXX, XX_X, etc or is there some syntax that would do this for me?
thanks

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@ellisglSep 22.2008 — Great if you are looking for all possible combination's for what is given.

http://www.charles-reace.com/PHP_and_MySQL/Anagram_Finder/index.php

You could look at soundex functions

http://us2.php.net/soundex

Or make something that takes XXXX, loops thru the amount of chars

and makes a query of column LIKE '_XXXX' OR column LIKE 'X_XXX'.....
×

Success!

Help @bigajosep spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.4,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...