java - regex for even no. of single quotes -


I'm trying to find 'more', even after this. Quote of single (') and replace it with' OR ', I am trying to regex it in java, but there is no luck till now

  for example company = Expected Output: Company = 'Sam' '' S & Joseph '' 'S' or Year = '1998', 'Sam' and 'Joseph' 'S' and Year = '1998' / Pre> 

Single quotes are not considered even within double quotes, while no number is counted for. Out of single quotes Then the above output will be retained in the first 'and' and will be replaced by the second place 'or'

.

We can use the following regex (can only be calculated before ' ").

  \ Band \ b (?: (?: [^ '] * [^' ']') {2}) * [^ '] * $)   

regular expression view



Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

c# - passing input text from view to contoller with FacebookContext using Facebook app -

Calling a C++ function from C# by passing a string with variable size to it -