Originally posted by bvdet
Code:
Re pattnum = re.compile(r''' -\d+\.\d+E\+\d+| # engineering notation -+ \d+\.\d+E\+\d+| # engineering notation ++ -\d+\.\d+E-\d+| # engineering notation -- \d+\.\d+E-\d+| # engineering notation +- -\d+\.\d+| # negative float format \d+\.\d+| # positive float format -\d+\.| # negative float format \d+\.| # positive float format -\.\d+| # negative float format \.\d+| # positive float format \d{1,8} # positive integer ''', re.X key_patt = re.compile(r'/([A-Za-z_-]+)/') data_patt = re.compile(r'\d+\.\d+|\d+|\w+')
Can you please elaborate the explanation for the above pattern ,with simple examples.What each pattern line stands for?. How are we deciding to go for this types of pattern.
Thanks
PSB
Comment