I need this to be done in Oracle SQL (10gR2). But I guess, I would rather put it plainly, any good, efficient algorithm is fine.
Given a line (or sentence, containing
This regex matches the last word on a line:
\w+$
And RegexBuddy gives this code for use in Oracle:
DECLARE match VARCHAR2(255); BEGIN match := REGEXP_SUBSTR(subject, '[[:alnum:]]_+$', 1, 1, 'c'); END;