Use non greedy modifier ?
:
preg_match("/\{\{(.*?)\}\}/si",$content,$matches);
here --^
More Related Contents:
- PHP regular expressions: No ending delimiter ‘^’ found in
- Delimiter must not be alphanumeric or backslash and preg_match
- preg_match(): Compilation failed: invalid range in character class at offset
- “Unknown modifier ‘g’ in…” when using preg_match in PHP?
- Optional Whitespace Regex
- Split camelCase word into words with php preg_match (Regular Expression)
- PHP – regex to allow letters and numbers only
- Extracting all values between curly braces regex php
- Function eregi() is deprecated [duplicate]
- Get repeated matches with preg_match_all()
- Unknown modifier ‘/’ in …? what is it? [duplicate]
- How to search in an array with preg_match?
- How to validate a domain name using Regex & PHP?
- Regular expression preg_quote symbols are not detected
- Test if a string is regex
- PHP email validation [duplicate]
- How to validate that a string only contain lowercase letters?
- Get non-numeric characters then number on each line of a block of texf
- Detecting a url using preg_match? without http:// in the string
- Regex to match an IP address [closed]
- PHP – Replace part of a string [closed]
- Capturing text between square brackets in PHP
- preg_match() Unknown modifier ‘[‘ help
- PHP preg_match to find whole words
- Using regex to filter attributes in xpath with php
- My pattern isn’t matching a ISO style date, why? [duplicate]
- Regex for password PHP [duplicate]
- PHP – detect whitespace between strings
- How do I replace characters not in range [0x5E10, 0x7F35] with ‘*’ in PHP?
- PHP regex templating – find all occurrences of {{var}}