cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site maintenance this Wednesday, February 1. Disruptions expected as we migrate the forums.

Regex doesn't work correctly

lx2pwnd
Node Clone

I'm tring to execute this query without succes

MATCH (t:Tweet)
WHERE  
    t.full_text =~ '(?i).*sciacalli.*'  AND
    t.created_at>'2018/01/01' AND t.created_at<'2020/04/25'
RETURN t

The output shuld be this one

"full_text": "RT @catlatorre: Sciacalli.\n
                  Comunque vada sempre sciacalli 
                  siete #KobeBryant https://t.co/******",
"created_at": "2020/01/26 22:49:51",

I don't understand way the regex not match

But if modify the query as follow

MATCH (t:Tweet)
WHERE  
    t.full_text CONTAINS 'sciacalli'  AND
    t.created_at>'2018/01/01' AND t.created_at<'2020/04/25'
RETURN t

I get the correct result. What's wrong ?

1 ACCEPTED SOLUTION

can you try to use (?ism).*sciacalli.* ?

s enables dotall mode
m care about multiline

View solution in original post

3 REPLIES 3

can you try to use (?ism).*sciacalli.* ?

s enables dotall mode
m care about multiline

Thanks now it's work. But I don't understand perfectly the difference between i s and m

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online