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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:16:52+00:00 2026-06-18T08:16:52+00:00

Anyone be able to help me with this regex please? I need an expression

  • 0

Anyone be able to help me with this regex please? I need an expression that will match the line that does not contain the “Created” string at the end. This script is being used to read the headings on some source code.

$string = "* JAN-01-2001   bugsbunny     1234     Created Module";
#$string = "* DEC-12-2012   bugsbunny     5678     Modified Module";
if($string =~ /^\*\s+(\w\w\w-\d\d-\d\d\d\d)\s+(\w+)\s+(\d+)\s+(?!Created)/){
    print "$1\n$2\n$3\n$4\n";
} else {
    print "no match\n";
}

When using the first $string definition, I need the match to fail because it has the word “Created” at the end of it. When using the second $string definition, it should pass and I need to pull out the date($1), user($2), change number($3) and description($4).

The expression above is not working. Any advice please?

  • 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-18T08:16:53+00:00Added an answer on June 18, 2026 at 8:16 am

    Close:

    /^\*\s+(\w{3}-\d{2}-\d{4})\s+(\w+)\s+(\d+)\s+(?!.*Created)/
    

    You need to allow any number of non-newline characters before Created, therefore the .*.

    Otherwise, the regex would simply back up by one character when matching \s+, so the following text would be " Created", and then (?!Created) would match.

    See it here; notice how the match stops one space before Created.

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

Sidebar

Related Questions

I was wondering if anyone would be able to help me fix this script...It
I don't expect anyone to be able to help out with this but let's
Would anyone be able to help me with how to get the file properties
I was wondering if anyone would be able to help me convert the below
FYI I'm programming in objective-C but anyone might be able to help. I've been
Can anyone help me with a regex to turn: filename_author to author_filename I am
I need some help with a RegEx. The concept is simple, but the actual
need some help with this one. I have some reflectance values for a colour
As anyone who's seen my posts will know, I'm a regex pleb. Anyone can
Is anyone able to provide a definitive guide to the labelled icons in Xcode

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.