Welcome! Log In Create A New Profile

Advanced

Re: regex issue

Edho Arief
January 19, 2012 02:18AM
On Wed, Jan 18, 2012 at 11:58 PM, mpratt <m.pratt1@verizon.net> wrote:
> For some reason, I am unable to take a URI like
> example.com/manufacturers/metlox/0?page=13 and change it to
> example.com/manufacturers/m
>
> It seems like the curly braces aren’t working. I’ve tried the following
> without results:
>



/(.{1})/
This will match and capture one character between slashes
Examples:
/a/ -> $1: a
/asd/ -> no match (three characters)

/([a-z]*)/
This one will match and capture one or less letter between slashes
Examples:
/a/ -> $1: a
/asd/ -> no match

/([a-z]?)/
This one is equivalent to /([a-z]*)/

/([a-z] ?)/
This one will match and capture one letter followed by space between slashes
Examples:
/a/ -> no match
/a / -> $1: " a"
/asd/ -> no match

/(.).*/
This one will match one or more characters between slashes and capture
the first character
/a/ -> $1: a
/a / -> $1: a
/asd/ -> $1: a


--
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

regex issue

mpratt January 19, 2012 02:08AM

Re: regex issue

Edho Arief January 19, 2012 02:18AM

Re: regex issue

Edho Arief January 19, 2012 02:20AM

Re: regex issue

mpratt January 19, 2012 08:35AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 115
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready