This would be rather annoying to do in Hypothesis itself, but in Hypofuzz we can go somewhat further than would otherwise be reasonable.
The r" prefix isn't explicitly represented in the AST, but with linenos and start-colnos we can read a slice from the filecache to check, for short strings which are valid regex patterns - it's not too expensive I think.
This would be rather annoying to do in Hypothesis itself, but in Hypofuzz we can go somewhat further than would otherwise be reasonable.
The
r"prefix isn't explicitly represented in the AST, but with linenos and start-colnos we can read a slice from the filecache to check, for short strings which are valid regex patterns - it's not too expensive I think.