Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 266
  • Last Modified:

easy regexp

this should be for a perl guru, but a perl guru, i'm not.  i'm actually using a apache regexp package in java code.  

i need a regexp that matches strings containing only Z's.  upper or lower are fine, but nothing else.

thanks in advance
0
peteodonnell
Asked:
peteodonnell
1 Solution
 
ozoCommented:
/^z+$/i
or, if an empty string should match
/^z*$/i
0
 
ahoffmannCommented:
if there is no i operator:

/^[zZ]+$/
/^[zZ]*$/
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now