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 8424693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:04:19+00:00 2026-06-10T04:04:19+00:00

I have a regex string for validating email addresses, and I’d like to send

  • 0

I have a regex string for validating email addresses, and I’d like to send it down to my application over json. I get an error from dojo/Json saying:

Uncaught SyntaxError: Unexpected token ]

So I took my JSON file and dropped it into JSONLint and got this slightly more specific error:

Parse error on line 3:
... {        "regex": "^(([^<>()[\]\\.,;:\
----------------------^
Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['

Here’s my json file contents:

{
"Email Address": {
    "regex": "^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$"
    }
}

Json.org doesn’t seem to say anything about escaping regex characters…and the string itself is escaped properly because I can set a variable to that regex string in a js console.

Anyone know what I can do to get this to work?

  • 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-06-10T04:04:21+00:00Added an answer on June 10, 2026 at 4:04 am

    This doesnt work because your using ” within the strings.

    One work around would be to replace every ” with something like /’\ then what you parse it again replace every /’\ with ” and that will work.

    Will look in to a better way but hopefuly this helps in the mean time.

    UPDATE:

    Every base 64 encode it then decode it: similar to http://decodebase64.com/

    And save the base 64 encode regex when your doing stringify and then when you parse decode the the base 64 and store it back..

    So basicly

    -when wanting to stringify
    -base64 encode regex
    -Overwrite normal regex with base 64
    -Stringify json

    -when wanting to parse JSON
    – Parse it in
    – Get base 64 reg ex
    – Decode it
    – Replace it

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

Sidebar

Related Questions

I have some Regex, it looks like this: string regexForDrop = @^((%27)|'|(\-\-))\s*(d|%64|%44)(r|%72|%52)(o|%6F|%4F)(p|%70|%50)$; It works
I have a good regular expression pattern for validating email addresses. I've used it
I have this regex: private static final String SPACE_PATH_REGEX =[a-z|A-Z|0-9|\\/|\\-|\\_|\\+]+; I check if my
I have a regex expression that I'm doing a split against another string and
I have used the excellent gskinner.com/RegExr/ tool to test my string matching regex but
I have these variables: boost::regex re //regular expression to use std::string stringToChange //replace this
Hi have this URL string which I need to extract possibly using regex but
I have a string: [\n['-','some text what\rcontains\nnewlines'],\n\n trying to parse: Regex.Split(@[\n['-','some text what contains
I have a string in PHP and I want it to match the regex
Is this Regex correct if I have to match a string which is atleast

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.