??xml version="1.0" encoding="utf-8" standalone="yes"?>综合自拍亚洲综合图不卡区,亚洲性线免费观看视频成熟,亚洲av午夜电影在线观看http://m.tkk7.com/zhyiwww/category/12353.htmlzhyiwwwzh-cnThu, 29 Mar 2007 09:17:20 GMTThu, 29 Mar 2007 09:17:20 GMT60三个数能l成三角形的充分必要条ghttp://m.tkk7.com/zhyiwww/archive/2007/03/29/107202.htmlzhyiwwwzhyiwwwThu, 29 Mar 2007 05:32:00 GMThttp://m.tkk7.com/zhyiwww/archive/2007/03/29/107202.htmlhttp://m.tkk7.com/zhyiwww/comments/107202.htmlhttp://m.tkk7.com/zhyiwww/archive/2007/03/29/107202.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/107202.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/107202.html 【题说?/span> 1996 q北京市赛高一复试?/span> 5 Q?/span>

【证】( 1 Q不妨设 a ?/span> b ?/span> c ?/span> a 为最大.

因ؓ 2 Q?/span> a 2 b 2 +b 2 c 2 +c 2 a 2 Q?/span> - Q?/span> a 4 +b 4 +c 4 Q?/span> = Q?/span> 2ab Q?/span> 2 - Q?/span> a 2 +b 2 -c 2 Q?/span> 2 ?/span> 0

所?/span>

2ab ?/span> a 2 +b 2 -c 2

a 2 +b 2 +c 2 = Q?/span> a 2 +b 2 -c 2 Q?/span> +2c 2 ?/span> 2ab+2c 2

?/span> 2 Q?/span> ab+bc+ca Q?/span>

Q?/span> 2 Q( * Q的逆命题:?/span> a ?/span> b ?/span> c 是非负实敎ͼ如果 a 2 +b 2 +c 2 ?/span> 2 Q?/span> ab+bc+ca Q,

?/span>

a 4 +b 4 +c 4 ?/span> 2 Q?/span> a 2 b 2 +b 2 c 2 +c 2 a 2 Q?/span>

q逆命题不真,例如 a=4 Q?/span> b=c=1 ?/span>

a 2 +b 2 +c 2 =2 Q?/span> ab+bc+ca Q?/span> =18

?/span> a 4 +b 4 +c 4 =258 Q?/span> 2 Q?/span> a 2 b 2 +b 2 c 2 +c 2 a 2 Q?/span> =66

【评注?/span> a 4 +b 4 +c 4 Q?/span> 2 Q?/span> a 2 b 2 +b 2 c 2 +c 2 a 2 Q是 a ?/span> b ?/span> c 构成三角形的充分必要条g Q而且在构成三角ŞӞ设三角Ş面积为Δ,?/span>

16 Δ 2 =2 Q?/span> a 2 b 2 +b 2 c 2 +c 2 a 2 Q?/span> -a 4 -b 4 -c 4 Q?/span> 0

sqrt.PNG

q是我在找资料的时候偶看到的Q觉得也总后有用得到的时候,所以就摘录了下来?br />

zhyiwww 2007-03-29 13:32 发表评论
]]>
B树算?转蝲)http://m.tkk7.com/zhyiwww/archive/2006/07/07/57174.htmlzhyiwwwzhyiwwwFri, 07 Jul 2006 10:24:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/07/07/57174.htmlhttp://m.tkk7.com/zhyiwww/comments/57174.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/07/07/57174.html#Feedback1http://m.tkk7.com/zhyiwww/comments/commentRss/57174.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/57174.html B树算?/b>
作?icephoton  


q个l构一般用?b>数据?/font>的烦引,l合效率较高?
另外q有一U与此类似的树结构叫B+树,?Berkerly DB , sqlite , mysql 数据?/font>都用了B+树算法处理烦引?
q两U处理烦引的数据l构的不同之处:
1。B树中同一键g会出现多ơ,q且它有可能出现在叶l点Q也有可能出现在非叶l点中。而B+树的键一定会出现在叶l点中,q且有可能在非叶l点中也有可能重复出玎ͼ以维持B+树的q?
2。因为B树键位置不定Q且在整个树l构中只出现一ơ,虽然可以节省存储I间Q但使得在插入、删除操作复杂度明显增加。B+树相比来说是一U较好的折中?
3。B树的查询效率与键在树中的位置有关Q最大时间复杂度与B+树相?在叶l点的时?Q最时间复杂度?(在根l点的时?。而B+树的时候复杂度Ҏ建成的树是固定的?

如果惌己做个小?b>数据?/font>Q可以参考一下下面给出的B树算法的实现Q可能会对你有所帮助?

  其中的注册很详细Q不用再多说了?

/* btrees.h */
/*
* q多\树的一U重要方案?
* ?1970 q由 R. Bayer ?E. McCreight 发明?
*/
#define M 1
/* B 树的Ӟ即非根节点中键的最数目?
* 有些人把阶定义ؓ非根节点中子树的最大数目?
*/
typedef int typekey;
typedef struct btnode {    /* B-Tree 节点 */
    int d;    /* 节点中键的数?*/
    typekey k[2*M];    /* ?*/
    char *v[2*M];    /* ?*/
    struct btnode *p[2*M+1];    /* 指向子树的指?*/
} node, *btree;
/*
* 每个键的左子树中的所有的键都于q个键,
* 每个键的叛_树中的所有的键都大于{于q个键?
* 叶子节点中的每个键都没有子树?
*/

/* ?M {于 1 时也UCؓ 2-3 ?
*    +----+----+
*    | k0 | k1 |                    
*  +-+----+----+---
*  | p0 | p1 | p2 |
*  +----+----+----+
*/
extern int btree_disp; /* 查找时找到的键在节点中的位置 */
extern char * InsValue; /* 与要插的键相对应的?*/

extern btree search(typekey, btree);
extern btree insert(typekey,btree);
extern btree delete(typekey,btree);
extern int height(btree);
extern int count(btree);
extern double payload(btree);
extern btree deltree(btree);
/* end of btrees.h */

/*******************************************************/

/* btrees.c */
#include <stdlib.h>
#include <stdio.h>
#include "btrees.h"

btree search(typekey, btree);
btree insert(typekey,btree);
btree delete(typekey,btree);
int height(btree);
int count(btree);
double payload(btree);
btree deltree(btree);

static void InternalInsert(typekey, btree);
static void InsInNode(btree, int);
static void SplitNode(btree, int);
static btree NewRoot(btree);

static void InternalDelete(typekey, btree);
static void JoinNode(btree, int);
static void MoveLeftNode(btree t, int);
static void MoveRightNode(btree t, int);
static void DelFromNode(btree t, int);
static btree FreeRoot(btree);

static btree delall(btree);
static void Error(int,typekey);

int btree_disp; /* 查找时找到的键在节点中的位置 */
char * InsValue = NULL; /* 与要插的键相对应的?*/
static int flag; /* 节点增减标志 */
static int btree_level = 0; /* 多\树的高度 */
static int btree_count = 0; /* 多\树的键L */
static int node_sum = 0;  /* 多\树的节点L */
static int level; /* 当前讉K的节Ҏ处的高度 */
static btree NewTree; /* 在节点分割的时候指向新建的节点 */
static typekey InsKey; /* 要插入的?*/

btree search(typekey key, btree t)
{
    int i,j,m;
    level=btree_level-1;
    while (level >= 0){
        for(i=0, j=t->d-1; i<j; m=(j+i)/2, (key > t->k[m])?(i=m+1):(j=m));
        if (key == t->k [ i ]){
            btree_disp = i;
            return t;
        }
        if (key > t->k [ i ]) /* i == t->d-1 时有可能出现 */
            i++;
        t = t->p[ i ];
        level--;
    }
    return NULL;
}

btree insert(typekey key, btree t)
{
    level=btree_level;
    InternalInsert(key, t);
    if (flag == 1)  /* 根节Ҏ之后Q它被分割成两个半满节点 */
        t=NewRoot(t);    /* 树的高度增加 */
    return t;
}

void InternalInsert(typekey key, btree t)
{
    int i,j,m;

    level--;
    if (level < 0){ /* 到达了树的底? 指出要做的插?*/
        NewTree = NULL; /* q个键没有对应的子树 */
        InsKey = key; /* D底层的叶子节点增加键?I子树对 */
        btree_count++;
        flag = 1; /* 指示上层节点把返回的键插入其?*/
        return;
    }
    for(i=0, j=t->d-1; i<j; m=(j+i)/2, (key > t->k[m])?(i=m+1):(j=m));
    if (key == t->k[ i ]) {
        Error(1,key); /* 键已l在树中 */
        flag = 0;
        return;
    }
    if (key > t->k[ i ]) /* i == t->d-1 时有可能出现 */
        i++;
    InternalInsert(key, t->p[ i ]);

    if (flag == 0)
        return;
    /* 有新键要插入到当前节点中 */
    if (t->d < 2*M) {/* 当前节点未满 */
        InsInNode(t, i); /* 把键?子树Ҏ入当前节点中 */
        flag = 0; /* 指示上层节点没有需要插入的键?子树Q插入过E结?*/
    }
    else /* 当前节点已满Q则分割q个面q把键?子树Ҏ入当前节点中 */
        SplitNode(t, i); /* l箋指示上层节点把返回的键?子树插入其中 */
}

/*
* 把一个键和对应的叛_树插入一个节点中
*/
void InsInNode(btree t, int d)
{
    int i;
    /* 把所有大于要插入的键值的键和对应的右子树右移 */
    for(i = t->d; i > d; i--){
        t->k[ i ] = t->k[i-1];
        t->v[ i ] = t->v[i-1];
        t->p[i+1] = t->p[ i ];
    }
    /* 插入键和叛_?*/
    t->k[ i ] = InsKey;
    t->p[i+1] = NewTree;
    t->v[ i ] = InsValue;
    t->d++;
}
/*
* 前g是要插入一个键和对应的叛_树,q且本节点已l满
* D分割q个节点Q插入键和对应的叛_树,
* q向上层q回一个要插入键和对应的右子树
*/
void SplitNode(btree t, int d)
{    
    int i,j;
    btree temp;
    typekey temp_k;
    char *temp_v;
    /* 建立新节?*/
    temp = (btree)malloc(sizeof(node));
    /*
     *   +---+--------+-----+-----+--------+-----+
     *   | 0 | ...... |  M  | M+1 | ...... |2*M-1|
     *   +---+--------+-----+-----+--------+-----+
     *   |<-      M+1     ->|<-        M-1     ->|  
     */
    if (d > M) { /* 要插入当前节点的叛_部分 */
        /* 把从 2*M-1 ?M+1 ?M-1 个键?子树对{Ud新节点中,
         * q且插入的键?子树I出位置 */
        for(i=2*M-1,j=M-1; i>=d; i--,j--) {
            temp->k[j] = t->k[ i ];
            temp->v[j] = t->v[ i ];
            temp->p[j+1] = t->p[i+1];
        }
        for(i=d-1,j=d-M-2; j>=0; i--,j--) {
            temp->k[j] = t->k[ i ];
            temp->v[j] = t->v[ i ];
            temp->p[j+1] = t->p[i+1];
        }
        /* 把节点的最叛_树{UL新节点的最左子?*/
        temp->p[0] = t->p[M+1];
        /* 在新节点中插入键和右子树 */
        temp->k[d-M-1] = InsKey;
        temp->p[d-M] = NewTree;
        temp->v[d-M-1] = InsValue;
        /* 讄要插入上层节点的键和?*/
        InsKey = t->k[M];
        InsValue = t->v[M];

    }
    else { /* d <= M */
        /* 把从 2*M-1 ?M ?M 个键?子树对{Ud新节点中 */
        for(i=2*M-1,j=M-1; j>=0; i--,j--) {
            temp->k[j] = t->k[ i ];
            temp->v[j] = t->v[ i ];
            temp->p[j+1] = t->p[i+1];
        }
        if (d == M) /* 要插入当前节点的正中?*/
            /* 把要插入的子树作为新节点的最左子?*/
            temp->p[0] = NewTree;
            /* 直接把要插入的键和D回给上层节点 */
        else { /* (d<M) 要插入当前节点的左半部分 */
            /* 把节点当前的最叛_树{UL新节点的最左子?*/
            temp->p[0] = t->p[M];
            /* 保存要插入上层节点的键和?*/
            temp_k = t->k[M-1];
            temp_v = t->v[M-1];
            /* 把所有大于要插入的键值的键和对应的右子树右移 */
            for(i=M-1; i>d; i--) {
                t->k[ i ] = t->k[i-1];
                t->v[ i ] = t->v[i-1];
                t->p[i+1] = t->p[ i ];
            }
            /* 在节点中插入键和叛_?*/
            t->k[d] = InsKey;
            t->p[d+1] = NewTree;
            t->v[d] = InsValue;
            /* 讄要插入上层节点的键和?*/
            InsKey = temp_k;
            InsValue = temp_v;
        }
    }
    t->d =M;
    temp->d = M;
    NewTree = temp;
    node_sum++;
}

btree delete(typekey key, btree t)
{
    level=btree_level;
    InternalDelete(key, t);
    if (t->d == 0)
    /* 根节点的子节点合q导致根节点键的数目随之减少Q?
     * 当根节点中没有键的时候,只有它的最左子树可能非I?*/
        t=FreeRoot(t);
    return t;
}

void InternalDelete(typekey key, btree t)
{
    int i,j,m;
    btree l,r;
    int lvl;

    level--;
    if (level < 0) {
        Error(0,key); /* 在整个树中未扑ֈ要删除的?*/
        flag = 0;
        return;
    }
    for(i=0, j=t->d-1; i<j; m=(j+i)/2, (key > t->k[m])?(i=m+1):(j=m));
    if (key == t->k[ i ]) { /* 扑ֈ要删除的?*/
        if (t->v[ i ] != NULL)
            free(t->v[ i ]); /* 释放q个节点包含的?*/
        if (level == 0) { /* 有子树ؓI则q个键位于叶子节?*/
            DelFromNode(t,i);
            btree_count--;
            flag = 1;
            /* 指示上层节点本子树的键数量减?*/
            return;
        } else { /* q个键位于非叶节?*/
            lvl = level-1;
            /* 扑ֈ前驱节点 */
            r = t->p[ i ];
            while (lvl > 0)  {
                r = r->p[r->d];
                lvl--;
            }
            t->k[ i ]=r->k[r->d-1];
            t->v[ i ]=r->v[r->d-1];
            r->v[r->d-1]=NULL;
            key = r->k[r->d-1];
        }
    }
    else if (key > t->k[ i ]) /* i == t->d-1 时有可能出现 */
        i++;         
    InternalDelete(key,t->p[ i ]);
    /* 调整q */
    if (flag == 0)
        return;
    if (t->p[ i ]->d < M) {
        if (i == t->d) /* 在最叛_树中发生了删?*/
            i--; /* 调整最右键的左叛_树^?*/
        l = t->p [ i ];
        r = t->p[i+1];
        if (r->d > M)
            MoveLeftNode(t,i);
        else if(l->d > M)
            MoveRightNode(t,i);
        else {
            JoinNode(t,i);
            /* l箋指示上层节点本子树的键数量减?*/
            return;
        }
        flag = 0;
        /* 指示上层节点本子树的键数量没有减,删除q程l束 */
    }
}

/*
* 合ƈ一个节点的某个键对应的两个子树
*/
void JoinNode(btree t, int d)
{
    btree l,r;
    int i,j;
    l = t->p[d];
    r = t->p[d+1];

    /* 把这个键下移到它的左子树 */
    l->k[l->d] = t->k[d];
    l->v[l->d] = t->v[d];
    /* 把右子树中的所有键值和子树转移到左子树 */
    for (j=r->d-1,i=l->d+r->d; j >= 0 ; j--,i--) {
        l->k[ i ] = r->k[j];
        l->v[ i ] = r->v[j];
        l->p[ i ] = r->p[j];
    }
    l->p[l->d+r->d+1] = r->p[r->d];
    l->d += r->d+1;
    /* 释放叛_树的节点 */
    free(r);
    /* 把这个键双的键和对应的叛_树左U?*/
    for (i=d; i < t->d-1; i++) {
        t->k[ i ] = t->k[i+1];
        t->v[ i ] = t->v[i+1];
        t->p[i+1] = t->p[i+2];
    }
    t->d--;
    node_sum--;
}
/*
* 从一个键的右子树向左子树转移一些键Q两个子树q
*/
void MoveLeftNode(btree t, int d)
{
    btree l,r;
    int m; /* 应{Uȝ键的数目 */
    int i,j;
    l = t->p[d];
    r = t->p[d+1];
    m = (r->d - l->d)/2;

    /* 把这个键下移到它的左子树 */
    l->k[l->d] = t->k[d];
    l->v[l->d] = t->v[d];
    /* 把右子树的最左子树{UL左子树的最叛_?
     * 从右子树向左子树Ud m-1 个键+子树?*/
    for (j=m-2,i=l->d+m-1; j >= 0; j--,i--) {
        l->k[ i ] = r->k[j];
        l->v[ i ] = r->v[j];
        l->p[ i ] = r->p[j];
    }
    l->p[l->d+m] = r->p[m-1];
    /* 把右子树的最左键提升到这个键的位|上 */
    t->k[d] = r->k[m-1];
    t->v[d] = r->v[m-1];
    /* 把右子树中的所有键值和子树左移 m 个位|?*/
    r->p[0] = r->p[m];
    for (i=0; i<r->d-m; i++) {
        r->k[ i ] = r->k[i+m];
        r->v[ i ] = r->v[i+m];
        r->p[ i ] = r->p[i+m];
    }
    r->p[r->d-m] = r->p[r->d];
    l->d+=m;
    r->d-=m;
}
/*
* 从一个键的左子树向右子树转移一些键Q两个子树q
*/
void MoveRightNode(btree t, int d)
{
    btree l,r;
    int m; /* 应{Uȝ键的数目 */
    int i,j;
    l = t->p[d];
    r = t->p[d+1];

    m = (l->d - r->d)/2;
    /* 把右子树中的所有键值和子树右移 m 个位|?*/
    r->p[r->d+m]=r->p[r->d];
    for (i=r->d-1; i>=0; i--) {
        r->k[i+m] = r->k[ i ];
        r->v[i+m] = r->v[ i ];
        r->p[i+m] = r->p[ i ];
    }
    /* 把这个键下移到它的右子树 */
    r->k[m-1] = t->k[d];
    r->v[m-1] = t->v[d];
    /* 把左子树的最叛_树{UL叛_树的最左子?*/
    r->p[m-1] = l->p[l->d];
    /* 从左子树向右子树Ud m-1 个键+子树?*/
    for (i=l->d-1,j=m-2; j>=0; j--,i--) {
        r->k[j] = l->k[ i ];
        r->v[j] = l->v[ i ];
        r->p[j] = l->p[ i ];
    }
    /* 把左子树的最右键提升到这个键的位|上 */
    t->k[d] = l->k[ i ];
    t->v[d] = l->v[ i ];
    l->d-=m;
    r->d+=m;
}
/*
* 把一个键和对应的叛_树从一个节点中删除
*/
void DelFromNode(btree t, int d)
{
    int i;
    /* 把所有大于要删除的键值的键左U?*/
    for(i=d; i < t->d-1; i++) {
        t->k[ i ] = t->k[i+1];
        t->v[ i ] = t->v[i+1];
    }
    t->d--;
}
/*
* 建立有两个子树和一个键的根节点
*/
btree NewRoot(btree t)
{
    btree temp;
    temp = (btree)malloc(sizeof(node));
    temp->d = 1;
    temp->p[0] = t;
    temp->p[1] = NewTree;
    temp->k[0] = InsKey;
    temp->v[0] = InsValue;
    btree_level++;
    node_sum++;
    return(temp);
}
/*
* 释放根节点,q返回它的最左子?
*/
btree FreeRoot(btree t)
{
    btree temp;
    temp = t->p[0];
    free(t);
    btree_level--;
    node_sum--;
    return temp;
}

void Error(int f,typekey key)
{
    if (f)
        printf("Btrees error: Insert %d!\n",key);
    else
        printf("Btrees error: delete %d!\n",key);
}

int height(btree t)
{
    return btree_level;
}

int count(btree t)
{
    return btree_count;
}
double payload(btree t)
{
    if (node_sum==0)
        return 1;
    return (double)btree_count/(node_sum*(2*M));
}
btree deltree (btree t)
{    
    level=btree_level;
    btree_level = 0;
    return delall(t);

}
btree delall(btree t)
{
    int i;
    level--;
    if (level >= 0) {
        for (i=0; i < t->d; i++)
            if (t->v[ i ] != NULL)
                free(t->v[ i ]);
        if (level > 0)
            for (i=0; i<= t->d ; i++)
                t->p[ i ]=delall(t->p[ i ]);
        free(t);
    }
    return NULL;
}

/* end of btrees.c */



zhyiwww 2006-07-07 18:24 发表评论
]]>
l典正则表达?转蝲)http://m.tkk7.com/zhyiwww/archive/2006/06/28/55506.htmlzhyiwwwzhyiwwwWed, 28 Jun 2006 03:55:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/06/28/55506.htmlhttp://m.tkk7.com/zhyiwww/comments/55506.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/06/28/55506.html#Feedback0http://m.tkk7.com/zhyiwww/comments/commentRss/55506.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/55506.html
l典正则表达?/font>
正则表达式用于字W串处理Q表单验证等场合Q实用高效,但用到时L不太把握Q以致往往要上|查一番。我一些常用的表达式收藏在q里Q作备忘之用。本贴随时会更新?br />
匚w中文字符的正则表辑ּQ?[\u4e00-\u9fa5]

匚w双字节字W?包括汉字在内)Q[^\x00-\xff]

应用Q计字W串的长度(一个双字节字符长度?QASCII字符?Q?br />
String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;}

匚wI的正则表辑ּQ\n[\s| ]*\r

匚wHTML标记的正则表辑ּQ?<(.*)>.*<\/\1>|<(.*) \/>/

匚w首尾I格的正则表辑ּQ?^\s*)|(\s*$)

应用Qjavascript中没有像vbscript那样的trim函数Q我们就可以利用q个表达式来实现Q如下:

String.prototype.trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}

利用正则表达式分解和转换IP地址Q?br />
下面是利用正则表辑ּ匚wIP地址QƈIP地址转换成对应数值的JavascriptE序Q?br />
function IP2V(ip)
{
re=/(\d+)\.(\d+)\.(\d+)\.(\d+)/g //匚wIP地址的正则表辑ּ
if(re.test(ip))
{
return RegExp.$1*Math.pow(255,3))+RegExp.$2*Math.pow(255,2))+RegExp.$3*255+RegExp.$4*1
}
else
{
throw new Error("Not a valid IP address!")
}
}

不过上面的程序如果不用正则表辑ּQ而直接用split函数来分解可能更单,E序如下Q?br />
var ip="10.100.20.168"
ip=ip.split(".")
alert("IP值是Q?+(ip[0]*255*255*255+ip[1]*255*255+ip[2]*255+ip[3]*1))

匚wEmail地址的正则表辑ּQ\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

匚w|址URL的正则表辑ּQhttp://([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?

利用正则表达式去除字串中重复的字W的法E序Q?br />
var s="abacabefgeeii"
var s1=s.replace(/(.).*\1/g,"$1")
var re=new RegExp("["+s1+"]","g")
var s2=s.replace(re,"")
alert(s1+s2) //l果为:abcefgi

我原来在CSDN上发贴寻求一个表辑ּ来实现去除重复字W的ҎQ最l没有找刎ͼq是我能惛_的最单的实现Ҏ。思\是用后向引用取出包括重复的字符Q再以重复的字符建立W二个表辑ּQ取C重复的字W,两者串q。这个方法对于字W顺序有要求的字W串可能不适用?br />
得用正则表达式从URL地址中提取文件名的javascriptE序Q如下结果ؓpage1

s="http://www.9499.net/page1.htm"
s=s.replace(/(.*\/){0,}([^\.]+).*/ig,"$2")
alert(s)

利用正则表达式限制网表单里的文本框输入内容Q?br />
用正则表辑ּ限制只能输入中文Qonkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))"

用正则表辑ּ限制只能输入全角字符Q?onkeyup="value=value.replace(/[^\uFF00-\uFFFF]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\uFF00-\uFFFF]/g,''))"

用正则表辑ּ限制只能输入数字Qonkeyup="value=value.replace(/[^\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"

用正则表辑ּ限制只能输入数字和英文:onkeyup="value=value.replace(/[\W]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))"

补充Q?
^\d+$  //匚w非负整数Q正整数 + 0Q?
^[0-9]*[1-9][0-9]*$  //匚w正整?
^((-\d+)|(0+))$  //匚w非正整数Q负整数 + 0Q?
^-[0-9]*[1-9][0-9]*$  //匚w负整?
^-?\d+$    //匚w整数
^\d+(\.\d+)?$  //匚w非负点敎ͼ正QҎ + 0Q?
^(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*))$  //匚w正QҎ
^((-\d+(\.\d+)?)|(0+(\.0+)?))$  //匚w非正点敎ͼ负QҎ + 0Q?
^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$  //匚w负QҎ
^(-?\d+)(\.\d+)?$  //匚w点?
^[A-Za-z]+$  //匚w?6个英文字母组成的字符?
^[A-Z]+$  //匚w?6个英文字母的大写l成的字W串
^[a-z]+$  //匚w?6个英文字母的写l成的字W串
^[A-Za-z0-9]+$  //匚w由数字和26个英文字母组成的字符?
^\w+$  //匚w由数字?6个英文字母或者下划线l成的字W串
^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$    //匚wemail地址
^[a-zA-z]+://匚w(\w+(-\w+)*)(\.(\w+(-\w+)*))*(\?\S*)?$  //匚wurl


zhyiwww 2006-06-28 11:55 发表评论
]]>
A Tao of Regular Expressions(转蝲)http://m.tkk7.com/zhyiwww/archive/2006/06/20/53922.htmlzhyiwwwzhyiwwwTue, 20 Jun 2006 03:04:00 GMThttp://m.tkk7.com/zhyiwww/archive/2006/06/20/53922.htmlhttp://m.tkk7.com/zhyiwww/comments/53922.htmlhttp://m.tkk7.com/zhyiwww/archive/2006/06/20/53922.html#Feedback1http://m.tkk7.com/zhyiwww/comments/commentRss/53922.htmlhttp://m.tkk7.com/zhyiwww/services/trackbacks/53922.html

A Tao of Regular Expressions

Steve Mansour
sman@scruznet.com
Revised: June 5, 1999
(copied by jm /at/ jmason.org from http://www.scruz.net/%7esman/regexp.htm, after the original disappeared! )


C O N T E N T S

What Are Regular Expressions
Examples
  
Simple
  
Medium (Strange Incantations)
  
Hard (Magical Hieroglyphics)
Regular Expressions In Various Tools


What Are Regular Expressions

A regular expression is a formula for matching strings that follow some pattern. Many people are afraid to use them because they can look confusing and complicated. Unfortunately, nothing in this write up can change that. However, I have found that with a bit of practice, it's pretty easy to write these complicated expressions. Plus, once you get the hang of them, you can reduce hours of laborious and error-prone text editing down to minutes or seconds. Regular expressions are supported by many text editors, class libraries such as Rogue Wave's Tools.h++, scripting tools such as awk, grep, sed, and increasingly in interactive development environments such as Microsoft's Visual C++.

Regular expressions usage is explained by examples in the sections that follow. Most examples are presented as vi substitution commands or as grep file search commands, but they are representative examples and the concepts can be applied in the use of tools such as sed, awk, perl and other programs that support regular expressions. Have a look at Regular Expressions In Various Tools for examples of regular expression usage in other tools. A short explanation of vi's substitution command and syntax is provided at the end of this document.

Regular Expression Basics

Regular expressions are made up of normal characters and metacharacters. Normal characters include upper and lower case letters and digits. The metacharacters have special meanings and are described in detail below.

In the simplest case, a regular expression looks like a standard search string. For example, the regular expression "testing" contains no metacharacters. It will match "testing" and "123testing" but it will not match "Testing".

To really make good use of regular expressions it is critical to understand metacharacters. The table below lists metacharacters and a short explanation of their meaning.
 

Metacharacter   Description


.
Matches any single character. For example the regular expression r.t would match the strings rat, rut, r t, but not root
$
Matches the end of a line. For example, the regular expression weasel$ would match the end of the string "He's a weasel" but not the string "They are a bunch of weasels.
^
Matches the beginning of a line. For example, the regular expression ^When in would match the beginning of the string "When in the course of human events" but would not match "What and When in the"
*
Matches zero or more occurences of the character immediately preceding. For example, the regular expression .* means match any number of any characters. 
\
This is the quoting character, use it to treat the following character as an ordinary character. For example, \$ is used to match the dollar sign character ($) rather than the end of a line. Similarly, the expression \. is used to match the period character rather than any single character. 
[ ] 
[c1-c2]
[^c1-c2]
Matches any one of the characters between the brackets. For example, the regular expression r[aou]t matches rat, rot, and rut, but not ret. Ranges of characters can specified by using a hyphen. For example, the regular expression [0-9] means match any digit. Multiple ranges can be specified as well. The regular expression [A-Za-z] means match any upper or lower case letter. To match any character except those in the range, the complement range, use the caret as the first character after the opening bracket. For example, the expression [^269A-Z] will match any characters except 2, 6, 9, and upper case letters. 
\< \>
Matches the beginning (\<) or end (\>) or a word. For example, \<the matches on "the" in the string "for the wise" but does not match "the" in "otherwise". NOTE: this metacharacter is not supported by all applications.
\( \)
Treat the expression between \( and \) as a group. Also, saves the characters matched by the expression into temporary holding areas. Up to nine pattern matches can be saved in a single regular expression. They can be referenced as \1 through \9.
|
Or two conditions together. For example (him|her) matches the line "it belongs to him" and matches the line "it belongs to her" but does not match the line "it belongs to them." NOTE: this metacharacter is not supported by all applications.
+
Matches one or more occurences of the character or regular expression immediately preceding. For example, the regular expression 9+ matches 9, 99, 999. NOTE: this metacharacter is not supported by all applications.
?
Matches 0 or 1 occurence of the character or regular expression immediately preceding.NOTE: this metacharacter is not supported by all applications.
\{ i \}
\{ i , j \}
Match a specific number of instances or instances within a range of the preceding character. For example, the expression A[0-9]\{3\} will match "A" followed by exactly 3 digits. That is, it will match A123 but not A1234. The expression [0-9]\{4,6\} any sequence of 4, 5, or 6 digits. NOTE: this metacharacter is not supported by all applications.


The simplest metacharacter is the dot. It matches any one character (excluding the newline character). Consider a file named test.txt consisting of the following lines:

    he is a rat
    he is in a rut
    the food is Rotten
    I like root beer
We can use grep to test our regular expressions. Grep uses the regular expression we supply and tries to match it to every line of the file. It prints all lines where the regular expression matches at least one sequence of characters on a line. The command
    grep r.t test.txt
searches for the regular expression r.t in each line of test.txt and prints the matching lines. The regular expression r.t matches an r followed by any character followed by a t. It will match rat and rut. It does not match the Rot in Rotten because regular expressions are case sensitive. To match both the upper and lower the square brackets (character range metacharacters) can be used. The regular expression [Rr] matches either Ror r. So, to match an upper or lower case r followed by any character followed by the character t the regular expression [Rr].t will do the trick.

To match characters at the beginning of a line use the circumflex character (sometimes called a caret). For example, to find the lines containing the word "he" at the beginning of each line in the file test.txt you might first think the use the simple expression he. However, this would match the in the third line. The regular expression ^he only matches the h at the beginning of a line.

Sometimes it is easier to indicate something what should not be matched rather than all the cases that should be matched. When the circumflex is the first character between the square brackets it means to match any character which is not in the range. For example, to match he when it is not preceded by t or s, the following regular expression can be used: [^st]he.

Several character ranges can be specified between the square brackets. For example, the regular expression [A-Za-z] matches any letter in the alphabet, upper or lower case. The regular expression [A-Za-z][A-Za-z]* matches a letter followed by zero or more letters. We can use the + metacharacter to do the same thing. That is, the regular expression [A-Za-z]+ means the same thing as [A-Za-z][A-Za-z]*. Note that the + metacharacter is not supported by all programs that have regular expressions. See Regular Expressions Syntax Support for more details.

To specify the number of occurrences matched, use the braces (they must be escaped with a backslash). As an example, to match all instances of 100 and 1000 but not 10 or 10000 use the following: 10\{2,3\}. This regular expression matches a the digit 1 followed by either 2 or 3 0's. A useful variation is to omit the second number. For example, the regular expression 0\{3,\} will match 3 or more successive 0's.



zhyiwww 2006-06-20 11:04 发表评论
]]>
正则表达式之?转蝲Q?/title><link>http://m.tkk7.com/zhyiwww/archive/2006/06/20/53920.html</link><dc:creator>zhyiwww</dc:creator><author>zhyiwww</author><pubDate>Tue, 20 Jun 2006 02:52:00 GMT</pubDate><guid>http://m.tkk7.com/zhyiwww/archive/2006/06/20/53920.html</guid><wfw:comment>http://m.tkk7.com/zhyiwww/comments/53920.html</wfw:comment><comments>http://m.tkk7.com/zhyiwww/archive/2006/06/20/53920.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/zhyiwww/comments/commentRss/53920.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/zhyiwww/services/trackbacks/53920.html</trackback:ping><description><![CDATA[ <center> <h1>正则表达式之?/h1> </center> <center> <p>原著QSteve Mansour <br />sman@scruznet.com <br /><font size="-1">Revised: June 5, 1999<br />(copied by jm /at/ jmason.org from http://www.scruz.net/%7esman/regexp.htm, after the original disappeared! ) </font></p> <p>译QNeo Lee<br />neo.lee@gmail.com<br /><font size="-1">2004q?0?6?/font></p> </center> <hr /> <p> <a >英文版原?/a> </p> <p>译者按Q原文因为年代久q,文中很多链接早已q期Q主要是关于vi、sed{工L介绍和手册)Q本译文中已此c链接删除,如需查这些链接可以查看上面链接的原文。除此之外基本照原文直译Q括号中有“译者按”的部分是译者补充的说明。如有内Ҏ面的问题L接和Steve Mansor联系Q当Ӟ如果你只写中文,也可以和我联pR?/p> <hr /> <h1>??/h1> <p> <b> <a >什么是正则表达?/a> </b> <br /> <b> <a >范例</a> </b> <br />   <a >?/a><br />   <a >中Q神奇的咒语Q?/a><br />   <a >困难Q不可思议的象形文字)</a><br /><b><a >不同工具中的正则表达?/a></b></p> <p> </p> <hr width="100%" /> <h1> <a name="WhatAreRegularExpressions"> </a>什么是正则表达?/h1>一个正则表辑ּQ就是用某种模式d配一cdW串的一个公式。很多h因ؓ它们看上L较古怪而且复杂所以不敢去使用——很不幸Q这文章也不能够改变这一点,不过Q经q一点点l习之后我就开始觉得这些复杂的表达式其实写hq是相当单的Q而且Q一旦你弄懂它们Q你p把数时辛苦而且易错的文本处理工作压~在几分钟(甚至几秒钟)内完成。正则表辑ּ被各U文本编辑Y件、类库(例如Rogue Wave的tools.h++Q、脚本工P像awk/grep/sedQ广泛的支持Q而且像Microsoft的Visual C++q种交互式IDE也开始支持它了? <p>我们在如下的章节中利用一些例子来解释正则表达式的用法Q绝大部分的例子是基?b><tt>vi</tt></b>中的文本替换命o?b><tt>grep</tt></b>文g搜烦命o来书写的Q不q它们都是比较典型的例子Q其中的概念可以在sed、awk、perl和其他支持正则表辑ּ的编E语a中用。你可以看看<a >不同工具中的正则表达?/a>q一节,其中有一些在别的工具中用正则表辑ּ的例子。还有一个关于vi中文本替换命令(sQ的<a >单说?/a>附在文后供参考?/p><h2>正则表达式基</h2>正则表达式由一些普通字W和一?i>元字W(metacharactersQ?/i>l成。普通字W包括大写的字母和数字Q而元字符则具有特D的含义Q我们下面会l予解释? <p>在最单的情况下,一个正则表辑ּ看上d是一个普通的查找丌Ӏ例如,正则表达?testing"中没有包含Q何元字符Q,它可以匹?testing"?123testing"{字W串Q但是不能匹?Testing"?/p><p>要想真正的用好正则表辑ּQ正的理解元字W是最重要的事情。下表列Z所有的元字W和对它们的一个简短的描述? </p><p></p><table cellspacing="2" cellpadding="2"><tbody><tr valign="baseline"><th align="left"><b><i>元字W?/i></b></th><td> </td><th align="left"><b><i>描述</i></b></th></tr><tr><td><hr width="100%" /></td><td></td><td><hr width="100%" /></td></tr><tr><td valign="top" align="middle"><center><b><tt><font face="Courier New"><font size="+1">.</font></font></tt></b></center></td><td></td><td>匚wM单个字符。例如正则表辑ּ<b><tt>r.t</tt></b>匚wq些字符Ԍ<i>rat</i>?i>rut</i>?i>r t</i>Q但是不匚w<i>root</i>。?/td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">$</font></font></tt></b></center></td><td></td><td>匚w行结束符。例如正则表辑ּ<b><tt>weasel$</tt></b> 能够匚w字符?<i>He's a weasel</i>"的末,但是不能匚w字符?<i>They are a bunch of weasels.</i>"。?/td></tr><tr><td valign="top"><center><b><font size="+1">^</font></b></center></td><td></td><td>匚w一行的开始。例如正则表辑ּ<b><tt>^When in</tt></b>能够匚w字符?<i>When in the course of human events</i>"的开始,但是不能匚w"<i>What and When in the"?/i></td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">*</font></font></tt></b></center></td><td></td><td>匚w0或多个正好在它之前的那个字符。例如正则表辑ּ<b><tt></tt></b><b><tt>.*</tt></b>意味着能够匚wL数量的Q何字W?/td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">\</font></font></tt></b></center></td><td></td><td>q是引用府,用来这里列出的q些元字W当作普通的字符来进行匹配。例如正则表辑ּ<b><tt>\$</tt></b>被用来匹配美元符P而不是行,cM的,正则表达?tt><strong>\.</strong></tt>用来匚w点字W,而不是Q何字W的通配W?/td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">[ ] </font></font></tt></b><br /><b><tt><font face="Courier New"><font size="+1">[c</font><font size="-1">1</font><font size="+1">-c</font><font size="-1">2</font><font size="+1">]</font></font></tt></b><br /><b><tt><font face="Courier New"><font size="+1">[^c</font><font size="-1">1</font><font size="+1">-c</font><font size="-1">2</font><font size="+1">]</font></font></tt></b></center></td><td></td><td>匚w括号中的M一个字W。例如正则表辑ּ<b><tt>r[aou]t</tt></b>匚w<i>rat</i>?i>rot</i>?i>rut</i>Q但是不匚w<i>ret</i>。可以在括号中用连字符-来指定字W的区间Q例如正则表辑ּ<b><tt>[0-9]</tt></b>可以匚wM数字字符Q还可以制定多个区间Q例如正则表辑ּ<b><tt>[A-Za-z]</tt></b>可以匚wM大小写字母。另一个重要的用法是“排除”,要想匚w<i>除了</i>指定区间之外的字W——也是所谓的补集——在左边的括号和W一个字W之间用^字符Q例如正则表辑ּ<b><tt>[^269A-Z]</tt></b> 匹配除???和所有大写字母之外的M字符?/td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">\< \></font></font></tt></b></center></td><td></td><td>匚w词(<em>word</em>Q的开始(\<Q和l束Q\>Q。例如正则表辑ּ<b><tt><font face="Courier New">\<the</font></tt></b>能够匚w字符?<i>for the wise</i>"中的"the"Q但是不能匹配字W串"<i>otherwise</i>"中的"the"?strong>注意</strong>Q这个元字符不是所有的软g都支持的?/td></tr><tr><td valign="top"><center><b><tt><font face="Courier New"><font size="+1">\( \)</font></font></tt></b></center></td><td></td><td>?\( ?\) 之间的表辑ּ定义为“组”(<em>group</em>Q,q且匹配这个表辑ּ的字W保存到一个时区域(一个正则表辑ּ中最多可以保?个)Q它们可以用 <b><tt>\1</tt></b> ?b><tt>\9</tt></b> 的符h引用?/td></tr><tr><td valign="baseline"><center><b><tt><font face="Courier New"><font size="+1">|</font></font></tt></b></center></td><td></td><td>两个匹配条件进行逻辑“或”(<em>Or</em>Q运。例如正则表辑ּ<b><tt><font face="Courier New">(him|her)</font></tt></b> 匚w"<i>it belongs to him</i>"?<i>it belongs to her</i>"Q但是不能匹?<i>it belongs to them.</i>"?strong>注意</strong>Q这个元字符不是所有的软g都支持的?/td></tr><tr valign="baseline"><td><center><b><tt><font face="Courier New"><font size="+1">+</font></font></tt></b></center></td><td></td><td>匚w1或多个正好在它之前的那个字符。例如正则表辑ּ<b><tt></tt></b><b><tt></tt></b><b><tt>9+</tt></b>匚w9?9?99{?strong>注意</strong>Q这个元字符不是所有的软g都支持的?/td></tr><tr valign="baseline"><td><center><b><tt><font size="+1">?</font></tt></b></center></td><td></td><td>匚w0?个正好在它之前的那个字符?strong>注意</strong>Q这个元字符不是所有的软g都支持的?/td></tr><tr valign="baseline"><td><center><b><font size="+1"><tt><font face="Courier New">\{</font></tt><i>i</i><tt><font face="Courier New">\}</font></tt></font></b><br /><b><font size="+1"><tt><font face="Courier New">\{</font></tt><i>i</i><tt><font face="Courier New">,</font></tt><i>j</i><tt><font face="Courier New">\}</font></tt></font></b></center></td><td></td><td valign="baseline">匚w指定数目的字W,q些字符是在它之前的表达式定义的。例如正则表辑ּ<b><tt><font face="Courier New">A[0-9]\{3\}</font></tt></b> 能够匚w字符"A"后面跟着正好3个数字字W的Ԍ例如A123、A348{,但是不匹配A1234。而正则表辑ּ<b><tt><font face="Courier New">[0-9]\{4,6\}</font></tt></b> 匚wq箋的Q?个?个或?个数字字W?strong>注意</strong>Q这个元字符不是所有的软g都支持的?/td></tr></tbody></table><p></p><hr width="100%" /><p>最单的元字W是点,它能够匹配Q何单个字W(注意<strong>?/strong>包括新行W)。假定有个文件test.txt包含以下几行内容Q?/p><ul><tt>he is a rat</tt><br /><tt>he is in a rut</tt><br /><tt>the food is Rotten</tt><br /><tt>I like root beer</tt></ul>我们可以使用grep命o来测试我们的正则表达式,grep命o使用正则表达式去试匚w指定文g的每一行,q将臛_有一处匹配表辑ּ的所有行昄出来。命? <ul><tt>grep r.t test.txt</tt></ul>在test.txt文g中的每一行中搜烦正则表达?b><tt>r.t</tt></b>Qƈ打印输出匚w的行。正则表辑ּ<b><tt>r.t</tt></b>匚w一?b><tt>r</tt></b>接着M一个字W再接着一?b><tt>t</tt></b>。所以它匹配文件中?b><tt>rat</tt></b>?b><tt>rut</tt></b>Q而不能匹?b><tt>Rotten</tt></b>中的<b><tt>Rot</tt></b>Q因为正则表辑ּ是大写敏感的。要惛_时匹配大写和写字母Q应该用字W区间元字符Q方括号Q。正则表辑ּ<b><tt>[Rr]</tt></b>能够同时匚w<b><tt>R</tt></b>?b><tt>r</tt></b>。所以,要想匚w一个大写或者小写的<b><tt>r</tt></b>接着M一个字W再接着一?b><tt>t</tt></b>p使用q个表达式:<b><tt>[Rr].t</tt></b>? <p>要想匚w行首的字W要使用抑扬字符Q?em>^</em>Q——又是也被叫做插入符。例如,x到text.txt中行?he"打头的行Q你可能会先用简单表辑ּ<b><tt>he</tt></b>Q但是这会匹配第三行?b><tt>the</tt></b>Q所以要使用正则表达?b><tt>^he</tt></b>Q它只匹配在行首出现?b><tt>h</tt></b>?</p><p>有时候指定“除了×××都匚w”会比较Ҏ辑ֈ目的Q当抑扬字符Q?em>^</em>Q出现在Ҏ号中是,它表C“排除”,例如要匹?b><tt>he</tt></b> Q但是排除前面是<b><tt>t</tt></b> or <b><tt>s</tt></b>的情性(也就?b><tt>the</tt></b>?b><tt>s</tt></b><b><tt>he</tt></b>Q,可以使用Q?b><tt>[^st]he</tt></b>?</p><p>可以使用Ҏh指定多个字符区间。例如正则表辑ּ<b><tt>[A-Za-z]</tt></b>匚wM字母Q包括大写和写的;正则表达?b><tt>[A-Za-z][A-Za-z]*</tt></b> 匚w一个字母后面接着0或者多个字母(大写或者小写)。当然我们也可以用元字符<b><tt>+</tt></b>做到同样的事情,也就是:<b><tt>[A-Za-z]+</tt></b> Q和<b><tt>[A-Za-z][A-Za-z]*</tt></b>完全{h。但是要注意元字W?b><tt>+</tt></b> q不是所有支持正则表辑ּ的程序都支持的。关于这一点可以参考后面的<a >正则表达式语法支持情?/a>?/p><p>要指定特定数量的匚wQ要使用大括P注意必须使用反斜杠来转义Q。想匚w所?b><tt>100</tt></b>?b><tt>1000</tt></b>的实例而排?b><tt>10</tt></b>?b><tt>10000</tt></b>Q可以用:<b><tt>10\{2,3\}</tt></b>Q这个正则表辑ּ匚w数字1后面跟着2或??的模式。在q个元字W的使用中一个有用的变化是忽略第二个数字Q例如正则表辑ּ<b><tt>0\{3,\}</tt></b> 匹配至?个连l的0?/p><h2><a name="SimpleCommands"></a>单的例子</h2><p>q里有一些有代表性的、比较简单的例子? </p><p></p><table cellspacing="2" cellpadding="2"><tbody><tr><td><b><i>vi 命o</i></b></td><td><b><i>作用</i></b></td></tr><tr><td><hr width="100%" /></td><td><hr width="100%" /></td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/ */ /g</font></font></tt></b></td><td>把一个或者多个空格替换ؓ一个空根{?/td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/ *$//</font></font></tt></b></td><td>L行尾的所有空根{?/td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/^/ /</font></font></tt></b></td><td>在每一行头上加入一个空根{?/td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/^[0-9][0-9]* //</font></font></tt></b></td><td>L行首的所有数字字W?/td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/b[aeio]g/bug/g</font></font></tt></b></td><td>所有的<i>bag</i>?i>beg</i>?i>big</i>?i>bog</i>改ؓ<i>bug</i>。?/td></tr><tr><td><b><tt><font face="Courier New"><font size="+1">:%s/t\([aou]\)g/h\1t/g</font></font></tt></b></td><td>所?i>tag</i>?i>tog</i>?i>tug</i>分别改ؓ<i>hat</i>?i>hot</i>?i>hug</i>Q注意用group的用法和使用\1引用前面被匹配的字符Q?/td></tr><tr><td></td><td></td></tr></tbody></table><h2><a name="MediumDifficultyExamples"></a>中的例子(奇的咒语)</h2><h3>?</h3><p>所有方法foo(<i>a,b,c</i>)的实例改为foo(<i>b,a,c</i>)。这里a、b和c可以是Q何提供给Ҏfoo()的参数。也是说我们要实现q样的{换: </p><p></p><table cellspacing="4" cellpadding="0"><tbody><tr><td><b>之前</b></td><td> </td><td><b>之后</b></td></tr><tr><td><tt>foo(10,7,2)</tt></td><td></td><td><tt>foo(7,10,2)</tt></td></tr><tr><td><tt>foo(x+13,y-2,10)</tt></td><td></td><td><tt>foo(y-2,x+13,10)</tt></td></tr><tr><td><tt>foo( bar(8), x+y+z, 5)</tt></td><td></td><td><tt>foo( x+y+z, bar(8), 5)</tt></td></tr></tbody></table><p>下面q条替换命o能够实现q一法Q?/p><ul><b><tt><font face="Courier New">:%s/foo(\([^,]*\),\([^,]*\),\([^)]*\))/foo(\2,\1,\3)/g</font></tt></b></ul><p>现在让我们把它打散来加以分析。写个表辑ּ的基本思\是找出foo()和它的括号中的三个参数的位置。第一个参数是用这个表辑ּ来识别的Q:<b><tt><font face="Courier New">\([^,]*\)</font></tt></b>Q我们可以从里向外来分析它:  </p><p></p><table><tbody><tr><td><b><tt><font face="Courier New">[^,]</font></tt></b></td><td> </td><td>除了逗号之外的Q何字W?/td></tr><tr><td><b><tt><font face="Courier New">[^,]*</font></tt></b></td><td></td><td>0或者多个非逗号字符</td></tr><tr><td><b><tt><font face="Courier New">\([^,]*\)</font></tt></b></td><td></td><td>这些非逗号字符标记?b><tt>\1</tt></b>Q这样可以在之后的替换模式表辑ּ中引用它</td></tr><tr valign="baseline"><td><b><tt><font face="Courier New">\([^,]*\),</font></tt></b></td><td></td><td>我们必须扑ֈ0或者多个非逗号字符后面跟着一个逗号Qƈ且非逗号字符那部分要标记出来以备后用?/td></tr></tbody></table><p>现在正是指出一个用正则表辑ּ常见错误的最x机。ؓ什么我们要使用<b><tt><font face="Courier New">[^,]*</font></tt></b>q样的一个表辑ּQ而不是更加简单直接的写法Q例如:<b><tt><font face="Courier New">.*</font></tt></b>Q来匚wW一个参数呢Q设x们用模?b><tt><font face="Courier New">.*</font></tt></b>来匹配字W串"10,7,2"Q它应该匚w"10,"q是"10,7,"Qؓ了解册个两义性(ambiguityQ,正则表达式规定一律按照最长的串来Q在上面的例子中是"10,7,"Q显然这样就扑և了两个参数而不是我们期望的一个。所以,我们要?b><tt><font face="Courier New">[^,]*</font></tt></b>来强制取出第一个逗号之前的部分?/p><p>q个表达式我们已l分析到了:<b><tt><font face="Courier New">foo(\([^,]*\)</font></tt></b>Q这一D可以简单的译为“当你找?b><tt>foo(</tt></b>把其后直到W一个逗号之前的部分标Cؓ<b><tt><font face="Courier New">\1</font></tt></b>”。然后我们用同L办法标记W二个参Cؓ<b><tt><font face="Courier New">\2</font></tt></b>。对W三个参数的标记Ҏ也是一P只是我们要搜索所有的字符直到x受我们ƈ没有必要L索第三个参数Q因为我们不需要调整它的位|,但是q样的模式能够保证我们只L换那些有三个参数的foo()Ҏ调用Q在foo()是一个重载(overoadingQ方法时q种明确的模式往往是比较保险的。然后,在替换部分,我们扑ֈfoo()的对应实例,然后利用标记好的部分q行替换Q是的第一和第二个参数交换位置?/p><h3>?</h3>假设有一个CSVQcomma separated valueQ文Ӟ里面有一些我们需要的信息Q但是格式却有问题,目前数据的列序是:姓名Q公司名Q州名羃写,邮政~码Q现在我们希望讲q些数据重新l织Q以便在我们的某个Y件中使用Q需要的格式为:姓名Q州名羃?邮政~码Q公司名。也是_我们要调整列序Q还要合q两个列来构成一个新列。另外,我们的Y件不能接受逗号前后面有MI格Q包括空格和制表W)所以我们还必须要去掉逗号前后的所有空根{? <p>q里有几行我们现在的数据Q?/p><ul><tt>Bill Jones,     HI-TEK Corporation ,  CA, 95011</tt><br /><tt><font face="Courier New">Sharon Lee Smith,  Design Works Incorporated,  CA, 95012</font></tt><br /><tt><font face="Courier New">B. Amos   ,  Hill Street Cafe,  CA, 95013</font></tt><br /><tt><font face="Courier New">Alexander Weatherworth,  The Crafts Store,  CA, 95014</font></tt><br /><tt><font face="Courier New">...</font></tt></ul>我们希望把它变成q个样子Q? <ul><tt>Bill Jones,CA 95011,HI-TEK Corporation</tt><br /><tt><font face="Courier New">Sharon Lee Smith,CA 95012,Design Works Incorporated</font></tt><br /><tt><font face="Courier New">B. Amos,CA 95013,Hill Street Cafe</font></tt><br /><tt><font face="Courier New">Alexander Weatherworth,CA 95014,The Crafts Store</font></tt><br /><tt><font face="Courier New">...</font></tt></ul>我们用两个正则表达式来解决q个问题。第一个移动列和合q列Q第二个用来LI格? <p>下面是W一个替换命令:</p><ul><b><tt><font face="Courier New">:%s/\([^,]*\),\([^,]*\),\([^,]*\),\(.*\)/\1,\3 \4,\2/</font></tt></b></ul>q里的方法跟?基本一PW一个列Q姓名)用这个表辑ּ来匹配:<b><tt><font face="Courier New">\([^,]*\)</font></tt></b>Q即W一个逗号之前的所有字W,而姓名内容被?b><tt><font face="Courier New">\1</font></tt></b>标记下来。公司名和州名羃写字D는同样的方法标Cؓ<b><tt><font face="Courier New">\2</font></tt></b>?b><tt><font face="Courier New">\3</font></tt></b>Q而最后一个字D는<b><tt><font face="Courier New">\(.*\)</font></tt></b>来匹配("匚w所有字W直到行?Q。替换部分则引用上面标记的那些内Ҏq行构造? <p>下面q个替换命o则用来去除空|</p><ul><b><tt><font face="Courier New">:%s/[ \t]*,[ \t]*/,/g</font></tt></b></ul>我们q是分解来看Q?b><tt><font face="Courier New">[ \t]</font></tt></b>匚wI格/制表W,<b><tt><font face="Courier New">[ \t]*</font></tt></b> 匚w0或多个空?制表W,<b><tt>[ \t]*</tt></b>,匚w0或多个空?制表W后面再加一个逗号Q最后,<b><tt><font face="Courier New">[ \t]*,[ \t]*</font></tt></b>匚w0或多个空?制表W接着一个逗号再接着0或多个空?制表W。在替换部分Q我们简单的我们扑ֈ的所有东西替换成一个逗号。这里我们用了l尾的可选的<b><tt>g</tt></b>参数Q这表示在每行中Ҏ有匹配的串执行替换(而不是缺省的只替换第一个匹配串Q? <h3>?</h3>假设有一个多字符的片断重复出玎ͼ例如Q? <blockquote><tt>Billy tried really hard</tt><br /><tt>Sally tried really really hard</tt><br /><tt>Timmy tried really really really hard</tt><br /><tt>Johnny tried really really really really hard</tt></blockquote>而你x"really"?really really"Q以及Q意数量连l出现的"really"字符串换成一个简单的"very"Qsimple is good!Q,那么以下命oQ? <blockquote><b><tt>:%s/\(really \)\(really \)*/very /</tt></b></blockquote>׃把上q的文本变成Q? <blockquote><tt>Billy tried very hard</tt><br /><tt>Sally tried very hard</tt><br /><tt>Timmy tried very hard</tt><br /><tt>Johnny tried very hard</tt></blockquote>表达?b><tt>\(really \)*</tt></b>匚w0或多个连l的"really "Q注意结有个空|Q?b><tt>\(really \)\(really \)*</tt></b> 匚w1个或多个q箋?really "实例? <h2><a name="HardExamples"></a>困难的例子(不可思议的象形文字)</h2><i>Coming soon</i>. <p></p><hr /><h1><a name="Regular_Expressions_In_Various_Tools"></a>不同工具中的正则表达?/h1>OKQ你已经准备使用REQregular expressionsQ正则表辑ּQ,但是你ƈ准备使用vi。所以,在这里我们给Z些在其他工具中用RE的例子。另外,我还会ȝ一下你在不同程序之间用RE可能发现的区别? <p>当然Q你也可以在Visual C++~辑器中使用RE。选择Edit->ReplaceQ然后选择"Regular expression"选择框,Find What输入框对应上面介l的vi命o<b><tt>:%s/pat1/pat2/g</tt></b>中的pat1部分Q而Replace输入框对应pat2部分。但是,Z得到vi的执行范围和<b><tt>g</tt></b>选项Q你要用Replace All或者适当的手工Find Next and ReplaceQ译者按Q知道ؓ啥有人骂微Y弱智了吧Q虽然VC中可以选中一个范围的文本Q然后在其中执行替换Q但是M不够vi那么灉|和典雅)?/p><h2>sed</h2><p>Sed?b><u>S</u></b>tream <b><u>ED</u></b>itor的羃写,是Unix下常用的Z文g和管道的~辑工具Q可以在手册中得到关于sed的详l信息?</p><p>q里是一些有的sed脚本Q假定我们正在处理一个叫做price.txt的文件。注意这些编辑ƈ不会改变源文Ӟsed只是处理源文件的每一行ƈ把结果显C在标准输出中(当然很容易用重定向来定ӞQ? </p><p></p><table><tbody><tr><td><b><i>sed脚本</i></b></td><td> </td><td><b><i>描述</i></b></td></tr><tr><td><hr width="100%" /></td><td></td><td><hr width="100%" /></td></tr><tr valign="baseline"><td><b><tt>sed 's/^$/d' price.txt</tt></b></td><td></td><td>删除所有空?/td></tr><tr><td><b><tt>sed 's/^[ \t]*$/d' price.txt</tt></b></td><td></td><td>删除所有只包含I格或者制表符的行</td></tr><tr><td><b><tt>sed 's/"http://g' price.txt</tt></b></td><td></td><td>删除所有引?/td></tr></tbody></table><h2>awk</h2>awk是一U编E语aQ可以用来对文本数据q行复杂的分析和处理。可以在手册中得到关于awk的详l信息。这个古怪的名字是它作者们的姓的羃写(AhoQWeinberger和KernighanQ? <p>在AhoQWeinberger和Kernighan的书<u>The AWK Programming Language</u>中有很多很好的awk的例子,请不要让下面q些微不道的脚本例子限制你对awk强大能力的理解。我们同样假定我们针对price.txt文gq行处理Q跟sed一Pawk也只是把l果昄在终端上。? </p><p></p><table><tbody><tr><td><b><i>awk脚本</i></b></td><td> </td><td><b><i>描述</i></b></td></tr><tr><td><hr width="100%" /></td><td></td><td><hr width="100%" /></td></tr><tr valign="baseline"><td><b><tt>awk '$0 !~ /^$/' price.txt</tt></b></td><td></td><td>删除所有空?/td></tr><tr><td><b><tt>awk 'NF > 0' price.txt</tt></b></td><td></td><td>awk中一个更好的删除所有行的办?/td></tr><tr valign="baseline"><td><b><tt>awk '$2 ~ /^[JT]/ {print $3}' price.txt</tt></b></td><td></td><td>打印所有第二个字段?J'或?T'打头的行中的W三个字D?/td></tr><tr valign="baseline"><td nowrap=""><b><tt>awk '$2 !~ /[Mm]isc/ {print $3 + $4}' price.txt</tt></b></td><td></td><td>针对所有第二个字段不包?Misc'或?misc'的行Q打印第3和第4列的和(假定为数字)</td></tr><tr valign="baseline"><td><b><tt>awk '$3 !~ /^[0-9]+\.[0-9]*$/ {print $0}' price.txt</tt></b></td><td></td><td>打印所有第三个字段不是数字的行Q这里数字是?tt>d.d</tt>或?tt>dq样的Ş式,其中</tt><tt>d</tt>??的Q何数?/td></tr><tr valign="baseline"><td><b><tt>awk '$2 ~ /John|Fred/ {print $0}' price.txt</tt></b></td><td></td><td>如果W二个字D包?John'或?Fred'则打印整?/td></tr></tbody></table><h2>grep</h2>grep是一个用来在一个或者多个文件或者输入流中用REq行查找的程序。它的name~程语言可以用来针对文g和管道进行处理。可以在手册中得到关于grep的完整信息。这个同样古怪的名字来源于vi的一个命令,<b><tt>g/</tt></b><i>re</i><b><tt>/p</tt></b>Q意思是<b>g</b>lobal <b>r</b>egular <b>e</b>xpression <b>p</b>rint? <p>下面的例子中我们假定在文件phone.txt中包含以下的文本Q——其格式是姓加一个逗号Q然后是名,然后是一个制表符Q然后是电话LQ?/p><ul><p><tt>Francis, John           5-3871</tt><br /><tt>Wong, Fred              4-4123</tt><br /><tt>Jones, Thomas           1-4122</tt><br /><tt>Salazar, Richard        5-2522</tt></p></ul><p></p><table><tbody><tr><td><b><i>grep命o</i></b></td><td><b><i> </i></b></td><td><b><i>描述</i></b></td></tr><tr><td><hr width="100%" /></td><td></td><td><hr width="100%" /></td></tr><tr valign="baseline"><td><b><tt>grep '\t5-...1' phone.txt</tt></b></td><td></td><td>把所有电话号码以5开头以1l束的行打印出来Q注意制表符是用<b><tt>\t</tt></b>表示?/td></tr><tr valign="baseline"><td nowrap=""><b><tt>grep '^S[^ ]* R' phone.txt</tt></b></td><td></td><td>打印所有姓以S打头和名以R打头的行</td></tr><tr valign="baseline"><td><b><tt>grep '^[JW]' phone.txt</tt></b></td><td></td><td>打印所有姓开头是J或者W的行</td></tr><tr valign="baseline"><td><b><tt>grep ', ....\t' phone.txt</tt></b></td><td></td><td>打印所有姓?个字W的行,注意制表W是?b><tt>\t</tt></b>表示?/td></tr><tr valign="baseline"><td><b><tt>grep -v '^[JW]' phone.txt</tt></b></td><td></td><td>打印所有不以J或者W开头的?/td></tr><tr valign="baseline"><td><b><tt>grep '^[M-Z]' phone.txt</tt></b></td><td></td><td>打印所有姓的开头是M到Z之间M字符的行</td></tr><tr valign="baseline"><td><b><tt>grep '^[M-Z].*[12]' phone.txt</tt></b></td><td></td><td>打印所有姓的开头是M到Z之间M字符Qƈ且点号号码结是1或?的行</td></tr></tbody></table><h2>egrep</h2>egrep是grep的一个扩展版本,它在它的正则表达式中支持更多的元字符。下面的例子中我们假定在文gphone.txt中包含以下的文本Q——其格式是姓加一个逗号Q然后是名,然后是一个制表符Q然后是电话LQ? <ul><tt>Francis, John           5-3871</tt><br /><tt>Wong, Fred              4-4123</tt><br /><tt>Jones, Thomas           1-4122</tt><br /><tt>Salazar, Richard        5-2522</tt></ul><p></p><table><tbody><tr><td><b><i>egrep command</i></b></td><td><b><i> </i></b></td><td><b><i>Description</i></b></td></tr><tr><td><hr width="100%" /></td><td></td><td><hr width="100%" /></td></tr><tr valign="baseline"><td><b><tt>egrep '(John|Fred)' phone.txt</tt></b></td><td></td><td>打印所有包含名?i>John</i>或?i>Fred</i>的行</td></tr><tr valign="baseline"><td nowrap=""><b><tt>egrep 'John|22$|^W' phone.txt</tt></b></td><td></td><td>打印所有包?i>John</i> 或者以22l束或者以<i>W</i>的行</td></tr><tr><td><b><tt>egrep 'net(work)?s' report.txt</tt></b></td><td></td><td>从report.txt中找到所有包?i>networks</i>或?i>nets</i>的行</td></tr></tbody></table><h2><hr width="100%" /></h2><h1><a name="Regular Expressions Syntax"></a>正则表达式语法支持情?/h1><table cellspacing="0" border="1"><tbody><tr><td><b>命o或环?/b></td><td><b><tt><font face="Courier New">.</font></tt></b></td><td><b><tt><font face="Courier New">[ ]</font></tt></b></td><td><b><tt><font face="Courier New">^</font></tt></b></td><td><b><tt><font face="Courier New">$</font></tt></b></td><td><b><tt><font face="Courier New">\( \)</font></tt></b></td><td><b><tt><font face="Courier New">\{ \}</font></tt></b></td><td><b><tt><font face="Courier New">?</font></tt></b></td><td><b><tt><font face="Courier New">+</font></tt></b></td><td><b><tt><font face="Courier New">|</font></tt></b></td><td><b><tt><font face="Courier New">( )</font></tt></b></td></tr><tr><td>vi</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>Visual C++</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>awk</td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> X </td><td> X </td><td> X </td><td> X </td></tr><tr><td>sed</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>Tcl</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> X </td><td> X </td><td> X </td><td> X </td></tr><tr><td>ex</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>grep</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>egrep</td><td> X </td><td> X</td><td> X </td><td> X </td><td> X </td><td> </td><td> X </td><td> X </td><td> X </td><td> X </td></tr><tr><td>fgrep</td><td> X </td><td> X </td><td> X </td><td> X </td><td> X </td><td> </td><td> </td><td> </td><td> </td><td> </td></tr><tr><td>perl</td><td> X</td><td> X</td><td> X</td><td> X</td><td> X</td><td> </td><td> X</td><td> X</td><td> X</td><td> X</td></tr></tbody></table><p> </p><hr /><h1><a name="ViSubstitutionCommandSyntax"></a>vi替换命o?/h1>Vi的替换命令: <ul><b><tt>:</tt></b><i>range</i><b><tt>s/</tt></b><i>pat1</i><b><tt>/</tt></b><i>pat2</i><b><tt>/g</tt></b></ul>其中 <ul><b><tt>:</tt></b> q是Vi的命令执行界面?</ul><ul><i>range </i>是命令执行范围的指定Q可以用百分号Q?Q表C所有行Q用点Q?Q表C当前行Q用美元符P$Q表C最后一行。你q可以用行P例如<b><tt>10,20</tt></b>表示W?0?0行,<b><tt>.,$</tt></b>表示当前行到最后一行,<b><tt>.+2,$-5</tt></b>表示当前行后两行直到全文的倒数W五行,{等? <p><b><tt>s</tt></b> 表示其后是一个替换命令?/p><p><i>pat1 </i>q是要查扄一个正则表辑ּQ这文章中有一大堆例子?/p></ul><ul><i>pat2 </i>q是希望把匹配串变成的模式的正则表达式,q篇文章中有一大堆例子? <p><b><tt>g</tt></b> 可选标志,带这个标志表C替换将针对行中每个匚w的串q行Q否则则只替换行中第一个匹配串?/p></ul>|上有很多vi的在U手册,你可以访问他们以获得更加完整的信息?<img src ="http://m.tkk7.com/zhyiwww/aggbug/53920.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/zhyiwww/" target="_blank">zhyiwww</a> 2006-06-20 10:52 <a href="http://m.tkk7.com/zhyiwww/archive/2006/06/20/53920.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>лǵվܻԴȤ</p> <a href="http://m.tkk7.com/" title="亚洲av成人片在线观看">亚洲av成人片在线观看</a> <div class="friend-links"> </div> </div> </footer> վ֩ģ壺 <a href="http://qu41.com" target="_blank">һƵ</a>| <a href="http://yisousou.com" target="_blank">߹ۿƵ</a>| <a href="http://szmazida.com" target="_blank">ҹAV</a>| <a href="http://bjqhkf.com" target="_blank">ձ߹ۿƵ</a>| <a href="http://zgxxx.com" target="_blank"> ߹ۿ91</a>| <a href="http://szq18888.com" target="_blank">avҹƬƷӰ</a>| <a href="http://www-66409b.com" target="_blank">ĻƵ</a>| <a href="http://b7277.com" target="_blank">߹ۿ˳Ƶɫ9</a>| <a href="http://jst-hosp.com" target="_blank">޹˾Ʒվ</a>| <a href="http://815389.com" target="_blank">aƵƷѹۿ</a>| <a href="http://8xjr.com" target="_blank">һɫþۺ޾Ʒ</a>| <a href="http://4husese.com" target="_blank">ɫۼۺ</a>| <a href="http://513109.com" target="_blank">ëɫëƬѹۿ</a>| <a href="http://nsmtv.com" target="_blank">þþƷձҰ</a>| <a href="http://cuitccol.com" target="_blank">߹ۿվ</a>| <a href="http://yes5555.com" target="_blank">СƵ߲</a>| <a href="http://lanchenews.com" target="_blank">ѹۿվ</a>| <a href="http://haigoumama.com" target="_blank">޹ƷƬ߹ۿ</a>| <a href="http://www-6209.com" target="_blank">Ů߲վ</a>| <a href="http://wwwly6080.com" target="_blank">þþ뾫Ʒպ˳</a>| <a href="http://cqtjqcc.com" target="_blank">Ƶ</a>| <a href="http://xp189.com" target="_blank">ۺŷ㻨</a>| <a href="http://155lh.com" target="_blank">޾ƷۺϾþ</a>| <a href="http://jack-fx.com" target="_blank">޾ƷŮ2020þ</a>| <a href="http://liulian88.com" target="_blank">þþþþþƵ</a>| <a href="http://xuanzhicity.com" target="_blank">޹Ʒþþþþ</a>| <a href="http://www-566846.com" target="_blank">aƬ</a>| <a href="http://cdessc.com" target="_blank">þˮav뾫Ʒ鶹</a>| <a href="http://wdjiuye.com" target="_blank">ѾƷ߶ </a>| <a href="http://hgbookvip.com" target="_blank">ѹۿ</a>| <a href="http://27simnjingmiguan.com" target="_blank">ŷۺһ</a>| <a href="http://xsjxp.com" target="_blank">Ůһ</a>| <a href="http://zzmm88.com" target="_blank">Ѹ߲</a>| <a href="http://eoeoyui.com" target="_blank">ǴýƵѹۿ</a>| <a href="http://lzhuiding.com" target="_blank">AVĻɫ</a>| <a href="http://lebaojj.com" target="_blank">2019Ļ</a>| <a href="http://jiuse54.com" target="_blank">һ߹ۿ</a>| <a href="http://qingdaostf.com" target="_blank">޳aƬӰԺ</a>| <a href="http://sdyzzs.com" target="_blank">˳ëƬ߲</a>| <a href="http://fanhaogo.com" target="_blank">ɫƵwww</a>| <a href="http://sdbfgcjx.com" target="_blank">Ļר</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>