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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:25:21+00:00 2026-06-16T05:25:21+00:00

Why do you have to escape some metacharacters in their regex engine, but not

  • 0

Why do you have to escape some metacharacters in their regex engine, but not others? For example:

/foo[1-9]*  

works as expected, but the regular expression

foo[1-9]+  

must be expressed as

/foo[1-9]\+  

in vim. Anybody know?

  • 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-16T05:25:22+00:00Added an answer on June 16, 2026 at 5:25 am

    This is because vim (actually vi) created their own regex flavor long before perl did. Even POSIX BRE and ERE came after vimwikipedia. They are still maintaining their own flavor so it’s quite different.

    To make the answer more resourceful here is a quote from ed‘s wiki.

    The editor was originally written in PDP-11/20 assembler in 1971 by Ken Thompson. Many features of ed came from the qed from his alma mater University of California at Berkeley3 Thompson was very familiar with qed, and had reimplemented it on the CTSS and Multics systems. His versions of qed were the first to implement regular expressions. Although regular expressions are part of ed, their implementation is considerably less general than that in qed.

    Aspects of ed went on to influence ex, which in turn spawned vi. The non-interactive Unix command grep was inspired by a common special uses of qed and later ed, where the command g/re/p means globally search for the regular expression re and print the lines containing it. The Unix stream editor, sed implemented many of the scripting features of qed that were not supported by ed on Unix. In turn sed influenced the design of the programming language AWK – which inspired aspects of Perl.

    These two paragraphs have a lot of information! I wish I could bold it all. Some highlights,

    • Ken Thompson wrote ed in 1971. ed was actually a reimplentation of qed.
    • Ken added Regular Expression in his version of qed which is actually ed.
    • Inspired by ed, in 1976 William Joy (known as Bill Joy) wrote exwikipedia
    • Bill Joy in 1976 wrote vi as the visual mode for a line editor called ex wikipedia
    • grep was inspired by special uses of qed and later ed.
    • sed was implemented as many of the scripting features of qed that were not supported by ed on Unix
    • sed influenced the design of awk.

    So vi Regular Expression were in ed which was written in 1971. It’s long before any other regular expression flavor.

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

Sidebar

Related Questions

For some reason I have difficulty removing escape characters in Metro. An example: Document
I have to escape some inputs on a form. I used mysql_real_escape_string to escape
I have some code: $(xml).find(strengths).each(function() { //Code //How can i escape from this block
i am trying escape some data before it goes into my database, but i
I have this regex: '/^files\/(.+\..+)$/'; But I want to replace the files/ section with
How do I escape '<' and '>' character in sed. I have some xml
I have some code which utilizes parameterized queries to prevent against injection, but I
I have a function that saves cookies cookievalue= escape(document.passwordCheck.oldPassword.value) + ;; document.cookie=oldCookie= + cookievalue
I have a bunch of string with special escape codes that I want to
I have a method that looks like this: public static String escape(String text) {

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.