About 5,490,000 results
Open links in new tab
  1. javascript - Regular expression for name with spaces allowed in between ...

    May 12, 2017 · I would say a name is a sequence of alphabetic chars delimited by spaces or dots, which can be defined by the following regex: ^[a-zA-Z]+(?:[\s.]+[a-zA-Z]+)*$ Demo: https://regex101.com/r/rH5jtc/2

  2. Regex for allowing alphanumeric,-,_ and space - Stack Overflow

    May 29, 2023 · You want to create a matching set for the characters that you want to validate: You can match alphanumeric with a \w, which is the same as [A-Za-z0-9_] in JavaScript (other languages can differ). That leaves - and spaces, which can be combined into a …

  3. Javascript Regular Expression "Single Space Character"

    It is perfectly legal to include a literal space in a regex. However, it's not equivalent - \s will include any whitespace character, including tabs, non-breaking spaces, half-width spaces and other characters, whereas a literal space will only match the regular space character.

  4. Regular expression syntax cheat sheet - JavaScript | MDN - MDN Web Docs

    Oct 28, 2024 · White space character class escape: Matches a single white space character, including space, tab, form feed, line feed, and other Unicode spaces.

  5. Regex for Name Validation in JavaScript - Tpoint Tech

    Apr 18, 2025 · In JavaScript, regex provides us with a way that we use to define patterns that the name should adhere to. For example, we want to enforce that the name only consists of alphabetic characters or they allow spaces and certain special characters like hyphens, etc.

  6. JavaScript RegExp \s Metacharacter - W3Schools

    let text = "Is this all there is?"; The \s metacharacter matches whitespace character. Whitespace characters can be: /\s/ is an ECMAScript1 (JavaScript 1997) feature. It is supported in all browsers: In JavaScript, a regular expression text search, can be done with different methods.

  7. Regex to replace multiple spaces with a single space

    We can use a regular expression (regex) combined with JavaScript's replace() method to effortlessly eliminate those surplus spaces! 💪🚀. By using the regex /\s+/g, we're targeting any consecutive whitespace characters \s+ in the text. The g flag ensures that all occurrences are replaced, not just the first one.

  8. JavaScript RegExp Reference - W3Schools

    A regular expression is a pattern of characters. The pattern is used for searching and replacing characters in strings. The RegExp Object is a regular expression with added Properties and Methods .

  9. Full name regex in javascript that also accepts space

    Dec 13, 2017 · I want a regex that matchs fullnames , i saw the below regex on SO: ^[a-z]([-']?[a-z]+)*( [a-z]([-']?[a-z]+)*)+$ But i also need to match names with a dot(.) , so the name "arun K." should return true with the regex.

  10. How to Add Space to Regex in JavaScript

    Nov 17, 2023 · Adding space to regex in JavaScript simplifies complex regular expression patterns by controlling how and where whitespace is matched. This tutorial has shown you through step-by-step examples how to ignore, require, or …

  11. Some results have been removed
Refresh