Spam Filter ISP Support Forum

  New Posts New Posts RSS Feed - RegEx for scrambled words
  FAQ FAQ  Forum Search   Register Register  Login Login

RegEx for scrambled words

 Post Reply Post Reply
Author
mikek View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 February 2005
Location: Switzerland
Status: Offline
Points: 133
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikek Quote  Post ReplyReply Direct Link To This Post Topic: RegEx for scrambled words
    Posted: 13 April 2005 at 9:20am

I'm looking for an effective regex to match scrambled words such as:

sotfware
stofware
sofwtare

and so on, but not matching the real word (software).

All I've come up with so far is

((?i)(s[oftwa]{5}re))

but that, will, of course, match "software" as well.

Any ideas?

Back to Top
lead View Drop Down
Newbie
Newbie
Avatar

Joined: 08 March 2005
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote lead Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2005 at 10:10am
I can't think of a fix in just one RegEx but you could use a combination of RegEx

((?i)(sf[otwa]{4}re))
((?i)(st[ofwa]{4}re))
((?i)(sw[ofta]{4}re))
((?i)(sa[oftw]{4}re))

which target the scrambled words.
Would this work?


Back to Top
mikek View Drop Down
Senior Member
Senior Member
Avatar

Joined: 22 February 2005
Location: Switzerland
Status: Offline
Points: 133
Post Options Post Options   Thanks (0) Thanks(0)   Quote mikek Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2005 at 12:01pm
that's what I'm doing now, but for 5 characters, there are a lot of combinations.... I thought it could be done easier...
Back to Top
Desperado View Drop Down
Senior Member
Senior Member
Avatar

Joined: 27 January 2005
Location: United States
Status: Offline
Points: 1143
Post Options Post Options   Thanks (0) Thanks(0)   Quote Desperado Quote  Post ReplyReply Direct Link To This Post Posted: 14 April 2005 at 12:31pm

Dan,

With the existing implementation of RegEX, I am not sure this can be simplified.  With the standard Perl RegEx, I would use a "NOT" function but that requires "Look Ahead" which I am nearly certain is *not* supported.

Regards,

The Desperado
Dan Seligmann.
Work: http://www.mags.net
Personal: http://www.desperado.com

Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.309 seconds.