Home| Design| License| Regex| Download| Credits| Contact
Text-Zap Info
› Overview› Text-Zap Ant Task› Expand Text-Zap› API Docs
Components
› Filters› Savers› Groupers› Sequencers
Filters
› Append Filter› Append File Filter› Extract Lines Filter› Find Filter› Insert References› Merge Filter› Replace Filter› Replace List Filter› Replace Filter Plus› Reverse Filter› Split By Regex Filter› XSLT Filter

Reverse Filter

Finds a regular expression and reverses the order of the characters. I found this to be useful when processing files containing Hebrew charachters which are not displayed correctly in some systems.

The reverse filter is an example of an implementaion of ReplaceListFilter.

^topParameters

AttributeDescriptionRequired
regexthe regex to be searched forYes
ModifyGroupthe regex group that should be modifiedNo; defaults to 0 which is the entire regex
preGroupthe regex group that is not changed that will come before the modified group in the outputNo; defaults none,where this part of the regex is ignored
postGroupthe regex group that is not changed that will come after the modified group in the outputNo; defaults none,where this part of the regex is ignored

^topExamples

Searches for all occurances of 'abc' and changes it into cba
 <reverse regex="abc"/>
Searches for capitalized strings with numeric prefix, and reverse it
 <reverse regex="([0-9]+)([A-Z]+)" modifyGroup="2" preGroup="1"/>
SourceForge.net Logo