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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T14:30:16+00:00 2026-06-02T14:30:16+00:00

I am using the normal regular expression which most of us are using for

  • 0

I am using the normal regular expression which most of us are using for Email validation.

Problem : Suppose if my Email id is : a@a.com, then after “com” if I press space twice, a full – stop gets appeared automatically.

I am using following code for validating email.

- (BOOL)validateEmailWithString:(NSString*)email
{
    NSLog(@"helloo in validate");
    NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; 
    NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; 
    return [emailTest evaluateWithObject:email];
}

How do I avoid this full-stop ????

As I am a newbie to iphone development, Please help me out !!

  • 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-02T14:30:18+00:00Added an answer on June 2, 2026 at 2:30 pm

    A full stop appearing after two spaces is normal behavior. Most users know this and won’t be surprised when it happens. You can turn it off in the settings (General->Keyboard->”.” Shortcut).

    If you really want to prevent it from happening, you can use the code in this answer. Note that you’ll have to set up the text field delegate for this to be called.

    - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)text
    {
        //Check if a space follows a space
        if ( (range.location > 0 && [text length] > 0 &&
              [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[text characterAtIndex:0]] &&
              [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[[textField text] characterAtIndex:range.location - 1]]) )
        {
            //Manually replace the space with your own space, programmatically
            textField.text = [textField.text stringByReplacingCharactersInRange:range withString:@" "];
    
            //Make sure you update the text caret to reflect the programmatic change to the text view
    //      textField.selectedTextRange = NSMakeRange(range.location+1, 0);  
    
            //Tell Cocoa not to insert its space, because you've just inserted your own
            return NO;
        }
        return YES;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Logged into my Windows XP SP2 computer using my normal user account (which has
A friend of mine has to send a normal email using ONLY HTML/HTML5 (or
I'm trying to change wikitext into normal text using Python regular expressions substitution. There
Using a normal .foo {cursor:pointer;cursor:hand;width:250px;height:250px;background:#aaa;} and <div class=foo><!--ph--></div> as seen here: http://jsfiddle.net/UZq5d/2/ If I
Hi I have been using the normal rails active record LIKE search in my
Right, perhaps I should be using the normal Python lists for this, but here
I can sample from a normal distribution using Boost in c++. I have now
I have a function that generates normal random number matrix having normal distribution using
I'm writing a small function to generate values from the Normal distribution using Box-Muller
Using an Oracle temporary table does not generate much redo log as a normal

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.