[lug] Regex Help

Will will.sterling at gmail.com
Fri Jul 8 15:09:25 MDT 2011


If you are not being passed the hostname which is often the case just add a
carrot to signify the start of the string.

^/somepath/*

On Fri, Jul 8, 2011 at 3:03 PM, George Sexton <georges at mhsoftware.com>wrote:

> Not to be stupid or anything, but if I understood regular expressions well
> enough to use this, I wouldn't have asked for help.
>
> I'm using an application that matches regular expressions in URLs.
>
> I'd like it to match
>
> /somepath/*
>
> But not
>
> /somethingelse/somepath/*
>
> I can write an expression to match /somepath/*. The problem is it's
> matching
> the second thing which I don't want.
>
> I don't get to write a lot of code.
>
> I don't know what the host name will be. It might be a fqdn, might be an IP
> Address.
>
> The input has the full URL syntax:
>
> Scheme:hostname/path/
>
>
>
> George Sexton
> MH Software, Inc.
> 303 438-9585
> www.mhsoftware.com
>
>
> > -----Original Message-----
> > From: lug-bounces at lug.boulder.co.us [mailto:lug-
> > bounces at lug.boulder.co.us] On Behalf Of Chip Atkinson
> > Sent: Friday, July 08, 2011 2:44 PM
> > To: Boulder (Colorado) Linux Users Group -- General Mailing List
> > Subject: Re: [lug] Regex Help
> >
> > How about this:
> >
> > http://txt2re.com/
> >
> >
> >
> > On Fri, 8 Jul 2011, George Sexton wrote:
> >
> > > I'm just dying on a regular expression here. I'm always rotten. If
> > someone
> > > could help me out I would appreciate it.
> > >
> > >
> > >
> > > I'm looking for a regex that will match:
> > >
> > >
> > >
> > > http://some.host/specificpath/
> > >
> > >
> > >
> > > but not
> > >
> > >
> > >
> > > http://some.host/otherjunk/specificpath/
> > >
> > >
> > >
> > > I'd really appreciate any help I can get.
> > >
> > >
> > >
> > >
> > >
> > > George Sexton
> > >
> > > MH Software, Inc.
> > >
> > > 303 438-9585
> > >
> > > www.mhsoftware.com
> > >
> > >
> > >
> > >
> >
> > _______________________________________________
> > Web Page:  http://lug.boulder.co.us
> > Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> > Join us on IRC: irc.hackingsociety.org port=6667
> > channel=#hackingsociety
>
>
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: irc.hackingsociety.org port=6667 channel=#hackingsociety
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20110708/125e3b4c/attachment.html>


More information about the LUG mailing list