Skip to content

Instantly share code, notes, and snippets.

@StephenVinouze
Created April 22, 2020 06:18
Show Gist options
  • Save StephenVinouze/b203141d3eaeb75dad4e742999d2ca21 to your computer and use it in GitHub Desktop.
Save StephenVinouze/b203141d3eaeb75dad4e742999d2ca21 to your computer and use it in GitHub Desktop.
Script to count word between two separators
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
inputString = """
"""
list = re.findall(r'\[\<(.+?)\>\]', inputString)
subString = " ".join(list).replace('\xc2\xa0', ' ')
count = len(subString.split())
print count
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment