We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 41d4083 commit 711f0c4Copy full SHA for 711f0c4
src/fosslight_source/_parsing_scancode_file_item.py
@@ -26,8 +26,8 @@
26
KEYWORD_DOWNLOAD_LOC = r'DownloadLocation\s*[\S]+'
27
KEYWORD_SCANCODE_UNKNOWN = "unknown-spdx"
28
SPDX_REPLACE_WORDS = ["(", ")"]
29
-KEY_AND = "and"
30
-KEY_OR = "or"
+KEY_AND = r"(?<=\s)and(?=\s)"
+KEY_OR = r"(?<=\s)or(?=\s)"
31
32
33
def get_error_from_header(header_item):
@@ -182,8 +182,7 @@ def split_spdx_expression(spdx_string):
182
license = []
183
for replace in SPDX_REPLACE_WORDS:
184
spdx_string = spdx_string.replace(replace, "")
185
- spdx_string = spdx_string.replace(KEY_OR, KEY_AND)
186
- license = spdx_string.split(KEY_AND)
+ license = re.split(KEY_AND + "|" + KEY_OR, spdx_string)
187
return license
188
189
0 commit comments