# How to remove RegexMatch() in output

**URL:** <https://discourse.julialang.org/t/how-to-remove-regexmatch-in-output/89158>\
**Category:** General Usage\
**Tags:** question, regex\
**Created:** [October 23, 2022, 6:03pm UTC](https://discourse.julialang.org/t/how-to-remove-regexmatch-in-output/89158 "2022-10-23T18:03:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chintu\_sharma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chintu_sharma/32/43808_2.png) [@Chintu\_sharma](https://discourse.julialang.org/u/Chintu_sharma)\
**Post date:** [October 23, 2022, 6:03pm UTC](https://discourse.julialang.org/t/how-to-remove-regexmatch-in-output/89158/1 "2022-10-23T18:03:35Z")

</div>

```julia
filefull="main.cpp"
extension_pattern=r"[^.]+$"
println(match(extension_pattern,filefull))
# answer is RegexMatch("cpp")
#but i need only output word "cpp"

```

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [October 23, 2022, 6:11pm UTC](https://discourse.julialang.org/t/how-to-remove-regexmatch-in-output/89158/2 "2022-10-23T18:11:19Z")

</div>

Welcome!

```julia
julia> m=match(extension_pattern,filefull)
RegexMatch("cpp")

julia> m.match
"cpp"

julia> println(match(extension_pattern,filefull).match)
cpp

```
