View Single Post
Old 12-22-2013, 04:19 PM   #355
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well, I figured it out in my head while I was doing something else, so I decided to come back.

It turns out capturing groups that are repeated with the star return only the last found match , so I doubled the capture group and captured only the first part -- which doesn't have to mean anything to you.

Here is a new template, which works in my custom column I use for testing new bit in red, in case anyone cares:
Code:
{tags:re((([^-/])[^-/]*( - ))?([^-/])[^-/]*(/)([^-/])[^-/]*,\2\3\4\5\6)}
This should work (although I have no idea why you got a much different problem than me).

Also, I had discovered as of last time, this should get away with matching spaces as well, just so long as you always use "-" and "/" exclusively as the separators, and only "-" the first time, and "/" the second time. For a total of three parts. If you wish more, I will have to construct a new regex.

EDIT: And yes, this is actually a good thing that we got so confused, because now I learned something cool about regex!

Last edited by eschwartz; 12-22-2013 at 05:25 PM.
eschwartz is offline   Reply With Quote