Re: [Tutor] receiving regular expression from command line

2016-10-01 Thread Alan Gauld via Tutor
On 01/10/16 09:16, anish singh wrote: > I am trying to implement grep to just increase my knowledge > about regular expression. > > Below is the program usage: > python test.py -i Documents/linux/linux/ -s '\w+_readalarm*' > > However, due to my lack of knowledge about string handling > in python

[Tutor] receiving regular expression from command line

2016-10-01 Thread anish singh
I am trying to implement grep to just increase my knowledge about regular expression. Below is the program usage: python test.py -i Documents/linux/linux/ -s '\w+_readalarm*' However, due to my lack of knowledge about string handling in python, I am getting wrong results. def read_file(file, pat