trying to extract the data between single quotes
import re
a = 'USA-APA HA-WBS-10.152.08.0/24'
print(re.findall(r'()', a))
expecting the oputput : USA-APA HA-WBS-10.152.08.0/24
-
What is your expected output here?Tim Biegeleisen– Tim Biegeleisen2022年11月30日 09:04:28 +00:00Commented Nov 30, 2022 at 9:04
-
USA-APA HA-WBS-10.152.08.0/24srini– srini2022年11月30日 09:07:01 +00:00Commented Nov 30, 2022 at 9:07
2 Answers 2
What is wrong with ? It is just a string ?
a = 'USA-APA HA-WBS-10.152.08.0/24'
print(a)
Output:
% python3 test.py
USA-APA HA-WBS-10.152.08.0/24
You might want to look at this also regarding quotes and strings:
answered Nov 30, 2022 at 9:23
SScotti
2,3386 gold badges30 silver badges48 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
I am not very familiar with python but with some quick searching around I've found that this work
import re
a = 'USA-APA HA-WBS-10.152.08.0/24'
result = re.findall(r'(.*?)', a)
print("".join(result))
I'm pretty sure there are better ways of solving this but I'm not familiar with the language
2 Comments
Tim Biegeleisen
... or just
print(a)Vasilis Neris
Yes as I said I'm unfamiliar with python and the case aswell. Maybe he wanted to find in a big text with double quotes all the texts with single quotes. I dunno :(
lang-py