Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
If you're not going to have a lastNode field, there's no need to even have a Node class -- just store your stringValue directly in ListOfStrings. Also, Id like to see what your ToString() would look like.
It should be noted that this approach only works because the regexes are all mutually exclusive. If you needed it to be multi-word and end in a 'y', for example, this can't be used.
The jsfiddle link doesn't work in my browser, so I have no idea how you solved anything. You should post the details on this site, with a link solely for reference.