From: "cyber c." Date: 2012-06-13T10:30:01+09:00 Subject: Problem with reg exp Hi, I need to match str1 = "ABC12A2012" str2 = "ABC13B2013KEYWORD" i have to extract, word1 = ABC, word2 = 12A2012 for str1 word1 = ABC, word2 = 13B2013 for str2 i have used str.split(/([a-zA-Z]+)(.*)(KEYWORD?)/) for str2 i get substrings as "","ABC","12A2012","KEYWORD" -- Why did the nil sub string popped up? for str1 i get only 1 substring which is the entire string Any one can spot the problem , please let me know. -- Posted via http://www.ruby-forum.com/.