title: Regex is not correctly applied as I try to rewrite the snippet using pandas
body: <p>I am trying to convert the following code, which involves some pre-processing on the code into a pre-processing code that uses pandas.</p>
  
  <pre><code>with open(filename, 'r') as csvfile:
      # creating a csv reader object
      csvreader = csv.reader(csvfile)
  
      # extracting field names through first row
      fields = csvreader.next()
  
      # extracting each data row one by one
      for row in csvreader:
          title.append(row[25])
          line = re.sub(r'[.,"!]+', '', row[25], flags=re.MULTILINE)  # removes the characters specified
          line = re.sub(r'^RT[\s]+', '', line, flags=re.MULTILINE)  # removes RT
          line = re.sub(r'https?:\/\/.*[\r\n]*', '', line, flags=re.MULTILINE)  # remove link
          line = re.sub(r'[:]+', '', line, flags=re.MULTILINE)
          line=(re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)", " ", line,flags=re.MULTILINE))
          line = filter(lambda x: x in string.printable, line)  # filter non-ascii characers
          synopses.append(line)
  </code></pre>
  
  <p>Now, using the pandas library. I translated the above code as follows:</p>
  
  <pre><code>input_data = pd.read_csv(filename)
  input_posts = input_data["Post Data"]
  
  input_posts = input_data["Post Data"].apply(lambda str : re.sub(r'[.,"!]+', '', str, flags=re.MULTILINE))
  input_posts = input_data["Post Data"].apply(lambda str : re.sub(r'^RT[\s]+', '', str, flags=re.MULTILINE))
  input_posts = input_data["Post Data"].apply(lambda str : re.sub(r'https?:\/\/.*[\r\n]*', '', str, flags=re.MULTILINE))
  input_posts = input_data["Post Data"].apply(lambda str : re.sub(r'[:]+', '', str, flags=re.MULTILINE))
  input_posts = input_data["Post Data"].apply(lambda str : re.sub("(@[A-Za-z0-9]+)|([^0-9A-Za-z \t])|(\w+:\/\/\S+)", " ", str,flags=re.MULTILINE))
  input_posts = input_data["Post Data"].apply(lambda str : filter(lambda x: x in string.printable, str))
  
  print(input_posts)
  </code></pre>
  
  <p>The issue is that the final column in <code>input_posts</code> still consists of <code>https://...</code> URLs, although I have tried to remove them. Also, I am not sure if this is the best way to translate code using pandas where I have used multiple lambda functions. Is there something wrong in the regex applied / or sequence in which the regex is applied?</p>
  
  <p><strong>Example of expected output:</strong></p>
  
  <blockquote>
    <p>@PRNcnsmr: SK-II unveils bold and unfiltered take on beauty with its
    first ever #BareSkinProject with @ChloeGMoretz <a href="https://abc" rel="nofollow noreferrer">https://abc</a></p>
  </blockquote>
  
  <p>need to remove <a href="https://abc" rel="nofollow noreferrer">https://abc</a> link to get</p>
  
  <blockquote>
    <p>@PRNcnsmr: SK-II unveils bold and unfiltered take on beauty with its
    first ever #BareSkinProject with @ChloeGMoretz</p>
  </blockquote>