Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Regular Expressions - am I right?
Old 11-13-2008, 10:05 AM Regular Expressions - am I right?
dartiss's Avatar
Experienced Talker

Latest Blog Post:
November
Posts: 32
Name: David Artiss
Location: Nottingham, UK
Trades: 0
Hi all,

Ok, I'll admit, I'm struggling with regular expressions. I think I've cracked it, but thought I'd check first.

First of all, the following should validate a string of characters that can contain only letters, numbers, hyphen and underscore...

"^[A-Za-z0-9_-]+$"

The next one is similar but will validate a .PHP page name that should only have the aforementioned characters in it...

^[a-zA-Z0-9_-]+\.php$

They appear to work okay. Anybody able to confirm that I've done the right thing?

David.
dartiss is offline
Reply With Quote
View Public Profile Visit dartiss's homepage!
 
 
Register now for full access!
Old 11-13-2008, 11:24 AM Re: Regular Expressions - am I right?
rogem002's Avatar
PHP Chap

Posts: 843
Name: Mike
Location: United Kingdom
Trades: 0
Thats looks ok, but the best way to find out is by trying
__________________
My Blog/Site:
Please login or register to view this content. Registration is FREE
rogem002 is offline
Reply With Quote
View Public Profile Visit rogem002's homepage!
 
Reply     « Reply to Regular Expressions - am I right?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.20727 seconds with 12 queries