# Type Nothing has no field match

**URL:** <https://discourse.julialang.org/t/type-nothing-has-no-field-match/95904>\
**Category:** General Usage\
**Tags:** match\
**Created:** [March 11, 2023, 4:58am UTC](https://discourse.julialang.org/t/type-nothing-has-no-field-match/95904 "2023-03-11T04:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hungpham3112](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hungpham3112/32/34315_2.png) [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Post date:** [March 11, 2023, 4:58am UTC](https://discourse.julialang.org/t/type-nothing-has-no-field-match/95904/1 "2023-03-11T04:58:24Z")

</div>

I’m learning Linear Regression model with housing [dataset](https://www.kaggle.com/datasets/ladcva/vietnam-housing-dataset-hanoi) from Kaggle.

Dealing with a problem to extract int or float from string make me some confusing.

```julia
# rename columns
renamed_df = rename(df2, Dict("Diện tích" => "Area", "Giá/m2" => "Price/m2"))
# convert "," => "." in string
comma_to_dot_column = map(x -> replace(x, "," => "."), renamed_df[:, "Price/m2"])
# extract int or float from string
for i in comma_to_dot_column
    @show typeof(match(r"[+-]?\d+(\.\d+)?", i).match)
end

```

The for loop returns error: `type Nothing has no field match` despite the fact that all regex match in the column existing in RegexMatch datatype.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/5/55a37c1fbda33c0ad7f66a1c22922a07c607dc67.jpeg)

I migrate from Python to Julia so maybe missing some important concept about Julia Datatype in this code

---

<div class="post-metadata">

**Author:** ![jling](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jling/32/212909_2.png) [@jling](https://discourse.julialang.org/u/jling)\
**Post date:** [March 11, 2023, 5:57am UTC](https://discourse.julialang.org/t/type-nothing-has-no-field-match/95904/2 "2023-03-11T05:57:27Z")

</div>

> [@hungpham3112](#):
>
> ` @show typeof(match(r"[+-]?\d+(\.\d+)?", i).match)`

in this line, the `.match` would throw an error before you can `show` anything, so I suggest you do this:

```julia
m = match(r"[+-]?\d+(\.\d+)?", i)
if isnothing(m)
    @show i
end

```
