Below are some examples that might help you in entering a valid TXT record.

Here are some examples of valid TXT values:

v=spf1 a -all ( )
v=spf1 a -all !@#$%^&*':;()_
'v=spf1 a ' -all \ foo
v=spf1 a -all \ asdf
v=spf1 a -all \\   Use of double backslash(\\) is allowed at the end.
v=spf1 a \" asdf \" -all a

Below are some examples of invalid TXT values:

v=spf1 a -all \ Value cannot end with a single backslash(\).
"v=spf1 a -all () Double quote(") not allowed at the beginning.
v=spf1 a -all ()" Double quote(") not allowed at the end.
v=spf1 a -all \\" Must use single backslash to escape a double quote.
\\" v=spf1 a -all Must use single backslash(\) to escape a double quote.
"v=spf1 a -all \_ \; \+ \^ \% " Double quote is the only character that needs to be escaped with a single backslash.
v=spf1 a -all \007 Only printable characters are allowed. Do not use escape codes to enter characters.
If an invalid record is entered, DNS will respond with a SERVFAIL.