Notepad++ is a common tool used when editing files in a site. One of the most useful functions within the tool is its ability to search for strings and even search and replace within an entire file structure. When doing this users may find the need to search for wildcard strings, or strings that contain some static information and then more information that is specific to each instance. Many users may be aware of the wildcard function, though it is not outlined within Notepad++.
The wildcard in Notepad++ works like this: a . will tell the search where the static information ends, and then placing a * will tell the search to search for any information that follows where the period ends. By adding more static information to the end you may tell the search to end at a certain word or character. The format looks something like this, <script type="text/javascript".*</script>, in this example the search would return any information beginning with <script type="text/javascript" and ending with </script> no matter what is contained in between the defined beginning and end. The following guide explains how to search for a string containing a wildcard in Notepad++ in more detail.
- Open Notepad++
- Select Search on the top bar, and then select Find... (for single files) or Find in Files... (for multiple files)
- In the Find What: box place the static part of the string, or the part that does not change per instance
- Immediately following the beginning of the string place the wildcard .*
- Enter the end of the string you wish to search for you immediately after the wildcard. Your Find What: bar will look something like the following example (the wildcard has been highlighted for emphasis)
- Make sure that Regular expression is checked at the bottom and pressed Find All
- If your files contain the information you are searching for they will be displayed in Notepad++
Article ID: 2315, Created: December 20, 2015 at 9:58 PM, Modified: September 23, 2016 at 11:30 AM