我没有使用编码语言。 这必须是直截了当的。
我需要在两条楼之间增加一个可变的白空间。 我在座的座右边有白色空间,需要替换:
string1 *27* string2
因此,我需要把27个白色空间插入插在座1至2号之间。
*(d+)*
这是我所抓住的,它似乎正在发挥作用,但我正试图把我改为:
s{$1}
或
$&s{$1}
因此,你会怎样做? 我正在使用口号进行验证,但并非所有的雷管模式都得到我使用的文字发动机的支持。
我没有使用编码语言。 这必须是直截了当的。
我需要在两条楼之间增加一个可变的白空间。 我在座的座右边有白色空间,需要替换:
string1 *27* string2
因此,我需要把27个白色空间插入插在座1至2号之间。
*(d+)*
这是我所抓住的,它似乎正在发挥作用,但我正试图把我改为:
s{$1}
或
$&s{$1}
因此,你会怎样做? 我正在使用口号进行验证,但并非所有的雷管模式都得到我使用的文字发动机的支持。
这样做是不可能的。 雷切尔将需要某种平级能力,以利用所捕获的变量并将其转化为重复空间。
你想要替代工作的方式也是不可能的。 由于reg鱼的替换部分是直截了当的,而不是另一个reg蒸器。
使用<代码>perl的一种方式 惠制:
perl -e
$s = q[string1 *27* string2];
$s =~ s/s+*(d+)*s+/" " x $1/e;
print $s
产出:
string1 string2
Recently I discovered two amazing regular expression features: ?: and ?!. I was curious of other neat regex features. So maybe you would like to share some tricky regular expressions.
I need to remove image tags from text, so both versions of the tag: <img src="" ... ></img> <img src="" ... />
How do I, using preg_replace, replace more than one underscore with just one underscore?
I was trying to write a regexp to replace all occurrences of with unless the is already preceeded immediately by a . I m doing this in Ruby 1.8.6 which doesn t support look behind in ...
Specifically, I have an array of strings called val, and want to replace all instances of "%{n}%" in the input with val[n]. More generally, I want the replace value to be a function of the match ...
I have the following log entry that I am processing in PowerShell I m trying to extract all the activity names and durations using the -match operator but I am only getting one match group back. I m ...
I m building a lexical analysis engine in c#. For the most part it is done and works quite well. One of the features of my lexer is that it allows any user to input their own regular expressions. This ...
I need a regex for four-digit numbers separated by comma ("default" can also be a value). Examples: 6755 3452,8767,9865,8766,3454 7678,9876 1234,9867,6876,9865 default Note: "default" ...