Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > I need help :)) (who does not)

Reply
Thread Tools

I need help :)) (who does not)

 
 
zero1979
Guest
Posts: n/a
 
      12-15-2006
I am beginner in perl programming and I am curious

wah does it mean. it is regular expresion
^xyz_[A-Z0-9][^_]*$

I know almost all symbols but I cannot find what [^_] mean in this
context.

Help please

 
Reply With Quote
 
 
 
 
Paul Lalli
Guest
Posts: n/a
 
      12-15-2006
zero1979 wrote:
> Subject: I need help ) (who does not)


Please put the subject of your post in the Subject of your post. This
subject should have been something along the lines of "What does [^_]
mean in a regexp?"

> I am beginner in perl programming and I am curious
>
> wah does it mean. it is regular expresion
> ^xyz_[A-Z0-9][^_]*$


Start of string, x, y, z, underscore, any character from A through Z or
0 through 9, 0 or more of any characters other than the underscore, end
of string.

> I know almost all symbols but I cannot find what [^_] mean in this
> context.


Brackets in a regexp delimit a character class. They match one of any
character listed in the brackets (either directly listed, or as part of
a range, like [A-Z0-9]. The ^ is a special character in a character
class that means "anything NOT listed here". Therefore [^_] means
"anything that's not an underscore".

Paul Lalli

 
Reply With Quote
 
 
 
 
Michele Dondi
Guest
Posts: n/a
 
      12-15-2006
On 15 Dec 2006 02:36:54 -0800, "zero1979" <(E-Mail Removed)>
wrote:

>Subject: I need help ) (who does not)


Me too (who does not?)
^
^

How 'bout putting the subject of your post in the Subject anyway?

>wah does it mean. it is regular expresion
>^xyz_[A-Z0-9][^_]*$
>
>I know almost all symbols but I cannot find what [^_] mean in this
>context.


Anything that is not '_'. See

perldoc perlre


Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      12-15-2006

Quoth "Paul Lalli" <(E-Mail Removed)>:
> Brackets in a regexp delimit a character class. They match one of any
> character listed in the brackets (either directly listed, or as part of
> a range, like [A-Z0-9]. The ^ is a special character in a character
> class


....at the *start* of a character class...[0] Elsewhere it just means
itself. '-' is similar: it only denotes a range if it's *not* at the
beginning or end of the class.

See perldoc perlre for the full details.

> that means "anything NOT listed here". Therefore [^_] means
> "anything that's not an underscore".


Ben

[0] While I am quite sure *you* know this, Paul, it seems worth making
sure others aren't confused...

--
Outside of a dog, a book is a man's best friend.
Inside of a dog, it's too dark to read.
http://www.velocityreviews.com/forums/(E-Mail Removed) Groucho Marx
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help, get error "Object does not match target type" in one instanceof an app, when others work Lasse Vågsæther Karlsen ASP .Net 1 11-27-2007 02:46 PM
re_---need help Network Adapters!!!! NEED HELP!!!! hedayatniac@gmail.com Computer Support 4 08-13-2006 01:03 AM
need help: SecurityException: signer information does not match.. Piper707@hotmail.com Java 0 02-15-2006 08:55 AM
Power button does not turn OFF? New power supply does not help! win2k lbbss Computer Support 0 01-06-2005 04:03 PM
does anyone need help barry_nicola Computer Support 11 02-07-2004 10:33 PM



Advertisments