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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:52:58+00:00 2026-06-06T18:52:58+00:00

I’m new to regular expressions and i’m feeling this very difficult to solve: I

  • 0

I’m new to regular expressions and i’m feeling this very difficult to solve:

I have a the following string:

"inforun 7970 12423 99 10:03 ? 00:09:03 abcd -PR -gmh domain.den.abc.com -gmp 6020 -guid 9c06cc02-b1c8-41cf-93e6-1d795e9fff62 -rst 180 -s FOLDER_NAME:wkf_workflow.s_session -something Session task instance [session]"

I have to extract the time which 10:03 and the 'domain' in domain.den.abc.com and the FOLDER_NAME, the 'workflow' in the 'wkf_worklfow' and the 'session' in the 's_session' the time, domain, foldername, workflow and session keep changing for every string and there are a bunch of strings like this all attached as a single string.
Here are the patterns that are common for every string. the 'abcd -PR -gmh' is common and can help in finding the time that is just before the '?'
the '-s', ':wkf' is common for all the string and the folder_name is right in between these two.
the 'workflow' is in between 'wkf_' and '.s_'
the session is in between 's_' and the immediate next '-'
I need the time, domain, folder name, workflow and session all in seperate strings.
I tried to practice regular expression only a few days back it is taking so much time for me even to comprehend something like "\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z" which is given here
Thank you for your help

  • 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-06T18:52:59+00:00Added an answer on June 6, 2026 at 6:52 pm

    Regex (time $1, domain $2, folder name $3, workflow $4, session $5):

    (?<=\s)(\d{2}:\d{2})(?=\s).*?(?<=\s)((?:[a-zA-Z\d]+(?:\-[a-zA-Z\d]+)*\.)+[a-zA-Z]{2,4})(?=\s).*?(?<=\s)([a-zA-Z\d_]+):wkf_([a-zA-Z\d]+)\.s_([a-zA-Z\d]+)(?=\s)
    

    Ruby:

    text = "inforun 7970 12423 99 10:03 ? 00:09:03 abcd -PR -gmh domain.den.abc.com -gmp 6020 -guid 9c06cc02-b1c8-41cf-93e6-1d795e9fff62 -rst 180 -s FOLDER_NAME:wkf_workflow.s_session -something Session task instance [session]"
    text =~ /(?<=\s)(\d{2}:\d{2})(?=\s).*?(?<=\s)((?:[a-zA-Z\d]+(?:\-[a-zA-Z\d]+)*\.)+[a-zA-Z]{2,4})(?=\s).*?(?<=\s)([a-zA-Z\d_]+):wkf_([a-zA-Z\d]+)\.s_([a-zA-Z\d]+)(?=\s)/
    puts $~.captures
    

    Output:

    10:03
    domain.den.abc.com
    FOLDER_NAME
    workflow
    session
    

    See and test the code here.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
Does anyone know how can I replace this 2 symbol below from the string
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

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.