Start a new topic

Regex to convert possibly completed field into boolean


I'm looking to create a dictionary to convert a free-text field into a boolean.

I intially had Replacement = False and Value to match on = --BLANK-- and this appeared to work fine.

I then tried to write something that could cope with absolutely anything being thrown at it (including tab, line breaks, whitespace etc.) and I tried to use Replacement = True and Value to match on = [\s\S]*

When I had both of these in the same dictionary absolutely any input returns "TrueTrue", even --BLANK-- which I thought should have resolved to "False" considering it is first in the dictionary

Any advice would be gladly received

Edit - changed to [\s\S]+ and now only returns "True" and not "TrueTrue" but still can't get "False" returned for blank input
Login or Signup to post a comment