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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T20:56:31+00:00 2026-06-12T20:56:31+00:00

Simple regex question on extracting comments with linebreaks: String: <description language=de>Diese Tabelle zeigt die

  • 0

Simple regex question on extracting comments with linebreaks:

String:

   <description language="de">Diese Tabelle zeigt die Zugangswege der Besucher auf die Website</description>

   <options>
      <!-- Hier stehen die Optionen für den View, die sich nicht auf colums beziehen.
           Bisher gibt es da nix, kann aber mal nicht schaden das vorzusehen  -->
   </options>


   <defaultcolumn>
      <!-- Hier können für Basiswerte für alle Spalten definiert werden. 
           Die Spaltendefinition weiter unten gibt die Möglichkeit die Werte je Spalte zu überschreiben
           Welche Optionen es gibt (incl. Titel, Description und Emptycelltext) siehe "allvaluescolumn" oben. 
      -->
      <options>
         <option name="align" value="left"><!-- (left|center|right), default left --></option>

My regex attempt:

/<!--(.*)-->/

This extracts all one-line comments.

Question:

How do I get all comments? Also the multiline ones? Adding \n or \r\n\ did not succeed.

<!-- get me (linebreak) me also -->

  • 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-12T20:56:32+00:00Added an answer on June 12, 2026 at 8:56 pm

    Try

    /<!--(.*?)-->/s
    

    The . matches per default no newline characters, so you need to enable the dotall mode with the s after the regex delimiter. (s is the singleline modifier, it treats the whole string as one single line, i.e. make the dot match also newlines.)

    Then I made the quantifier ungreedy by adding a ? after it , otherwise it will match from the first opening tag to the last closing tag.

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

Sidebar

Related Questions

Simple regex question. I have a string on the following format: this is a
A quick simple regex question I have a domain name in a string that
Simple question but I got a headache to solve this game. Example regex. [a-zA-Z0-9\s]
I have a simple question how do I remove a \ with regex? Thanks
This simple regex matching returns a string instead of an object on every browser
I have a very simple regex question. Suppose I have 2 conditions: url =
Just one simple, specific question: I've got the string {var1}12345{var2} , and I want
A simple (I hope) regex question: I have several pages where I need to
I have what should be a real simple regex question. I'm making a makefile
Maybe simple question.. String text = fake 43 60 fake; String patt = [43.60];

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.