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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:51:15+00:00 2026-06-07T19:51:15+00:00

Why does ^.*$ does not match a line in: This is some sample text

  • 0

Why does ^.*$ does not match a line in:

This is some sample text

this is another line

this is the third line

how can I create a regular expression that will match an entire line so that when finding the next match it will return me the next line.

In other words I will like to have a regex so that the first match = This is some sample text , next match = this is another line etc…

  • 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-07T19:51:18+00:00Added an answer on June 7, 2026 at 7:51 pm

    ^ and $ match on the entire input sequence. You need to use the Multiline Regex option to match individual lines within the text.

    Regex rgMatchLines = new Regex ( @"^.*$", RegexOptions.Multiline);
    

    See here for an explanation of the regex options. Here’s what it says about the Multiline option:

    Multiline mode. Changes the meaning of ^ and $ so they match at the
    beginning and end, respectively, of any line, and not just the
    beginning and end of the entire string.

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

Sidebar

Related Questions

I am trying to delete part of a string that does not match my
Please could someone explain to me why this regex does not match anything, when
Possible Duplicate: php - regular expression - PCRE does not support \L, \l, \N,
I am wondering why the following regex does not match. string query = \1
We're getting a server error saying Parameter count does not match Parameter Value count.
I have to match two hashtable, but its keys does not match. So i
Have error ValueError: time data '2012-03-15 9:45:00 AM' does not match format '%Y-%m-%d %H:%M:%S'
In Pyramid , add_notfound_view(append_slash=True) will cause a request which does not match any view,
If the itemcount property does not exactly match the number of indexed rows is
Does an analogue to Java's Math.rint exist in Python? If not, how can I

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.