# New proc (regex)

Source: https://ref.dm-lang.org/regex/proc/New
Added in BYOND 510.

### Format
- `regex(pattern, flags)`
- `regex(Regex)`


### Args
- `pattern`: The pattern string to search for
- `flags`: (optional) A text string containing any combination of modifier flags
- `Regex`: an existing /regex datum to copy


Calling new/regex() is the same as calling regex(). It will create a new /regex datum.

### See also
- [Regular expressions](https://ref.dm-lang.org/notes/regex.md)
- [regex datum](https://ref.dm-lang.org/regex/index.md)
- [regex proc](https://ref.dm-lang.org/proc/regex.md)
