# preg\_match\_all()

**URL:** <https://forum.kirupa.com/t/preg-match-all/272989>\
**Category:** programming\
**Created:** [October 9, 2008, 11:42pm UTC](https://forum.kirupa.com/t/preg-match-all/272989 "2008-10-09T23:42:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![b\_rich](https://avatars.discourse-cdn.com/v4/letter/b/53a042/32.png) [@b\_rich](https://forum.kirupa.com/u/b_rich)\
**Post date:** [October 9, 2008, 11:42pm UTC](https://forum.kirupa.com/t/preg-match-all/272989/1 "2008-10-09T23:42:21Z")

</div>

I’m trying to match and strip out the following content using preg\_match\_all()

```auto
1. content1, content2<br>
2. content1, content2<br>
3. content1, content2<br>
4. content1, content2<br>

```

I’d like to strip out ‘ **content1** ’ and ‘ **content2** ’ from each line… any help is appreciated.

I’m new to regex but I gave it a shot…here is the pattern I have sofar (doesn’t work yet but it’s a start)

```php
$testPattern = '/^[0-9]\.(.*),(.*)<br>$/';

```
