9 questions from the last 7 days
-3
votes
0
answers
34
views
Unexpected regex behavior [closed]
re.search(
r"(\d{1,4}[^\d:]{1,2}\d{1,4}[^\d:]{1,2}\d{1,4} | \w{3,10}.{,6}\d{4})",
'abc2024-07-08'
)
Why does this regex extract the second pattern, "abc2024", not "...
-1
votes
2
answers
72
views
Regex to match all but this pattern
I have filenames with this pattern [a-zA-Z0-9]{10} and .txt extension. They might also contain a pattern like this [super] and it could be either before or after [a-zA-Z0-9]{10} with '_' separating ...
Best practices
0
votes
3
replies
63
views
Searching through Unicode text with an ASCII keyboard in Python
I have a corpus of text which includes some accented words, such as épée, and I would like people to be able to easily search through it using an ASCII keyboard. Ideally, they would simply type ...
-7
votes
0
answers
83
views
Sum of Differences within a string [closed]
id
range
differences (inclusive
sum of Differences total
1
'01-08,24-32'
8,9
17
2
'38-70'
33
33
3
'01-25, 27-38'
25,12
37
4
'1-6,13-20,25-32'
6,8,8
22
5
'1-4, 7-8, 11-12'
4,2,2
8
4
NULL
NULL
NULL
5
'...
-4
votes
1
answer
103
views
Escape characters issue when defining a regex in a JSON string [duplicate]
I am trying to extract values for colorName from the following strings located in <script> of an HTML page.
\\"colorName\\":\\"GLOSS REDSKY SHDWSIL WHT IMPASTO\\"
\\"colorName\\":\\"GLOSS ...