[Webinar] Streamline your web hosting managementRegister Today

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

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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