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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T04:39:35+00:00 2026-06-18T04:39:35+00:00

How this is possible? var re = /\w+/; I have never seen something like

  • 0

How this is possible?

var re = /\w+/;

I have never seen something like this in any other language. Is this part of language sintax or something else? Leading ‘/’ is what I don’t understand, what exactly js does when it gets that with the “\w+/”?

  • 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-18T04:39:36+00:00Added an answer on June 18, 2026 at 4:39 am

    It is a regular expression literal.

    From the MDN docs

    You construct a regular expression in one of two ways:

    Using a regular expression literal, as follows:

    var re = /ab+c/; 
    

    Regular expression literals provide compilation of
    the regular expression when the script is evaluated. When the regular
    expression will remain constant, use this for better performance.

    Calling the constructor function of the RegExp object, as follows: 1

    var re = new RegExp("ab+c");
    

    Using the constructor function provides runtime compilation of the regular expression. Use the constructor function when you know the regular expression pattern will be changing, or you don’t know the pattern and are getting it from another source, such as user input.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is something like this possible: function FooClass() { var barsArray=new Array(); var index=0; function
is it possible to copy a variable like this this? class Colours { var
Why is it possible to initialize a Dictionary<T1,T2> like this: var dict = new
I have created four different functions, like this: var normal = function() { return;
I have a table that looks something like this: <table> <tr id=header> <th>Title</th> <th>Title</th>
Is it it possible to do this in php? Javascript code: var a =
Is this possible to use Ajax.Beginform with update target inside of ajax form. like
Possible Duplicate: Javascript multiple assignment statement I was wondering what this does. I have
Possible Duplicate: Can someone Explain this jQuery code? I have posted this before, but
I don't know if this is possible, I've never really used html canvas, but

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.