Hello.
If a specific word is included, I'm trying to write a code to save the sentence to firebase!
I don't have a clue
For example, if there's a sentence that says, "Hashcode is good!" I'm just trying to narrow it down.
How can I make a way to throw away the word "hash code" even if there are multiple sentences, and save it if there are.?
Please give me your advice.
python firebase
"I like it!" "I like you!" "I like it!" "I like it!" "I like the hash code!" "I like it!" Do you want to take a hash code or a sentence like "I like it
r"(Good![\w\s]*Hashcode|Hashcode[\w\s]*Good!)
How about using this regular expression? The sample is as follows:
# coding=utf8
# # the above tag defines encoding for this document and is for Python 2.x compatibility
import re
regex = r (like![\w\s]*hashcode|hashcode[\w\s]*like!)
test_str = ("Like!", \n"
"I like you!" \n"
"Throw away the sentence ""Nice, yum!"""
"Hashcode is good!", \n"
"Good! Hashcode", \n"
"I like hash codes!" \n"
"Do you want to take this kind of sentence?")
subst = ""
# # You can manually specify the number of replacements by changing the 4th argument
result = re.sub(regex, subst, test_str, 0, re.UNICODE)
if result:
print (result)
578 Understanding How to Configure Google API Key
917 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
613 GDB gets version error when attempting to debug with the Presense SDK (IDE)
© 2024 OneMinuteCode. All rights reserved.