Simple question reg string matching

K

K3

I am a newbie to perl, so i wud appreciate if anyone give the code for
finding the number of matches in a given string, allowing atmost m no
of mismatches.

input: short string (len = k)
long string (len =n)
no of mismatches (=m)

output: no of matches allowing m mismatches
cheers
karthik
 
J

John Bokma

K3 said:
I am a newbie to perl, so i wud appreciate if anyone give the code for
finding the number of matches in a given string, allowing atmost m no
of mismatches.

input: short string (len = k)
long string (len =n)
no of mismatches (=m)

output: no of matches allowing m mismatches

CPAN or pay someone for doing your homework.
 
K

K3

John

I know how to do that thing normally. But if u can give me some
efficient code, I wud appreciate ur help.

cheers
karthik
 
J

John Bokma

K3 said:
John

I know how to do that thing normally.

Write the code, profile it, and if you don't know how to speed it up, post
it here. There are plenty of people here willing to /improve/ code.
 
J

Jim Gibson

K3 said:
I am a newbie to perl, so i wud appreciate if anyone give the code for
finding the number of matches in a given string, allowing atmost m no
of mismatches.

input: short string (len = k)
long string (len =n)
no of mismatches (=m)

output: no of matches allowing m mismatches

In addition to following John's excellent advice, you will need (for
me, anyway) to define what you mean by a 'mismatch', with examples.

For example, if the string to be tested is 'aababcaabd' against the
pattern 'ab', I can see that there are 3 matches. However, I don't know
the number of mismatches. It could be 3 ('a', 'ca', 'd') or 6 ('aa',
'ba', 'bc', 'ca', 'aa', 'bd') or maybe something else, depending upon
how you define a mismatch.
 
T

Tad McClellan

K3 said:
I know how to do that thing normally.


Then post your code, and we will help you improve it.


But if u can give me some ^
efficient code, I wud appreciate ur help.
^^^ ^^

Please use real English.

You are being inconsiderate of those who don't have English
as their first language.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top