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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:09:47+00:00 2026-05-14T05:09:47+00:00

In my regex, I want to say that within the sample text, any characters

  • 0

In my regex, I want to say that within the sample text, any characters are allowed, including a-z in upper and lower case, numbers and special characters.

For example, my regular expression may be checking that a document is html. therefore:

"/\n<html>[]+</html>\n/"

i have tried []+ but it does not seem to like this?

  • 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-14T05:09:47+00:00Added an answer on May 14, 2026 at 5:09 am

    Using [XXX]+ means any character that’s between [ and ], one or more than one time.

    Here, you didn’t put any character between [ and ] — hence the problem.

    If you want to say “any possible character”, you can use a `.`

    Note : by default, it will not match newlines ; you’ll have to play with [**Pattern Modifiers**][1] if you want it to.

    If you want to say any letter, you can use :

    • for lower case : [a-z]
    • for upper-case : [A-Z]
    • for both : [a-zA-Z]

    And, for numbers :

    • [0-9] : any digit
    • [a-zA-Z0-9] : any lower-case or upper-case letter, and any number.

    At that point, you will probably want to take a look at :

    • The Backslash section of the PCRE manual
    • And, especially, the \w meta-character, which means "any word character"

    After that, when you’ll begin using a regex such as

    /.+/s
    

    which should match :

    • Any possible character
      • Including newlines
    • One or more time

    You’ll see that it doesn’t "stop" when you expect it too — that’s because matching is greedy, by default — you’ll have to use a ? after the +, or use the U modifier ; see the Repetition section, for more informations.

    Well, actually, the best thing to do would be to *invest* some time, carefully reading everything in the [**PCRE Patterns**][4] section of the manual, if you want to start working with regexes 😉

    Oh, and, BTW : **using regex to *parse* HTML is a bad idea…**

    It’s generally much better to use a DOM Parser, such as :

    • DOMDocument::loadHTML
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What should be the RegEx if I want to find the text between the
Let's say I have the following within my source code, and I want to
I want to select blocks of text within given string. These blocks of text
I'm banging my head against a wall. I want a regex that matches: empty
I want a regex that match all the occurrences in a string of a
I need help with Regex to extract numbers from a string that is missing
First of all, I want to say that I know there are a bunch
I want a regex that matches a string which contains - At least one
Let's say that I want to generate a data frame which contains a column
I am having problems with the nested '+'/'-' lookahead/lookbehind in regex. Let's say that

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.