Jump to content
Sign in to follow this  

this regex function gets unexpected results at some cases

Recommended Posts

i use this Regex function to check if the string have a Characters that I specify in the pattern on not


Function CheckCharsinString(const astr: string):Boolean;
Regexs : TRegEx;
i : integer;
svalue : string;
Allowed : string;

svalue := Trim(astr);

if Regexs.IsMatch(svalue, '^[ء-يA-Za-z0-9٠-٩⁰-⁹$™®©¤?@~<>«»✿❢•°،‘♔ہ¹ے;✧¢¯☆⊱٭✰❥¨.,’^*()%!\s-]+$') then
Result := True;
end else
Result := False;




when i check the following string  CheckCharsinString('✿شـ❢ـوكـ❢ـ‏‏ Dan✿') it always Return False.   


it should return True sense all that chars i use is in regex pattern . what is my Mistake ?

Edited by Skullcode

Share this post

Link to post

The regex you posted here got mixed up by the editor/browser. There is no way we can help you based on that code. Do as @FredS suggests: Use a tool to try this regex.

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this