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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T23:00:59+00:00 2026-06-09T23:00:59+00:00

I need to validate a textarea with jquery validate. I’m looking for regex to

  • 0

I need to validate a textarea with jquery validate. I’m looking for regex to check multiple quoted strings separated by a whitespace and longer more than 5 chars.. :

“quoted text..” “some other quoted text” “another quoted string” = good

“quoted text..” “” “another quoted string” = not good

“quoted text..” “abcd” “another quoted string” = not good

The following checks only the first quoted text … (“quoted string longer than 5” “” –> this passes but it shouldn’t)

$(document).ready(function()
{
   $.validator.addMethod("coll_regex", function(value, element) { 
   return this.optional(element) || /"(.*?)"/.test(value); 
    }, "Message here......");

$("#f_coll").validate(
{
    rules:{
    'coll_txt':{
        required: true,
        minlength: 5,
        maxlength: 200,
        coll_regex: true
        }
    },
    messages:{
    'coll_txt':{
        required: "Textarea is empty...",
        minlength: "Length must be, at least, 5 characters..",
        maxlength: "You exceeded the max_length !",
        coll_regex: "Use the quotes...."
       }
    },
    errorPlacement: function(error, element) {
      error.appendTo(element.next());
  }
});
});

is there a regex that does this ??? Would be great …
Thank you

  • 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-09T23:01:01+00:00Added an answer on June 9, 2026 at 11:01 pm

    The regex you’re looking for is /^("[^\".]{5,}" )*"[^\".]{5,}"$/

    '"abcdefg" "abcdefg" "01324"'.match(/^("[^\".]{5,}" )*"[^\".]{5,}"$/)  //--> true
    '"abcdefg" "123" "01324"'.match(/^("[^\".]{5,}" )*"[^\".]{5,}"$/)  //--> false
    '"abcdefg" "" "01324"'.match(/^("[^\".]{5,}" )*"[^\".]{5,}"$/)  //--> false
    

    EDIT:

    This one is more precise: /^("[^\".]{5,}"\s+)*"[^\".]{5,}"$/
    It allows any whitespace between groups, not only a single space.

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

Sidebar

Related Questions

I need to validate a textarea using the plugin jQuery Validate, to do that
i need to validate address1 , address 2 and city using jquery regex.. Used
I need to validate submitted form data: To check whether fields are empty. Proceed
I have a textarea in which I need to validate that at least one
I'm looking to validate the length of a textarea using a regular expression validator.
I need validate multiple fields in the JavaScript Framework, but can't figure out how.
I need help with jQuery and ajax. need to load textarea content from file
Possible Duplicate: Check whether the string is a unix timestamp i need validate a
I need to validate a byte[] in my model as Required but whenever I
I need to validate the text box value from the generated html table (grid)

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.