It is currently May 20th, 2024, 10:28 am

String ?

Get help with creating, editing & fixing problems with skins
trinhanhngoc
Posts: 23
Joined: May 23rd, 2010, 3:48 pm

String ?

Post by trinhanhngoc »

If the string (from WebParser) includes a character (Example : %) then that string is shown as text (Example : N/A)
How to do it ?

"Tear In% Heaven" -> "N/A"
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: String ?

Post by kenz0 »

Example:

Code: Select all

[MeasureTitle]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=...
RegExp="<title>([^%]*?)</title>"
StringIndex=1
ErrorString=N/A
Output results

Case1:
<title>Tear In Heaven</title> → Tear In Heaven

Case2:
<title>Tear In% Heaven</title> → N/A
.
Image
trinhanhngoc
Posts: 23
Joined: May 23rd, 2010, 3:48 pm

Re: String ?

Post by trinhanhngoc »

kenz0 wrote:Example:

Code: Select all

[MeasureTitle]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=...
RegExp="<title>([^%]*?)</title>"
StringIndex=1
ErrorString=N/A
Output results

Case1:
<title>Tear In Heaven</title> → Tear In Heaven

Case2:
<title>Tear In% Heaven</title> → N/A
^ Match the beginning of the line
[^%] ... Please explain this code
%Tear In Heave -> %Tear In Heave
User avatar
kenz0
Developer
Posts: 263
Joined: July 31st, 2009, 2:23 pm
Location: Tokyo, JPN

Re: String ?

Post by kenz0 »

trinhanhngoc wrote:^ Match the beginning of the line
Yes, but it has another meaning.

In this case, [^%] is the one character that matches any character except %

When % is contained in search strings, this matching is not successful.
As a result, N/A is displayed as error string.
.
Image
trinhanhngoc
Posts: 23
Joined: May 23rd, 2010, 3:48 pm

Re: String ?

Post by trinhanhngoc »

kenz0 wrote: Yes, but it has another meaning.

In this case, [^%] is the one character that matches any character except %

When % is contained in search strings, this matching is not successful.
As a result, N/A is displayed as error string.
Thanks you. why do you know it ? Does it appear in help file ?
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: String ?

Post by poiru »

trinhanhngoc wrote:Thanks you. why do you know it ? Does it appear in help file ?
http://www.google.com/search?q=regex+tutorial