Re: [Tutor] regex advice

2015-01-06 Thread Cameron Simpson
On 06Jan2015 11:43, Norman Khine wrote: i have the following code: [...] #t(" ") gettext_re = re.compile(r"""[t]\((.*)\)""").findall My first thought is: "[t]" can just be written "t" [...] so, gettext_re = re.compile(r"""[t]\((.*)\)""").findall is not correct as it includes results such

Re: [Tutor] regex advice

2015-01-06 Thread Peter Otten
Norman Khine wrote: > i have a blade template file, as > > replace page > .row > .large-8.columns > form( method="POST", action="/product/saveall/#{style._id}" ) > input( type="hidden" name="_csrf" value=csrf_token ) > h3 #{t("Generate Product for")} #{tt(style.name)}

Re: [Tutor] regex advice

2015-01-06 Thread Steven D'Aprano
On Tue, Jan 06, 2015 at 11:43:01AM +, Norman Khine wrote: > hello, > i have the following code: > > import os > import sys > import re > > walk_dir = ["app", "email", "views"] > #t(" ") > gettext_re = re.compile(r"""[t]\((.*)\)""").findall > > for x in walk_dir: [...] The first step in effe

[Tutor] regex advice

2015-01-06 Thread Norman Khine
hello, i have the following code: import os import sys import re walk_dir = ["app", "email", "views"] #t(" ") gettext_re = re.compile(r"""[t]\((.*)\)""").findall for x in walk_dir: curr_dir = "../node-blade-boiler-template/" + x for root, dirs, files in os.walk(curr_dir, topdown=False):