FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Requesting Help with a Regular Expression
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Requesting Help with a Regular Expression [message #179442] Sun, 28 October 2012 23:08 Go to previous message
bobgatski is currently offline  bobgatski
Messages: 11
Registered: October 2012
Karma:
Junior Member
From strings such as these ...
int(11)
varchar(45)
datetime
.... I am trying to extract just the type and length; i.e. for the type I want ...
int
varchar
datetime
.... and for the length I want ...
11
45
NULL
I can get the type using ...
(\w+)
.... but I haven't been able to get the type and length. What I think should work is ...
(\w+)(\((\d+)\))?
.... gets no matches at all,not even the type.

I knew that I wasn't a regular expression expert but I thought I could handle something this easy.

Thanks for any help, advice, sympathy anyone can offer.

Bob
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to cURL a JSP page
Next Topic: Beginner's trouble with substr
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 00:06:35 GMT 2024

Total time taken to generate the page: 0.04439 seconds