Caused by: java.util.regex.PatternSyntaxException: Illegal repetition

user3011731

I m trying to get search query and passing parameters in search query(its cypher query with like operator) and passing the dynamic parameter but i m getting eror. Is it neo4j problem of Regex problem.

    Map<String, Object> map = new HashMap<String, Object>();
            map.put(parameter, groupIdAfterSubstituet(collabVo));//
            map.put("{display_name}",input);//input="S"
    Result<Map<String, Object>> result = neoOperation.query(
                    collabVo.getSearchQuery(), map);//MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) where f.firstName =~"{display_name}.*" RETURN f
            Result<Student> std = result.to(Student.class);
            for (Student st : std) {
                students.add(st);

Error

[STDERR] javax.el.ELException: /sections/content/postAlertContent.xhtml @28,38 completeMethod="#         {autocompleteBeanController.completeUserProfile}": java.util.regex.PatternSyntaxException: Illegal    repetition
[STDERR] {display_name}.*
[STDERR]    at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:111)
[STDERR]    at   org.primefaces.component.autocomplete.AutoComplete.broadcast(AutoComplete.java:337)
[STDERR]    at javax.faces.component.UIData.broadcast(UIData.java:1093)
[STDERR]    at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
[STDERR]    at javax.faces.component.UIViewRoot.processDecodes(UIViewRoot.java:935)
[STDERR]    at  com.sun.faces.lifecycle.ApplyRequestValuesPhase.execute(ApplyRequestValuesPhase.java:78)
[STDERR]    at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
[STDERR]    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) 
[STDERR]    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)
[STDERR]    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:652)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1329) 
[STDERR]    at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:98)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) 
[STDERR]    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:106)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at com.ramselabs.education.filter.LoginFilter.doFilter(LoginFilter.java:52)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1300)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
[STDERR]    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:556)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:227)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1038)
[STDERR]    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:374)
[STDERR]    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:189)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:972)
[STDERR]    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
[STDERR]    at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
[STDERR]    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
[STDERR]    at org.eclipse.jetty.server.Server.handle(Server.java:363)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:483)  
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:931)
[STDERR]    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:992)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:856)
[STDERR]    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
[STDERR]    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
[STDERR]    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
[STDERR]    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
[STDERR]    at java.lang.Thread.run(Thread.java:745)
[STDERR] Caused by: java.util.regex.PatternSyntaxException: Illegal repetition
[STDERR] {display_name}.*
[STDERR]    at java.util.regex.Pattern.error(Pattern.java:1924)
[STDERR]    at java.util.regex.Pattern.closure(Pattern.java:3104)
[STDERR]    at java.util.regex.Pattern.sequence(Pattern.java:2101)
[STDERR]    at java.util.regex.Pattern.expr(Pattern.java:1964)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1665)
[STDERR]    at java.util.regex.Pattern.<init>(Pattern.java:1337)
[STDERR]    at java.util.regex.Pattern.compile(Pattern.java:1022)
[STDERR]    at scala.util.matching.Regex.<init>(Regex.scala:153)
user3011731

It was not the pattern's problem. The problem was in my cypher query. The cypher query should be like this:

MATCH (n:OrganizationUnit {id:{class}})-[r:PART]-(c)-[r1:STUDENTROLE]-(f) 
where f.firstName =~{display_name} RETURN f

And adding parameters should be like this:

map.put("display_name", input);  

where input contains the full pattern (like "nameToMatch.*"). This should work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

java.util.regex.PatternSyntaxException

From Dev

java.util.regex.PatternSyntaxException with UCanAccess

From Dev

java.util.regex.PatternSyntaxException Android

From Dev

Exception in thread "main" java.util.regex.PatternSyntaxException: Unmatched closing

From Dev

Java replaceAll Illegal repetition

From Dev

java.util.regex.PatternSyntaxException: Unclosed character class near index 0

From Dev

java.util.regex.PatternSyntaxException: Unclosed character class near index 12 \\b]([^.(|[]+)

From Dev

java.util.regex.PatternSyntaxException: Unmatched closing ')' : during string.split operation

From Dev

java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0 +

From Dev

java.util.regex.PatternSyntaxException: Unclosed character class near index 44

From Dev

invalid regular expression : illegal repetition in Java

From Dev

Java: PatternSyntaxException thrown with regex .*-\\d+{.*}\\d+-.*

From Dev

How to prevent char repetition with Java regex

From Dev

Regex repetition

From Dev

Java PatternSyntaxException: Unmatched closing '('

From Dev

Java - Spring injected RegEx - Illegal Character - Ampersand

From Dev

Alternatives to java.util.regex

From Dev

Netbeans import java.util.Scanner illegal start of type

From Dev

Java Regex - To parse function name and argument name - throws PatternSyntaxException: Unclosed Character

From Dev

Regex to check for repetition

From Dev

Nongreedy regex with alternation and repetition

From Dev

how to replace repetition in regex?

From Dev

jOOQ 3.6.3 Code Generation Bug? PatternSyntaxException: Illegal/unsupported escape sequence

From Dev

Android: PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR

From Dev

Regex matchin "java.util" but not "java.util.Collections"

From Dev

PHP Regex, capture repetition matches

From Dev

capture repetition of letters in a word with regex

From Dev

Best practice for regex to match repetition

From Dev

PHP Regex, capture repetition matches

Related Related

  1. 1

    java.util.regex.PatternSyntaxException

  2. 2

    java.util.regex.PatternSyntaxException with UCanAccess

  3. 3

    java.util.regex.PatternSyntaxException Android

  4. 4

    Exception in thread "main" java.util.regex.PatternSyntaxException: Unmatched closing

  5. 5

    Java replaceAll Illegal repetition

  6. 6

    java.util.regex.PatternSyntaxException: Unclosed character class near index 0

  7. 7

    java.util.regex.PatternSyntaxException: Unclosed character class near index 12 \\b]([^.(|[]+)

  8. 8

    java.util.regex.PatternSyntaxException: Unmatched closing ')' : during string.split operation

  9. 9

    java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0 +

  10. 10

    java.util.regex.PatternSyntaxException: Unclosed character class near index 44

  11. 11

    invalid regular expression : illegal repetition in Java

  12. 12

    Java: PatternSyntaxException thrown with regex .*-\\d+{.*}\\d+-.*

  13. 13

    How to prevent char repetition with Java regex

  14. 14

    Regex repetition

  15. 15

    Java PatternSyntaxException: Unmatched closing '('

  16. 16

    Java - Spring injected RegEx - Illegal Character - Ampersand

  17. 17

    Alternatives to java.util.regex

  18. 18

    Netbeans import java.util.Scanner illegal start of type

  19. 19

    Java Regex - To parse function name and argument name - throws PatternSyntaxException: Unclosed Character

  20. 20

    Regex to check for repetition

  21. 21

    Nongreedy regex with alternation and repetition

  22. 22

    how to replace repetition in regex?

  23. 23

    jOOQ 3.6.3 Code Generation Bug? PatternSyntaxException: Illegal/unsupported escape sequence

  24. 24

    Android: PatternSyntaxException: Syntax error U_ILLEGAL_ARGUMENT_ERROR

  25. 25

    Regex matchin "java.util" but not "java.util.Collections"

  26. 26

    PHP Regex, capture repetition matches

  27. 27

    capture repetition of letters in a word with regex

  28. 28

    Best practice for regex to match repetition

  29. 29

    PHP Regex, capture repetition matches

HotTag

Archive