Hi, I'm a newbie to this forum and switched from VBscript to PhP some six months ago.
PhP rocks! I really like the preg_match_all() function and have read alle the basic manuals, but i'm having problem building the expression for:
Er was een een <b>knappe</b> prins die op zoek was naar een <b><i>mooie</i> prinses</b> in een <b>donker</b> bos.
I would like to retreive the text between the bold tags. My expression is:
/<b>(.*)<\/b>/
But this results in:
array(2) {
[0]=>
array(1) {
[0]=>
string(93) "<b>knappe</b> prins die op zoek was naar een <b><i>mooie</i> prinses</b> in een <b>donker</b>"
}
[1]=>
array(1) {
[0]=>
string(86) "knappe</b> prins die op zoek was naar een <b><i>mooie</i> prinses</b> in een <b>donker"
}
}
instead of:
array(2) {
[0]=>
array(3) {
[0]=>
string(13) "<b>knappe</b>"
[1]=>
string(27) "<b><i>mooie</i> prinses</b>"
[2]=>
string(13) "<b>donker</b>"
}
[1]=>
array(3) {
[0]=>
string(6) "knappe"
[1]=>
string(20) "<i>mooie</i> prinses"
[2]=>
string(6) "donker"
}
}
Who can help me ajust this expression?