Skip to content

Commit

Permalink
Update RegEx
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelYochpaz committed Jul 2, 2023
1 parent 493d91c commit 24b476f
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
or demisto.params().get('key', '')

INCIDENT_TYPE: str = PARAMS.get('incidentType', '')

URL_REGEX = r'https?://[^\s]*'
ENTITLEMENT_REGEX: str = \
r'(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}'
MENTION_REGEX = r'^@([^@;]+);| @([^@;]+);'
Expand Down Expand Up @@ -296,8 +296,8 @@ def urlify_hyperlinks(message: str, url_header: str | None = EXTERNAL_FORM_URL_D
url_header = url_header or EXTERNAL_FORM_URL_DEFAULT_HEADER
formatted_message: str = message

for url_match in re.finditer(urlRegex, message):
url: str = url_match.group()
for url_match in re.finditer(URL_REGEX, message):
url = url_match.group()
# is the url is a survey link coming from Data Collection task
formatted_message = formatted_message.replace(url, f'[{url_header if EXTERNAL_FORM in url else url}]({url})')
return formatted_message
Expand Down

0 comments on commit 24b476f

Please sign in to comment.