0

I was struggling hard with this one for some time. I'm working with the MediaWiki API and I'm trying to find the headers of the articles with the regex (like I'm doing for every other styling). The syntax goes as follows:

 === some text in here === for h1, 
 == some text in here == for h2
etc,. you get the idea. 

I've been experimenting and testing in regex101 editor to find out the correct pattern but nothing works 100% for me.

Here you can see my test case, a text very similar to the ones I have to work with

As you can see, for the first couple occurrences he finds the match, but fails in the second paragraph.

Based on some stuff I read online I've tried ===.+?(?====) but it obviously doesn't work.

0 Answers0