Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Java Basics
|
Java Basics General beginning Java language questions that don't fit in one of the more specific forums. Please specify what version.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 15th, 2007, 01:37 PM
Registered User
 
Join Date: Nov 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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).










Similar Threads
Thread Thread Starter Forum Replies Last Post
Regular Expression matching sub string mayasht Pro Java 3 August 8th, 2007 05:32 AM
Regular Expressions mega Beginning PHP 1 February 5th, 2007 05:31 PM
I need some help in regular expressions! marwaesmat Perl 2 March 7th, 2006 05:22 PM
regular expressions help kyootepuffy Classic ASP Databases 2 September 10th, 2003 01:37 PM
Regular Expressions Dave Doknjas C# 1 August 9th, 2003 12:05 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.