Well, I've got a propositional logic sentence like this :
~(((-P|-Q)->(P->Q))&((P->Q)->(-P|Q)))
and what I'd like to do, it's to add spaces between each character; and get something like this:
~ ( ( ( -P | -Q ) -> ( P -> Q ) ) & ( ( P -> Q ) -> ( -P | Q ) ) )
Moreover; I wouldn't like to add spaces only in those joined character -> and -P because represent an operand and a negative statements.
I had found a regular expression which added spaces, but it did it with all the characters, even with those which shouldn't have.
this is the expression i had found:
(?<=.)(?!$)
So; any help for doing it; doesn't matter whether is either a method or the same regular expression but modified.