PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Sat Jul 22, 2017 11:44 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help for writing a regex
PostPosted: Mon Apr 07, 2014 5:45 am 
Offline
Forum Newbie

Joined: Mon Apr 07, 2014 5:41 am
Posts: 1
Hello everybody...

I'm completely new in regex using but I need help for creating one that will recognized that type:

{(1,4),(2,3),(3,8),(6,7)},{(1,8),(2,7),(3,6),(4,5)}

Help me please!!!

Thanks


Top
 Profile  
 
PostPosted: Mon Apr 07, 2014 5:53 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6254
Location: Montreal, Canada
Ugly, but this'll do it.
Code:
\{(\(\d,\d\),?){4}\},?{2}

There's probably a more elegant regex you can come up with. Take a look at Rubular.


Top
 Profile  
 
PostPosted: Sat Dec 20, 2014 7:50 pm 
Offline
Forum Newbie

Joined: Sat Dec 20, 2014 7:38 pm
Posts: 4
Syntax: [ Download ] [ Hide ]
^((\{(\(\d,\d\),?)+(?<!,)\},?)+)$

_________________
http://www.regex-builder.com/ online regular expression composer based on text analysis


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group