# Intermediate RegEx expression:

**URL:** <https://forum.kirupa.com/t/intermediate-regex-expression/189436>\
**Category:** Uncategorized\
**Created:** [June 2, 2006, 2:40pm UTC](https://forum.kirupa.com/t/intermediate-regex-expression/189436 "2006-06-02T14:40:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![logikal2](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/logikal2/32/1143_2.png) [@logikal2](https://forum.kirupa.com/u/logikal2)\
**Post date:** [June 2, 2006, 2:40pm UTC](https://forum.kirupa.com/t/intermediate-regex-expression/189436/1 "2006-06-02T14:40:04Z")

</div>

Hey guys,

I’ve been using PHP for a while, but i’m fairly new to RegEx, so I was wondering if anyone could help me solve this dilemna using RegEx:

How do I search a string for data enclosed within **##** symbols, and if there is any, then remove the \*\*##\*\*s from around the text, and convert the text to its ASCII equivalent?

**For example, the before:**

```auto
$str = "##Hi##, this is a ##test## string.";

```

**And, the after (ignore the dots):**

```auto
$str = "&.#72;&.#105;, this is a &.#116;&.#101;&.#115;&.#116; string.";

```

Thanks in advance! :kommie:  
Matt
