# What is regex?

**URL:** https://discourse.julialang.org/t/what-is-regex/46215
**Category:** New to Julia
**Tags:** strings, regex
**Created:** [September 7, 2020, 6:25pm UTC](https://discourse.julialang.org/t/what-is-regex/46215 "2020-09-07T18:25:29Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![Henrique\_Becker](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/henrique_becker/32/15443_2.png) [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)
#### Post date: [September 7, 2020, 7:09pm UTC](https://discourse.julialang.org/t/what-is-regex/46215/5 "2020-09-07T19:09:33Z")

</div>

> [@string-dot-byte](#):
>
> As far as I know most scripting languages do not have regex.

Did you mean the opposite? Because [Python](https://docs.python.org/3.8/library/re.html), [Ruby](https://ruby-doc.org/core-2.7.1/Regexp.html), [Javascript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions), [Perl](https://perldoc.perl.org/perlre.html), all of them have RegEx in their standard libraries. Could you point some mainstream scripting language of the last 20 years that do not have RegEx in their standard library?

> [@string-dot-byte](#):
>
> > The example you give with `printf` has nothing to do with regex as far as I know.
> 
> Well, I thought something like `match("^%d+$")` would fall in the category.

Yes, you could use regular expressions in such case. However, the number of different formats for `printf` is relatively limited, their structure is very simple, and each of them basically needs to be treated in a different way, so I am not sure if that code uses RegEx inside it. Anyway, it is not an example of the use of RegEx but of an standard library method that may be using RegEx inside it.

> [@string-dot-byte](#):
>
> So that means that it’s used for matching strings or finding strings within another in a more simple way? If I were to have a long script and I am trying to find a certain keyword placed next to another, regex would come in useful?

It is a compact way, and after you learn/master them, it is a very easy way to search for certain patterns. However, they cannot represent every possible pattern (the theory of formal languages very clearly specifies what are their limitations) and it is common to find people criticizing their readability (I often write comments above them explaining them because, otherwise, months later I will have a hard time remembering what they were supposed to parse).

> [@string-dot-byte](#):
>
> Example trying to compare a digit with another?

Sorry, I am not sure I understand which example you are asking me to do.

---

_[View the full topic](https://discourse.julialang.org/t/what-is-regex/46215)._
