Regex syntax difference in lpad and fworker

The command line query lpad get_fws -q '{"name":{"$regex":"c4_ts_\d+"}}' works, but the same query in my fworker.yaml does not, as it raises a JSONDecodeError. Instead, you need to escape the special character twice, query: '{"name":{"$regex":"c4_ts_\\d+"}}'. Is this something that should or can be changed? I understand that this discrepancy makes sense considering how Python parses text, but it’s still fairly confusing to a new user. Thanks!