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

  • Home
  • SEARCH
  • 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 8192955
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T04:18:45+00:00 2026-06-07T04:18:45+00:00

I want to construct a regular expression that will, for every line of text

  • 0

I want to construct a regular expression that will, for every line of text input I give it, pick out what XX, YY, and ZZ are, preferably returning the values to me in variables that I can add up or put in an array or whatever.

The thing is I’m fairly new to both regular expressions and shell scripting (I will be using csh for this task). So I was wondering how to do this with csh regex, and if it’s different than say perl regex.

Just to reiterate the pattern is as follows:

Some text repeating: 23h04m31s
...
Some text repeating: 12h13m22s
...

EDIT – my script will need to look into particular files for this. I’m thinking I can use the GREP tool in my csh script, with the correct regex.

Thank you for any 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-07T04:18:48+00:00Added an answer on June 7, 2026 at 4:18 am
    while read line
    do
        time=${line##*: }
        hours=${time%h*}
        minutes=${time#*h}
        minutes=${minutes%m*}
        seconds=${time#*m}
        seconds=${seconds%s*}
    
        do_something_with "$hours" "$minutes" "$seconds"
    done < yourinputfile
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to be able to construct a regular expression which searches for a
I would like to construct a regular expression that matches any letter (including accented
I have this regular expression in python: '<input type=hidden name=GALX value=(?P<galx>[a-zA-Z0-9_]+)>' I want an
I'm trying to construct a regular expression that would match a pattern as such:
i want to realize a construct in MS SQL that would look like this
in my C# program, I have a regular expression textparser, that finds all occurrences
I'm trying to come up with a regular expression that can match only characters
I want to construct a div that has a header with background like that
I am designing a regular expression tester in HTML and JavaScript. The user will
In a Windows batch file, I want to construct a classpath of .jar files

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.