Java and .Net Regular Expressions

Difference between Java Regular Expression Pattern and .Net Framework

I am trying to convert My.Net Framework but templates are not valid

Is it possible to indicate the main differences in regex patterns

eg. As we will call the grouping construct in java, etc.

+3
source share
2 answers

There are many differences that are given here .

The most important of them are:

  • In Java strings you need to avoid all backslashes ( @"\s"becomes "\\s")
  • Java does not support groups of captured names.
  • Java does not support endless repetition inside lookbehinds.
  • Java does not support conventions ( (?(?=regex)then|else))
  • Unicode -.

. , , - Java () , , , .

, RegexBuddy, .

+2

... . , "Java lookbehinds" , AFAIK , ,.NET (-), Java .

:

: - ? ( demo.docx)

.NET-: \.docx$ ( "demo.docx", -

Java: .*\.docx$ ( .*, , . .NET Java.

+1

All Articles