(Aug-07-2022, 01:07 PM)kucingkembar Wrote: something error, I tried this:
I think that you're confused.
grep
as I know it, is a command-line utility for searching plain-text data sets for lines that match a regular expression and is a part of Unix type computer operating systems (I can't speak for MS Windows OS, as I don't use it), but so far as I know, there is no Python library of the same name: I stand to be corrected on that, if I'm wrong.For a regular expression pattern match, I'd use regex:
import re re.search(<regex>, <string>)
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein