Python Forum
a useful grep command
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a useful grep command
#4
(Dec-21-2018, 11:02 AM)Larz60+ Wrote: try using sed
see: https://linuxcommando.blogspot.com/2008/...-file.html
the idea is to lex or parse the file enough to distinguish parts like string literals, comments, and code and apply the search to the specified parts. so if i specify to search code and literals, it won't search the comments (even within the same line). sed does not have any capability to understand python source.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
a useful grep command - by Skaperen - Dec-21-2018, 02:59 AM
RE: a useful grep command - by Larz60+ - Dec-21-2018, 11:02 AM
RE: a useful grep command - by Skaperen - Dec-21-2018, 07:40 PM
RE: a useful grep command - by Gribouillis - Dec-21-2018, 11:21 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  python code wanted: grep IP address Skaperen 7 6,322 Jul-09-2018, 05:25 AM
Last Post: Skaperen

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020