# Simple wildcard search in dataframes

**URL:** <https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401>\
**Category:** General Usage\
**Tags:** dataframes\
**Created:** [April 1, 2021, 10:31pm UTC](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401 "2021-04-01T22:31:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [April 1, 2021, 10:31pm UTC](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401/1 "2021-04-01T22:31:41Z")

</div>

Hello All,

This seems like such a trivial thing, but I couldn’t get it to work.

I’m simply trying to filter a dataframe column by a wildcard search. What is the right syntax?

```julia
df = DataFrame(:a => ["abcdef","abcdeg","xyzefg"], :b => [1,2,3])

```

so I’m looking for something like abc\*g on column :a

I tried this, but this doesn’t seem to work.

```julia
contains.(df.a, r"abc*g")

```

Thanks.

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [April 1, 2021, 10:36pm UTC](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401/2 "2021-04-01T22:36:03Z")

</div>

> [@jonjilla](#):
>
> ```julia
> contains.(df.a, r"abc*g")
> 
> ```

I think you just have a regex error

```julia
julia> contains.(df.a, r"abc.*g")
3-element BitVector:
 0
 1
 0

```

I always have a tab of Regex101 open when working with regex.

---

<div class="post-metadata">

**Author:** ![jonjilla](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Post date:** [April 1, 2021, 10:40pm UTC](https://discourse.julialang.org/t/simple-wildcard-search-in-dataframes/58401/3 "2021-04-01T22:40:31Z")

</div>

OK, thanks, I knew it was something stupid I did.

Regex is my weakness…
