1. Knowledge Base
  2. State Revolving Fund Dashboard

How to use Regex search your State Revolving Fund Dashboard

Regex Overview

Regular expressions (Regex) are a powerful tool used to search, match, and manipulate text data. A regex code is essentially a pattern of characters used to match specific strings of text. In the State Revolving Fund (SRF) Dashboard, a regex code can be entered to string match text contained in the Project field.

It is suggested to utilize the Regex Search instead of the project keyword search filters when filtering the dashboard for a list of more than three project keywords. For example, if you would like to filter your SRF Dashboard for 10 keywords relevant to your industry all at once, you can do so by entering a regex code.

To use the Regex Search, you can either reach out to Citylitics team with a preferred list of keywords, or you can follow the guides in the next section outlining how a regex code can be created.

List of Use Cases

The following are some examples of use cases that can be achieved through the Regex Search. If you require further assistance or ideas, please don't hesitate to contact the Citylitics team.

Note: When constructing a Regex query please always put the keywords in lowercase.

Use Case #1: Searching the Dashboard for 4 or More Keywords

In order to filter the dashboard with a lengthy list of keywords, include [\S\s]* at the start of the query, followed by a left bracket, and each keyword in lowercase separated by a vertical line. Enclose the list of keywords with a right bracket, and conclude with an additional [\S\s]* at the end of the query. As illustrated in the example below, the Regular Expression query will match any project containing text that includes "design", "water", "pump", or "pipe".

[\S\s]*(design|pipe|pump|water)[\S\s]*

 

hs regex

Use Case #2: Searching the Dashboard with “AND” logic

To filter the dashboard for projects with text containing multiple keywords, include [\S\s]* at the start of the query. Next, for each keyword in lowercase, enclose it in brackets on both sides. After that, insert a question mark, equals sign, and period (in that order) following the left bracket and before the keyword. Finally, include [\S\s]* at the end of the query. As demonstrated in the example below, the Regular Expression query will match any project with text containing both "design" and "water".

[\S\s]*(?=.*water)(?=.*design)[\S\s]*

 

hs regex 2

Use Case #3: Searching the Dashboard with both “AND” & “OR” logic

To apply both "AND" and "OR" logic when filtering the dashboard, use the same general formatting instructions outlined in Use Case #1 and Use Case #2. In addition, enclose the entire set of lowercase keywords in a second set of brackets, and include an additional vertical line to separate the "AND" keywords from the "OR" keywords. As shown in the example below, the Regular Expression query will match any project with text containing both "design" and "water", and also a mention of either "pipe" or "pump".

[\S\s]*(?=.*water)(?=.*design)(?=.*(pipe|pump))[\S\s]*