hello and Happy new year !  have a little problem with more then 2000 .html files. I need to select all empty spaces from the next particular tag, and to replace with just one space.  &lt;p class="test_formal"&gt; This is my text    &lt;em&gt;and all of  this&lt;/em&gt; I have    to go home .&lt;/p&gt;  My regex is not very good :(  Search: (?s)(?:\G)|&lt;p class="text_formal"&gt;).*?|.*(?=&lt;/p&gt;)|+\h  Replace by: (Leave one space)
121366
I want to remove every two or more spaces between specific tags and leave just a space instead:  For example:  &lt;p class="text_obisnuit"&gt;  The context of articles,   stories, and conversations helps you     figure out and understand the meaning   of English words in the text that are new to you.   &lt;/p&gt;  My desire output:  &lt;p class="text_obisnuit"&gt;The context of articles, stories, and conversations helps you figure out and understand the meaning of English words in the text that are new to you.&lt;/p&gt;  I tried something but it did not work  (?&lt;=&lt;p class="text_obisnuit"&gt;)\s*|\s*(?=&lt;/p&gt;)
33951
Im trying to craft a regex that only returns &lt;link&gt; tag hrefs  Why does this regex return all hrefs including &lt;a hrefs?       (?&lt;=&lt;link\s+.*?)href\s*=\s*[\'\"][^\'\"]+        &lt;link rel="stylesheet" rev="stylesheet"      href="idlecore-tidied.css?T_2_5_0_228" media="screen">     &lt;a href="anotherurl">Slash Boxes&lt;/a>   thank you
86647
I have noticed that I hardly ever use the \negthinspace command  \!.  This is because I don't know how to use it properly (I do use other spacing commands quite a bit, because I can better understand the guidelines of when they might be useful). When might it be considered appropriate to use this spacing command?
107680
Wanted to convert  &lt;br/&gt; &lt;br/&gt; &lt;br/&gt; &lt;br/&gt; &lt;br/&gt;   into  &lt;br/&gt;
36235
I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.  I have looked for this myself but have been unable to find information on the syntax and how to use it. Does anyone know where the documentation for the syntax is?  EDIT: The attribute filters allow you to select based on patterns of an attribute value.
40363
I'm trying to replace each , in the current file by a new line:  :%s/,/\n/g    But it inserts what looks like a ^@ instead of an actual newline. The file is not in DOS mode or anything.  What should I do?  If you are curious, like me, check the question  as well.
66432
The Markdown editor knows that an empty line, followed by a number, followed by a period, followed by a space, is a list item.  This works great It's almost magic  The problem is that I almost always use a close parenthesis for my lists. I think it's a pretty common practice, but the problem is that the editor / Markdown parser doesn't accept parenthesis as an acceptable list delimiter:  This fails horribly This is on the next line I swear
111292
I'm trying to write a regex function that will identify and replace a single instance of a match within a string without affecting the other instances.  For example, I have this string:  12||34||56   I want to replace the second set of pipes with ampersands to get this string:  12||34&amp;&amp;56   The regex function needs to be able to handle x amount of pipes and allow me to replace the nth set of pipes, so I could use the same function to make these replacements:  23||45||45||56||67 -&gt; 23&amp;&amp;45||45||56||67  23||34||98||87 -&gt; 23||34||98&amp;&amp;87   I know that I could just split/replace/concat the string at the pipes, and I also know that I can match on /\|\|/ and iterate through the resulting array, but I'm interested to know if it's possible to write a single expression that can do this.  Note that this would be for Javascript, so it's possible to generate a regex at runtime using eval(), but it's not possible to use any Perl-specific regex instructions.
105050
I want to write a script that completely removes every instance of a particular span class from a given HTML file.   For example, if my undesired span class is "foo" then running my script on the file  &lt;html&gt;   &lt;head&gt;     &lt;title&gt;hello world&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt; lorem ipsum &lt;span class="foo"&gt; STUFF &lt;/span&gt; alpha beta &lt;span class="foo"&gt; MORE  STUFF&lt;/span&gt;   &lt;/body&gt; &lt;/html&gt;   should yield  &lt;html&gt;   &lt;head&gt;     &lt;title&gt;hello world&lt;/title&gt;   &lt;/head&gt;   &lt;body&gt; lorem ipsum alpha beta    &lt;/body&gt; &lt;/html&gt;   I have two questions.   Can this be done with sed or perl?  Is there a tool in linux that is designed to easily edit HTML documents like this?
5764
After you've typed in a question, you get suggested tags that appear that look like this:        It appears that you need a minimum amount of characters ():     you must have entered a title (any length) and a minimum body length of 220 characters.   But other than that, how are the tags chosen? Is it:   A match of the title/body with other questions (taking the tags from those questions) A match of the title/body with tag excerpts (taking tags with overlap) A match of the title/body with tag wikis (taking tags with overlap) All of the Above None of the Above Other (please explain)   Some additional info from :  The suggested tags seem to only pop up on meta.so (they do not work on regular Stack Overflow, or on other SE sites).  While we're on the topic, why isn't this feature implemented network-wide?
80748
I have a file like this: 1 22 1 4 $3 3 5556 $33 $233 $1 5  I want to move all the lines starting with $ to the previous line by replacing the newline characters with a space. My result should look something like: 1 22 1 4 $3 3 5556 $33 $233 $1 5  How can I do it using sed or grep or awk?
37193
What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?
77019
I'm really stumped on this one. I want to output a list and have the tag file take care of commas, singular versus plural, etc. but when I display the list it completely ignores whitespace so everythingrunstogetherlikethis. I tried using the HTML entities "thinsp", "ensp" and "emsp" (I can't use "nbsp", these have to be breaking), but they're all hideously wide on IE except thinsp which is way too skinny on everything else.  Edit:  won't work. The output from the tag has no spaces at all. Although any content in the JSP has normal spacing. Obviously I could just put everything in the JSP but this is code that goes on multiple JSPs, so tag files would make a lot of sense.
18554
I'm new to regular expressions and would appreciate your help.  I'm trying to put together an expression that will split the example string using all spaces that are not surrounded by single or double quotes. My last attempt looks like this: (?!") and isn't quite working. It's splitting on the space before the quote.  Example input:   This is a string that "will be" highlighted when your 'regular expression' matches something.   Desired output:  This is a string that will be highlighted when your regular expression matches something.   Note that "will be" and 'regular expression' retain the space between the words.
91894
Does anyone know of a script that can select all text references to URLs and automatically replace them with anchor tags pointing to those locations?  For example:  http://www.google.com   would automatically turn into  &lt;a href="http://www.google.com"&gt;http://www.google.com&lt;/a&gt;   Note: I am wanting this because I don't want to go through all my content and wrap them with anchor tags.
67655
Does anyone know how to select an item in the DOM by ID with jQuery, when that ID has a space?   For example, the ID of my item would be  &lt;div id="content Module"&gt;Stuff&lt;/div&gt;   How would I select this with jQuery?   If I just do   $("#content Module").whatever()    jQuery will try to find an item with both the ID of content and the ID of Module, which is not what I am looking for.  I should add that I am working with an old code base where these two word ids are used extensively, so going through and changing all the IDs would be bad.
74283
I was answering a question on Stack Overflow and required to use a trailing space in one of my code snippets.  I formatted it like so:  `&lt;a `   And it renders without the trailing space: &lt;a  Using the &lt;code&gt; tag does account for trailing spaces, though in my case it busts because of the &lt;. Here's my formatting with the &lt;code&gt; tag:  &lt;code&gt;&lt;a &lt;/code&gt;   Here's how it renders:  (Yes, you should see nothing there).  This is a pretty annoying bug. Can we get it fixed?