Solved

easy regexp

Posted on 2002-05-29
2
252 Views
Last Modified: 2010-03-05
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
Comment
Question by:peteodonnell
2 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 7043352
/^z+$/i
or, if an empty string should match
/^z*$/i
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 50 total points
ID: 7044171
if there is no i operator:

/^[zZ]+$/
/^[zZ]*$/
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question