# eregi\_replace question

**URL:** <https://forum.kirupa.com/t/eregi-replace-question/214280>\
**Category:** programming\
**Created:** [January 26, 2007, 10:57pm UTC](https://forum.kirupa.com/t/eregi-replace-question/214280 "2007-01-26T22:57:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DHDesign](https://avatars.discourse-cdn.com/v4/letter/d/b19c9b/32.png) [@DHDesign](https://forum.kirupa.com/u/DHDesign)\
**Post date:** [January 26, 2007, 10:57pm UTC](https://forum.kirupa.com/t/eregi-replace-question/214280/1 "2007-01-26T22:57:17Z")

</div>

I have always had trouble reading and understanding the details that one can place into a eregi\_replace function…for example, can anyone please explain to me what the following do:

```auto

$theTemplate = eregi_replace('{[^ }]*}', '', $theTemplate);

```

```auto

$theTemplate = eregi_replace('{([^ }]*)}', '<!-- \\1 undefined -->',$theTemplate);

```

Specially, what the parts in the squiggly brackets do?  
I know what the function does in general (replace pattern match with new string in the string that you mention).

Thanks!
