P**a 发帖数: 1267 | 1 还有就是Python 的regexp用起来太不方便了。 |
|
r*****8 发帖数: 2697 | 2 试过
也试过改max version, 即使安装了也不work
就是这个xul/migemo搞不定, 搜索支持RegExp的 |
|
r*******e 发帖数: 7583 | 3 how much do you know about regexp |
|
o**o 发帖数: 3964 | 4 不仅快捷键。regexp搜索匹配, 还有多窗口看同一文件的不同部分,都是很超前的先进
功能 |
|
g**********y 发帖数: 14569 | 5 1. Java compilor need \\ to know that you want a \.
2. regexp need \\ to know that you want a \.
That's why you need \\\\ to get actually one \.
similarly, if you want a ".", you need to put "\\\." |
|
|
l**********9 发帖数: 537 | 7 请教一下,这个打印什么:
System.out.println("Java".replaceAll("\w*", "RX"));
为什么是2个RX,而不是一个RX, 谢了 |
|
h*****0 发帖数: 4889 | 8 你是说"\\w*"吧?
打印两个的原因我猜是*表示0或多个,所以1个match了一次,0个也match了一次…… |
|
l**********9 发帖数: 537 | 9 对的,是\w*.
你的意思是找到"java" 打印一次"RX", 然后找到0个character,再打印一次"RX".
谢谢了 |
|
|
l**********9 发帖数: 537 | 11 mitbbs 没做\符号的处理,需要打"\\"才出"\" |
|
h*****0 发帖数: 4889 | 12 不是,我打\\就出的\\,但在引文里就变成单\了。 |
|
|
i***e 发帖数: 3219 | 14 put cursor at the beginning. "M-x replace-regexp". When prompted, type in "
\(.\)", and return. When prompted again type in "\1^q^j", then return. |
|
m*********g 发帖数: 273 | 15 in perl, I will do
/^(NY)\s/
$patt=$1 |
|
r*******n 发帖数: 3020 | 16 in vim.
open filename in vim.
then
step 1: %s/.*\D\{5}$//g 删掉所有不是以5个数字的邮编结尾的行
step 2: %s/\d\{5}$//g 删掉邮编
step 3: %s/^\n//g 删掉所有空行
extract |
|
|
|
|
w****g 发帖数: 597 | 20 sed 是不需要指明是哪行到哪行,你可以想想用regular expression 查找出你需要一
段的第一行和最后一行就行了,看看sed的用法例子解释:
http://www.ibm.com/developerworks/linux/library/l-sed1.html
例如,
More on addresses
Up till now, we've taken a look at line addresses, line range addresses, and
regexp addresses. But there are even more possibilities. We can specify two
regular expressions separated by a comma, and sed will match all lines
starting from the first line that matches the first regular expression, up
to and including the line that matches th |
|
r**u 发帖数: 1567 | 21 想用grep+perl regular expression在文件里找一些东西,但是遇到这个问题。如何解
决?多谢
grep: Support for the -P option is not compiled into this --disable-perl-
regexp binary |
|
s****a 发帖数: 238 | 22 比如要把a1,a2替换成b1,b2,用replace-regexp只能在查找时支持正则表达式,替换时
就不行,有没有什么命令能够同时支持正则表达式的? |
|
G*****s 发帖数: 27 | 23 怎么不行?
(replace-regexp "a\\([0-9]\\)" "b\\1") |
|
g****g 发帖数: 1828 | 24 AWK是一种优良的文本处理工具,Linux及Unix环境中现有的功能最强大的数据处理引擎
之一。这种编程及数据操作语言(其名称得自于它的创始人 阿尔佛雷德·艾侯 、
Peter Weinberger 和 Brian Kernighan 姓氏的首个字母)的最大功能取决于一个人所
拥有的知识。 AWK 提供了极其强大的功能:可以进行正则表达式的匹配,样式装入、
流控制、数学运算符、进程控制语句甚至于内置的变量和函数。它具备了一个完整的语
言所应具有的几乎所有精美特性。实际上 AWK 的确拥有自己的语言: AWK 程序设计语
言, 三位创建者已将它正式定义为“样式扫描和处理语言”。它允许您创建简短的程
序,这些程序读取输入文件、为数据排序、处理数据、对输入执行计算以及生成报表,
还有无数其他的功能。gawk 是 AWK 的 GNU 版本。
最简单地说,AWK 是一种用于处理文本的编程语言工具。AWK 在很多方面类似于 Unix
shell 编程语言,尽管 AWK 具有完全属于其本身的语法。它的设计思想来源于
SNOBOL4 、sed 、Marc Rochkind设计的有效性语言、语言工具 y... 阅读全帖 |
|
S*A 发帖数: 7142 | 25 string 就很容易了。随便 regexp 把数字就提出来就成了。 |
|
|
|
t****t 发帖数: 6806 | 28 "Note that the number of exponent digits in the scientific notation produced
by %e, %E, %g and %G for numbers with the modulus of the exponent less than
100 is system-dependent: it may be three or less (zero-padded as necessary)
. In other words, 1.23 times ten to the 99th may be either ``1.23e99'' or ``
1.23e099''."
so i suggest you do sprintf and do a regexp replacement.
3 |
|
l****e 发帖数: 137 | 29 Thanks. I also notice this paragraph. But is there any way around other than
using regexp replacement?
produced
than
necessary)
`` |
|
mw 发帖数: 525 | 30 我用过的也就是regexp
皮毛而已
听人说起boost跨平台不是很好
很小了解一下版上的前辈们都是用boost做什么的?
谢谢了 |
|
y******e 发帖数: 203 | 31 BOOST is used extensively in our project
smart pointer,
foreach
signal
Spirit
regexp
string algorithm
etc... |
|
mw 发帖数: 525 | 32 I have tried Boost.RegEx for a while, it seems that this lib compromised a
lot of 'readability' to be compatible with Boost and generic programming
philosophy.
can anyone suggest a light weight, easy to use C++ regexp library?
thanks |
|
|
b***y 发帖数: 2799 | 34 ☆─────────────────────────────────────☆
somehow (王小石, 一转身便是永恒) 于 (Sat Jul 5 19:38:28 2008) 提到:
☆─────────────────────────────────────☆
friediceman (Bing) 于 (Sat Jul 5 20:21:06 2008) 提到:
何以见得是script language?
☆─────────────────────────────────────☆
somehow (王小石, 一转身便是永恒) 于 (Sat Jul 5 20:59:44 2008) 提到:
regexp, split, join, ....
all high level APIs,
as long as u know English.
GUI is like Java, much easier than MFC.
certainly i don't know .net, web app, that's why i'm saying so.
|
|
r****x 发帖数: 3613 | 35 matlab, reading txt files, data seperated by column, I have to use regexp re
ad data. One major problem is I don't know how many rows in each file, thus
I can only use 'while' to read one file. To loop these files, the rows are a
dded one after another, don't know when to stop. |
|
X****r 发帖数: 3557 | 36 So are you using double loops? i.e. the outer loop for each file and
the inner loop for each row in the current file? If this is the case
why don't you just reset your array/matrix that holds the data to
empty each time before you enter the inner loop?
regexp re
thus
are a |
|
s****a 发帖数: 238 | 37 比如要把a1,a2替换成b1,b2,用replace-regexp只能在查找时支持正则表达式,替换时
就不行,有没有什么命令能够同时支持正则表达式的?手册文档都看过了好像找不到..
. |
|
X****r 发帖数: 3557 | 38 What do you want? 替换时支持正则表达式? This doesn't make sense.
You want to use captured parts, e.g.
M-x replace-regexp a\([0-9]+\) b\1
replaces all a1, a2, ...., a101, a102, ... to
b1, b2, ..., b101, b102, ...
.. |
|
d**********x 发帖数: 4083 | 39 我感觉linux下貌似没有什么好用的C++ refactor工具
要么就用某些java ide,半吊子,要么就用regexp,偶尔会出错,需要智商。 |
|
n****1 发帖数: 1136 | 40 Closure is an expensive way to get real private variables, isn't it?
var person = function () {
var fullName = "Jason Shapiro";
var reg = new RegExp(/d+/);
return {
"setFullName" : function (newValue) {
if( reg.test(newValue) ) {
alert("Invalid Name");
}
else {
fullName = newValue;
}
},
"getFullName" : function () {
return fullName;
}
}; // end of the return
}(); // Note the '()', this means we're calling the function
// a... 阅读全帖 |
|
|
|
w*s 发帖数: 7227 | 43 too complicated, i was expecting 1 line, but thanks ! |
|
|
|
|
d******e 发帖数: 2265 | 47 >>> m= re.search('(W+)', str)
and if you are not sure:
>>> m= re.search('>(W+)', str)
>>> m.group(0)
'>ABT'
>>> m.group(1)
'ABT' |
|
w*s 发帖数: 7227 | 48 this is what i end with as well,
thanks everyone for your reply ! |
|