How can I match series of | with a Java regex? -


Some questions:

1) How to create the following Reggae ^ ^ ^ based on the basis of the search. Work for Search Verbatim

Search literally ^ based regex (which works fine, which is valuable information from this forum):

  string intermediate = in All substituted ("(Test \\ ^ [^^] * \\ ^ \\ ^ [^^] * \\ ^ [^^] * \\ ^) \" \ "\\ ^", "$ 1 ^ "); String finalolt = intermediate result Replacelei ("(Test \\ ^ [^^] * \\ ^) (\\ ^ [^^] * \\ ^ [^^] * \\ ^ ([^ \" \\ ^]. * | "[^ \"]. *), "$ 1 $ 2 $");  

When I change ^ (where ever necessary) I do not get the desired result (nothing changes in the given string):

 < Code> string intermediate = in.replaceAll ("(Test \\ | [\\ | \\ | | * * \\ | [\\ | \\ | | * \\ | [\\ | \\ |] * \\ | [\\ | \\ |] * \\ |) \ "\" \\ | "," $ 1 | "); String finals = result = intermediate result Reitens All ("(Test \\ | | [\\ | \\ | * * \\\\ |) (\\ | [\\ | \\ |] * \\ | [\\ | \\ |] * \ \ | ([^ \\ ^]. * | \ "[^ \"]. *)), "$ 1 $ 2 $");  

Are Any Known Issues Java regex or I need different regex for search.

So I tried this way but in vain (\\ | instead of \ |) it is happening:

The first reggae changes all the places which are similar. "" In the given string, though I hope to make it only empty, if between the 5th and 6th event The content "" is not sure why the second regex string will not change at all for any reason.

  string intermediate = in.replaceAll ("(Test \\ | | [\\ | \ |] * \\\\ | [\\ | \\ |] * \\\\ | [\\ | \\ | | * \\\\ | [\\ | \\ |] * \\\\ |) \ "\" \\ | "," $ 1 ""); String finals = result = intermediate result Empty All ("(Test \\ | | [\\ | \\ |] * \\\\ |) (\\\\ | [\\ | \\ |] * \\\\ | [\ \ | \\ | ] * \\ | ([^ \\ ^]. * | \ "[^ \"]. *)), "$ 1ST $ 2")  

2) Apart from this , What is the meaning of this regex part of the match and substitution str:

  string final = reset = intermediate result.reales all ("(test \\ ^ [^ ^] * \\ ^ ) (\\ ^ [^^] * \\ ^ [^^] * \\ ^ ** ([^ \\ ^]. * | \ "[^ \"]. *) **) "," * * $ 1 $ $ 2 ** ");  

Very sorry for the confusion and the long post; I am going to post only one question and for any clarity Second question in post I am posting.

Detail on the question before the original email:

I have the following string (each row is separated by \ r \ n). The first Reggae related to the literal search should check whether the content between the second and third events is empty and if the content is between 5th and 6th, then empty it.

Second Reggae (re-related) to see whether the 5th and 6th decreases Content between users. Not empty and not empty, then between the second incident of 2 and 3, make the material in the form of a scheduled tribe.

The example is as follows:

Existing string:

  test | X || You ** "" ** | C | "" | \ R \ n \ Test | Jade || Y || Anything from "blank" or "\ r \ n \  replaceall () : 

   

Code> test | x || y || c | "" | \ r \ n \ test | jade | ** st ** | y) "or anything from blank" || r \ n \

I found an error in your conversion of pattern [^^] Meaning "is a character, which is not '^', thus, it is" | " To change, it will be [^ |] (inside of [], no need to escape.).

Now I am going to take a fork and take out my eyes. I do not want to see it again.


Comments