Re: RegEx question, hopefully easy

Richard Thomas <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.template-toolkit
Message-ID <[email protected]>
> Lets say I have this string -
> 
> CC: Apparel : Red Shoes : Prints : Madden
> 
> *there might be a case where there is no space before or after the ":".
> 
> Why I want is to extract "Madden", basically all non-space chars after the last ":" or if anchoring from the back, all chars up to ":" (not including the : or space).


Not rigorously tested, but something along the lines of:

	SET var = string.split('\s*:\s*');
	SET keep = var.last ;

... ought to be pretty close to what you need.

cheers
RET
______________________________________________________
Don't anthropomorphize computers. They hate that.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.