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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:56:55+00:00 2026-06-03T23:56:55+00:00

I have a smaller SSIS packat that I am trying to match a file

  • 0

I have a smaller SSIS packat that I am trying to match a file name with VB Regex and delete “said” file. My regex looks like this, ^RegZStmntAdj.[A-z0-9_].\.txt$, and I am trying to figure out why it won’t match any of the files in the directory. This is valid syntax if I am thinking correctly.

RegZStmntAdj2_07272011.txt
RegZStmntAdj1_07272011.txt
RegZStmntAdj2_07272011.txxt
New Text Document.txt

If I run the regex with ^RegZStmntAdj.*.\.txt$, it matches the correct files and deletes them. I know * works, but I would like to learn to make more precise Regular Expressions.

RegZStmntAdj2_07272011.txt
RegZStmntAdj1_07272011.txt
  • 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-03T23:56:57+00:00Added an answer on June 3, 2026 at 11:56 pm

    Try the following Regex:

    ^RegZStmntAdj.[\w_]{9}\.txt$
    

    I’ve used \w, which is the same as A-Za-z0-9, and told it to match 9 characters so that it will match the _<date> part of your filename. You were only matching the first character from there (i.e. the underscore).

    Using Powershell to verify:

    PS> $test = "^RegZStmntAdj.[\w_]{9}\.txt$"
    PS> "RegZStmntAdj2_07272011.txt" -match $test
        True
    PS> "RegZStmntAdj1_07272011.txt" -match $test
        True
    PS> "RegZStmntAdj2_07272011.txxt" -match $test
        False  # (Correct as contains 2 "xx"s in extension)
    PS> "New Text Document.txt" -match $test
        False  # (Correct as nowhere near a match!!)
    

    To make your regex even more precise, you could use ^RegZStmntAdj\d_[\d]{8}\.txt$, which translates to:

    A string starting with “RegZStmntAdj”, then a digit, then an
    underscore, then 8 digits, then ending in “.txt”

    which I believe is what you are looking for.

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

Sidebar

Related Questions

I have this file file.txt which I want to split into many smaller ones.
I heard many libraries such as JXTA and PjSIP have smaller footprints. Is this
I have a method that i have broken into smaller nested functions to break
I have an unordered list that is a child in a smaller parent div
I have a large C++ file (SS.cpp) which I decided to split in smaller
I have a smaller web app that republishes content from one social source to
I am building a multi-tier application that will have multiple smaller apps apart from
I have a table like follows: Potion { id, name, freq } I gave
I have a text input box exactly like so... <input class='text' type='text' name='org' id='org'
I have this simple piece of code on a windows form containing said DataGridView

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.