Skip to content

Commit

Permalink
[CommonServer.js] Update emailRegex (#31148)
Browse files Browse the repository at this point in the history
change email regex
  • Loading branch information
mmhw committed Dec 7, 2023
1 parent 3988df8 commit 29512df
Show file tree
Hide file tree
Showing 8 changed files with 2,157 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Packs/Base/.pack-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ ignore=BA124
[file:DBotTrainClustering.yml]
ignore=BA124

[file:CommonServer_6_10.yml]
ignore=BA108,BA109

[known_words]
createindicatorrelationship
commonserverpython
Expand Down
6 changes: 6 additions & 0 deletions Packs/Base/ReleaseNotes/1_33_0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

#### Scripts

##### CommonServer

- Update the `emailRegex` in CommonServer (JS) to catch emails with unicode as well (Available from Cortex XSOAR 6.11.0).
2 changes: 1 addition & 1 deletion Packs/Base/Scripts/CommonServer/CommonServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@ function stringToDate(dateString, format) {
/**************************** REGEX FORMATTING *******************************/

var ipRegex = /\b(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])\b/;
var emailRegex = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/;
var emailRegex = /\b(?:(?:\\|\^{3})u[a-f\d]{4})?(?<localpart>[\p{L}\d.!#$%&'*+\/=?^_\xe60{}~-][\p{L}\d.!#$%&'*+\/=?^_\xe60{|}~-]{0,63})\[?@\]?(?<domain>[\p{L}\d-]{1,255}(?:\[?\.\]?(?:[\p{L}\d-]{2,}))*(?:\[?\.\]?(?<tld>[\p{L}]{2,})))\b/gm;
var hashRegex = /[a-fA-F0-9]/;
var md5Regex = /\b[a-fA-F\d]{32}\b/gm;
var sha1Regex = /\b[a-fA-F\d]{40}\b/gm;
Expand Down
4 changes: 2 additions & 2 deletions Packs/Base/Scripts/CommonServer/CommonServer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ type: javascript
tags:
- infra
- server
comment: Common code that will be merged into each server script when it runs
comment: Common code that will be merged into each server script when it runs.
system: true
scripttarget: 0
dependson: {}
timeout: 0s
tests:
- 'Test CommonServer'
fromversion: 5.0.0
fromversion: 6.11.0

0 comments on commit 29512df

Please sign in to comment.