Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-03-17 09:45:36

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Regex for article titles changes

I would like to format my article titles based on this writing model:

Macbeth, de William Shakespeare

In order to display this instead:

«Macbeth» de William Shakespeare

I use a regex but unfortunatly I can’t get the desired signs. None of these two samples work:

<txp:title trim="/(.*)(,)/" replace="«$1»" />

<txp:title trim="/(.*)(,)/" replace="\xAB$1\xBB" />

Could you tell me please how to accomplish such that kind of thing?

Demo: https://regex101.com/r/qkesDM/1

Last edited by Pat64 (2020-03-17 09:48:25)


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

#2 2020-03-17 10:43:49

etc
Developer
Registered: 2010-11-11
Posts: 5,053
Website GitHub

Re: Regex for article titles changes

Hi Patrick,

the first version is working for me on Pete’s demo server.

Offline

#3 2020-03-17 11:58:07

Pat64
Plugin Author
From: France
Registered: 2005-12-12
Posts: 1,599
GitHub Twitter

Re: Regex for article titles changes

Thank you lot Oleg!

I’m using a MAMP local server and, as often, we observe lot of differences with a real environment…


Patrick.

Github | CodePen | Codier | Simplr theme | Wait Me: a maintenance theme | [\a mi.ni.ma]: a “Low Tech” simple Blog theme.

Offline

Board footer

Powered by FluxBB