Package: regexfilesearch
Regex search in all kind of files  (in chunks) + binary subpip install regexfilesearchimportregexfromregexfilesearchimportregex_filesearch,get_all_files_in_folders_with_subdir_limitalf=get_all_files_in_folders_with_subdir_limit(folders=r"C:\Users\Gamer\anaconda3\envs\stopjogo",maxsubdirs=0)df=regex_filesearch(files=alf,regexpressions=[r"\bchar\b",r"import.*?pandas "],with_context=True,chunksize=8192,flags=regex.IGNORECASE,)print(df.loc[df.aa_bytesstart>1][:20].to_string(max_colwidth=10))aa_chunknoaa_fileaa_bytesstartaa_bytesendaa_chunkstartaa_chunkendaa_regexaa_regexpatternaa_replaceaa_get_contextaa_partial_resultaa_full_matchaa_partial_matchaa_groupsaa_allcapturesaa_resultaa_result_utf8aa_bytesstart_wholeaa_bytesend_whole121C:\Use...5256016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char             52                   56131C:\Use...182186016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            182                  186141C:\Use...217221016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            217                  221151C:\Use...254258016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            254                  258161C:\Use...440444016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            440                  444171C:\Use...582586016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            582                  586181C:\Use...622626016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            622                  626191C:\Use...661665016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            661                  665201C:\Use...5256016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char             52                   56211C:\Use...182186016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            182                  186221C:\Use...217221016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            217                  221231C:\Use...254258016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            254                  258241C:\Use...440444016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            440                  444251C:\Use...582586016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            582                  586261C:\Use...622626016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            622                  626271C:\Use...661665016384<regex...regex....f(newf...f()False(b'#in...          <NA>        ((0, b...          0        b'char'       char            661                  665291C:\Use...2008020084016384<regex...regex....f(newf...f()False(b'<\x...          <NA>        ((0, b...          0        b'char'       char          20080                20084301C:\Use...2023620240016384<regex...regex....f(newf...f()False(b'<\x...          <NA>        ((0, b...          0        b'char'       char          20236                20240311C:\Use...2026020264016384<regex...regex....f(newf...f()False(b'<\x...          <NA>        ((0, b...          0        b'char'       char          20260                20264321C:\Use...2145721461016384<regex...regex....f(newf...f()False(b'<\x...          <NA>        ((0, b...          0        b'char'       char          21457                21461print(df.loc[df.aa_bytesstart>1][:20].iloc[0].to_string())aa_chunkno1aa_fileC:\Users\Gamer\anaconda3\envs\stopjogo\mademod...aa_bytesstart52aa_bytesend56aa_chunkstart0aa_chunkend16384aa_regex<regex.Matchobject;span=(52,56),match=b'ch...aa_regexpatternregex.Regex(b'\\bchar\\b',flags=regex.A|reg...aa_replacef(newfile:str,newbytes:bytes)aa_get_contextf()aa_partial_resultFalseaa_full_match(b'#include <stdio.h>\r\n\r\n\r\n\r\n\r\n// np...aa_partial_match<NA>aa_groups((0,b'char'),((52,56),))aa_allcaptures0aa_resultb'char'aa_result_utf8charaa_bytesstart_whole52aa_bytesend_whole56# df.loc[df.aa_bytesstart > 1][:20].aa_replace.iloc[0]('c:\\testestest.py', 'CHARRRRRRR')# substitutes one match, never changes the original file//np=np.byte,c=signedCHARRRRRRR,ctypes=ctypes.c_byte,code=b//numpy.int8:8-bitsignedinteger(-128to127).//Signedintegertype,compatiblewithCcharvoidcfun_byte(constsignedchar*indatav,size_tsize,signedchar*outdatav)