Skip to content

Commit

Permalink
method to extract ncl of a story
Browse files Browse the repository at this point in the history
  • Loading branch information
Macbull committed May 7, 2016
1 parent 5b4558a commit 2e85ec7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions regex_ops.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
""" Methods for Regex Operations """
import re

def get_ncl(link):
""" Method to extract ncl value of a story"""
ncl_string = re.findall("ncl=.*?&",link)
if ncl_string:
return ncl_string[0][4:-1]
else:
return ''

0 comments on commit 2e85ec7

Please sign in to comment.