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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T05:46:32+00:00 2026-05-16T05:46:32+00:00

/* Check if username is not valid */ else if(!eregi(/[^a-z0-9\s\’ ‘]/i, $subuser)){ $form->setError($field, *

  • 0
/* Check if username is not valid */
     else if(!eregi("/[^a-z0-9\s\' ']/i", $subuser)){
        $form->setError($field, "* Username not valid");
     }

How to I allow for spaces to be allowed in the eregi line??

On a sidenote…
I was going to use:

$input_name = preg_replace('/\s\s+/', ' ', $input_name)

to strip excess white space, can this be done in a one liner using eregi?

  • 1 1 Answer
  • 1 View
  • 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-16T05:46:32+00:00Added an answer on May 16, 2026 at 5:46 am

    If you’re using PHP5, you should drop ereg functions altogether. They’ve already been deprecated in 5.3.

    if (!preg_match('/[\w\s]+/',$subuser)
       echo 'Invalid';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a signup page and i want to check username exists or not
When I click on sign in link it should check for valid username and
I have a CustomValidator that is being used to check username availability, but it
How to check the username or password of the some https site is correct
I'm using this Jquery function for available username check. How can I fire this
im making a username availability check in ASP.net using ajax updatepanel, but i keep
I'm trying to check if the username is available and display it for the
Whats the best way to check if a username exists in a MySQL table?
In my login activity...I am asking the username and password.. I want to check
I am trying to build a PHP class to check the username and password

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.