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"
It is currently September 15th, 2024, 11:41 pm
String ?
-
- Developer
- Posts: 263
- Joined: July 31st, 2009, 2:23 pm
- Location: Tokyo, JPN
Re: String ?
Example:
Output results
Case1:
<title>Tear In Heaven</title> → Tear In Heaven
Case2:
<title>Tear In% Heaven</title> → N/A
Code: Select all
[MeasureTitle]
Measure=Plugin
Plugin=Plugins\WebParser.dll
UpdateRate=3600
Url=...
RegExp="<title>([^%]*?)</title>"
StringIndex=1
ErrorString=N/A
Case1:
<title>Tear In Heaven</title> → Tear In Heaven
Case2:
<title>Tear In% Heaven</title> → N/A
-
- Posts: 23
- Joined: May 23rd, 2010, 3:48 pm
Re: String ?
^ Match the beginning of the linekenz0 wrote:Example:Output resultsCode: Select all
[MeasureTitle] Measure=Plugin Plugin=Plugins\WebParser.dll UpdateRate=3600 Url=... RegExp="<title>([^%]*?)</title>" StringIndex=1 ErrorString=N/A
Case1:
<title>Tear In Heaven</title> → Tear In Heaven
Case2:
<title>Tear In% Heaven</title> → N/A
[^%] ... Please explain this code
%Tear In Heave -> %Tear In Heave
-
- Developer
- Posts: 263
- Joined: July 31st, 2009, 2:23 pm
- Location: Tokyo, JPN
Re: String ?
Yes, but it has another meaning.trinhanhngoc wrote:^ Match the beginning of the line
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.
-
- Posts: 23
- Joined: May 23rd, 2010, 3:48 pm
Re: String ?
Thanks you. why do you know it ? Does it appear in help file ?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.
-
- Developer
- Posts: 2873
- Joined: April 17th, 2009, 12:18 pm
Re: String ?
http://www.google.com/search?q=regex+tutorialtrinhanhngoc wrote:Thanks you. why do you know it ? Does it appear in help file ?