如何设置Storm伪分布式集群(How to set up a Storm pseudo distributed cluster)
我已经设置了Zookeeper伪分布式集群,我想在我的单机上的伪集群上运行Storm拓扑,我该怎么办? 我见过有人写道,需要配置Storm 3次就像处理Zookeeper一样,我不确定,有没有人知道它?
I have set up a Zookeeper pseudo distributed cluster, and I want to run a Storm topology on a pseudo cluster on my single machine, what should I do? I have seen someone write that it need to configure Storm 3 times just like dealing with Zookeeper, I`m not sure, does anyone know about it ?
原文:https://stackoverflow.com/questions/34691150
最满意答案
找:
r'(".*?")|(\s+)'
更换:
r'\1'
我们的想法是忽略引号内的所有字符,首先将所有引号与内部(
".*?"
)匹配并替换为相同的(\1
)。我们知道左边的空格(
\s+
)不会在引号内(或者第一个规则会匹配它们)并且不用任何东西替换这些空格。
Find:
r'(".*?")|(\s+)'
Replace:
r'\1'
The idea is to ignore all characters inside quotes, by first matching all quotes with something inside (
".*?"
) and replacing with the same (\1
).We know that the white spaces left (
\s+
) will not be inside quotes (or the first rule would have matched them instead) and replace these white spaces with nothing.
相关问答
更多-
只需应用re.escape就可以了。 re.escape(string) 返回字符串,所有非字母数字反向; 如果你想匹配一个可能有正则表达式元字符的任意文字字符串,这很有用。 Just apply re.escape and you'll be fine. re.escape(string) Return string with all non-alphanumerics backslashed; this is useful if you want to match an arbitrary litera ...
-
为什么要使用正则表达式? 只需使用indexOf来获取任何给定位置的char: var addr = 'foo@bar'; console.log(addr[0], addr[addr.indexOf('@')+1]) 为确保您的代码适用于所有浏览器,您可能希望使用charAt而不是[] : console.log(addr.charAt(0), addr.charAt(addr.indexOf('@')+1)); 无论哪种方式,它都可以正常工作, 这无疑是最快的方法 如果你要坚持并选择正则表达式,那么 ...
-
这match工作更容易。 要匹配任何非空格,可以使用\s的相反部分,即\S 由于引号也与\S匹配,因此您还需要首先测试引用,并且仅将\S作为替代选项。 也许你也想忽略一个被引用的部分,当它紧跟着一个非空格时,就像"thi"s word"应该不会变成['thi','s','word'] ,但是['"thi"s','word']你可以做负面的预测: (?!\S) 。所有这些都会变成: /"[^"]*"(?!\S)|\S+/g This works easier with match. To match any ...
-
如果您只是在进行IIS重写,则可以匹配文件thefolder并选中“ 忽略大小写”复选框,然后执行您需要执行的操作。 在重写配置文件中尝试这样的事情:
-
如果使用Delphi XE,则使用TRegEx类构建正则表达式功能。 如果您使用的是早期版本的Delphi,可以在这里找到一个库,在那里您还可以找到有关Delphi XE支持的更多信息: http : //www.regular-expressions.info/delphi.html 这个正则表达式最多匹配6个字符,直到. 将扩展名与文件名的其余部分分开。 ^([^\.]{1,6})[^\.]*(?:\..*)?$ 给定输入: FileName.txt 第1组将是: FileNa 给定输入: File. ...
-
这将多次处理多个空格 (([A-Z]\s*){3}([0-9]\s*){10}) 由于AD E12 34567890符合该模式,因此将与AB CAAAA AD E12 34567890 AD E12 34567890匹配 https://regex101.com/r/bK3sF8/1 this will handle multiple spaces multiple times (([A-Z]\s*){3}([0-9]\s*){10}) will match AB C A A A A AD E12 34 ...
-
找: r'(".*?")|(\s+)' 更换: r'\1' 我们的想法是忽略引号内的所有字符,首先将所有引号与内部( ".*?" )匹配并替换为相同的( \1 )。 我们知道左边的空格( \s+ )不会在引号内(或者第一个规则会匹配它们)并且不用任何东西替换这些空格。 看到它在行动 Find: r'(".*?")|(\s+)' Replace: r'\1' The idea is to ignore all characters inside quotes, by first matching al ...
-
您可以使用以下正则表达式 .replace(/(85)|5/g, (m, $1) => $1 || '0') 正则表达式将搜索85或5 。 如果找到5后跟8,则不会发生替换。 当没有85 ,匹配的5将被0替换。 请注意,此处$1是第一个捕获组的值,即匹配时为85 。 如果未找到85 ,则$1将为空字符串,因此OR条件将返回第二个值,即'0' 。 console.log('4515856581128483548598852649285965451533568536158523'.replace(/(85)| ...
-
使用正则表达式,您可以使用单个数字周围的单词边界: string num = "5"; Regex.Replace(num, @"\b\d\b", "0$&"); //=> 05 num = "31"; Regex.Replace(num, @"\b\d\b", "0$&"); //=> 31 代码演示 正则表达式\b\d\b将匹配任一侧的单个数字和字边界,以确保我们只匹配一个数字。 关于Word边界的更多信息 如果数字可以出现在单词的中间,那么你可以像这样使用lookarounds正则表达式: num ...
-
看起来你正在尝试清理文件名,如果是这样试试这个: private static string MakeValidFileName( string name ) { string invalidChars = System.Text.RegularExpressions.Regex.Escape( new string( System.IO.Path.GetInvalidFileNameChars() ) ); string invalidRegStr = string.Format( @"([{ ...