# types/selectors/ContainsRegexpSelector.php

## \ContainsRegexpSelector
jump to top

Package: phing\types\selectors

Selector that filters files based on whether they contain a particular string using regexp.

It provides support for gathering the parameters together as well as for assigning an error message and throwing a build exception if an error is detected.

Parent(s)
  \BaseExtendSelector < \BaseSelector < \DataType < \ProjectComponent
Author
  Hans Lellelid (Phing)
Author
  Bruce Atherton (Ant)
Version
  $Revision: 526 $

### Constants

`EXPRESSION_KEY = "expression"`

`CASE_KEY = "casesensitive"`

### Properties

`$casesensitive= 'true'`
Default value `true` Details

Type
  n/a

`\Regexp $myExpression= ''`

Details

Type
  \Regexp

`\RegularExpression $myRegExp= ''`

Details

Type
  \RegularExpression

`$parameters= 'null'`
inherited

The passed in parameter array.

Inherited from: \BaseExtendSelector::$$parameters
Default value `null` Details

Type
  n/a
Inherited_from
  \BaseExtendSelector::$$parameters

`string $userProvidedExpression= ''`

The expression set from XML.
Details

Type
  string

### Methods

`circularReference( ) : void`
inherited

Inherited from: DataType::circularReference()\BaseExtendSelector::circularReference()
`dieOnCircularReference( ) : void`
inherited

Inherited from: DataType::dieOnCircularReference()\BaseExtendSelector::dieOnCircularReference()
`getCheckedRef( ) : void`
inherited

Inherited from: DataType::getCheckedRef()\BaseExtendSelector::getCheckedRef()
`getDescription( ) : void`
inherited

Inherited from: DataType::getDescription()\BaseExtendSelector::getDescription()
`getError( ) : void`
inherited

Inherited from: BaseSelector::getError()\BaseExtendSelector::getError()
`getParameters( ) : \the`
inherited

Allows access to the parameters gathered and set within the <custom> tag.

Inherited from: \BaseExtendSelector::getParameters()
Returns

Type | Description
--- | ---
\the | set of parameters defined for this selector

`getProject( ) : void`
inherited

Inherited from: ProjectComponent::getProject()\BaseExtendSelector::getProject()
`isReference( ) : void`
inherited

Inherited from: DataType::isReference()\BaseExtendSelector::isReference()
`isSelected( \basedir $basedir, \filename $filename, \file $file ) : \whether`

The heart of the matter. This is where the selector gets to decide on the inclusion of a file in a particular fileset.

Parameters

Name | Type | Description
--- | --- | ---
$basedir | \basedir | the base directory the scan is being done from
$filename | \filename | is the name of the file to check
$file | \file | a PhingFile object the selector can use

Returns

Type | Description
--- | ---
\whether | the file should be selected or not

`log( ) : void`
inherited

Inherited from: ProjectComponent::log()\BaseExtendSelector::log()
`noChildrenAllowed( ) : void`
inherited

Inherited from: DataType::noChildrenAllowed()\BaseExtendSelector::noChildrenAllowed()
`parsingComplete( ) : void`
inherited

Inherited from: DataType::parsingComplete()\BaseExtendSelector::parsingComplete()
`setCasesensitive( boolean $casesensitive ) : void`

Whether to ignore case in the regex match.

Parameters

Name | Type | Description
--- | --- | ---
$casesensitive | boolean | whether to pay attention to case sensitivity

`setDescription( ) : void`
inherited

Inherited from: DataType::setDescription()\BaseExtendSelector::setDescription()
`setError( ) : void`
inherited

Inherited from: BaseSelector::setError()\BaseExtendSelector::setError()
`setExpression( string $exp ) : void`

The expression to match on within a file.

Parameters

Name | Type | Description
--- | --- | ---
$exp | string | the string that a file must contain to be selected.

`setParameters( array $parameters ) : void`

When using this as a custom selector, this method will be called.

It translates each parameter into the appropriate setXXX() call.

Parameters

Name | Type | Description
--- | --- | ---
$parameters | array | the complete set of parameters for this selector

`setProject( ) : void`
inherited

Inherited from: ProjectComponent::setProject()\BaseExtendSelector::setProject()
`setRefid( ) : void`
inherited

Inherited from: DataType::setRefid()\BaseExtendSelector::setRefid()
`toString( ) : void`

`tooManyAttributes( ) : void`
inherited

Inherited from: DataType::tooManyAttributes()\BaseExtendSelector::tooManyAttributes()
`validate( ) : void`
inherited

Inherited from: BaseSelector::validate()\BaseExtendSelector::validate()
`verifySettings( ) : void`

Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.

Documentation was generated by DocBlox 0.17.1.