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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:39:34+00:00 2026-06-01T15:39:34+00:00

What is the regex I need to use if I Need to select the

  • 0

What is the regex I need to use if I

Need to select the “10” in player list and not the “10” from group

{"group":"10","player":["12","15","13","10","1"]}

Sorry I should have given a little more on the programming scope

The json string is supposed to be treated as a string and not json parsed because I need to use query in mysql to select rows that match this criteria..

for example, in the above example…

Select * from team Where jsondata=(Something to the effect that "10" can be found in player list but will ignore if "10" is found only in group)

If i use:

Select * from team Where jsondata LIKE'%"10"%'

then obviously it would be wrong because if the data was {"group":"10","player":[]} it would still qualify

i want to run a php command like preg_match to match the “10” form the player list if found

Thanks for those who have replied so far

  • 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-01T15:39:35+00:00Added an answer on June 1, 2026 at 3:39 pm

    I know you asked for a regular expression. However, if the string will always be a Python dict, then how about:

    str = "{\"group\":\"10\",\"player\":[\"12\",\"15\",\"13\",\"10\",\"1\"]}"
    
    "10" in eval( str )["player"]
    

    This would test whether the string "10" exists for the list in the "player" key. You might want something slightly different. The point being, if the data will always be a serialized Python data structure, you’ll be able to work with this data much more naturally as a Python data structure.

    Note, since I was typing the string manually I had to escape the ". If you were reading this string from a file you wouldn’t have to do that.

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

Sidebar

Related Questions

I have a URL that looks as follows... /images/home/img/digits.png I need to use regex
I need a regex that could select from the following text: string test hello
I need a regex to use in Java to replace a String with UNKNOWN
I need to do use php/regex to replace this: {{image-4-m}} to this: <img src=4.jpg
I don't usually use regular expressions, hence my question. I need a regex to
Using Regex I need to remove the last folder from a path: Example :
In my XSLT transformation I have two analyze-strings that I need to use to
I need to use regex to get the Did you mean? portion of the
what Regex Expression do we need to use in this scenario Iam looking to
Couldn't find a function for this. I'm assuming I need to use regex? I'm

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.