Re: Spread a statement over various lines

2019-09-19 Thread Ralf M.
Am 18.09.2019 um 22:24 schrieb Alexandre Brault: On 2019-09-18 4:01 p.m., Ralf M. wrote: I don't know the exact rules of Windows wildcards, so there may be even more cases of unexpected behavior. If anyone knows where to find the complete rules (or a python module that implements them), I woul

Re: Spread a statement over various lines

2019-09-19 Thread Ralf M.
Am 18.09.2019 um 22:22 schrieb Chris Angelico: On Thu, Sep 19, 2019 at 6:20 AM Ralf M. wrote: Am 17.09.2019 um 20:59 schrieb Manfred Lotz: I have a function like follows def regex_from_filepat(fpat): rfpat = fpat.replace('.', '\\.') \ .replace('%', '.') \

Re: Spread a statement over various lines

2019-09-19 Thread Peter Otten
Manfred Lotz wrote: >> Where does '%' come from? >> > > '%' was a mistake as I had replied myself to my initial question. Oh, sorry. I missed that. -- https://mail.python.org/mailman/listinfo/python-list

Re: Spread a statement over various lines

2019-09-19 Thread Manfred Lotz
On Thu, 19 Sep 2019 08:36:04 +0200 Peter Otten <__pete...@web.de> wrote: > Manfred Lotz wrote: > > >> Not related to your question, but: > >> You seem to try to convert a Windows wildcard pattern to a regex > >> pattern. > > > > No, I'm on Linux. > > > > Shortly, after I had posted the questi

Re: Spread a statement over various lines

2019-09-18 Thread Peter Otten
Manfred Lotz wrote: >> Not related to your question, but: >> You seem to try to convert a Windows wildcard pattern to a regex >> pattern. > > No, I'm on Linux. > > Shortly, after I had posted the question I discovered fnmatch() in the > standard library, and I changed my code accordingly. I wou

Re: Spread a statement over various lines

2019-09-18 Thread Manfred Lotz
On Wed, 18 Sep 2019 22:01:34 +0200 "Ralf M." wrote: > Am 17.09.2019 um 20:59 schrieb Manfred Lotz: > > I have a function like follows > > > > def regex_from_filepat(fpat): > > rfpat = fpat.replace('.', '\\.') \ > >.replace('%', '.') \ > >.rep

Re: Spread a statement over various lines

2019-09-18 Thread codewizard
On Wednesday, September 18, 2019 at 9:01:21 AM UTC-4, Manfred Lotz wrote: > On Wed, 18 Sep 2019 08:30:08 +0200 > Peter Otten <__pete...@web.de> wrote: > > > Manfred Lotz wrote: > > > > > I have a function like follows > > > > > > def regex_from_filepat(fpat): > > > rfpat = fpat.replace('.',

Re: Spread a statement over various lines

2019-09-18 Thread Alexandre Brault
On 2019-09-18 4:01 p.m., Ralf M. wrote: > Am 17.09.2019 um 20:59 schrieb Manfred Lotz: >> I have a function like follows >> >> def regex_from_filepat(fpat): >> rfpat = fpat.replace('.', '\\.') \ >>    .replace('%', '.')  \ >>    .replace('*', '.*') >> >

Re: Spread a statement over various lines

2019-09-18 Thread Chris Angelico
On Thu, Sep 19, 2019 at 6:20 AM Ralf M. wrote: > > Am 17.09.2019 um 20:59 schrieb Manfred Lotz: > > I have a function like follows > > > > def regex_from_filepat(fpat): > > rfpat = fpat.replace('.', '\\.') \ > >.replace('%', '.') \ > >.replace(

Re: Spread a statement over various lines

2019-09-18 Thread Ralf M.
Am 17.09.2019 um 20:59 schrieb Manfred Lotz: I have a function like follows def regex_from_filepat(fpat): rfpat = fpat.replace('.', '\\.') \ .replace('%', '.') \ .replace('*', '.*') return '^' + rfpat + '$' As I don't want to have the r

Re: Spread a statement over various lines

2019-09-18 Thread Manfred Lotz
On Wed, 18 Sep 2019 08:30:08 +0200 Peter Otten <__pete...@web.de> wrote: > Manfred Lotz wrote: > > > I have a function like follows > > > > def regex_from_filepat(fpat): > > rfpat = fpat.replace('.', '\\.') \ > > .replace('%', '.') \ > > .replace(

Re: Spread a statement over various lines

2019-09-18 Thread Manfred Lotz
On Wed, 18 Sep 2019 09:52:21 +0200 Wolfgang Maier wrote: > On 17.09.19 20:59, Manfred Lotz wrote: > > I have a function like follows > > > > def regex_from_filepat(fpat): > > rfpat = fpat.replace('.', '\\.') \ > > .replace('%', '.') \ > > .replace

Re: Spread a statement over various lines

2019-09-18 Thread Wolfgang Maier
On 17.09.19 20:59, Manfred Lotz wrote: > I have a function like follows > > def regex_from_filepat(fpat): > rfpat = fpat.replace('.', '\\.') \ > .replace('%', '.') \ > .replace('*', '.*') > > return '^' + rfpat + '$' > > > As I don't want to

Re: Spread a statement over various lines

2019-09-17 Thread Peter Otten
Manfred Lotz wrote: > I have a function like follows > > def regex_from_filepat(fpat): > rfpat = fpat.replace('.', '\\.') \ > .replace('%', '.') \ > .replace('*', '.*') > > return '^' + rfpat + '$' > > > As I don't want to have the replace()

Re: Spread a statement over various lines

2019-09-17 Thread Manfred Lotz
On Tue, 17 Sep 2019 16:51:04 -0400 Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> wrote: > On 9/17/19 2:59 PM, Manfred Lotz wrote: > > > def regex_from_filepat(fpat): > > rfpat = fpat.replace('.', '\\.') \ > >.replace('%', '.') \ > >.rep

Re: Spread a statement over various lines

2019-09-17 Thread Dan Sommers
On 9/17/19 2:59 PM, Manfred Lotz wrote: > def regex_from_filepat(fpat): > rfpat = fpat.replace('.', '\\.') \ >.replace('%', '.') \ >.replace('*', '.*') > > return '^' + rfpat + '$' > > As I don't want to have the replace() functions in on

Re: Spread a statement over various lines

2019-09-17 Thread Manfred Lotz
On Tue, 17 Sep 2019 20:59:47 +0200 Manfred Lotz wrote: > I have a function like follows > > def regex_from_filepat(fpat): > rfpat = fpat.replace('.', '\\.') \ > .replace('%', '.') \ Not related to my question but the second replace must be: .replace(