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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:46:37+00:00 2026-06-14T04:46:37+00:00

I am validating a street address with the following function which works fine for

  • 0

I am validating a street address with the following function which works fine for all English letters. But it does not accept these letters ö, Ö, ä, Ä. How can I change the following function so that it accepts these letters too?

validateAddress = function (val) {
        var streetRegex = /^[\w+\s]+\d+,\s*[\s\w]+$/;
        if (streetRegex.test(val)) return true;
        else return false;
    }
  • 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-14T04:46:38+00:00Added an answer on June 14, 2026 at 4:46 am

    Modern browsers should be able to handle those characters in the regex. Check out this example on Chrome or Firefox.

    var str = 'öabÖcdäefgÄh';
    console.log( str.match(/[öä]/gi) ); //=> ["ö", "Ö", "ä", "Ä"]
    

    But you can always convert those chars to ascii or unicode and use that instead:

    function toAscii( str ) {
      return str.replace(/./g, function( char ) {
        return '\\x'+ char.charCodeAt(0).toString(16).toUpperCase();
      });
    }
    
    // Use RegExp constructor
    var regex = new RegExp('...'+ toAscii('ä') +'...');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got my model which contains some members: public class Address { public Street
When validating my page (https://www.slamgmt.com), it says: document type does not allow element body
While validating my CSS on http://jigsaw.w3.org/css-validator/ I am getting following errors: 1.Property zoom doesn't
I'm validating a textbox for valid email with this: <asp:RegularExpressionValidator ID=RegularExpressionValidator1 ControlToValidate=txtMailCustom Text=Invalid address
I'd like to prompt for a street address, in exactly the same way as
I'm looking into using a CASS -Certified address validation service to correct user-provided street
I am creating an address control which would use some address validation APIs( google/bing
I have this domain model: class Person < ActiveRecord::Base composed_of :address, mapping: [%w(address_street street),
I am doing a street Address validation, in stret address validation text field should
Validating a form is not working. Below you see the code and error message.

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.