Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:37:30+00:00 2026-05-28T19:37:30+00:00

Hi i want to use below php regex in spry java script framework but

  • 0

Hi i want to use below php regex in spry java script framework but them doesn’t work with spry framework and spry doesn’t let the user to input!.
1)"/^[\d]+$/"
2)"/^([\x{600}-\x{6FF}]+\s)*[\x{600}-\x{6FF}]+$/u"
3)"/^([\x{600}-\x{6FF}]+\d*\s)*[\x{600}-\x{6FF}]+\d*$/u"
please help me to convert them to use in spry framework.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:37:30+00:00Added an answer on May 28, 2026 at 7:37 pm
    1) /^[\d]+$/
    2) /^([\u0600-\u06FF]+\s)*[\u0600-\u06FF]+$/
    3) /^([\u0600-\u06FF]+\d*\s)*[\u0600-\u06FF]+\d*$/
    

    /u is not supported, since Javascript regexes only supports unicode in terms of codepoints. \x{???} (unicode codepoints) should be written \u???? in Javascript regex (always 4 digits 0 padded)

    In these cases, the following applies to the rest of the regex:

    • \s in Javascript is treated as unicode
    • \d isn’t, which means only ASCII digits (0-9) are accepted.

    This means we specifically have to allow “foreign” numerals, e.g. Persian (codepoints 06F0-06F9):

    1) /^[\d\u06F0-\u06F9]+$/
    2) /^([\u0600-\u06FF]+\s)*[\u0600-\u06FF]+$/
    3) /^([\u0600-\u06FF]+[\d\u06F0-\u06F9]*\s)*[\u0600-\u06FF]+[\d\u06F0-\u06F9]*$/
    

    (Remove \d if ASCII digits shouldn’t be accepted)

    Not sure what the brackets are supposed to be doing in example 1, originally they could be written:

    1) /^\d+$/
    

    But to add the Persian numerals, we need them, see above.

    Update

    Spry character masking, however, only wants a regex to be applied on each entered character – i.e., we can’t actually do pattern matching, it’s just a “list” of accepted characters in all places, in which case:

    1      ) /[\u06F0-\u06F9\d]/      // match 0-9 and Persian numerals
    2 and 3) /[\u0600-\u06FF\d\s]/    // match all Persian characters (includes numerals), 0-9 and space
    

    Once again, remove \d if you don’t want to accept 0-9.

    Update 2

    Now… using regex for validation with Spry:

    var checkFullName = function(value, options)
    {
       // Match with the by now well-known regex:
       if (value.match(/^([\u0600-\u06FF]+\s)*[\u0600-\u06FF]+$/))
       {
          return true;
       }
       return false;
    }
    
    var sprytextfield =
         new Spry.Widget.ValidationTextField(
              "sprytextfield", 
              "custom", 
              { validation: checkFullName, validateOn: ["blur", "change"] }
         );
    

    A similar custom function can be made for case 3.

    See examples from Adobe labs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to use two independent $_SESSIONs in a single PHP script. I have
Below is my stored procedure. I want use stored procedure select all row of
I have a paragraph of text below that I want to use an input
good day dear php-fans at stackoverflow. i want to use imagegrabscreen — to get
the code below is a jquery POST request javascript. i want to use the
I am working on a new PHP framework for personal use in future projects,
I want use A-Z buttons on a html page like shown below (only sample
<?php wp_nav_menu(); ?> So I want to use the above function to spit out
I have a php variable echo $id. Now I want to use the $_POST
I want to use Zend_Debug::dump, to keep some variables in the log, but since

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.