3 ms·
Cleaned it up and tested it as Unit Tests. `^unsafe(\s(\{|fn|trait|impl))` will match the four examples I gave but not match print or commented `unsafe`. I'm no
by Nadya 10y ago
Cleaned it up and tested it as Unit Tests. `^unsafe(\s(\{|fn|trait|impl))` will match the four examples I gave but not match print or commented `unsafe`. I'm not sure if unsafe can be indented inside of a block but ignoring whitespace at the start of a line should fix it.
I did this as a learning experience because I either regex101 doesn't properly implement /g or I don't understand capture groups. :D
[0] http://i.imgur.com/zMSVo4A.png http://i.imgur.com/zMSVo4A.png