Coverage for intelligence_toolkit/helpers/texts.py: 100%
5 statements
« prev ^ index » next coverage.py v7.10.7, created at 2025-10-16 13:41 -0300
« prev ^ index » next coverage.py v7.10.7, created at 2025-10-16 13:41 -0300
1# Copyright (c) 2024 Microsoft Corporation. All rights reserved.
2# Licensed under the MIT license. See LICENSE file in the project.
3#
4import re
7def clean_text_for_csv(text: str | int) -> str:
8 # Replace non-alphanumeric characters
9 return re.sub(r"[^\w\s&@\+]", "", str(text))
12def clean_for_column_name(text: str | int) -> str:
13 # Replace non-alphanumeric characters
14 return re.sub(r"[^\w\s&()\-_\+]", "", str(text))