[TYPO3-core] RFC: #9336 Enable ascii for parsefunc-short replacement

Martin Kutschker masi-no at spam-typo3.org
Fri Sep 12 12:10:54 CEST 2008


Oliver Hader schrieb:
> Oliver Hader schrieb:
>> Example:
>> 10 = TEXT
>> 10 {
>>   field = bodytext
>>   stdWrap.strReplace {
>>     search.char = 32
>>     replace = %20
>>   }
>>   parseFunc {
>>     ...
>>   }
>> }
>>
>> 20 = TEXT
>> 20 {
>>   field = bodytext
>>   stdWrap.pregReplace {
>>     search = (cat|dog|tiger)
>>     replace = animal
>>     modifier = 1
>>   }
>>   parseFunc {
>>     ...
>>   }
>> }
> 
> Or as addition a combined way to perform more than one replacement:
> 
> 10 = TEXT
> 10 {
>   field = bodytext
>   stdWrap.replacement {
>     10 {
>       search.char = 32
>       replace = %20
>     }
>     20 {
>       search = oldValue
>       replace = newValue
>     }
>     30 {
>       search = (cat|dog|tiger)
>       replace = animal
>       // regExp could be "1" for "yes, use preg_replace" or a modifier
>       regExp = i
>     }
>   }
>   parseFunc {
>     ...
>   }
> }
> 
> The indexes 10, 20, 30 are just for setting an order on the execution of
> the replacement. Each subkey "search", "replace" and "regExp" has again
> stdWrap functionality.

Nice ideas.

Maybe it makes sense to get in touch with the 5.0 folks so we can have a
syntax in 4.x that will make a transition to 5.0 easier.

Masi


More information about the TYPO3-team-core mailing list