RegExp for cyrillic and latin alphanumeric strings in ignite 2013.2 igTextEditor`s validatorOptions - infragistics

In ignite-ui igTextEditor regexp validation for latin alphanumeric I tried :
regExp: /^[A-Za-z0-9]+$/
It works for latin alphanumeric but when it comes to regexp for both latin and cyrillic alphanumeric there is nothing that I can make to work.
What is the regexp that I must type in the validator options so that both latin and cyrillc strings are checked for alphanumeric?

You will need to cover the Cyrillic characters as a Unicode range:
regExp: /^[A-Za-z0-9\u0410-\u044F]+$/

Related

Regex pattern that matches a string with English characters only with no spaces and special characters in flutter?

I tried many pattern examples but none worked so far.
I want to use a regex pattern that only allows English characters with no spaces and no special characters in flutter.
RegExp('[a-zA-Z]');
This is what I used before, but it allows spaces and other characters.
Also after using
r'/^[a-zA-Z]+$/'
The string entered in the username always returns false with spaces and special characters and without.
I'm not looking for an answer in JavaScript also the other question doesn't have the answer I'm looking for.
Here's a regular expression pattern to match only letters from the alphabet (both uppercase and lowercase):
/^[a-zA-Z]+$/
This pattern will match one or more characters that are in the range a-z or A-Z. The ^ and $ symbols indicate the start and end of the string, respectively, ensuring that only letters are present and no additional characters (such as spaces or numbers) are allowed.

How to build regex to search for strings that has non-alphanumeric characters?

I want a search for strings that has any special characters like alphanumeric characters. /[^a-zA-Z0-9]/ searches for strings that has no alphanumeric characters. But I don't want that. I want to filter with the only alphanumeric characters like á. So that it can match with álgebra but doesn't match with algebra. How can I build that?
You seem to want to match alphanumeric strings that should contain any letter other than an ASCII letter.
You can use
^(?=.*(?![A-Za-z])\p{L})[\p{L}0-9]+$
See the regex demo.
Details
^ - start of string
(?=.*(?![A-Za-z])\p{L}) - there must be at least one letter that is not an ASCII letter
[\p{L}0-9]+ - one or more any Unicode letters or ASCII digits
$ - end of string.
If you already know what character will be taken. I think you could use [list of characters].
I will give an example. I have some texts.
álgebara
algebara
algebrà
I use regex: ^.*?[áà].*?$
Result:
álgebara
algebrà
Demo
Details:
^.*?[áà].*?$: captures which string contains the specified character á or à

Need help on Regex to include European accents and special characters

There are tons of articles here around but I wasn't able to find a solution in this case.
I need to exclude any strings that doesn't include European characters like Chinese, Arabic, Russian etc.
Is is possible with one single Regex to match:
Alphanumeric Latin Characters (a,b,c,1,2,3,A,B,C ...)
European Accents (è,é,ò,ç,à ...)
UTF-8 Symbols (© ...)
Currencies (€,£,$ ...)
Whitespaces
And exclude all other characters?
What you'll need is something like:
[\p{Sc}\p{So}\p{Mn}\p{P}\p{Z}À-ÿ\w]
Here:
\p{Sc} matches any currency sign
\p{So} matches Various symbols that are not math symbols, currency signs, or combining characters
\p{Mn} matches a character intended to be combined with another character without taking up extra space (e.g. accents, umlauts, etc.)
\p{P} matches any kind of punctuation character
\p{L} matches any kind of letter from any language
\p{Z} matches any kind of whitespace or invisible separator
À-ÿ matches accents
\w any alphanum

Match Arabic word with regex that ends with “#”?

I use this for matching if there its '#' in beginning of word
/(?!\b)(#\S+\b)/
it takes everything after '#'.
But now I need to find all Arabic word who ends with "#" or for start how can I find all word end with "#"?
I try \b[A-Za-z]*#\b but dont work :(
[A-Za-z] would match ASCII alphabets..You need to specify arabic unicode range to match arabic words
You can try this
\b[\u0600—\u06FF]+#(?=\s|$)
This is a pretty good reference for Arabic unicode range..
[\u0600—\u06FF] covers the complete arabic unicode range which includes digits,numeric symbols...
If you want to match arabic alphabets only use this range
[\u0600-\u065F\u066A-\u06EF\u06FA-\u06FF]
To match arabic word you should use only arabic alphabets.
\u0621-\u063A\u0641-\u064A\u0660-\u0669\s
Your regex would be:
\b[\u0621-\u063A\u0641-\u064A\u0660-\u0669\s]*#\b

How to match Cyrillic characters with a regular expression

How do I match French and Russian Cyrillic alphabet characters with a regular expression? I only want to do the alpha characters, no numbers or special characters. Right now I have
[A-Za-z]
If your regex flavor supports Unicode blocks ([\p{IsCyrillic}]), you can match Cyrillic characters with:
[\p{IsCyrillic}] or [\p{Cyrillic}]
Otherwise try using:
[U+0400–U+04FF]
For PHP use:
[\x{0400}-\x{04FF}]
Explanation:
[\p{IsCyrillic}]
Match a character from the Unicode block "Cyrillic" (U+0400–U+04FF) «[\p{IsCyrillic}]»
Note:
Unicode Characters list and Numeric HTML Entities of [U+0400–U+04FF] .
It depends on your regex flavor. If it supports Unicode character classes (like .NET, for instance), \p{L} matches a letter character (in any character set).
To match only Russian Cyrillic characters use:
[\u0401\u0451\u0410-\u044f]
which is the equivalent of:
[ЁёА-я]
where А is Cyrillic, not Latin. (Despite looking the same they have different codes)
\p{IsCyrillic}, \p{Cyrillic}, [\u0400-\u04FF] which others suggested will match all variants of Cyrillic, not only Russian
If you use modern PHP version - just:
preg_match("/^[\p{L}]+$/u");
Don't forget the u flag for unicode support!
Regex to match cyrillic alphabets with normal(english) alphabets :
^[A-Za-z.!#?#"$%&:;() *\+,\/;\-=[\\\]\^_{|}<>\u0400-\u04FF]*$
It matches special chars,cyrillic alphabets,english alphabets.
Various regex dialects use [:alpha:] for any alphanumeric character in the current locale. (You may need to put that in a character class, e.g. [[:alpha:]].)
this worked for me
[a-z\u0400-\u04FF]
If you use Elixir:
String.match?(string, ~r/^\p{Cyrillic}*$/u)
You need to add the u flag for unicode support.
You can use the first and the last letter. For example in Bulgarian:
[А-я]+
For modern PHP (source):
$string = 'тест тест Тест Обязателльно Stackoverflow >!<';
var_dump(preg_replace('/[\x{0410}-\x{042F}]+.*[\x{0410}-\x{042F}]+/iu', '', $string));
In Java to match Cyrillic letters and space use the following pattern
^[\p{InCyrillic}\s]+$