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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:35:21+00:00 2026-06-13T19:35:21+00:00

hey i have a requirement , where i have to compare a file name

  • 0

hey i have a requirement , where i have to compare a file name of the uploaded file to a standardized file name format specified by our client

Standardize Format FW12_CommunicatedArticles.xlsx
any file that user uploads should be comply to the following format FW12_CommunicatedArticles.xlsx
the integars (1, 2 in FW can change but the rest of the name should exactly match the format specified)

for example a valid file upload can be FW13_CommunicatedArticles.xlsx , FW23_CommunicatedArticles.xlsx etc , etc

invalid upload = sW13_CommunicatedArticles.xlsx , FW13_CommuArticles.xlsx , FW1324_CommuArticles.xlsx etc etc

only the value of the integars can be different , the strings length , its arrangement and everything has to be exactly the same as specified by the convention i have to do the validating through javascript , can you guys please help me devising the proper regular expression validation to tackle this issue

  • 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-13T19:35:21+00:00Added an answer on June 13, 2026 at 7:35 pm

    This simple regexp will do the trick. \d will match a digit.

    /^FW\d\d_CommunicatedArticles\.xlsx$/.test(filename)
    

    Here’s a jsfiddle. Press F1 and Esc in Chrome to show the console.

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

Sidebar

Related Questions

Hey I have this configuration in my web.config <log4net> <appender name=LogFileAppender type=log4net.Appender.FileAppender> <param name=File
Hey i have the foolowing xml file : <?xml version=1.0?> <accidents> <accident> <org>1</org> <com>194</com>
Hey I have this kinda structure in my ini file I want to be
Hey guys in my recent project i have used the valums file uploader for
Hey I have been following gcm tutorial to create gcm-demo-server and a demo-client. All
Hey guys, here's my requirement: I have one central App which receives requests from
Hey I have an ajax call which currently calls a php file with queries
Hey all, I have something of an interesting requirement for my project. I need
Hey i have been looking around and i cant find a way to get
Hey I have an array where each element is a hash containing a few

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.