Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^7: counting the number of 16384 pattern matches in a large DNA sequence

by BrowserUk (Patriarch)
on Jun 15, 2012 at 16:37 UTC ( [id://976460]=note: print w/replies, xml ) Need Help??


in reply to Re^6: counting the number of 16384 pattern matches in a large DNA sequence
in thread counting the number of 16384 pattern matches in a large DNA sequence

If zero-width really means zero-width, the next match should start at the same point and match the same string again, shouldn't it?

Having the regex engine always move on by at least 1 character is a way to ensure that it always makes progress. Thus it prevents many cases of endless looping that would result in pathological behaviors.

Once you know that, the semantics are very useful.

Conversely this m[([ACGT](?=[ACGT]{6}))]; only captures a single character each time. Unless the capturing parens are inside the lookahead construct, anything they match is not captured.

Again, once you know the (slightly counter-intuitive) semantics, this proves to be quite useful.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

The start of some sanity?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://976460]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-28 17:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found