import re
text = '[p]1littlecoder is amazing[/p]'
# Use a regular expression to match the text you want to extract
match = re.search(r'\[p\](.*?)\[/p\]', text)
# If a match was found, extract the text
if match:
extracted_text = match.group(1)
print(extracted_text)
from transformers import pipeline
# Initialize the summarization pipeline
summarizer = pipeline("summarization")
# Provide the text you want to summarize as input
input_text = "Replace this with the text you want to summarize"
# Use the summarize method to generate the summary
summary = summarizer(input_text, max_length=100, min_length=30)
# Print the generated summary
print(summary[0]['summary_text'])
import re
text = "0s11 0s12 0s33 my name is 0sgfh 0s1 0s22 0s87"
pattern = r"(0s\w+(?:\s+0s\w+)*)"
matches = re.findall(pattern, text)
# matches will be a list of strings, each containing a matched sequence
print(matches)