Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Simple question reg string matching

Reply
Thread Tools

Simple question reg string matching

 
 
K3
Guest
Posts: n/a
 
      10-26-2006
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

 
Reply With Quote
 
 
 
 
John Bokma
Guest
Posts: n/a
 
      10-26-2006
"K3" <(E-Mail Removed)> wrote:

> 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.

--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
 
Reply With Quote
 
 
 
 
K3
Guest
Posts: n/a
 
      10-26-2006
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

John Bokma wrote:
> "K3" <(E-Mail Removed)> wrote:
>
> > 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.
>
> --
> John Experienced Perl programmer: http://castleamber.com/
>
> Perl help, tutorials, and examples: http://johnbokma.com/perl/


 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      10-26-2006
"K3" <(E-Mail Removed)> wrote:

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


u'v 2 lk @ cpan


--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
 
Reply With Quote
 
John Bokma
Guest
Posts: n/a
 
      10-26-2006
"K3" <(E-Mail Removed)> wrote:

> 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.

--
John Experienced Perl programmer: http://castleamber.com/

Perl help, tutorials, and examples: http://johnbokma.com/perl/
 
Reply With Quote
 
Jim Gibson
Guest
Posts: n/a
 
      10-26-2006
In article <(E-Mail Removed) .com>, K3
<(E-Mail Removed)> wrote:

> 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.
 
Reply With Quote
 
Tad McClellan
Guest
Posts: n/a
 
      10-26-2006
K3 <(E-Mail Removed)> wrote:

> 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.


--
Tad McClellan SGML consulting
http://www.velocityreviews.com/forums/(E-Mail Removed) Perl programming
Fort Worth, Texas
 
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
reg exact string matching sivga Perl Misc 3 11-02-2006 06:47 AM
Simple question reg string matching K3 Perl Misc 0 10-26-2006 07:31 PM
Windows Reg Pro vs Tweak now Reg Cleaner vs Registry fix, vs RegCleaner jl Computer Support 3 05-31-2005 12:53 AM
Java Pattern Matching / Reg Ex Question Domenick Java 7 01-04-2005 02:07 PM
Java Pattern Matching / Reg Ex Question hiwa Java 1 01-04-2005 01:52 PM



Advertisments