Re: Regular Expression Question: How To Search For Section Titles

Inside a character class delimited by square brackets, the vertical bar character is not used for alternation. Currently, your line could end with a bar. Try the following revision:


^[A-Z].*[A-Za-z0-9]$

Jamal


On 8/6/2010 9:42 AM, Homme, James wrote:


Hi,

How would you construct a regular expression that looks for the first
letter of any line in upper case followed by the rest of the line as
long as it ends with a letter or number? Would it be something like this?

^[A-Z].*[A-Z|a-z|1-9]$

Thanks.

Jim

Jim Homme,

Usability Services,

Phone: 412-544-1810. Skype: jim.homme

Internal recipients, Read my accessibility blog
<http://mysites.highmark.com/personal/lidikki/Blog/default.aspx>.
Discuss accessibility here
<http://collaborate.highmark.com/COP/technical/accessibility/default.aspx>.
Accessibility Wiki: Breaking news and accessibility advice
<http://collaborate.highmark.com/COP/technical/accessibility/Accessibility%20Wiki/Forms/AllPages.aspx>



This e-mail and any attachments to it are confidential and are intended
solely for use of the individual or entity to whom they are addressed.
If you have received this e-mail in error, please notify the sender
immediately and then delete it. If you are not the intended recipient,
you must not keep, use, disclose, copy or distribute this e-mail without
the author's prior permission. The views expressed in this e-mail
message do not necessarily represent the views of Highmark Inc., its
subsidiaries, or affiliates.
__________
View the list's information and change your settings at http://www.freelists.org/list/programmingblind

Other related posts: