Check length of text with space

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
Arjun Brti
Posts: 49
Joined: October 15th, 2020, 3:40 am

Check length of text with space

Post by Arjun Brti »

Dear team

How can I write the logic to check the space in a string field. For example if name of a person is John Deli, the enumerators must write the first name and last name like John<space> Deli, not JohnDeli with min length 5.

Thank you.

Regards,
Brti
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Check length of text with space

Post by Gregory Martin »

There are a variety of ways you could do this, but one option is to use the regexmatch function: https://www.csprousers.org/help/CSPro/r ... ction.html

If you want to check for characters, a single space, more characters, and then optional spaces, you would use this regular expression: ^\S+\s\S+\s*$

You can test it here: https://regex101.com/r/wjkOp8/1
Post Reply