# Why does question mark blocks case insensitive matching?

**URL:** <https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267>\
**Category:** Neo4j Graph Platform\
**Created:** [April 22, 2021, 9:46pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267 "2021-04-22T21:46:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lingvisa](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lingvisa/32/8150_2.png) [@lingvisa](https://community.neo4j.com/u/lingvisa)\
**Post date:** [April 22, 2021, 9:46pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267/1 "2021-04-22T21:46:29Z")

</div>

`match (n) where n.name = 'Okay?Okay?' return n`

This can successfully return the node from the graph. However,

`match (n) where n.name =~ '(?i)Okay?Okay?' return n`

This returns nothing.

---

<div class="post-metadata">

**Author:** ![koji](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/koji/32/27564_2.png) [@koji](https://community.neo4j.com/u/koji)\
**Post date:** [April 22, 2021, 10:31pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267/2 "2021-04-22T22:31:34Z")

</div>

Hi @lingvisa

The "=~ '(?i)Okay?Okay?'" is a regular expression.  
This question mark in a regular expression means some character.

If you write a backslash before the question mark, it will work correctly.

```auto
MATCH (n)
  WHERE n.name =~ '(?i)Okay\?Okay\?'
RETURN n

```

---

<div class="post-metadata">

**Author:** ![dana\_canzano](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/dana_canzano/32/27392_2.png) [@dana\_canzano](https://community.neo4j.com/u/dana_canzano)\
**Post date:** [April 22, 2021, 11:03pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267/3 "2021-04-22T23:03:41Z")

</div>

further detail on regular expressions at [WHERE - Cypher Manual](https://neo4j.com/docs/cypher-manual/current/clauses/where/#query-where-regex)

---

<div class="post-metadata">

**Author:** ![lingvisa](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/lingvisa/32/8150_2.png) [@lingvisa](https://community.neo4j.com/u/lingvisa)\
**Post date:** [April 23, 2021, 6:15pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267/4 "2021-04-23T18:15:22Z")

</div>

Shouldn't the question mark '?' represent any character? If that's the case, it does not have to be escapeted?

---

<div class="post-metadata">

**Author:** ![koji](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/koji/32/27564_2.png) [@koji](https://community.neo4j.com/u/koji)\
**Post date:** [April 23, 2021, 10:07pm UTC](https://community.neo4j.com/t/why-does-question-mark-blocks-case-insensitive-matching/37267/5 "2021-04-23T22:07:18Z")

</div>

Hi @lingvisa  
Sorry, My description was incorrect.  
The "any character" is period.  
The question mark indicates _zero or one_ occurrences of the preceding element.

You can find "Okay?Okay?", "okay?okay?", "Okay1Okay2", "OkayAOkayB".

```auto
MATCH (n)
  WHERE n.name =~ '(?i)Okay.Okay.'
RETURN n

```
