Regex in PHP: dont match

12 views
Skip to first unread message

Mario Lacunza

unread,
Dec 3, 2013, 12:44:03 PM12/3/13
to re...@googlegroups.com
Hello,
Im new with regex and Im trying to found a simple pair of {} inside of a text with the next code but its not working, any idea?

the text to be searched is: {chesspos} {/chesspos}

between both some html text will be founded.

My code:
// expression to search
$regex = "#{chesspos}(.*?){/chesspos}#s";
       
// find all instances and put in $matches
preg_match_all( $regex, $row->text, $matches );

Thomas Minitsios

unread,
Dec 12, 2013, 7:32:07 PM12/12/13
to re...@googlegroups.com
Try: $regex = "/\{chesspos\}(.|\n)*?\{\/chesspos\}/";


--
--
Sub, Unsub, Read-on-the-web, tune your personal settings for this Regex forum:
http://groups.google.com/group/regex?hl=en
 
---
You received this message because you are subscribed to the Google Groups "Regex" group.
To unsubscribe from this group and stop receiving emails from it, send an email to regex+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages