[File] Meaning of regex/T?

Christos Zoulas christos at zoulas.com
Sat Mar 8 17:19:12 UTC 2025



> On Mar 7, 2025, at 9:55 PM, Sudarshan S Chawathe <chaw at eip10.org> wrote:
> 
> There are a few instances of regex/T in the collection in magic/Magdir
> (1 in the file windows and 2 in msdos) but I don't think that flag is
> documented in 'man magic', which only mentions flags c, s, and l for
> regex.
> 
> Does /T for regex mean something similar to its meaning for the string
> type (i.e., trim)?  In that case, does it mean that the string matching
> the given regex is trimmed before printing?

Yes.

> 
> Related: are the flags for the regex type case-insensitive?  In
> particular, is regex/C an acceptable alternative for regex/c?  If not,
> what does regex/C mean?  (For instance, the file msdos contains
> regex/512/C.)

That currently does not work. I will add some code to detect it.

christos
> 
> Regards,
> 
> -chaw
> -- 
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20250308/80f88ef9/attachment.asc>


More information about the File mailing list