File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Q: Best way of matching strings? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Q: Best way of matching strings?" Watch "Q: Best way of matching strings?" New topic
Author

Q: Best way of matching strings?

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Hello,
An example of what I am trying to do is match a string such as lo?lip?p (the
?s are the missing letters in a crossword clue for example) to the words
which fit the blanks in a wordlist file.
How can you match a string (where there are wildcards) to another string? I
have looked at compareTo but I don't think that is the right way to do it.
The wordlist is implemented in a binary tree and, to search for matches, the
program does an inorder traversal
Can anyone offer any hints or URLs etc.
Donnie
paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20582
    ∞

I think your best bet is to go all the way and get a regular expression engine.
Try www.oroinc.com.

permaculture Wood Burning Stoves 2.0 - 4-DVD set
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Another very popular regexp package is GNU regexp. When the ORO software was unavailable for a while last year, this seemed to be generally regarded as the bast.
Frank.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Q: Best way of matching strings?