Does not work.
Example:
pattern: "/^[a-z]*$/i" (check non latin letters)
Text: "נוצרOPGN"
Hi Bar Code Guru,
Try check this regex....
https://regex101.com/r/zI2Xoc/1
King Regards
Hi @Bad Code Guru ,As per your regex /^[a-z]*$/i it will match a string if it contains only lowercase letters (or no letters at all), and it will be case-insensitive. If the string contains any uppercase letters or other characters (digits, symbols, etc.), the regex won't match (All these conditions are for the English language).If you are looking for Latin Regular expressions then, there will be some keywords which is different from Normal regular expressions, and I think this component is not supporting Latin regular expressions.
Regards,
Hi @Bad Code Guru ,
Though I don't have idea about the FORGE Component which you have mentioned, but I could suggest you an alternate to work around with Regular Expressions with the JS Node.
Please take a look at the oml file attached below.
If you find my answer helpful, please mark as Solution.
Thanks,
Muneera Shaik
Hi @Bad Code Guru
I would first remind you that this component is just a wrapper on the Regex.Matches C# Method. Having said this, as far as I can tell, the pattern you provided does indeed not return any matches for the example text you provided, because it shouldn't, so I conclude the component is working correctly.
Just to double-check, I did a quick test prepending part of your example text to the pattern and got a match, so the component supports the characters that you are using.
What exactly are you trying to achieve? Leonardo has already given you an alternative, but without knowing your use case, we can only guess what the correct regex should be.
You can also use some online tools that can explain the regex you are using, so that you can have a better understanding of what it is matching.
Regards
Thank you for your replay.
The task is to identify if there are at least one non-latin char in the input string.
Quick test in console shows it should work:
As a workaround I came up with OS regex replace action, where I replace any latin char in a string with String.Empty, and check the length of a result. If it is non zero, then there are non-latin character.
Thank you.
Your last example tests just the string "OPGN". This test also works when using the component:
Using your original test string "נוצרOPGN" it will not match with your current regex as was already explained above.
If you want to capture anything that is not the "a-z" chars in the input string, then you can try the following regex: [^a-z]+
(Remember to set IgnoreCase = True, so the regex is case insensitive)
This will return the invalid chars when they exist:
And will return nothing if all chars are valid: