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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:09:16+00:00 2026-05-14T23:09:16+00:00

Which features of regular expressions are standard, and which are idiosyncratic ? What should

  • 0

Which features of regular expressions are standard, and which are idiosyncratic ?
What should I do, and not do, if I want to use the same regex in different context, languages, platforms ?

  • 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-05-14T23:09:16+00:00Added an answer on May 14, 2026 at 11:09 pm

    There is no standard, but if maximum portability is your goal you should stick to the features supported by JavaScript regexes. All of the other major flavors support everything JS does, with only minor variations here and there. For example, some only support the POSIX character-class notation ([:alpha:]), while others use the Unicode syntax (\p{Alpha}).

    Probably the most troublesome variations are those that affect the dot (.) and the anchors (^ and $). For example, JavaScript has no DOTALL (or “single-line”) mode, so to match anything including a newline you have to use a hack like [\s\S]. Meanwhile, Ruby has a DOTALL mode but calls it multiline mode–what everyone else calls “multiline” (^ and $ as line anchors) is how Ruby always works.

    Be aware, too, of exactly what the dot doesn’t match (in the default mode). Traditionally that was just the linefeed (\n), but more and more flavors are adopting (or at least approximating) the Unicode guidelines concerning line separators. For example, in Java the dot doesn’t match any of [\r\n\u0085\u2028\u2029], while ^ and $ treat \r\n as a single separator and won’t match between the two characters.

    Note that I’m only talking about Perl-derived flavors, like Python, Ruby, PHP, JavaScript, etc.. It wouldn’t make sense to inlcude GNU or POSIX based flavors like grep, awk, and MySQL; they tend to have fewer features, but that’s not what you would choose them for anyway.

    I’m also not including the XML Schema flavor; it’s much more limited than JavaScript, but it’s a specialized application. For example, it doesn’t support the anchors (^, $, \A, \Z, etc.) because matches are always anchored at both ends.

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

Sidebar

Related Questions

There are some features in modern regex engines which allow you to match languages
I have a site that features some pages which do not require any post-back
Several implementations of regular expressions differ from each other in subtle ways which is
I already use some new features from C++0x in Visual C++ 2010, like regular
I want to write regular expressions to read data inside blocks of <script></script> in
The query criteria should support boolean operators and regular expressions. I've read about Booleano,
Recently launched a Magento store which features an image slider on the homepage. Works
I am using a horizontal menu from cssmenumaker.com which features subitems. I've been trying,
The new OS (3.0+) adds more features which speed up the development (like working
What is out of box features in sharepoint. The features which we can develop

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.