Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #87889 > unrolled thread

Regex Python Help

Started bygdotoli@gmail.com
First post2015-03-24 11:13 -0700
Last post2015-03-26 12:04 +0000
Articles 3 on this page of 23 — 11 participants

Back to article view | Back to comp.lang.python


Contents

  Regex Python Help gdotoli@gmail.com - 2015-03-24 11:13 -0700
    Re: Regex Python Help Skip Montanaro <skip.montanaro@gmail.com> - 2015-03-24 13:23 -0500
    Re: Regex Python Help Gary Herron <gherron@digipen.edu> - 2015-03-24 11:25 -0700
      Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-24 12:10 -0700
        Re: Regex Python Help Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-03-24 19:40 +0000
    Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-24 12:22 -0700
      Re: Regex Python Help Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-03-24 20:40 +0100
      Re: Regex Python Help Skip Montanaro <skip.montanaro@gmail.com> - 2015-03-24 14:35 -0500
      Re: Regex Python Help Vincent Vande Vyvre <vincent.vande.vyvre@telenet.be> - 2015-03-24 20:38 +0100
      Re: Regex Python Help smap <askme.first@thankyouverymuch.invalid> - 2015-03-28 07:53 +0000
    Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-24 12:43 -0700
      Re: Regex Python Help Rob Gaddi <rgaddi@technologyhighland.invalid> - 2015-03-24 19:53 +0000
        Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-24 13:45 -0700
    Re: Regex Python Help Terry Reedy <tjreedy@udel.edu> - 2015-03-24 15:53 -0400
    Re: Regex Python Help Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-25 12:43 +1100
      Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-25 07:53 -0700
    Re: Regex Python Help Denis McMahon <denismfmcmahon@gmail.com> - 2015-03-25 20:34 +0000
      Re: Regex Python Help Gregg Dotoli <gdotoli@gmail.com> - 2015-03-25 14:19 -0700
        Re: Regex Python Help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-25 22:15 +0000
        Re: Regex Python Help Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-03-26 10:10 +1100
          Re: Regex Python Help Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-03-25 23:50 +0000
          Re: Regex Python Help Terry Reedy <tjreedy@udel.edu> - 2015-03-26 01:00 -0400
        Re: Regex Python Help Denis McMahon <denismfmcmahon@gmail.com> - 2015-03-26 12:04 +0000

Page 2 of 2 — ← Prev page 1 [2]


#88000

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2015-03-25 23:50 +0000
Message-ID<mailman.168.1427327424.10327.python-list@python.org>
In reply to#87991
On 25/03/2015 23:10, Steven D'Aprano wrote:
> On Thu, 26 Mar 2015 08:19 am, Gregg Dotoli wrote:
>
>> Grep is regular expressions. If I'm using Python, I'll use the Python
>> modules. Silly
>
> It very well may be silly.
>
> You're using Python regular expressions because you're using Python. Why are
> you using Python? Early in this thread you said
>
> "Here you go. Windows shell was easier!!!"
>
> Does Windows shell have grep? How about Powershell? If grep is available,
> why mix two different languages?
>

gnuwin32 certainly does.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [next] | [standalone]


#88025

FromTerry Reedy <tjreedy@udel.edu>
Date2015-03-26 01:00 -0400
Message-ID<mailman.180.1427346059.10327.python-list@python.org>
In reply to#87991
On 3/25/2015 7:10 PM, Steven D'Aprano wrote:

> Does Windows shell have grep? How about Powershell?

No.  I just use Idle's grep (Find in Files).  And I generally would even 
if Command Prompt did have grep.  Idle's has the nice feature that 
output goes in an Output Window, with each line found prefaced with 
filename and line number.  One can then right click on a line and open 
the file at that line in an Idle editor.  One can also save the list to 
a file if so inclined.

-- 
Terry Jan Reedy

[toc] | [prev] | [next] | [standalone]


#88043

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2015-03-26 12:04 +0000
Message-ID<mf0sji$426$1@dont-email.me>
In reply to#87984
On Wed, 25 Mar 2015 14:19:39 -0700, Gregg Dotoli wrote:

> On Wednesday, March 25, 2015 at 4:36:01 PM UTC-4, Denis McMahon wrote:
>> On Tue, 24 Mar 2015 11:13:41 -0700, gdotoli wrote:
>> 
>> > I am creating a tool to search a filesystem for one simple string.
>> 
>> man grep
>> 
>> STOP! REINVENTING! THE! WHEEL!
>> 
>> Your new wheel will invariably be slower and less efficient than the
>> old one.

> Grep is regular expressions. If I'm using Python, I'll use the Python
> modules.
> Silly

1. Please don't top post, this is usenet, we don't top post, comments go 
after the text they comment on soi we can read down the page and it makes 
sense.

2. You gave the thread the title of "regex python help".

3. Your initial comment was "I am creating a tool to search a filesystem 
for one simple string."

4. The tool (see 3) already exists, it's called grep, it uses regular 
expressions (see 2). It's also going to be a lot faster than using python.

5. According to your post, grep seems to be the tool you are looking for.

6. Reinventing grep in python seems much more silly to me, by the time 
you've finished writing and testing the python code (especially if you 
need to seek help from a newsgroup in the process) grep would have found 
and identified every file containing your "one simple string".

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.python


csiph-web