This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The 'File name patterns' seems only to accept regular expressions against a file name. Sometimes it is a particular path that i would like to restrict the search to. For example i would like to able to enter into this field something like: genericsitesearch.sesam.no/**/views.xml so that only hits in files named views.xml somewhere underneath a directory genericsitesearch.sesam.no were to be returned.
This should not be a big technical problem but I am not sure it is needed that much. You can achieve the same if you select directory "genericsitesearch.sesam.no" and enter pattern "views.xml". It should be a working and quite easy solution for occasional need. What do you think?
> You can achieve the same if you select directory "genericsitesearch.sesam.no" and enter pattern "views.xml". Neither are a regular expression pattern. genericsitesearch.sesam.no, for example, contains a number of child projects. Say for example i wanted to search genericsitesearch.sesam.no/*.no/**/main/**/views.xml
> Say for example i wanted to search genericsitesearch.sesam.no/*.no/**/main/**/views.xml Have you ever really needed to search using such complex pattern?
:-) well of course when i filed the issue. sure it's an advanced usage, but it does not provide any extra UI in any way, just a more solid result from regular expression searching.
It is doable and - surprisingly - parsing the pattern and scanning for the files should be the easiest part. The reason is that the parser and scanner already exist in the JUnit module (package org.netbeans.modules.junit.output.antutils). What is worse is that the Find... action currently does not necessarily search the directory structure. It accepts an enumeration of DataObjects provided by the nodes.
A well-tested variant of the matching logic can also be found in org.netbeans.spi.project.support.ant.PathMatcher, though you would not want to depend on this module from search.
Find in Projects now supports "File Path Regular Expression" option, which should be sufficient, hopefully. Thank you for reporting.