Reputation: 138
I have the following regex and I want to extract the text including [b]. How can I ignore the [b], [i] and [u]
~id="schedule-text".*?]([^[]*)~is
[cs_text id="schedule-text" class="cs-ta-center"]OPEN [b]HOUSE[/b] Sunday, 12/4 from 2-4pm Additional showings by appointment[/cs_text]
https://regex101.com/r/ukHENx/1
Expected output:
OPEN [b]HOUSE[/b] Sunday, 12/4 from 2-4pm Additional showings by appointment
Upvotes: 1
Views: 40
Reputation: 15141
Hope this one will be helpful.
Regex: id="schedule-text".*?]\K.*?(?=\[/cs)
1.
id="schedule-text".*?]
this will matchid="schedule-text"
and till the next occurrence of]
2.
\K
this will reset the whole match3.
.*?(?=\[/cs)
this will match all and positive look ahead for[/cs
Upvotes: 1