I haven't done this specific task, but don't see a reason why you can not, you can try out a policy something like
Rule 1
scope=configuration
Parse as block = ^interface .*
condition match criteria = interface (.*)
selected match action = continue
Rule 2
scope=previously matched block
condition match criteria = spanning-tree portfast edge
selected match action = do not raise violation
selected does not match action = raise violation
let me know if it works for you
-hope this helps-