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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:36:53+00:00 2026-06-09T03:36:53+00:00

I have a regex for file name validation. Here it is: /^[0-9a-zA-Z\^\&\’\@\{\}\[\]\,\$\=\!\-\#\(\)\.\%\+\~\_; ]+$/ How

  • 0

I have a regex for file name validation. Here it is:

 /^[0-9a-zA-Z\^\&\'\@\{\}\[\]\,\$\=\!\-\#\(\)\.\%\+\~\_; ]+$/

How do I change it to check for file name not to start with . symbol. Thanks for 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-09T03:36:55+00:00Added an answer on June 9, 2026 at 3:36 am

    A negative lookahead will be the easiest solution:

    /^(?!\.)[0-9a-zA-Z^&'@{}[\],$=!\-#().%+~_; ]+$/
    

    Alternatively, you can match the first character with an extra character class:

    /^[0-9a-zA-Z^&'@{}[\],$=!\-#()%+~_; ][0-9a-zA-Z^&'@{}[\],$=!\-#().%+~_; ]*$/
                                   ^^ no dot here
    

    Btw, inside a character class nearly all special characters loose their function and will not need to be escaped.

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

Sidebar

Related Questions

I have a regexp to validate file names. Here is it: /[0-9a-zA-Z\^\&\'\@\{\}\[\]\,\$\=\!\-\#\(\)\.\%\+\~\_ ]+$/ It
So I have a regex expression to parse certain parts of a file name.
I have a java file having @Start, @End tag multiple places. looking for Regex
I have to create regex for file name patterns, the program I am building
I have a binary file that I would like to regex search/replace hex bytes
Possible Duplicate: RegEx match open tags except XHTML self-contained tags I have a file
I have been given some file name which can be like <filename>YYYYMMDD<fileextension> some valid
I have declared this regex at the top of my js file - var
I have the following regular expression for validating a file name: ^(([a-zA-Z]:|\)\)?(((.)|(..)|([^\/:*\?\|<>. ](([^\/:*\?\|<>. ])|([^\/:*\?\|<>]
I need a regex for renaming file in c#. My file name is 22px-Flag_Of_Sweden.svg.png

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.