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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:01:00+00:00 2026-06-04T00:01:00+00:00

Are the rules for what I escape in a bracket different for what I

  • 0

Are the rules for what I escape in a bracket different for what I do outside of brackets?

For example should I escape a ? inside a bracket? Is it /blah[^?]/ or /blah[^\?]/

Are the rules for brackets different than not, or should I be escaping both the same?

  • 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-04T00:01:03+00:00Added an answer on June 4, 2026 at 12:01 am

    The only thing that needs to be escaped in brackets is a closing bracket, and a minus if it is not initial or final, and a hat if it is initial, AFAIK. And the backslash itself, obviously.

    The reason is, these are the only characters with a special significance inside the brackets. A closing bracket ends the brackets, a mid-string minus indicates a range, and an initial hat negates the bracket class. Everything else should be literally interpreted. The backslash is the escape character, so you need a double backslash to match a literal backslash.

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

Sidebar

Related Questions

The rules for promotion is when operands are of different types, automatic binary numeric
I am using these rules and conditions in .htaccess to turn these http://www.example.com/index.php/about/history http://www.example.com/about/history/index.php
The escaping rule for single quoted string looks inconsistent in the following example: What's
I'm trying to get matches of single bracket followed by a non-space, but not
What rules should i follow in order map efficiently entities from my domain model
What rules or tips should I follow to enable a function to use NRV
I am tired of always trying to guess, if I should escape special characters
Here is rspec code for controller: it should render edit if update was not
What are the rules for the escape character \ in string literals? Is there
With at-rules, it's possible to have a ruleset for elements during that at-rule event

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.