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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:11:47+00:00 2026-05-17T21:11:47+00:00

I got this issue figuring out how to build a regexp for verifying a

  • 0

I got this issue figuring out how to build a regexp for verifying a netbios name. According to the ms standard these characters are illegal
\/:*?”<>|

So, thats what I’m trying to detect. My regex is looking like this

^[\\\/:\*\?"\<\>\|]$

But, that wont work.

Can anyone point me in the right direction? (not regexlib.com please…)
And if it matters, I’m using php with preg_match.

Thanks

  • 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-17T21:11:47+00:00Added an answer on May 17, 2026 at 9:11 pm

    Your regular expression has two problems:

    1. you insist that the match should span the entire string. As Andrzej says, you are only matching strings of length 1.
    2. you are quoting too many characters. In a character class (i.e. []), you only need to quote characters that are special within character classes, i.e. hyphen, square bracket, backslash.

    The following call works for me:

    preg_match('/[\\/:*?"<>|]/', "foo");  /* gives 0: does not include invalid characters */
    preg_match('/[\\/:*?"<>|]/', "f<oo"); /* gives 1: does include invalid characters */
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got this error which according to Apache Support is an issue relating with
I got this issue, In the above html I cannot click on the dropdown
Got this design issue with JSF + Spring :- I got a datatable on
I got stumbled upon this issue once and I guess I need some expertise
I got an issue. The scenario is like this: I got an NSOperationQueue that
recently got an issue when loading vs 2008, it displays this... can anyone tell
I've placed panel from this example http://docs.sencha.com/ext-js/4-0/#!/example/dd/dnd_grid_to_grid.html to Ext.window.Window and got an issue: proxy
I've read many posts about this issue but I never got this to work.
So I've got this issue with forms generated by Zend Framework. As we know
i'm not so good at jquery and i've got this issue: i'm using jquery

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.