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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:17:55+00:00 2026-05-28T04:17:55+00:00

I need to be able to handle data that can look like: set setting1

  • 0

I need to be able to handle data that can look like:

set setting1 "bind button_x +actionslot1;bind button_y \" bind button_x +stance \" "

bind button_a jump

set setting2 1 1 0 1

toggle setting_3 " \"value 1\" \"value 2\" \"value 3\" "

These are what some of the commands for the console of a game look like, and I’m trying to write an emulator of sorts that will interpret the code the same way the game will.

The first thing that comes to mind is regex, but I’m not sure it’s the best option. For example, when matching for the value of a setting, I might trying something like /set [\w_]+ "?(.+)"?/, but the wildcard matches the ending quote because it’s not lazy, but if I make it lazy, it matches the quote inside the value. If I make it greedy and stop it from matching the quotes, it won’t match the escaped quotes in the values.

Even if there are possible regex solutions, they seem like the wrong option. I had asked before about how programs like Visual Studio and Notepad++ know which parentheses and curly braces matched, and I was told there was something similar to regex in some ways but much more powerful.

The only other thing I can think of is to go through the lines of code character by character and use booleans to determine that state of the current character.

What are my options here? What do game developers use to handle console commands?

edit: Here’s another possible command which strongly deters me from using regex:

set setting4 "bind button_a \" bind button_b "\" set setting1 0 \" " \" "

The commands include not just escaped quotes, but quotes of the manner "\" inside escaped quotes.

  • 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-28T04:17:56+00:00Added an answer on May 28, 2026 at 4:17 am

    I would suggest you read about Lexical Analysis
    , this is the process of tokenizing your text using a grammar.
    I think it will help you with what you are trying to do.

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

Sidebar

Related Questions

I have a client application that should be able to handle the following: 1)
I've created a global handler for ajaxSuccess , but I need to be able
Users of the website need to able to store images in their area ,
Need to be able to pull Magento products into an external template. Need to
I need to be able to create basic MS Project items (tasks, projects, resources,
I need to be able to get at the full URL of the page
I need to be able to get a list of the groups a user
I need to be able to merge two (very simple) JavaScript objects at runtime.
I need to be able to load the entire contents of a text file
I need to be able to quickly convert an image (inside a rails controller)

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.