http://qs1969.pair.com?node_id=528892


in reply to Re: Splitting a string
in thread Splitting a string

/\w(?=\w(?<=(..)))/g;

Isn't that rather more complicated than necessary?

/(?=(\w\w))./g;

Replies are listed 'Best First'.
Re^3: Splitting a string
by japhy (Canon) on Feb 08, 2006 at 19:19 UTC
      It is true that /PATTERN/g will DWIM when /PATTERN/ matches the empty string and not find an infinite number of matches as the same point.

      I, however, consider code that relies on this behaviour in order save one character to be less simple.