Skip to main content
March 16, 2022
Question

I want to put a condition that text field only accept Hebrew charecter,

  • March 16, 2022
  • 8 replies
  • 0 views

Hi,

I want to put a condition that text field only accept Hebrew charecter, I tried to find correct regex to validate hebrew text, but did not find.

Please suggest where can i find regex for hebrew text or is there any other way to do the same.

Thanks & Regards,

ShreeKrishna Tiwari 

8 replies

stefanhelzle0001
Brainy
March 16, 2022

You could add a validation to check that all characters are Hebrew. I think there is no need for any regex.

https://unicode-table.com/en/blocks/hebrew/

This snippet checks whether a given string only consists of valid characters.

a!localVariables(
  local!string: "abcx",
  local!valid: "abc",
  len(cleanwith(local!string, local!valid)) = len(local!string)
)

March 16, 2022

Hi,

Thank you for quick response,

So The way You sugeested, do I need to put all 112 hebrew charecter in one string one by one?   

stewart.burchell
March 16, 2022

If the characters are in a contiguous unicode range then you could write an expression to automate this. 

davel001150
March 16, 2022

You can use the code() function to split a string into a list of numbers representing the Unicode number of the character, then confirm for all numbers they are greater than one value and less than the other (like the beginning and end of the Hebrew code blocks).

You may want to confirm in the unicode standard that you don't have a separate block for special Hebrew characters and punctuation.  I find that Unicode usually has 2 blocks for popular languages, the rarer symbols being grouped together further down the list.  I don't know if you'll need an additional block for Hebrew numbers.  I know that numerals in Arabic got it's own block.

True enough, you're going to need to account for both Hebrew block starting at  #0590 (that's hexadecimal) and the Hebrew Presentation Forms block starting at #FB00 (hexadecimal)  Go to unicode.org.