User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Perl section within the Software Development category of DaniWeb, a massive community of 423,070 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,334 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Perl advertiser: Programming Forums
Views: 1005 | Replies: 3 | Solved
Reply
Join Date: Jun 2008
Posts: 15
Reputation: grr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
grr grr is offline Offline
Newbie Poster

Regex A-Z, a-z, 0-9, spaces, _s

  #1  
Jul 8th, 2008
Here's my current code:

/[\w\s]+/

I'm trying to make the following characters match:
Q W E R T Y U I O P A S D F G H J K L Z X C V B N M 
q w e r t y u i o p a s d f g h j k l z x c v b n m
_ (spaces)

Note - Sorry, I couldn't resist!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2006
Posts: 616
Reputation: KevinADC is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 32
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Master Poster

Re: Regex A-Z, a-z, 0-9, spaces, _s

  #2  
Jul 8th, 2008
The character class you have will match all of the characters in the list of characters you posted. Is there a problem?
Reply With Quote  
Join Date: Jun 2008
Posts: 15
Reputation: grr is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
grr grr is offline Offline
Newbie Poster

Re: Regex A-Z, a-z, 0-9, spaces, _s

  #3  
Jul 8th, 2008
That's strange... well, thanks for verifying that it works.
Reply With Quote  
Join Date: Mar 2006
Posts: 616
Reputation: KevinADC is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 32
KevinADC's Avatar
KevinADC KevinADC is offline Offline
Practically a Master Poster

Re: Regex A-Z, a-z, 0-9, spaces, _s

  #4  
Jul 8th, 2008
Its not strange at all. What is strange is your post, it makes no sense.

In addition to the characters you posted the character class will also match 0-9 which is part of the \w character list:

a-zA-Z0-9_

If you don't want 0-9 you have to do this:

[a-zA-Z_\s]
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Perl Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Perl Forum

All times are GMT -4. The time now is 5:25 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC