View Full Version : Regex, get part of string

05-25-2011, 07:51 PM
Hello to everyone it's my first post here. I am looking for a really nice coding forums for quite a while now, I do different languages, I like polite and respecful communities, hope here will be the place.

Anyway, I'm facing a problem I could do with someone's help:

I'm trying to make a regex that would return only a number from a BBCode string. Like this:

bla bla bla bla

I only want "50". So I could do it the dirty way, but I'm looking for a better way to "exclude" 50.

So I make my pattern, like this:


I think the expression above should match anything between my tags.

Now, what I'm trying to extract the number before the replace. Anyone knows how to do this?


05-25-2011, 10:29 PM
The number argument will be match 1 and the content in the tags will be match 2.