Reputation: 29
I have a long text. how to get only "Brandshubs" from below HTML?
output = Brandshubs3.7
Upvotes: 0
Views: 127
Reputation: 26
Just use re.search('Brandshubs', s)
or findall
function in python re
library.
But you will get the string Brandshubs
always, that's not meaningful so I guess you want to check exists or count the times? For that you can check/count
the results of these functions' return directly
Upvotes: 1
Reputation: 428
You can use either text.find("Brandshubs")
or utilize the Python re
library if you need something more sophisticated.
Upvotes: 1