title: AttributeError: 'NoneType' object has no attribute 'group'
body: <p>please help as i am trying to use a raspberry pi pir sensor to transfer the data collected by the pir sensor(which is 1 or 0 ) to the web service
  and i got this error </p>
  
  <pre><code>Traceback (most recent call last):
    File "pir_5.py", line 54, in &lt;module&gt;
      moveHold = float(matches.group(1))
  AttributeError: 'NoneType' object has no attribute 'group'
  </code></pre>
  
  <p>and this is my code </p>
  
  <pre><code>while True :
  
      # Read PIR state
      Current_State = GPIO.input(GPIO_PIR)
  
      if Current_State==1 and Previous_State==0:
        # PIR is triggered
        output =  subprocess.check_output(["echo", "18"]);
        print "  Motion detected!"
        # Tell the Pi to run our speech script and speak the words
        # motion dtected! - anything after the .sh will be read out.
        matches = re.search("Current_State==1 and Previous_State==0", output)
        moveHold = float(matches.group(1))
        resultm = client.service.retrieveMove(moveHold)
  
        cmd_string = './speech.sh motion detected!'
        # now run the command on the Pi.
        os.system(cmd_string)
        # Record previous state
        Previous_State=1
      elif Current_State==0 and Previous_State==1:
        # PIR has returned to ready state
        print "  Ready"
        Previous_State=0
  
      # Wait for 10 milliseconds
      time.sleep(0.01)
  </code></pre>