php - Regular expression : Find elements wrapped with specific selectors -


I am very bad with regular expressions - there was not enough time to learn it correctly.

I'm trying to find all the elements of a string wrapped with '%% %%' - the example would be:

%% gallery %%

Any ideas that regular expression will work here?

I'm going to use the PHP in place to replace the placeholder with the relevant plugins.

view:

(? & Lt;!%)% % ([^%] +) %% (?!%)

This is exactly %% a %% match, it's a non-greedy match, Lauroms ipsum %% specimen %% lorem %%% Ipsum %%% 'and so on'

Comments