RegEx for scrambled words | 
 
    Post Reply  
   | 
  
| Author | |
   
   mikek  
   
   Senior Member  
   Joined: 22 February 2005 Location: Switzerland Status: Offline Points: 133  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     Topic: RegEx for scrambled wordsPosted: 13 April 2005 at 9:20am  | 
 
| 
   
    I'm looking for an effective regex to match scrambled words such as: sotfware 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?  | 
 |
![]()  | 
 |
   
   lead  
   
   Newbie  
   Joined: 08 March 2005 Status: Offline Points: 18  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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?  | 
 |
![]()  | 
 |
   
   mikek  
   
   Senior Member  
   Joined: 22 February 2005 Location: Switzerland Status: Offline Points: 133  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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...
    
   
   | 
 |
![]()  | 
 |
   
   Desperado  
   
   Senior Member  
   Joined: 27 January 2005 Location: United States Status: Offline Points: 1143  | 
  
   
      Post Options
    
        Thanks(0)
      Quote   Reply
   
     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  | 
 |
![]()  | 
 |
    Post Reply  
   | 
  |
|       
  
  Tweet   	
    | 
 
| Forum Jump | Forum Permissions  ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum  | 
 
This page was generated in 0.326 seconds.
 
 
 
 
 
 
 Topic Options
   
 Post Options
 Thanks(0)
 

   