in reply to Re^2: Removing Flanking "N"s in a DNA String
in thread Removing Flanking "N"s in a DNA String
since we don't really need capturing. Which makes me think that ideally one may want it, instead, to see the text that has been substituted. But then he would only get the N's at ^ (if any) as $1 or . Which in turn make me wonder why there's this asymmetry between s/// and m//, since the latter, in list context and with /g does return all captures while the former just returns a true (or false) value in any context, precisely the numer of matches (or the empty string)...s/(?:^N+|N+$)//g;
|
|---|