Hi,
I'm trying to combine 2 different regex with the same names into one and got the error message like this:
Warning: preg_match(): Compilation failed: two named subpatterns have the same name at offset 276 ...
One regex looks like this:
'%<div class="artikkelen">[\s\S]*?<h2>(?P<title>[\s\S]*?)</h2>%'
The other looks like this:
'%<div id="article">[\s\S]*?<h1>(?P<title>[\s\S]*?)</h1>%'
I could combine them in the following way without problem:
'%(<div class="artikkelen">[\s\S]*?<h2>(?P<title>[\s\S]*?)</h2>|<div id="article">[\s\S]*?<h1>(?P<title2>[\s\S]*?)</h1>)%'
But I don't like this way because I use 2 names. I'm wondering whether there is a better way to solve this problem. Thanks in advance.
Best Regards, Box (boxoft...Simple & Great)