I need help :)) (who does not)

Z

zero1979

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
 
P

Paul Lalli

zero1979 said:
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
 
M

Michele Dondi

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
 
B

Ben Morrow

Quoth "Paul Lalli said:
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... :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top