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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T03:37:55+00:00 2026-05-16T03:37:55+00:00

I have some useful regular expressions in Perl. Is there a simple way to

  • 0

I have some useful regular expressions in Perl. Is there a simple way to translate them to .NET’s dialect of regular expressions?

If not, is there a concise reference of differences?

  • 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-16T03:37:56+00:00Added an answer on May 16, 2026 at 3:37 am

    There is a big comparison table in http://www.regular-expressions.info/refflavors.html.


    Most of the basic elements are the same, the differences are:

    Minor differences:

    • Unicode escape sequences. In .NET it is \u200A, in Perl it is \x{200A}.
    • \v in .NET is just the vertical tab (U+000B), in Perl it stands for the “vertical whitespace” class. Of course there is \V in Perl because of this.
    • The conditional expression for named reference in .NET is (?(name)yes|no), but (?(<name>)yes|no) in Perl.

    Some elements are Perl-only:

    • Possessive quantifiers (x?+, x*+, x++ etc). Use non-backtracking subexpression ((?>…)) instead.
    • Named unicode escape sequence \N{LATIN SMALL LETTER X}, \N{U+200A}.
    • Case folding and escaping
      • \l (lower case next char), \u (upper case next char).
      • \L (lower case), \U (upper case), \Q (quote meta characters) until \E.
    • Shorthand notation for Unicode property \pL and \PL. You have to include the braces in .NET e.g. \p{L}.
    • Odd things like \X, \C.
    • Special character classes like \v, \V, \h, \H, \N, \R
    • Backreference to a specific or previous group \g1, \g{-1}. You can only use absolute group index in .NET.
    • Named backreference \g{name}. Use \k<name> instead.
    • POSIX character class [[:alpha:]].
    • Branch-reset pattern (?|…)
    • \K. Use look-behind ((?<=…)) instead.
    • Code evaluation assertion (?{…}), post-poned subexpression (??{…}).
    • Subexpression reference (recursive pattern) (?0), (?R), (?1), (?-1), (?+1), (?&name).
    • Some conditional expression’s predicate are Perl-specific:
      • code (?{…})
      • recursive (R), (R1), (R&name)
      • define (DEFINE).
    • Special Backtracking Control Verbs (*VERB:ARG)
    • Python syntax
      • (?P<name>…). Use (?<name>…) instead.
      • (?P=name). Use \k<name> instead.
      • (?P>name). No equivalent in .NET.

    Some elements are .NET only:

    • Variable length look-behind. In Perl, for positive look-behind, use \K instead.
    • Arbitrary regular expression in conditional expression (?(pattern)yes|no).
    • Character class subtraction (undocumented?) [a-z-[d-w]]
    • Balancing Group (?<-name>…). This could be simulated with code evaluation assertion (?{…}) followed by a (?&name).

    References:

    • .NET Framework 4: Regular Expression Language Elements
    • perlre
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Python, is there a better way to parameterise strings into regular expressions than
I have some useful typedefs on a header file called utypes.h. I have decided
I have some useful wpf buttons to test some functionality. It would be good
Does anyone have some useful beginner tutorials and code snippets for playing with basic
I have a program where I want to scrap some useful study material for
The Application class in System.Windows.Forms have a some properties that can be quite useful.
Often we have to use some of the methods which don't return anything useful.
interfaces provide a useful abstraction capability. One can have a class Foo implement some
I have some files that are uuencoded, and I need to decode them, using
I'm really a beginner when it comes to regular expressions, and I'm not really

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.