0

I need to remove [quote] tag while keep content, however I tried many times but don't know why I can't select content between them.

[b]List of questions[/b]

[quote]
1. Questions 1
2. Questions 2
3. Questions 3
4. Questions 4
5. Questions 5
[/quote]

This regex works

\s*\[b\](.+?)\[/b\]\s*\[quote\]

While this code doesn't work

\s*\[b\](.+?)\[/b\]\s*\[quote\](.*?)\[/quote\]

I appreciate any helps.

The Hung
  • 279
  • 4
  • 15
  • 2
    Because the dot by default doesn't match the newline `\n` character (Line Feed). To change this default behaviour, you need to switch the s (singleline) modifier on, or, if not available, to use `[\s\S]` in place of the dot. In your particular case, and if you are sure that there's no opening square brackets between your quote tags, you can also use `[^\[]`. – Casimir et Hippolyte Jun 09 '17 at 11:03
  • Thanks @CasimiretHippolyte It worked for me. – The Hung Jun 09 '17 at 11:22

0 Answers0