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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T02:35:30+00:00 2026-06-09T02:35:30+00:00

I seem to have entered a pretty complex area (to me anyways.) Lets say

  • 0

I seem to have entered a pretty complex area (to me anyways.)
Lets say I have the following line:

1:11:39 "LOGIN ATTEMPT: "47576966" Arlond"

What I am trying to do is seperate the time(1:11:39) ID(47576966) and name(Arlond). I got as far as the below regex but I am sort of lost at what I need to do next. I understand my regex is incorrect to grab everything I need and that’s where I’ll also need help among getting my For loop to work correctly. I have been looking up on how to regex split and replace but so far I have not had any luck getting anything to work.

([""'])(?:(?=(\\?))\2.)*?\1


Using TestFile As New IO.StreamReader(My.Settings.cfgPath & "tempRPT.txt", System.Text.Encoding.Default, False, 4096)
        Do Until TestFile.EndOfStream
            ScriptLine = TestFile.ReadLine
            ScriptLine = LCase(ScriptLine)
            If InStr(ScriptLine, "login attempt:") Then
                Dim m As MatchCollection = Regex.Matches(ScriptLine, "([""'])(?:(?=(\\?))\2.)*?\1")
                For Each x As Match In m

                Next
                'builder.AppendLine(ScriptLine)
            End If

        Loop
    End Using
  • 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-09T02:35:31+00:00Added an answer on June 9, 2026 at 2:35 am

    With respect to your regular expression, I’ve always found it best to be explicit wherever possible (anchors, for example). Assuming your input data is as well behaved as it looks, you could do something like this:

    ^(\d{1,2}:\d{2}:\d{2})\s""LOGIN\sATTEMPT:\s""(\d+)""\s([^""]+)""$
    

    Breaking that into its components:

    ^                       // Anchor: Start of string (or line).
    (\d{1,2}:\d{2}:\d{2})   // Capture one or two digits, colon, two digits, colon, two digits.
    \s""LOGIN\sATTEMPT:\s"" // Anchor: match (but don't capture) literal text.
    (\d+)                   // Match/capture one or more digits. (maybe you could use \d{8} instead).
    ""\s                    // Anchor: literal text.
    ([^""]+)                // Match and capture everything that is not a quote.
    ""                      // Anchor: Literal quote.
    $                       // Anchor: End of string (or line).
    

    This breaks down if your name field is allowed to contain the " (double-quote) character. If that turns out to be the case you will have to modify the last subexpression to be more permissive.

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

Sidebar

Related Questions

I seem to have a problem passing some strings on from one form to
I seem to have found a bug in jQuery UI that duplicates dragged elements
I seem to have hit a snag while building my project using Ant. The
i seem to have some trouble installing autopy.h https://github.com/msanders/autopy/#introduction i already tried the installation
I seem to have the Twitter Bootstrap carousel working properly as far as moving
I seem to have broken validates_confirmation_of in my rails app. My model looks like
I seem to have looked through many solution on here and the web and
I seem to have ballsed up my git repo by tracking a file, later
I seem to have a problem with getting MVC to fill in my custom
I seem to have the exact opposite problem than this question on stopping dock

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.