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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:54:10+00:00 2026-05-11T05:54:10+00:00

Both languages claim to use Perl style regular expressions. If I have one language

  • 0

Both languages claim to use Perl style regular expressions. If I have one language test a regular expression for validity, will it work in the other? Where do the regular expression syntaxes differ?

The use case here is a C# (.NET) UI talking to an eventual Java back end implementation that will use the regex to match data.

Note that I only need to worry about matching, not about extracting portions of the matched data.

  • 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. 2026-05-11T05:54:10+00:00Added an answer on May 11, 2026 at 5:54 am

    There are quite (a lot of) differences.

    Character Class

    1. Character classes subtraction [abc-[cde]]
      • .NET YES (2.0)
      • Java: Emulated via character class intersection and negation: [abc&&[^cde]])
    2. Character classes intersection [abc&&[cde]]
      • .NET: Emulated via character class subtraction and negation: [abc-[^cde]])
      • Java YES
    3. \p{Alpha} POSIX character class
      • .NET NO
      • Java YES (US-ASCII)
    4. Under (?x) mode COMMENTS/IgnorePatternWhitespace, space (U+0020) in character class is significant.
      • .NET YES
      • Java NO
    5. Unicode Category (L, M, N, P, S, Z, C)
      • .NET YES: \p{L} form only
      • Java YES:
        • From Java 5: \pL, \p{L}, \p{IsL}
        • From Java 7: \p{general_category=L}, \p{gc=L}
    6. Unicode Category (Lu, Ll, Lt, …)
      • .NET YES: \p{Lu} form only
      • Java YES:
        • From Java 5: \p{Lu}, \p{IsLu}
        • From Java 7: \p{general_category=Lu}, \p{gc=Lu}
    7. Unicode Block
      • .NET YES: \p{IsBasicLatin} only. (Supported Named Blocks)
      • Java YES: (name of the block is free-casing)
        • From Java 5: \p{InBasicLatin}
        • From Java 7: \p{block=BasicLatin}, \p{blk=BasicLatin}
    8. Spaces, and underscores allowed in all long block names (e.g. BasicLatin can be written as Basic_Latin or Basic Latin)
      • .NET NO
      • Java YES (Java 5)

    Quantifier

    1. ?+, *+, ++ and {m,n}+ (possessive quantifiers)
      • .NET NO
      • Java YES

    Quotation

    1. \Q...\E escapes a string of metacharacters
      • .NET NO
      • Java YES
    2. \Q...\E escapes a string of character class metacharacters (in character sets)
      • .NET NO
      • Java YES

    Matching construct

    1. Conditional matching (?(?=regex)then|else), (?(regex)then|else), (?(1)then|else) or (?(group)then|else)
      • .NET YES
      • Java NO
    2. Named capturing group and named backreference
      • .NET YES:
        • Capturing group: (?<name>regex) or (?'name'regex)
        • Backreference: \k<name> or \k'name'
      • Java YES (Java 7):
        • Capturing group: (?<name>regex)
        • Backreference: \k<name>
    3. Multiple capturing groups can have the same name
      • .NET YES
      • Java NO (Java 7)
    4. Balancing group definition (?<name1-name2>regex) or (?'name1-name2'subexpression)
      • .NET YES
      • Java NO

    Assertions

    1. (?<=text) (positive lookbehind)
      • .NET Variable-width
      • Java Obvious width
    2. (?<!text) (negative lookbehind)
      • .NET Variable-width
      • Java Obvious width

    Mode Options/Flags

    1. ExplicitCapture option (?n)
      • .NET YES
      • Java NO

    Miscellaneous

    1. (?#comment) inline comments
      • .NET YES
      • Java NO

    References

    • regular-expressions.info – Comparison of Different Regex Flavors
    • MSDN Library Reference – .NET Framework 4.5 – Regular Expression Language
    • Pattern (Java Platform SE 7)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a language where both are available, would you prefer to see an instance
Both the jQuery and Prototpye JavaScript libraries refuse to allow me to use a
Both are mathematical values, however the float does have more precision. Is that the
Both DataSource and DataSourceID are defined on 'grdCommunication'. Remove one definition. I just got
Both of these appservers are at least in part OSGI based. One (Glassfish) is
Both of them are mbeans. Both are intended to setup Hibernate Session Factory and
Both Session.Clear() and Session.Abandon() get rid of session variables. As I understand it, Abandon()
Both ideas sound very similar to me, but there might be subtle differences or
Both about -a and -e options in Bash documentation is said: -a file True
Both: CLSID IID Having specified the above, and using: CoCreateInstance() To returning a single

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.