[ic] Filter question - Is this possible?

William Carr bill at bottlenose-wine.com
Fri Nov 5 14:44:46 EST 2004


On Nov 5, 2004, at 2:18 PM, Aftermarket Cellular wrote:

> Hi,
>
> Is there a way the filter out everything before a : For example
> take "Some text: Some more text" and return "Some text". I need to do
> this in the title field in one of my templates.
[set some_text]Some text: Some more text[/set]
[calc]
	$Scratch->{some_text} =~ s/^([^:]+).*/$1/;
	return;
[/calc]
[scratch some_text]

Or make a filter in /ic/code/Filters
CodeDef MyFilter Filter
CodeDef MyFilter Routine <<EOR
sub {
	my $in = shift;
	$ in =~ s/^([^:]+).*/$1/;
	return $in;
}
EOR

[filter MyFilter]Some text: Some more tex[/filter]


-- 
Bill Carr
Bottlenose - Websites for Wine & Spirits Merchants
http://bottlenose-wine.com/
877-857-6700



More information about the interchange-users mailing list