Skip to content

Commit 6c6e3f8

Browse files
Merge remote-tracking branch 'upstream/hotfixes' into release
2 parents 841f63e + 1a58385 commit 6c6e3f8

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

pm4py/algo/filtering/common/traces/infix_to_regex.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,5 @@
1-
'''
2-
PM4Py – A Process Mining Library for Python
3-
Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)
1+
from re import escape
42

5-
This program is free software: you can redistribute it and/or modify
6-
it under the terms of the GNU Affero General Public License as
7-
published by the Free Software Foundation, either version 3 of the
8-
License, or any later version.
9-
10-
This program is distributed in the hope that it will be useful,
11-
but WITHOUT ANY WARRANTY; without even the implied warranty of
12-
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13-
GNU Affero General Public License for more details.
14-
15-
You should have received a copy of the GNU Affero General Public License
16-
along with this program. If not, see this software project's root or
17-
visit <https://www.gnu.org/licenses/>.
18-
19-
Website: https://processintelligence.solutions
20-
21-
'''
223
def translate_infix_to_regex(infix):
234
regex = "^"
245
for i, act in enumerate(infix):
@@ -29,6 +10,9 @@ def translate_infix_to_regex(infix):
2910
else:
3011
regex = f"{regex}([^,]*,)*"
3112
else:
13+
if act:
14+
act = escape(act)
15+
3216
if is_last_activity:
3317
regex = f"{regex}{act}"
3418
else:

0 commit comments

Comments
 (0)