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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:08:28+00:00 2026-05-30T19:08:28+00:00

1. (.*?) 2. (*) 3. #regex# 4. /regex/ A. What do the above symbols

  • 0
1. (.*?)
2. (*)
3. #regex#
4. /regex/

A. What do the above symbols mean?
B. What is the different between # and /?

I have the cheat-sheet, but didn’t full get it yet. What i know * gets
all characters, so what .*? is for!

The above patterns are used in PHP preg_match and preg_replace.

  • 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-30T19:08:29+00:00Added an answer on May 30, 2026 at 7:08 pm
    • . matches any character (roughly).
    • *? is a so-called quantifier, matching the previous token at least zero times (and only as often as needed to complete a match – it’s lazy, hence the ?).
    • (...) create a capturing group you can refer to in either the regex or the match. They also are used for limiting the reach of the | alternation to only parts of the regex (just like parentheses in math make precedence clear).
    • /.../ and #...# are delimiters for the entire regex, in PHP at least. Technically they’re not part of the regex syntax. What delimiter you use is up to you (but I think you can’t use \), and mostly changes what characters you need to escape in the regex. So / is a bad choice when you’re matching URIs that might contain a lot of slashes. Compare the following two varaints for finding end-of-line comments in C++ style:

      preg_match('/\/\/.*$/', $text);
      preg_match('#//.*$#', $text);
      

      The latter is easier to read as you don’t have to escape slashes within the regex itself. # or @ are commonly used as delimiter because they stands out and aren’t that frequent in text, but you can use whatever you like.

      Technically you don’t need this delimiter at all. This is probably mostly a remnant of PHP’s Perl heritage (in Perl regexes are delimited, but are not contained in a string). Other languages that use strings (because they have no native regex literals), such as Java, C# or PowerShell do well without the delimiter. In PHP you can add options after the closing delimiter, such as /a/i which matches a or A (case-insensitively), but the regex (?i)a does exactly the same and doesn’t need delimiters.

    And next time you take the time to read through Regular-Expressions.info, it’s an awesome reference on regex basics and advcanced topics, explaining many things very well and thoroughly. And please also take a look at the PHP documentation in this regard.

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

Sidebar

Related Questions

/^[^ ]([\w- \.\\\/&#]+)[^ ]$/, I have the above regex. I want to make sure
I have this regex to filter out urls but its also filtering out some
/^[a-d][a-d]*(?:_[a-d]+)*$/ I'm using the above regex in jquery where I call it on every
Simple regex question. I have a string on the following format: this is a
I have a regex that is going to end up being a bit long
I read this PHP RegEx page , but either I'm missing something, misreading something,
Ok i got this example from Regular Expression Cookbook ^(?=.{3}$).* The regex above is
I would like to know how one could validate a password with regex. I
I have the following regex to detect text inside <?php (including the tag) '/<\?php(.*)\?>/isU'
I'm using Jquery(don't know if that's relevant), here's the regex: var re = new

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.