SNOBOL4 (CSNOBOL4), 5863 bytes
I =INPUT R I LEN(1) $. X I X X = :S(R) OUTPUT =IDENT(I) 1 END Matches the first character LEN(1) and saves it with immediate assignment $. to X and. If I matches another X concatenated with itself, replacing it with nothingreplaces that substring and repeats. If the match succeeded, this step repeats; if the remaining string is empty, IDENT(I,<implicit empty string>), then 1 is output, else nothing is output.