ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# Appendix G. Core selectors Selectors are a specific subset of Phing `data types` that allow you to fine-tune matching in a [Appendix聽D](apd.html "Appendix D. Core Types")FileSet (or DirSet). Phing supports the following core selectors, which typically match on both files and directories in a` <fileset>`: - [<Contains>](apg.html#Contains "G.1 Contains") - Select files that contain a specific string - [<Readable>](apgs16.html "G.16 Readable") - Select files if they are readable - [<Writable>](apgs17.html "G.17 Writable") - Select files if they are writable - [<Executable>](apgs18.html "G.18 Executable") - Select files if they are executable - [<date>](apgs02.html "G.2 Date") - Select files/directories that have been modified either before or after a specific date/time - [<Depend>](apgs03.html "G.3 Depend") - Select files/directories that have been modified more recently than equivalent items elsewhere - [<Depth>](apgs04.html "G.4 Depth") - Select files/directories that appear at a specific depth in a directory tree - [<Different>](apgs05.html "G.5 Different") - Select files that are different from those elsewhere - [<Filename>](apgs06.html "G.6 Filename") - Select files/directories whose name matches a particular pattern. Equivalent to the include and exclude elements of a patternset. - [<Present>](apgs07.html "G.7 Present") - Select files/directories that either do or do not exist in some other location - [<Symlink>](apgs20.html "G.20 Symlink Selector") - Select files if they are symlink. - [<Containsregexp>](apgs08.html "G.8 Containsregexp")<containsregexp> - Select files that contain text matching a regular expression - [<Size>](apgs09.html "G.9 Size")<size> - Select files that are larger or smaller than a particular number of bytes. - [<Type>](apgs10.html "G.10 Type")<type> - Select files/directories by type ('file' or 'dir') Additionally, to create more complex selections, a variety of selectors that contain other selectors are available for your use. They combine the selections of their child selectors in various ways. Phing supports the following selector containers: - [<And>](apgs11.html "G.11 And")<and> - Select a file only if all the contained selectors select it. - [<Majority>](apgs12.html "G.12 Majority")<majority> - Select a file only if all the contained selectors select it. - [<None>](apgs13.html "G.13 None")<none> - Select a file only if none of the contained selectors select it. - [<Not>](apgs14.html "G.14 Not")<not> - Can contain only one selector, and reverses what it selects and doesn't select. - [<Or>](apgs15.html "G.15 Or")<or> - Select a file if any one of the contained selectors selects it. - [<Selector>](apgs19.html "G.19 Selector")<selector> - Contains only one selector and forwards all requests to it without alteration. This is the selector to use if you want to define a reference. It is usable as an element of `<project>`. G.1 Contains The `<contains>` tag selects files that contain the string specified by the `text` attribute. ``` <fileset dir="${src}" includes="**/*.php"> <contains text="PHP"/> </fileset> ``` Table G.1:聽 Attributes for the `<contains>` selector NameDescriptionDefaultRequired`text`Specifies the text that every file must containn/aYes`casesensitive`Whether to pay attention to case when looking for the string in the text attribute.`true`No`ignorewhitespace`Whether to eliminate whitespace before checking for the string in the text attribute.`false`No