Recent Changes - Search:

LiveStreamsPro

PmWiki

pmwiki.org

edit SideBar

Regex

The regex block contains regular expressions or python code use to process the source page or strings and extract or manipulate content

You can call regex in regex. While processing a regex, you can $doregex and call another regex from it. multiple regex in page, regex in session, also htmlunescape responses and you can have multiple regex in url section, in regex, in link and in Page too.

Since version 2.7.3 regex is also supported in title elements! Similar to thumbnail elements you have to use pyfunctions. For example:

<thumbnail>$pyFunction: urllib.quote_plus('[makelist.param1]').replace('%3A',':').replace('%2F','/')</thumbnail>


Since version 2.7.8 you have two options:
1. use pyfunction in the title. This is little complex but you can call a function in title. something like this:
<expres>$pyFunction:mylib.getvideotitle('https://www.youtube.com/channel/UCOuDMda3jxj-g_iI1P2d2zw')
You would need to implement getvideotitle function in mylib python file, put this file in the data directory of the addon and it should work, In that function you can make whatever title you want by checking the site etc and produce the value with flag etc.

2. or you can call regex from title like this

<title>Living Hope SDA Church live at 14:15 GMT [COLOR yellow]$doregex[getliveflag][/COLOR]</title>



Same for thumbnails:

<thumbnail>$pyFunction: urllib.quote_plus('[makelist.param1]').replace('%3A',':').replace('%2F','/')</thumbnail>

For more information on regular expressions please look here How to create a simple XML regex file for LSP

Edit - History - Print - Recent Changes - Search
Page last modified on May 14, 2017, at 05:16 PM
Free Web Hosting