
28 Nov
2011
28 Nov
'11
10:57 a.m.
On Mon, Nov 28, 2011 at 5:18 AM, Roman Perepelitsa <roman.perepelitsa@gmail.com> wrote:
Is it possible to extract the last token from a list of space separated tokens?
AFAIK, it depends. If the preceding tokens are known a priory and do not contain non-alphanumeric symbols, yes. Otherwise, no.
LAST_TOKEN(a b) // expands to b LAST_TOKEN(blah blah b) // expands to b
Yes but only if you know that `a` and `blah blah` are the only tokens that will ever be in front of b.
LAST_TOKEN(* & b) // expands to b
No because * and & are not alphanumeric. If this is your case, I can reply writing you the macros that can do this. HTH, --Lorenzo