[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]
	$Scratch->{some_text} =~ s/^([^:]+).*/$1/;
[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;

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

Bill Carr
Bottlenose - Websites for Wine & Spirits Merchants

More information about the interchange-users mailing list