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

1# Copyright (c) 2024 Microsoft Corporation. All rights reserved. 

2# Licensed under the MIT license. See LICENSE file in the project. 

3# 

4import re 

5 

6 

7def clean_text_for_csv(text: str | int) -> str: 

8 # Replace non-alphanumeric characters 

9 return re.sub(r"[^\w\s&@\+]", "", str(text)) 

10 

11 

12def clean_for_column_name(text: str | int) -> str: 

13 # Replace non-alphanumeric characters 

14 return re.sub(r"[^\w\s&()\-_\+]", "", str(text))