Package org.apache.tools.ant.filters

# Class TokenFilter.ContainsRegex

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.filters.TokenFilter.ChainableReaderFilter
org.apache.tools.ant.filters.TokenFilter.ContainsRegex

All Implemented Interfaces:
  `Cloneable`, `ChainableReader`, `TokenFilter.Filter`

Enclosing class:
  TokenFilter

public static class TokenFilter.ContainsRegex extends TokenFilter.ChainableReaderFilter
filter to filter tokens matching regular expressions.

## Field Summary

### Fields inherited from class org.apache.tools.ant.ProjectComponent

`description, location, project`

## Constructor Summary

Constructors
Constructor
Description
`ContainsRegex()`

## Method Summary

Modifier and Type
Method
Description
`String`
`filter(String string)`
apply regex and substitution on a string
`void`
`setFlags(String flags)`
`void`
`setPattern(String from)`
`void`
`setReplace(String to)`

### Methods inherited from class org.apache.tools.ant.filters.TokenFilter.ChainableReaderFilter

`chain, setByLine`

### Methods inherited from class org.apache.tools.ant.ProjectComponent

`clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### ContainsRegex

public ContainsRegex()

## Method Details

### setPattern

public void setPattern(String from)

Parameters:
  `from` - the regex pattern

### setReplace

public void setReplace(String to)

Parameters:
  `to` - the replacement string

### setFlags

public void setFlags(String flags)

Parameters:
  `flags` - the regex flags

### filter

public String filter(String string)
apply regex and substitution on a string

Parameters:
  `string` - the string to apply filter on
Returns:
  the filtered string