Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux CÕýÔò±í´ïʽ——POSIXÕýÔò²âÊÔ

ÕâÊÇCµÄÔ­³ÌÐò
#include <stdio.h>
#include <regex.h>
int main(int argc, char** argv)
{
regex_t reg;
regmatch_t pm[10];
char *pattern;
char buf[50];
const size_t nmatch = 10;

pattern = argv[1];
int result = regcomp(®, pattern, REG_EXTENDED);
while( fgets(buf, sizeof(buf), stdin) )
{
int e = 0;
if ( e = strlen(buf) > 0 && buf[e-1] == '\n' )
buf[e-1] = 0;
result = regexec( ®, buf, nmatch, pm, REG_NOTBOL );
if ( result == REG_NOMATCH )
continue;
int i = 0;
for ( i = 0; i < nmatch && pm[i].rm_so != -1; ++i )
{
char c[50] ;
strncpy( c, buf + pm[i].rm_so, pm[i].rm_eo - pm[i].rm_so );
c[pm[i].rm_eo - pm[i].rm_so] = 0;
printf("%d,%d:%s\n", pm[i].rm_so, pm[i].rm_eo,c);
}
}

ÕâÊDzâÊÔÎļþÄÚÈÝ£º
µÄrqyy rqyy
Ò»ggll ggll
²»gii gii
ÊÇjghu jghu
ÁËbnh bnhÊÇjghu jghu
ÎÒtrnt trnt
Ëûwbn wbnÊÇjghu jghu
ÈËwwww wwww
µÍµãwqhk
µÍÁäwqhwÊÇjghu jghu
¶íµÒÆÖ˹wqia
¸«Ï÷wqie
µÍ³±wqifÊÇjghu jghu
µÍÍÝwqif
µÍÎÂwqij
µÍ³Áwqip
µÍÁÓwqit
ÑöÓ¾wqiy
ÄãÊÇwqjg
ÏñÊÇwqjg
º¬½ðÁ¿wqjg 
±àÒëºóÖ´ÐÐ
bash-4.0$ ./reg "[a-y]*$" <aaa  Ã»ÓÐÊä³öÊý¾Ý
13,13:
13,13:
11,11:
13,13:
23,23:
13,13:
23,23:
13,13:
11,11:
23,23:
17,17:
11,11:
23,23:
11,11:
11,11:
11,11:
11,11:
11,11:
11,11:
11,11:
14,14:
bash-4.0$ ./reg "[a-y]*" <aaa
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
0,0:
bash-4.0$ ./reg "[a-y]" <aaa     //Æ¥Åäµ½ÁËÒ»¸ö×Öĸ
3,4:r
3,4:g
3,4:g
3,4:j
3,4:b
3,4:t
3,4:w
3,4:w
6,7:w
6,7:w
12,13:w
6,7:w
6,7:w
6,7:w
6,7:w
6,7:w
6,7:w
6,7:w
6,7:w
6,7:w
9,10:w
bash-4.0$ ./reg "[a-y]{1,}" <aaa      //Æ¥Åäµ½Á˽áβËĸö×Öĸ
3,7:rqyy
3,7:ggll
3,6:gii
3,7:jghu
3,6:bnh
3,7:trnt
3,6:wbn
3,7:wwww
6,10:wqhk
6,10:wqhw
12,16:wqia
6,10:wqie
6,10:wqif
6,10:wqif
6,10:wqij
6,10:wq


Ïà¹ØÎĵµ£º

ÔÚlinuxÏÂʵÏÖweb qqµÄ×ÀÃ滯


´´½¨×ÀÃæͼ±ê
Ä¿Ç°½«ÍøÂçÓ¦ÓÃÀ©Õ¹µ½×ÀÃæÊÇÒ»¸öÇ÷ÊÆ£¬´æÔÚןܶà½â¾ö·½°¸£¬±¾ÎÄÒÔ Mozilla Prism ΪÀý£¬ÀàËƵķ½·¨Í¬ÑùÊÊÓÃÓÚ Google Chrome ¡£
1. µ½ Mozilla Prism µÄÍøÕ¾ÉÏÏÂÔØ Prism£¬µã»÷ Download Now Ö®ºó»áÌáʾÓÐÁ½ÖÖ£¬Ò»ÖÖÊÇÒÔ Mozilla Firefox À©Õ¹µÄ·½Ê½£¬ÊʺÏÒѾ­°²×°ÓÐ Firefox µÄÅóÓÑ£»Ò»Ö ......

linuxʵÓù¤¾ß

»ù±¾ÊµÓù¤¾ß£º
ls  ÏÔʾÎļþÃû(list)
cat  ÏÔʾÎı¾ÎļþÄÚÈÝ
rm [-i]  ɾ³ýÎļþ(remove),-i´ò¿ªÑ¡Ïî
less/more  ·ÖÆÁÏÔʾÎļþ
hostname  ÏÔʾϵͳÃû
Îļþ²Ù×÷£º
cp SOURCEFILE DESTINATIONFILE  ¸´ÖÆÎļþcopy
mv OLDNAME NEWNAME  ¸ü¸ÄÎļþÃû(move)
lpr [-p] FILEN ......

Ubuntu Linux²Ù×÷ϵͳ³£ÓÃÃüÁîÏêϸ½éÉÜ

sudo apt£­get install Èí¼þÃû °²×°Èí¼þÃüÁî
sudo nautilus ´ò¿ªÎļþ£¨ÓÐrootȨÏÞ£©
su root Çл»µ½“root”
ls Áгöµ±Ç°Ä¿Â¼Îļþ£¨²»°üÀ¨Òþº¬Îļþ£©
ls -a Áгöµ±Ç°Ä¿Â¼Îļþ£¨°üÀ¨Òþº¬Îļþ£©
ls -l Áгöµ±Ç°Ä¿Â¼ÏÂÎļþµÄÏêϸÐÅÏ¢
cd .. »Øµ±Ç°Ä¿Â¼µÄÉÏÒ»¼¶Ä¿Â¼
cd - »ØÉÏÒ»´ÎËùÔÚµÄĿ¼
cd ~ »ò cd »Øµ± ......

8¸ö¹¤×÷ʹÓöøÓÐȤµÄlinux½Å±¾

http://club.topsage.com/thread-1201128-1-1.html
ºÜ¶àÈ˶¼¶Ô¹ýÃüÁîÐÐÌáʾµÄÖØÒªÐÔ²»Ð¼Ò»¹Ë£¬ÉõÖÁÊÇÒ»µã¶¼²»¹ØÐÄ¡£µ«ÊÇÎÒÈ´Ò»µã¶¼²»ÕâôÈÏΪ£¬Ò»¸öºÃµÄÃüÁîÐÐÌáʾ¿ÉÒԸıäÄãʹÓÃÃüÁîµÄ·½Ê½¡£Îª´Ë£¬ÎÒÔÚinternetÉÏÕÒµ½Ò»Ð©·Ç³£ÊµÓã¬ÓÅÐ㣬²¢ÓÐȤµÄbashµÄÃüÁîÐÐÌáʾ¡£ÏÂÃæÎÒ½«ÎÒ×îϲ»¶Ê¹ÓõÄһЩÃüÁîÐÐÌáʾÂÞÁÐÈçÏ¡£
¡¡¡ ......

mysql C±à³Ì£¨Ò»£©mysql´íÎóÂ룬¹ØÓÚmysql_errno

¼ÙÉèÎÒÃÇʹÓÃmysql_real_queryÖ´ÐÐÁËÒ»ÌõsqlÓï¾äÖ®ºó£¬·µ»ØֵΪ·Ç0Öµ£¬´ó¼Ò¶¼ÖªµÀÕâÊÇÕâÌõÓï¾äÖ´Ðгö´í£¬µ«ÊÇÎÒÃÇÏë
Á˽âµØ¸üÏêϸµãµÄ»°£¬¾¿¾¹ÊÇʲôԭÒòµ¼ÖÂÁËÕâ¸ö´íÎóÄØ£¿Õâʱºò¾ÍµÃÓÃÉÏmysqlÌṩµÄÁíÍâÒ»¸öAPI£ºmysql_errno¡£
mysql_errno»áÌṩ×î½üÒ»´Îµ÷ÓõÄC API³ö´íµÄÐÅÏ¢£¨²»¼ûµÃÿ¸öAPI¶¼»á¶ÔÕâ¸öerrno½øÐÐÉèÖ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ