Re: Regular Expression Question: How To Search For Section Titles
- From: Jim Bauer <holdsworthfan@xxxxxx>
- To: programmingblind@xxxxxxxxxxxxx
- Date: Fri, 06 Aug 2010 12:25:20 -0500
It does, just not inside a character class. If you wanted to match something
from one of several character classes using `|', you would do something
like:
----------
[a-z]|[A-Z]|[...]
----------
But you can just spell out everything you want to match in a single character
class, so I don't see that as particularly useful.
On Fri, 6 Aug 2010 12:48:12 -0400, Homme, James wrote:
> Hi,
> I'm misusing the vertical bar. I thought it created an or condition.
>
> Jim
>
> Jim Homme,
> Usability Services,
> Phone: 412-544-1810. Skype: jim.homme
> Internal recipients, Read my accessibility blog. Discuss accessibility here.
> Accessibility Wiki: Breaking news and accessibility advice
>
>
> -----Original Message-----
> From: programmingblind-bounce@xxxxxxxxxxxxx
> [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Jim Bauer
> Sent: Friday, August 06, 2010 10:36 AM
> To: programmingblind@xxxxxxxxxxxxx
> Subject: Re: Regular Expression Question: How To Search For Section Titles
>
> You're including `|' in your last character class, not matching uppercase
> letters or lowercase letters or digits. This means something like `This is a
> test|' will match, which, of course, is fine if that's what you're intending.
> :)
>
> ----------
> ^[A-Z].+[A-Za-z0-9]$
> ----------
>
> On Fri, 6 Aug 2010 09:42:55 -0400, 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
>
> __________
> View the list's information and change your settings at
> http://www.freelists.org/list/programmingblind
__________
View the list's information and change your settings at
http://www.freelists.org/list/programmingblind
Other related posts: