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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:37:54+00:00 2026-06-01T11:37:54+00:00

I am trying to match & group ( any phrase )##date##( any phrase ),

  • 0

I am trying to match & group (any phrase)##date##(any phrase), but val1 and val2 are empty.

Console.WriteLine("Subject: "+line);
Match match = Regex.Match(line, "(.)"+Regex.Escape("##date##")+"(.)", RegexOptions.IgnoreCase);
string val1 = match.Groups[1].Value;
string val2 = match.Groups[2].Value;
Console.WriteLine("Line#{0}: {1} Date: {2}", ++lineNo, val1, val2);

Console:

Subject: http://www.website.com/url/is/masked.htm ##date## 3
Line#25:   Date: 

Isn’t a dot supposed to match anything?

  • 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-01T11:37:56+00:00Added an answer on June 1, 2026 at 11:37 am

    A dot matches a single character other than a newline. In your case, it matched the space before and after ##date##. Use the following regular expression instead:

    Match match = Regex.Match(line, "(.*) ##date## (.*)", RegexOptions.IgnoreCase);
    

    This matches the entire phrases before and after ##date##, excluding the single spaces on either side.

    Output:

    Line#25: http://www.website.com/url/is/masked.htm Date: 3

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

Sidebar

Related Questions

I am trying to match elements that have no other children elements, but also
I'm trying to match a regex string against a data file in perl, but
im trying to rewrite a url like page.php?sort=66&search=s&category=2,3,4&archive=june&page=3 to page-sort-1-search(s)-category-1,2,3-archive(june)-page3 but the thing is
I'm trying to match on a line ending with something like: blocking=12345us The pattern
I have this regex: /.*v\=([\w-]+).*(&autoplay\=1)?/ Which I am trying to match against: http://www.youtube.com/watch?v=awmLS6GCJno&width=1000&height=300&autoplay=1 This
I am trying to match a parent in the following HTML <tbody> <tr id=group-1
Im trying to match forum_id with several different forum_id's, something like forum_id = 5,7,12,43,63,78
I'm trying to match elements with a name that is 'container1$container2$chkChecked' , using a
I am trying to match floating-point decimal numbers with a regular expression. There may
I'm trying to match the parts of a version number (Major.Minor.Build.Revision) with C# regular

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.