RegExp - please help me! (Posting On Python-List Prohibited)

szykcech at gmail.com szykcech at gmail.com
Wed Dec 27 00:37:56 EST 2017


W dniu wtorek, 26 grudnia 2017 21:53:14 UTC+1 użytkownik Lawrence D’Oliveiro napisał:
> On Wednesday, December 27, 2017 at 2:15:21 AM UTC+13, szyk... at gmail.com wrote:
> > struct (.+)\s*{\s*(.+)\s*};
> 
> You realize that “.” matches anything? Whereas I think you want to match non-whitespace in those places.

I realize that. I want skip white-spaces from the beginning and from the end and match entire body of C++ struct declaration (with white spaces inside as well). Maybe should I use "".strip(" ").strip("\t").strip("\n") function after matching?



More information about the Python-list mailing list