in reply to Re: Removing Flanking "N"s in a DNA String
in thread Removing Flanking "N"s in a DNA String
Note that this is inefficient. The non-greedy quantifier will cause the engine to try matching the trailing N* part whenever it can, so in the case it will match into the middle NNNN part before finding that the end-of-string doesn’t follow and backtracking out of it.
In very nearly every case where you want to do something at the start of the string and at the end of the string, you should use two anchored substituions.
And what’s more important is, that’s more readable too.
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Removing Flanking "N"s in a DNA String
by BrowserUk (Patriarch) on Nov 07, 2005 at 15:24 UTC | |
by Aristotle (Chancellor) on Nov 07, 2005 at 16:10 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 16:25 UTC | |
by Perl Mouse (Chaplain) on Nov 07, 2005 at 16:35 UTC | |
by BrowserUk (Patriarch) on Nov 07, 2005 at 16:56 UTC |