Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > String match algorithm?

Reply
Thread Tools

String match algorithm?

 
 
syncmaster1113 syncmaster1113 is offline
Junior Member
Join Date: Feb 2009
Posts: 1
 
      02-12-2009
Does anyone can suggest an efficient algorithm on string match

if the strings are "aaa", then output is A
if the strings are "aba", then output is B

1. aaa - > A
2. aba -> B

for instance,
input : aaaabaaaa -> output : ABA
aaa : A, aba : B, aaa:A

input aaababaaaabbababa -> output : ABAB
aaa : A, aba : B, aaa :A,aba : B
 
Reply With Quote
 
 
 
 
pinto pinto is offline
Junior Member
Join Date: Feb 2009
Posts: 12
 
      02-12-2009
Can you provide more rules?
"input aaababaaaabbababa -> output : ABAB
aaa : A, aba : B, aaa :A,aba : B" - Not clear how it is translated to ABAB
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
re.sub(): replace longest match instead of leftmost match? John Gordon Python 13 12-20-2011 02:58 AM
String#match vs. Regexp#match - confused Old Echo Ruby 1 09-04-2008 06:11 PM
pat-match.lisp or extend-match.lisp in Python? ekzept Python 0 08-10-2007 06:08 PM
$match = true() for empty $match?? Victor XML 2 05-17-2004 10:43 AM
Java regex can't match lengthy match? hiwa Java 0 01-29-2004 10:09 AM



Advertisments