how can I use a query (in Parse) in javascript to find or match words with accented characters like "escazĂș" and "escazu", both words must display the same results.
I have something like
query.matches("direccion", "escazĂș", i);
Thanks for your help!
Leo
Related
I am new here. I wanted to ask a question on using REGEX for an entity in DialogFlow
I wanted the entity to accept all text and spaces except for the symbol *
I have tried to use [A-Za-z0-9 ][^*], but it is not working. Any advice. thanks!
In your Regex expression, [^*] means "capture any character at the start of the line." To refer to a literal asterisk rather than matching any character, you need to use \*
If you want to match a line of letters or numbers as in the [A-Za-z0-9] example you give, but only if that string does not include an asterisk, then this expression should work for you:
^[a-zA-Z0-9]+$
This means "match a whole line of text if it only contains one or more of the characters a-z, A-Z, or 0-9".
If you want to match any character or group of characters in a line except for the asterisk, then you could use something like this:
(?!\*)([a-zA-Z0-9]+)(?<!\*)
The first part is called a "negative lookahead," and it looks forward to ensure we're not matching the asterisk. The last part is called a "negative lookbehind," and it looks backwards to make sure we're not matching the asterisk. The middle part is your "capture group," and confirms that you're matching any letters or numbers in a given string, but excluding the * character.
If this Regex gets input like *abc, it will capture abc. If it encounters abc*, it will still capture abc. If it encounters abc*def, it will capture abc and def separately in two capture groups, because it will break around the asterisk.
This link explains the concept of lookarounds in Regex. You can also use this Regex tester to get started practicing your Regular Expressions with explanations of what each block of characters does.
EDITED TO ADD If you're just interested in matching single characters rather than groups of characters, you can use [A-Za-z0-9] and match any upper or lowercase letter and any single digit. You don't need to exclude the * character, because the character group is already exclusive.
This is a slight duplicate of the question below, so responses here may also help you. Hope this helps!
How can I exclude asterisk in a regex expression
[A-Za-z0-9 ][^*]
What you regex will do is match 2 consecutive characters. First, it will look for anything A-Za-z0-9 . Then, it will look at the negated set that includes *, and will match ANY character except *.
You can type your regex into https://regexr.com/ to see a breakdown of how it matches and test some strings.
For example, your regex would match these:
Aa
AA
a&
A1
0_
But would not match these:
A*
a*
1*
And WOULD NOT match anything longer than 2 characters. If you really want to match any string with any characters except *, this should work:
[^\*]+
What that will do is match any number of consecutive characters that are not *. (The + means match 1 or more characters in the set). It is also a good idea to escape * because it is also a reserved character in regex. Even though most regex parsers are smart enough to know that inside a group you probably mean the literal char *, it is still a best practice to escape it. (And by that same token, you would want to use \s instead of the blank space in your original regex.)
Is it built-in function in DB2 to check if text(varchar) contains ONLY one uppercase character or i have to iterate a whole string and check every character?
you can use REGEXP_COUNT
something like:
SELECT REGEXP_COUNT( 'Steven Jones and Stephen Smith are the best players', '[A-Z]') FROM sysibm.sysdummy1
Result: 4
Take care if you can have accented chars, you may need to change the regexp pattern to consider them (don't remember the syntax, but you can find it easily on the web).
Also, look at the documentation to specify the length unit, if using a unicode string.
some time ago i found this weird character that i can t put it here because it doesn't work but i have images of it. It looks like a space character in the begin but it isn't.
When i google it i get this here and some random character in the search bar. Also i can't find it in the Unicode/ASCII library of characters
Does anyone what this character is and it's purpose?
Based on your Google search string, you have a long series of the character U+3164, the "Hangul Filler." Hangul is the Korean alphabet.
So I recently used this following lua code to separate each word from string and notice it's not showing special characters (e.g. /,;,'). So is there anyway for it to show?
string = "Test, Im testing"
for word in string:gmatch("%w+") do
print(word)
end
This code will not show the commas on the string but I need it to show.
Instead of %w I think you are looking for %S pattern.
Alternatively you can also try [%w%p]+.
See a brief description of how lua pattern behave at lua pil
How to search for percentage (%) sing through Google, Twitter Search etc.?
The search engines use it as a special character of just completely ignore it. I've tried to search for an HTML code of %, which is %, but it did not work either.
You can not do what you want with Google as it works today.
You cannot search for special characters in Google Web Search nor Gmail.
Google doesn't recognize special search characters like square brackets, parentheses, currency symbols, the ampersand, the pound sign, and asterisks.
These are the only symbols that return any results.
& (ampersand)
_ (underscore)
Check out the link below, an interesting article, it is 2005, but the same applies today, you still cannot search for special chars:
link text
AFAIK, there is no special entity for percent char, but You could provide its decimal code %