Create a sperate file like producer.py -
import json
import ssl
from aiokafka import AIOKafkaProducer
from conf.app_vars import KAFKA_HOST, KAFKA_USERNAME, KAFKA_PASSWORDGo to .ssh directory (if not exists, create .ssh directory). Make sure you are in .ssh directory. Now generate ssh key for each of your github account like this :
>> ssh-keygen -t rsa -b 4096 -C "work-email@example.com"
output:
| import re | |
| text = " Hello < I live in Bangladesh. <I love my country> I speak Bangla>" | |
| textGreedyRegex = re.compile(r"<.*>") # Greedy Approach | |
| print(textGreedyRegex.search(text)) | |
| # Output: | |
| <re.Match object; span=(7, 66), match='< I live in Bangladesh. <I love my country> I speak Bangla> |
| import re | |
| text = "I speak Bangla. I live in Bangladesh" | |
| textRegex = re.compile(r"Bangla(desh)+") # 1 or more time | |
| print(textRegex.search(text)) | |
| # Output: | |
| <re.Match object; span=(26, 36), match='Bangladesh'> |
| import re | |
| text_1 = "I speak Bangla" | |
| text_2 = "I eat Banana" | |
| textRegex = re.compile(r"Ba(na)*") # O or more time | |
| print(textRegex.search(text_1)) | |
| # Output: |
| import re | |
| text_1 = "I live in Bangladesh" | |
| text_2 = "I speak Bangla" | |
| textRegex = re.compile(r"Bangla(desh)?") # 0 or one time. | |
| print(textRegex.search(text_1)) | |
| # Output: |
| import re | |
| text = "I live in Bangladesh" | |
| textRegex = re.compile(r"Bangla(desh|deshi)") | |
| print(textRegex.search(text)) | |
| Output: | |
| <re.Match object; span=(10, 20), match='Bangladesh'> |
| import re | |
| text = "my phone number is 01740-999768" | |
| phoneRegex = re.compile(r"(\d{5})-(\d{6})") | |
| print(phoneRegex.search(text)) | |
| Output: | |
| <re.Match object; span=(19, 31), match='01740-999768'> |
| import re | |
| text = "my phone number is 01740999768" | |
| phoneRegex = re.compile(r"\d{5, 11}") | |
| print(phoneRegex.search(text)) | |
| Output: |