Bootstrap按钮没有与输入字段对齐(Bootstrap button not lining up with input field)
我无法通过
glyphicon-search
按钮在引导程序中排队。 这不是一个独特的问题,我发现这个问题提出了类似的问题,除了接受和庆祝的答案对我不起作用。 就像答案一样,我有一个div输入组包装器应该排成一行,但它不起作用,你可以在我的jsfiddle中看到:<div class="input-group"> <span class="input-group-btn"> <button class="btn btn-default glyphicon glyphicon-search input-sm" type="submit"></button> </span> <input type="text" class="form-control input-sm"> </div>
I'm having trouble getting a
glyphicon-search
button to line up in bootstrap. This is not a unique problem, I found this question that asks a similar thing, except the accepted and celebrated answer isn't working for me. Just like the answer, I have a div input group wrapper that should line up the field, but it isn't working, as you can see in my jsfiddle:<div class="input-group"> <span class="input-group-btn"> <button class="btn btn-default glyphicon glyphicon-search input-sm" type="submit"></button> </span> <input type="text" class="form-control input-sm"> </div>
原文:https://stackoverflow.com/questions/36700643
最满意答案
\
是正则表达式中的转义字符,可用于转义自身,这意味着您可以编写\\n
来匹配文本\n
。使用模式
\\r\\n
并替换为\r\n
。
\
is an escape character in regex and can be used to escape itself, meaning that you can write\\n
to match the text\n
.Use the pattern
\\r\\n
and replace with\r\n
.
相关问答
更多-
这会做什么? [^\r]\n 基本上它匹配一个'\ n',后面跟着一个不是'\ r'的字符。 如果您希望它检测以单个'\ n'开头的行,请尝试 ([^\r]|$)\n 它说它应该匹配一个'\ n',但只有那些是第一个字符的字符或那些不是以'\ r'开头的字符 可能有特殊情况需要检查,因为你正在搞乱线条的定义,'$'可能不太好。 但我认为你应该明白。 编辑:信用@Kibbee使用预见s显然更好,因为它不会捕获匹配的前面的字符,并应该帮助任何边缘案例。 所以这里有一个更好的正则表达式+代码变成: myStr ...
-
\是正则表达式中的转义字符,可用于转义自身,这意味着您可以编写\\n来匹配文本\n 。 使用模式\\r\\n并替换为\r\n 。 \ is an escape character in regex and can be used to escape itself, meaning that you can write \\n to match the text \n. Use the pattern \\r\\n and replace with \r\n.
-
您的正则表达式语法不正确,您将它包含在级联字符类中,并且您尝试在类中使用捕获组,这会导致模式在到达结束时失败) 简而言之,您的正则表达式当前定义了一组字符( 不是您想要的 )然后失败。 [[^([A-Z] # any character of: '[', '^', '(', '[', 'A' to 'Z' 要解决此问题,您需要删除已放置的字符类和捕获组,确保在正则表达式模式中双重转义\w ,然后它应该适合您。 我在我的控制台上测试了它,它工作正常。 > df[,-1] <- str_replace_a ...
-
已经有nl2br()函数替换新行符之前插入的
标签: 示例( 键盘 ): '; echo nl2br($desc2); ?> 但是如果它仍然不工作,请确保文本$desciption是双引号。 这是因为单引号不会扩展转义序列,例如\n与双引号字符串相 ... -
编辑要将多个连续换行符(\n)替换为____ ,应执行以下操作: >>> import re >>> i = "(2 months)\n\nML" >>> re.sub(r'(\n+)(?=[A-Z])', r'____', i) '(2 months)____ML' (?=[AZ])是断言“换行符后跟大写字母”。 REGEX DEMO 。 EDIT To replace multiple continuous newline characters (\n) to ____, this should d ...
-
这是br元素被剥离的地方: var $col = $(col), text = $col.text(); 一种解决方案是用标记替换它们,然后用\r\n替换标记: var $col, text; $col = $(col).clone(); $col.find("br").replaceWith("{{MARKER}}"); text = $col.text().replace(/{{MARKER}}/g, "\r\n"); 那 克隆元素,以便我们可以在不更改文档的情况下更 ...
-
您的替换不是全局替换 - 它们只替换字符串中模式的第一个实例。 要进行全局替换,请在最后一个斜杠后加上ag,如下所示: $description =~ s/\r//g; $description =~ s/\n//g; 您还可以使用字符集将这两个替换组合成单个替换: $description =~ s/[\n\r]//g; Your substitutions are not global substitutions - they replace only the first instance of t ...
-
正则表达式替换每个换行符(Regex to replace every newline)[2022-03-12]
这将用一些东西替换一个或多个换行符,不一定用一个换行符 - 这是由你没有显示的regex_newline.Replace(...)调用决定的。 所以基本上,答案是 Regex regex_newline = new Regex("(\r\n|\r|\n)"); // remove the '+' // : regex_newline.replace(somestring, "X"); That will replace one or more newlines with something, n ... -
要匹配字符,可以将字符放在括号内,如[.] 。 要不匹配,可以使用[^.]等插入符启动字符列表。 这将有效地匹配任何不是a的角色. 。 对于您的特定情况,您希望匹配没有的\r\n . 在它面前。 结合以上内容,您可以使用: [^.]\r\n 要替换它,您需要“捕获”非一段时间的角色以使其保持替换状态。 您可以通过将其包装在括号中来捕获它,例如([^.]) 。 使用Regex.Replace() ,它将是这样的: yourString = Regex.Replace(yourString, @"([^.]) ...
-
正则表达式用\ r \ n替换\ r后面没有后跟\ n的所有实例(Regex to replace all instances of \r not followed by \n with \r\n)[2022-01-27]
你需要使用 \r(?!\n) 也就是说,从\r(?!^\n)表达式中删除字符串/行修饰符的^ start。 \r将匹配回车符,如果在其右侧有一个LF,则(?!\n)将使匹配失败。 一个C#演示: var s = "Line1\rLine2\r\nLine3"; var res = Regex.Replace(s, "\r(?!\n)", "\r\n"); Console.WriteLine(res.Replace("\r","CR").Replace("\n","LF\n")); // => Line1C ...