Search This Blog

Saturday, September 30, 2017

Regular expression matching operations in programming

In programming to select and extract necessary information from website you can use regex or regular expression - symbolic logic to select or exclude information. In Python there is library Regular Expression Syntax, which explains syntax and present samples. Though it is complicated to understand and to write by himself even after searching Stackoverflow. So use search regex tutorial on Google. Search show to use website RegexOne Learn Regular Expressions with simple, interactive exercises. Interactive Tutorial and Regular expressions 101 Interactive website to read to understand and to practice regex. With regex you can write complex commands in Scrapy spider to extract only necessary information or you can process text file with regex also. Today I program integration of automatic solution for Facebook groups matching with their members number, which I have already developed. I found that Chrome Extension LinkKlipper has option to select text file for download with regex option. So I put /groups/ in regex field and LinkKlipper will download only those links which contain word 'groups' in it. Unecssary links with 'permalink' word will deleted automatically by python code, so for sake of simplity I avoid more complex regex syntax.