def get_fund_infomation(): data = get_data() pattern1 = re.compile(r"^{{基礎情報.*?$\n(.*?)^}}$", re.MULTILINE + re.DOTALL) pattern2 = re.compile(r"^\|(.*?)\s=\s(.+?)(?:(?=\n\|)|(?=\n$))", re.MULTILINE + re.DOTALL) result = pattern2.findall(pattern1.findall(data)[0]) ans = {} for match in result: ans[match[0]] = match[1] return ans
def get_section_level(): data = get_data() pattern = re.compile(r"^(={2,})\s*(.+?)\s*\1.*$", re.MULTILINE) return pattern.findall(data)
def get_category_line(): return re.findall(r".*Category.*$",get_data(),re.MULTILINE)
def get_file(): data = get_data() pattern = re.compile(r"(?:File|ファイル):(.+?)\|", re.MULTILINE) return pattern.findall(data)