Regarding the Space issue while using Rich Text

Hi, I am using Rich Text Widget in my project. When I am entering the spaces in rich text and saving it then those spaces are getting saved. I don't want all the spaces to be removed. Only the data with no characters should not be saved. For that I have tried to use multiple regex just to find out whether the given input in the rich text have any characters or not. Before using regex I have used HTML to Plain text java action in order to remove HTML tags so that I can check the presence of any characters using regex.  The regex is not allowing any space but along with that it is not allowing any character as well. Can anyone suggest me how to solve this?
1 answers

You could try something like this to check if the string only consists of whitespace:

isMatch($YourPlainText, '\s+')


Or the other way around, if there are any non-whitespace characters:

isMatch($YourPlainText, '.*[\S].*')