How do I find a paragraph that starts with 002 in the paragraph below?
001 Hide and Seek/Can you see us? Can you see me? Yes, I can see you. Can you see me? Yes, we can see you. Can you see me? Yes, we can see you. We can all see Dad.
002 Reds and Blues/Red Team and Blue Team We are all in red. We are all in blue. Come on the reds! Red team, fighting! Come on the blues! Blue team, fighting! Who is in red? Who is in blue? We are all mud.
Come and look at this. Come and look at this. Is it a big monster? Come and look at this. Is it a big dinosaur? Come and look at this. Is it a big giant? No, it is Dad.
import re
# # Define the regular expression pattern for entity-label pairs
str = "001 Hide and Seek/Can you see us? Can you see me? Yes, I can see you. Can you see me? Yes, we can see you. Can you see me? Yes, we can see you. We can all see Dad.
002 Reds and Blues/Red Team and Blue Team We are all in red. We are all in blue. Come on the reds! Red team, fighting! Come on the blues! Blue team, fighting! Who is in red? Who is in blue? We are all mud.
Come and look at this. Come and look at this. Is it a big monster? Come and look at this. Is it a big dinosaur? Come and look at this. Is it a big giant? No, it is Dad.
"""
match = re.search(r'^002.*\n',str,re.MULTILINE)
print(match.group(0))
You can try it by pressing
.
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.