not supported by the BSD regex code.
#------------------------------------------------------------------------------
-# $File: commands,v 1.55 2016/07/10 12:44:24 christos Exp $
+# $File: commands,v 1.57 2017/04/04 20:34:24 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
!:mime text/x-awk
0 string/wt #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
-0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk or perl script text
+0 regex/4096 =^[A-Za-z0-9_]{0,100}BEGIN[A-Za-z0-9_]{0,100}[{] awk or perl script text
# AT&T Bell Labs' Plan 9 shell
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
#------------------------------------------------------------------------------
-# $File: images,v 1.122 2017/03/17 21:35:28 christos Exp $
+# $File: images,v 1.123 2017/04/04 20:34:24 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
>>>&0 regex =[0-9]{1,50} \b %s
0 search/1 P1
->0 regex/4 P1\\s
+>0 regex/4 P1[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
0 search/1 P2
->0 regex/4 P2\\s
+>0 regex/4 P2[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, greymap
!:strength + 45
!:mime image/x-portable-greymap
0 search/1 P3
->0 regex/4 P3\\s
+>0 regex/4 P3[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, pixmap
!:strength + 45
!:mime image/x-portable-pixmap
0 string P4
->0 regex/4 P4\\s
+>0 regex/4 P4[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, rawbits, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
0 string P5
->0 regex/4 P5\\s
+>0 regex/4 P5[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, rawbits, greymap
!:strength + 45
!:mime image/x-portable-greymap
0 string P6
->0 regex/4 P6\\s
+>0 regex/4 P6[A-Za-z0-9_]
>>0 use netpbm
>>>0 string x \b, rawbits, pixmap
!:strength + 45
#------------------------------------------------------------------------------
-# $File: python,v 1.28 2015/09/16 22:19:54 christos Exp $
+# $File: python,v 1.30 2017/04/04 20:34:24 christos Exp $
# python: file(1) magic for python
#
# Outlook puts """ too for urgent messages
# from module.submodule import func1, func2
-0 regex \^from\\s+(\\w|\\.)+\\s+import.*$ Python script text executable
+0 regex \^from[\040\t\f\r\n]+([A-Za-z0-9_]|\\.)+[\040\t\f\r\n]+import.*$ Python script text executable
!:mime text/x-python
# def __init__ (self, ...):
# except: or finally:
# block
0 search/4096 try:
->&0 regex \^\\s*except.*: Python script text executable
+>&0 regex \^[A-Za-z0-9_]*except.*: Python script text executable
!:mime text/x-python
>&0 search/4096 finally: Python script text executable
!:mime text/x-python