Skip to content

splitting by the last occurance of a dot

5 messages · Ashim Kapoor, Gabor Grothendieck

#
On Tue, Nov 8, 2011 at 6:06 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote:
Assuming we want to split off the number at the end try this which
splits on those dots which are followed by a digit:

strsplit(r, "\\.(?=\\d)", perl = TRUE)
#
On Tue, Nov 8, 2011 at 6:48 AM, Ashim Kapoor <ashimkapoor at gmail.com> wrote:
See the info on zero width lookahead assertions on the ?regex page.