Skip to content

Commit 542d38d

Browse files
EPP: Chnages in denylist to extend REGEX chapter
1 parent c787a3f commit 542d38d

File tree

1 file changed

+62
-2
lines changed
  • docs/endpointprotector/admin/denylistsallowlists

1 file changed

+62
-2
lines changed

docs/endpointprotector/admin/denylistsallowlists/denylists.md

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,9 @@ You can test a regular expression for accuracy using the right-side option. Add
164164
click Test. If the Regular Expression has no errors, then the same content should appear into the
165165
Matched content box, as shown below:
166166

167-
- To match an E-mail – [-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4}
167+
- To match an E-mail – `[-0-9a-zA-Z.+_]+@[-0-9a-zA-Z.+_]+\.[a-zA-Z]{2,4}`
168168
- To match an IP –
169-
(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}
169+
`(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}`
170170

171171
:::note
172172
This feature is provided “as is” and requires advanced knowledge of the Regular Expression
@@ -177,6 +177,66 @@ implement regular expressions and to thoroughly test.
177177

178178
![You can test a regular expression for accuracy using the right-side option](regexnewdenylist.webp)
179179

180+
### Regex Supported Formats
181+
182+
Endpoint Protector supports both standard Regex syntax and **Perl-Compatible Regular Expression (PCRE)** extensions and modifiers. For example, you can use the (?i) modifier at the beginning of a regex pattern to make it case-insensitive during matching.
183+
184+
**Case Sensitivity Options in Regular Expressions**
185+
186+
Regular expressions allow you to control how text matching handles letter casing. Depending on your requirements, you can use case-sensitive, case-insensitive, or partially case-insensitive matching.
187+
188+
**1. Case-Sensitive Matching (Default)**
189+
190+
By default, Regex matching is case-sensitive.
191+
This means that only text with the exact same casing will be matched.
192+
193+
**Example:**<br />
194+
**Pattern:** `test@example\\.com`<br />
195+
**Matches:** `[email protected]`<br />
196+
Does **not match:** `[email protected]` or `[email protected]`
197+
198+
199+
**2. Case-Insensitive Matching**
200+
To make a Regex pattern case-insensitive, use the (?i) flag.
201+
This enables matching regardless of the case of letters in the input text.
202+
203+
**Example:**<br />
204+
**Pattern:** `(?i)test@example\\.com`<br />
205+
206+
207+
**3. Partial Case-Insensitive Matching**
208+
Regex also allows you to apply case-insensitive matching only to specific parts of your pattern.
209+
You can enable and disable this mode using the following flags:
210+
211+
- `(?i)` — enables case-insensitive mode
212+
- `(?-i)` — disables case-insensitive mode
213+
214+
**Example:**<br />
215+
**Pattern:** `(?i)confidential(?-i) document`<br />
216+
**Matches:** `"CONFIDENTIAL document"`, `"Confidential document"`<br />
217+
Does **not match:** `"CONFIDENTIAL DOCUMENT"`
218+
219+
**Regex Operators**
220+
221+
| **Character** | **Description** | **Example** |
222+
|---------------|-------------------------------------------------------------------------|----------------------------------------------------------------------|
223+
| &circ; | Matches the start of a string or line. | \^abc matches “abc” only if it appears at the beginning of the line. |
224+
| \$ | Matches the end of a string or line. | abc\$ matches “abc” only if it’s at the end of the line. |
225+
| . | Matches any single character except newline (\\n). | a.c matches “abc”, “axc”, etc. |
226+
| \* | Matches 0 or more occurrences of the preceding character or group. | bo\* matches “b”, “bo”, “boo”, “booo”, etc. |
227+
| [] | Defines a character class, matching any one of the enclosed characters. | [abc] matches “a”, “b”, or “c”. |
228+
| [abc] | Any single character of a, b or c | [abc] matches “a”, “b”, or “c”. |
229+
| [&circ;abc] | Any single character expect a, b or c | It will match any single charact expect “a”, “b”, or “c”. |
230+
| [a-z] | A character in range a-z | It will match single character in range of a – z. |
231+
| [a-zA-Z] | A character in range a-z & A-Z | It will match single character in range of a – z & A - Z |
232+
| \\d | Any digit character | \\d will match any digit 0-9 |
233+
| \| | Groups expressions together or captures them for backreferences. | (abc)+ matches one or more repetitions of “abc”. |
234+
| () | Groups expressions together or captures them for backreferences. | (abc)+ matches one or more repetitions of “abc”. |
235+
| \\ | Used to escape special characters or indicate special sequences. | \\. matches a literal period “.”; \\d matches any digit. |
236+
| (?i) | Enables case-insensitive matching. | (?i)abc matches “abc”, “ABC”, “AbC”, etc. |
237+
| \\s | Any whitespace character | |
238+
| \\S | Any non-whitespace character | |
239+
180240
## Domain and URL
181241

182242
Domain and URL Denylists are custom-defined lists of web addresses identified by Endpoint Protector.

0 commit comments

Comments
 (0)