BDMV.INFO

 Retrieve Password
 register now
Search
Hot: #
!show!: 23820|Reply: 2

[2013.08.29]Using Regular Express to Get the Value from Win8.1(WHCK) System IQ Test [Copy URL]

Rank: 9Rank: 9Rank: 9

Post time 2013-8-29 16:42:03 |Show all posts
People can get the log file or htm report from WHCK, like below example
  1. <td class="MsgInstance" width="72%" colspan="2">[RESULT] Test=Luminance,Result=PASS,METRIC=LUMINANCE,Value=102,Expected=88-168,Bucketized_Error=0,Camera=USB2.0 Camera,Location=NotSet,Resolution=640x480,Lux=20<table width="100%"></table>
Copy the Code

We use expresso to analysis the regular express rule to get the vale we need .
For example, I need to collect the IQ test vale of every test itmes, so I need get the parameter from the word - Test, Value, Expected, Resolution and Lux.

Below  conclustion list some perl regular express rule to realize my need, people can use ultraedit or expresso to test the result.

replace what---
pattern1:
.*Test=([^,]*),.*Result=([^,]+),.*METRIC=([^,]+),.*Value=([^,]+),.*Expected=([^,]+),.*Resolution=([x0-9]+).*(Lux=[0-9]+).*

pattern2:
.*Test=([^,]+),Result=([^,]+),METRIC=([^,]+),Value=([^,]+),Expected=([^,]+)[^<]+Resolution=([^,]+),(Lux=[^,<]+)<.*

pattern3:
.*Test=([^,]+),Result=([^,]+),METRIC=([^,]+),Value=([0-9\.]+),Expected=([-0-9\.]+),.*,Resolution=([x0-9]+),(Lux=[^<]+).*

pattern4:
.*Test=([\w-\.]+).*Result=([\w-\.]+).*METRIC=([\w-\.]+),.*Value=([\w-\.]+),.*Expected=([\w-\.]+),.*Resolution=([\w-\.]+),.*(Lux=[\w-\.]+)<.*
(Because of regular express are not only Perl but POSIX RE  or Extended RE, the  w parameter of rule4 can't recongnize  by ultraedit Perl, it just could to be analysis by expresso.)

replace with---
TEST=,\1,Result=,\2,METRIC=,\3,Value=,\4,Expected=,\5,Resolution=,\6,\7

result---
TEST=,Luminance,Result=,PASS,METRIC=,LUMINANCE,Value=,102,Expected=,88-168,Resolution=,640x480,Lux=20



---------reference-------
http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/perl-regular-expressions.html
www.google.com.tw/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDEQFjAA&url=http%3A%2F%2Fspace.uwants.com%2Fhtml%2F31%2F2470831-395547.html&ei=SbUdUoKtEsXDkgX_tYCABA&usg=AFQjCNEbcCzD_IrIXgBKaeKpYCfpHjsSHg
http://zh.wikipedia.org/wiki/%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8F
http://tigermax.dyndns.org/bbs/forum.php?mod=viewthread&tid=6251




Rank: 9Rank: 9Rank: 9

Post time 2013-10-24 23:12:40 |Show all posts
Other application of the ultraedit perl replace A on B:
1. Get the specific source  from some homepage




2.
fill the pattern
  1. .*href="(.*mkv\|)([^\|]*)\|([^\|]*)\|.*
Copy the Code
and replace with
  1. \1\2|\3|
Copy the Code
then, you can get the pure ed2k links


Use magic Report

Rank: 9Rank: 9Rank: 9

Post time 2013-10-26 00:52:39 |Show all posts
Another application
Baidu cloud (百度雲) download by SMG

First, you need to install BaiduPanDownloadHelper.
Then you can view the links source like above example's step.



Final that you also deal with the source by ultraedit to get pure donwnload links.
1.regular express engine set to UltraEdit and replace amp; on none(Null)
2.regular express engine set to UltraEdit, then replace <a class= on ^p<a class=
3.regular express engine set to Perl
pattern
  1. .*href="([^\"]*)\".*[^>]*>(.*mkv).*
Copy the Code
replace with
  1. \1|\2
Copy the Code



Then, you can get the download link, and you can copy these links into SMG to download files

Use magic Report

You have to log in before you can reply Login | register now

Archiver|Cell Phone|BDMV.INFO

GMT+8, 2024-3-29 08:31 , Processed in 0.012371 second(s), 5 queries , Xcache On.

Powered by Discuz! X2

© 2001-2011 Comsenz Inc.

Top