Pira.cz Technical Forum

Magic RDS 4 => Configuration Options and Possibilities => Topic started by: South Coast FM Tech on December 17, 2021, 05:16:08 am

Title: Text Replacing - Limit radiotext character length
Post by: South Coast FM Tech on December 17, 2021, 05:16:08 am
Hi Jan,

How would I use Text Replacing to limit the number of characters sent in radiotext.
(ie: Truncate the string at say 30 characters max.)
I've tried various %REGEX%, but not been successful so far.

Something like...
Change: %REGEX%.{0,30}.+
To: (blank)

thanks, Rod
Title: Re: Text Replacing - Limit radiotext character length
Post by: Jan on December 19, 2021, 06:26:31 pm
A new command has been added to the Text replace in version 4.0.34:

%MATCHEDSTR%

Example of use (limit the text length to 30 characters):

Change
%REGEXP%^.{0,30}

To
%CLEAR%%MATCHEDSTR%
Title: Re: Text Replacing - Limit radiotext character length
Post by: South Coast FM Tech on December 19, 2021, 11:47:06 pm
Thanks Jan,

The Text Replacing '%CLEAR%%MATCHEDSTR%' for text truncation that you've just implemented worked perfectly.

cheers, Rod