replaceText("J*JSR", "J, JSR", "A, B")
# same output, on input expresions containing spaces
replaceText("J*JS R", "J, JS R", "A, B")
# works even with Boolean expressions, where lower case
# letters signal the absence of the causal condition
replaceText("DEV + urb*LIT", "DEV, URB, LIT", "A, B, C", boolean = TRUE)
Run the code above in your browser using DataLab