[ic] Filter ul

Stefan Hornburg racke at linuxia.de
Thu Jul 17 01:31:29 EDT 2003


On Wed, 16 Jul 2003 15:14:16 -0700
John Young <john_young at sonic.net> wrote:

> 
> 
> Trentt Cramer wrote:
> > Is there a standard filter that converts (form) names to
> > Uppercase/Lowercase(1st char uc, rest lc)?
> 
> 
> Filter "namecase" is close, but it looks like it only converts when
> the inital
> string starts with an uppercase letter.
> Perhaps instead of:
>      $val =~ s/([A-Z]\w+)/\L\u$1/g;
> maybe it should say:
>      $val =~ s/([A-Z][a-z]\w+)/\L\u$1/g;
> 
> Anyway, in case I've missed something, you can find all the filters
> and what they do simply by looking in two places:
> 
> ~interch/lib/Vend/Interpolate.pm  - look around line# 800 for "%Filter
> = ("~interch/code/Filter              - which is also where you can
> install custom filters
> 
> The documentation lists filters, but the two locations above are the 
> actual sources.
> 
> If you have to write your own, you can try something like creating
> ~interch/code/Filter/titlecase.filter containing the following:
> 
> CodeDef titlecase Filter
> CodeDef titlecase Routine <<EOR
> sub {
> 	my $val = shift;
> 	$val =~ s/(\w+)/\u\L$1/g;
> 	return $val;
> }
> EOR

You can put this into catalog.cfg as well (CodeDef needs Interchange
4.9.x)
.

Ciao
	Racke

-- 
LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team



More information about the interchange-users mailing list