Answers for "python extract word from string"

4

how to get words from a string in python

sentence = "How are you feeling today"
sentence = sentence.split() # this returns list of words
# output = ["How", "are", "you", "feeling", "today"]
Posted by: Guest on January-30-2021
0

how to extract words from string in python

string = "This is demo string"
words = string.split()
for word in words:
  print(word)
Posted by: Guest on April-18-2022
0

python how to extract a string from another string

import re

text = 'gfgfdAAA1234ZZZuijjk'

m = re.search('AAA(.+?)ZZZ', text)
if m:
    found = m.group(1)

# found: 1234
Posted by: Guest on April-04-2021

Code answers related to "python extract word from string"

Python Answers by Framework

Browse Popular Code Answers by Language