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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:16:07+00:00 2026-05-26T12:16:07+00:00

I am attempting to retrieve jpeg and jpg files using the following statement: string[]

  • 0

I am attempting to retrieve jpeg and jpg files using the following statement:

string[] files = Directory.GetFiles(someDirectoryPath, "*.jp?g");

MSDN’s docs for System.IO.Directory.GetFiles(string, string) state that ? represents “Exactly zero or one character.”, however the above block selects jpeg files but omits jpg files.

I am currently using the overly-permissive search pattern "*.jp*g" to achieve my results, but it wrinkles my brain because it should work.

  • 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-05-26T12:16:07+00:00Added an answer on May 26, 2026 at 12:16 pm

    From the docs you linked to:

    A searchPattern with a file extension of one, two, or more than three characters returns only files having extensions of exactly that length that match the file extension specified in the searchPattern.

    I suspect that’s the problem. To be honest, I’d probably fetch all the files and then postprocess them in code – it’ll make for code which is simpler to reason about than relying on the Windows path-handling oddities.

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

Sidebar

Related Questions

I'm currently attempting to retrieve a list of objects from my database using jQuery.
I'm attempting to retrieve the document text in Notepad++ using SendMessage in C#. Below
I have an sql statement as below attempting to retrieve the most recent entries
I'm attempting to retrieve the user name and client machine name of the person
I'm attempting to retrieve data from a SolarWinds network performance database (MS SQL 2005)
When attempting to use HttpWebRequest to retrieve a page from my dev server, I
I am attempting to retrieve a list of objects from Entity Framework via WCF,
I am attempting to retrieve information on all the various monitors (and their adapters)
I am attempting to retrieve the ASPXAUTH cookie programmatically without success. A similar question
I am attempting to retrieve metadata from a URLResource. The URLResource is not controlled

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.