• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Limiting the search to certain file extensions

New Here ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

Is there a way to specify the file extension(s) when doing a search? If I know what I'm looking for is in a php file I need to filter for that, I don't need the search results to list the finds in css or js files or even waste time looking in non php files. Notepad++ allows *.php

Views

183

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

Sort of, but not with RegEx...

You can highlight the files you want to search in the Files Window...

JonFritzII_0-1680198063614.png

 

...then select "Selected Files in Site" from the "In" dropdown when you use the Find & Replace In Files option (Ctrl + Shift + F)...

JonFritzII_1-1680198116240.png

...if your site is well organized, with css and scripts occupying their own folders, selecting everything but the items you don't want to search should be simple enough.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

LATEST

This works in some situations, but for example take a typical WordPress/WooCommerce site. The file could be in plugins/woocommerce, the parent theme, the child-theme/woocommerce, functions.php or maybe even in one of the numerous plugins that support WooCommerce and the only search possible is on a css class name or part of a name. So you don't want the search results to list .css or .scss files, just the php code that delivers it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 30, 2023 Mar 30, 2023

Copy link to clipboard

Copied

Do you keep your PHP scripts inside a folder?  I ask because search can target selected Folders.

 

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines