title: matching string using regular expression
body: <pre><code>text = "hellovision hey creator   yoyo  b  creator great  publisher"
  </code></pre>
  
  <p>I want to extract creator's name and publisher's name from text.</p>
  
  <p>The result will be,</p>
  
  <p>creator = hellovision hey, yoyo</p>
  
  <p>publisher = great </p>
  
  <p>How can I get text using regular expression?</p>
  
  <p>Do I need to use span()..?</p>
  
  <p>This is my code.</p>
  
  <pre><code>def preprocess2(text):
  
      text_list = test.split(' ')
      lyricist = []
      composer = []
      music_arranger = []
      temp = []
      lyricist.clear()
      composer.clear()
      music_arranger.clear()
      for i in range(0, len(text_list)):
          if text_list[i] == 'creator':
              print(len(text_list))
              for a in range(0, i-1):
                  temp.append(text_list[a])
              lyricist.append(''.join(temp))
              temp.clear()
              for b in range(0, i+1):
                  print(b)
                  text_list.pop(b)
                  print(len(text_list))
              break
          elif text_list[i] == 'pulisher':
              for a in range(0, i-1):
                  temp.append(text_list[a])
              composer.append(''.join(temp))
              temp.clear()
              for b in range(0, i+1):
              text_list.pop(b)
          break
      i = i +1
  return text_list
  </code></pre>