View Single Post
  #1 (permalink)  
Old 11-15-2007, 08:46 PM
DennyLoi DennyLoi is offline
Member
 
Join Date: Nov 2007
Posts: 2
DennyLoi is on a distinguished road
regular expressions and string matching
Hi everyone,

Here is my problem, I have a partially decrypted piece string which would appear something like.

Partially deycrpted: the?anage??esideshe?e
Plain text: themanagerresideshere


So you can see that there are a few letter missing from the decryped text. What I am trying to do it insert spaces into the string so that I get:

The ?anage? ?esides he?e

I have a method which splits up the string in substrings of varying lengths and then compares the substring with a word from a dictionary (implemented as an arraylist) and then inserts a space.

The problem is that my function does not find the words in the dictionary because my string is only partially decryped.

Eg: ?anage? is not stored in the dictionary, but the word “manager” is.

So my question is, is there a way to build a regular expression which would match the partially decrypted text with a word from a dictionary (ie - ?anage? is recognised and “manager” from the dictionary).
Reply With Quote
Sponsored Links