<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel>
	  <title>Ask MetaFilter questions tagged with regularexpressions</title>
      <link>http://ask.metafilter.com/tags/regularexpressions</link>
      <description>Questions tagged with 'regularexpressions' at Ask MetaFilter.</description>
	  <pubDate>Tue, 13 Oct 2009 13:33:24 -0800</pubDate> <lastBuildDate>Tue, 13 Oct 2009 13:33:24 -0800</lastBuildDate>

      <language>en-us</language>
	  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
	  <ttl>60</ttl>	  
	<item>
	<title>I just want to add a dash!</title>
	<link>http://ask.metafilter.com/135380/I%2Djust%2Dwant%2Dto%2Dadd%2Da%2Ddash</link>	
	<description>I&apos;m using the find and replace tool in dreamweaver, ultilizing Regular Expressions to find four numbers and a space and then &apos;replace&apos; that expression with itself but add a dash. I have a series of years and descriptions, it looks something like this:&lt;br&gt;
&lt;br&gt;
1991 Event Number 1&lt;br&gt;
1992 Event Number 2&lt;br&gt;
1994 Event Number 3&lt;br&gt;
1997 Event Number 4&lt;br&gt;
&lt;br&gt;
I want to turn that into:&lt;br&gt;
&lt;br&gt;
1991&lt;br&gt;
- Event Number 1&lt;br&gt;
&lt;br&gt;
1992&lt;br&gt;
- Event Number 2&lt;br&gt;
&lt;br&gt;
1994&lt;br&gt;
- Event Number 3&lt;br&gt;
&lt;br&gt;
1997&lt;br&gt;
- Event Number 4&lt;br&gt;
&lt;br&gt;
I don&apos;t want to do it manually, because there&apos;s something like 200 some-odd dates. I&apos;ve managed to deceiver a regular expression to find the year and space ([0-9][0-9][0-9][0-9] ) but I can&apos;t seem to get dreamweaver to replace the found expression with itself.&lt;br&gt;
&lt;br&gt;
Is that possible? if not, is there any method I can use to find the 5th character in a line, or the first space in a line?&lt;br&gt;
&lt;br&gt;
Any suggestions?&lt;br&gt;
&lt;br&gt;
(fyi: the end document will be a html page.)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.135380</guid>
	<pubDate>Tue, 13 Oct 2009 13:33:24 -0800</pubDate>
	<category>dreamweaver</category>
	<category>formating</category>
	<category>regularexpressions</category>
	<dc:creator>royalsong</dc:creator>
	</item>
	<item>
	<title>How can I get my two regex subexpressions to match repeatedly?</title>
	<link>http://ask.metafilter.com/127267/How%2Dcan%2DI%2Dget%2Dmy%2Dtwo%2Dregex%2Dsubexpressions%2Dto%2Dmatch%2Drepeatedly</link>	
	<description>Regular Expressions:  How can I get my two subexpressions to match repeatedly?  Right now my pattern matches the first instances but refuses to match anything after it. I&apos;ve spent a few hours looking at regex tutorials, examples, and fiddling with a regex tester program and I&apos;m obviously not making the intuitive leap.&lt;br&gt;
&lt;br&gt;
Here&apos;s &lt;a href=&quot;http://pastebin.com/m527cba5f&quot;&gt;my pattern (PHP)&lt;/a&gt; and &lt;a href=&quot;http://pastebin.com/m221f6aba&quot;&gt;my sample text&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
I&apos;m trying to pick the four sets of HREF locations and link text (the subexpressions) &lt;br&gt;
out of the html soup.  So far $matches contains the whole subsection, and only the first set of location/text that I want.  I suspect my failure is that some portion of the expression isn&apos;t greedy.  Right?&lt;br&gt;
&lt;br&gt;
Please hope me!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.127267</guid>
	<pubDate>Sun, 12 Jul 2009 22:42:53 -0800</pubDate>
	<category>htmlparsing</category>
	<category>php</category>
	<category>regex</category>
	<category>regularexpressions</category>
	<category>resolved</category>
	<category>subexpressions</category>
	<dc:creator>cowbellemoo</dc:creator>
	</item>
	<item>
	<title>Regex Help for Adding +14 to a Series</title>
	<link>http://ask.metafilter.com/117098/Regex%2DHelp%2Dfor%2DAdding%2D14%2Dto%2Da%2DSeries</link>	
	<description>I&apos;m trying to use Regular Expressions in Textmate to do a Find/Replace. The goal: Find id=&quot;1&quot;, id=&quot;2&quot;, id=&quot;3&quot;, etc. and Replace with a value of +14, so that I replace yields id=&quot;15&quot;, id=&quot;16&quot;, id=&quot;17&quot; etc. Thank you! I don&apos;t mind doing the Finds/Replaces one at a time, so I&apos;m not worried about greedy/reluctant, whatever. I just want a bit of an easier way to add +14 to a value. &lt;br&gt;
&lt;br&gt;
So far I&apos;ve been able to Find using id=&quot;*[0-9], but no luck for the Replace.  Thanks mucho for any help!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2009:site.117098</guid>
	<pubDate>Wed, 18 Mar 2009 14:47:47 -0800</pubDate>
	<category>coding</category>
	<category>computerscience</category>
	<category>regex</category>
	<category>regularexpressions</category>
	<category>resolved</category>
	<category>textmate</category>
	<dc:creator>pinto</dc:creator>
	</item>
	<item>
	<title>Regexp seems great but how do I output the result?</title>
	<link>http://ask.metafilter.com/87474/Regexp%2Dseems%2Dgreat%2Dbut%2Dhow%2Ddo%2DI%2Doutput%2Dthe%2Dresult</link>	
	<description>I have a found out a regular expression that searches for a specific bit of text i want to extract from a html document (product names) in notepad++. Now i want to put all the matches of my expression in a new file. Can this be done? I tried using the macro recorder but didnt manage to find a solutions since it always go back to the first match. I also tried cygwin grep but never got it to work (I typed &quot;grep &apos;expression&apos; file&quot; but it returned the whole lines, not only the match).&lt;br&gt;
&lt;br&gt;
I also have excel if it will help.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2008:site.87474</guid>
	<pubDate>Mon, 31 Mar 2008 08:28:56 -0800</pubDate>
	<category>notepad</category>
	<category>regexp</category>
	<category>regularexpressions</category>
	<dc:creator>ilike</dc:creator>
	</item>
	<item>
	<title>Regex Alms for the Perl-less?</title>
	<link>http://ask.metafilter.com/79601/Regex%2DAlms%2Dfor%2Dthe%2DPerlless</link>	
	<description>Help me composite some regex.

&lt;small&gt;(That phrasing makes this question sound &lt;em&gt;way&lt;/em&gt; less nerdy than it is)&lt;/small&gt; Here&apos;s a regex to find some stuff between square brackets:&lt;br&gt;
/\[[^\]]+\]/&lt;br&gt;
&lt;br&gt;
Here&apos;s one that finds something like Alt: or alt. or Alternative: or alternate or Alternate: or Alternative or Alt.: or you get the idea [note it ends with \s+; it is important for my application that the &quot;Alt___ &quot; I&apos;m testing for has white space at the end, and that I test for it. In the final answer we can test for that word boundary any way we like, we just need to make sure that we &lt;em&gt;do&lt;/em&gt;.]:&lt;br&gt;
/(A|a)lt(\.|ernat(e|ive))?:?\s+/&lt;br&gt;
&lt;br&gt;
So what I need is a regular expression for &quot;stuff between square brackets where the first thing inside the brackets will NOT match the second regex.&quot; Or &quot;Stuff inside square brackets that begins with anything BUT alt or Alt. or Alternate or alternative: or alt.: or etc. etc.&lt;br&gt;
&lt;br&gt;
I feel like this should be easy, but I never bothered to totally and completely grok regex, and obviously I&apos;m hurting now because of it.  I&apos;d very much appreciate any help anyone could give, and in exchange you&apos;ll get co-author credit for the &lt;strong&gt;amazing&lt;/strong&gt; piece of software that this thing will ultimately be a part of!  ;-)</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.79601</guid>
	<pubDate>Fri, 28 Dec 2007 02:12:28 -0800</pubDate>
	<category>headache</category>
	<category>perl</category>
	<category>regex</category>
	<category>regularexpression</category>
	<category>regularexpressions</category>
	<dc:creator>ChasFile</dc:creator>
	</item>
	<item>
	<title>How to make regular expressions work with track changes?</title>
	<link>http://ask.metafilter.com/75099/How%2Dto%2Dmake%2Dregular%2Dexpressions%2Dwork%2Dwith%2Dtrack%2Dchanges</link>	
	<description>How can I make Microsoft Word&apos;s Find-and-Replace feature work properly with regular expressions when Track Changes is on? I&apos;m working on a document containing a significant number of citations with page ranges.  Many of those page ranges are separated by hyphens, and I need them to be separated by en dashes instead.&lt;br&gt;&lt;br&gt;So I&apos;m using Find and Replace with regular expressions like so:&lt;br&gt;&lt;strong&gt;Find what:&lt;/strong&gt;  ([0-9]{1,5})-([0-9]{1,5})&lt;br&gt;&lt;strong&gt;Replace with:&lt;/strong&gt; \1&#8211;\2&lt;br&gt;&lt;br&gt;Here&apos;s the problem:  If I run Replace All on the test sentence, &quot;Read pages 35-66, 87-92, &amp;amp; 105-22,&quot; I get back &quot;Read pages 35&#8211;66, 87&#8211;92, &amp;amp; 105&#8211;22.&quot;  Perfect.  But if I turn on Track Changes and run it, I get &quot;Read pages 3566&#8211;, 8792&#8211;, &amp;amp; 10522&#8211;.&quot;  I need these changes to be tracked.  Am I doomed to doing them by hand?&lt;br&gt;&lt;small&gt;I realize how this question looks to people who aren&apos;t grammar nerds or law students.  Trust me when I say that there is a difference, that the difference matters, and that the changes have to be tracked.&lt;/small&gt;</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.75099</guid>
	<pubDate>Wed, 31 Oct 2007 09:42:09 -0800</pubDate>
	<category>2003</category>
	<category>2007</category>
	<category>microsoft</category>
	<category>microsoftword</category>
	<category>msword</category>
	<category>office</category>
	<category>regexp</category>
	<category>regularexpressions</category>
	<category>trackchanges</category>
	<category>word</category>
	<dc:creator>Partial Law</dc:creator>
	</item>
	<item>
	<title>Regex question</title>
	<link>http://ask.metafilter.com/55460/Regex%2Dquestion</link>	
	<description>What&apos;s a regular expression to match and replace space characters between curly braces with under scores? In other words, turn something like: &lt;br&gt;
&lt;br&gt;
blah blah blah {blah blah blah} blah&lt;br&gt;
&lt;br&gt;
into: &lt;br&gt;
&lt;br&gt;
blah blah blah blah_blah_blah blah&lt;br&gt;
&lt;br&gt;
There can be any number of words between the curly braces.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2007:site.55460</guid>
	<pubDate>Sun, 21 Jan 2007 11:52:29 -0800</pubDate>
	<category>regex</category>
	<category>regularexpressions</category>
	<dc:creator>pealco</dc:creator>
	</item>
	<item>
	<title>Regular expressions to describe incoming search engine URLs?</title>
	<link>http://ask.metafilter.com/30233/Regular%2Dexpressions%2Dto%2Ddescribe%2Dincoming%2Dsearch%2Dengine%2DURLs</link>	
	<description>HtAccessFilter: I&#8217;m seeking regular expressions to describe URLs that encompass search engines&#8217; image and video search engines, but not the engines themselves, so that I can block said image and video search engines using &#8220;SetEnvIfNoCase Referer&#8221; in .htaccess.  Also, I&#8217;m also seeking to block all incoming requests for one particular URL which is popular with these video and image search engines but which no longer exists &#8211; but I don&#8217;t want to serve them the normal 404. To be specific, I&#8217;m seeking to block most image and video search engines from my website, while not excluding the main search engines themselves (e.g., I want Google Images and all its regional variations blocked, but not Google itself; Yahoo Video Search, but not Yahoo; etc.).  I managed to get a good variation for Google Images:&lt;br&gt;
&lt;br&gt;
SetEnvIfNoCase Referer &quot;^https?://(www\.)?images.google.(ae|at|be|ca|ch|cl|co\.hu|co\.il|co\.in|co\.jp|co\.kr|co\.nz|co\.th|co\.uk|co\.za|com|com\.ar|com\.au|com\.br|com\.fn|com\.gr|com\.hk|com\.mx|com\.my|com\.ph|com\.pr|com\.ru|com\.sg|com\.tr|com\.tw|com\.ua|de|dk|fi|fr|gr|ie|it|lv|nl|pl|pt|ro|se|sk)&quot; DumbSearchEngine=1&lt;br&gt;
&lt;br&gt;
However, I did that not through my own very bad knowledge of regular expressions, but by emulating what I saw elsewhere.   I just don&apos;t have the know-how or the adequate reference to stave off the other search engines, really.&lt;br&gt;
&lt;br&gt;
I&#8217;m now hoping others have worked out similar ways of describing and/or blocking things like AltaVista Video, Yahoo Video Search, and so on, without blocking Google, AltaVista, and Yahoo themselves.  I also do not want to go too wide by blocking anything with &#8216;images&#8217; or &#8216;video&#8217; in the name itself, for example.&lt;br&gt;
&lt;br&gt;
I then can direct them to a Forbidden error, so that they never even hit my StatCounter, which is the ultimate goal.  I&apos;m not a heavy multimedia website -- for some reason, if I am linking to an MP3 or AVI on another website, Yahoo, AltaVista, Google are all deciding that I&apos;M hosting the image and linking their image- or video-search to me.  Bastards.&lt;br&gt;
&lt;br&gt;
Thanks.</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2006:site.30233</guid>
	<pubDate>Thu, 05 Jan 2006 09:56:13 -0800</pubDate>
	<category>altavista</category>
	<category>google</category>
	<category>htaccess</category>
	<category>images</category>
	<category>regex</category>
	<category>regularexpressions</category>
	<category>resolved</category>
	<category>searchengines</category>
	<category>setenvifnocase</category>
	<category>video</category>
	<category>yahoo</category>
	<dc:creator>WCityMike</dc:creator>
	</item>
	<item>
	<title>(How|Where) does one find Google&apos;s (guide|help) on (searching|querying) using regular expressions?</title>
	<link>http://ask.metafilter.com/21820/HowWhere%2Ddoes%2Done%2Dfind%2DGoogles%2Dguidehelp%2Don%2Dsearchingquerying%2Dusing%2Dregular%2Dexpressions</link>	
	<description>Well, what do you know, err.. what do I know, Google does &lt;a href=&quot;http://www.google.com/search?hl=en&amp;lr=&amp;safe=off&amp;q=%22%28I%7CHe%7CShe%29+%28can%7Cmay%7Cwill%29+%28search%7Cfind%7Clocate%29%22&amp;btnG=Search&quot;&gt;support&lt;/a&gt; some sort of regular expressions. However, I can&apos;t find the usage guide. Anyone?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2005:site.21820</guid>
	<pubDate>Thu, 28 Jul 2005 04:34:41 -0800</pubDate>
	<category>google</category>
	<category>regex</category>
	<category>regexp</category>
	<category>regularexpressions</category>
	<category>search</category>
	<category>syntax</category>
	<category>tools</category>
	<category>use</category>
	<dc:creator>Gyan</dc:creator>
	</item>
	<item>
	<title>Using wildcards in virtusertable for sendmail: resources, pointers, and simple examples, please.</title>
	<link>http://ask.metafilter.com/8542/Using%2Dwildcards%2Din%2Dvirtusertable%2Dfor%2Dsendmail%2Dresources%2Dpointers%2Dand%2Dsimple%2Dexamples%2Dplease</link>	
	<description>Using wildcards in virtusertable for sendmail: resources, pointers, and simple examples, please. Google-fu fails to provide examples that answer my questions. [emm eye] While the basic question, &quot;Can I use wildcarded addresses at the server level with sendmail?&quot; leads to the answer &quot;of course, using vitusertable,&quot; the examples generally seen have broad scope:&lt;br /&gt;&lt;br /&gt;&lt;br&gt;
&lt;i&gt;myemail@somedomain.com -&amp;gt; %1@otherdomain.com&lt;/i&gt;&lt;br /&gt;&lt;br /&gt;&lt;br&gt;
Compounding this is the sendmail-specific wildcarding scheme, which I still don&apos;t completely grok.&lt;br&gt;
&lt;br&gt;
can I wildcard something like this?&lt;br&gt;
&lt;br&gt;
&lt;i&gt;[*+]foo[*+]@mydomain.com -&amp;gt; specificaddress@mydomain.com&lt;/i&gt;&lt;br&gt;
&lt;br&gt;
(please note my also-primitive grasp of grep may mislead. I&apos;m hoping that pseudo-address translates verbally to &quot;any number and combination of characters on either or both sides of a specific string.&quot;)&lt;br&gt;
&lt;br&gt;
So I think there are two parts here.&lt;br&gt;
&lt;br&gt;
1. can I use virtusertable to set up subset-catchalls and direct them to the same domain?&lt;br&gt;
&lt;br&gt;
2. can I get grep-style (grep-ish, what have you) wildcarding in virtusertable?&lt;br&gt;
&lt;br&gt;
TIA!</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.8542</guid>
	<pubDate>Wed, 07 Jul 2004 18:49:34 -0800</pubDate>
	<category>regex</category>
	<category>regularexpressions</category>
	<category>sendmail</category>
	<category>wildcard</category>
	<dc:creator>mwhybark</dc:creator>
	</item>
	<item>
	<title>Is there a regular expressions standard?</title>
	<link>http://ask.metafilter.com/6684/Is%2Dthere%2Da%2Dregular%2Dexpressions%2Dstandard</link>	
	<description>Regular Expressions: Is there a standard? [more] Many programming languages and technologies support pattern matching in text using regular expressions. Is there a published industry standard somewhere for their syntax and implementation?</description>
	<guid isPermaLink="false">tag:ask.metafilter.com,2004:site.6684</guid>
	<pubDate>Wed, 21 Apr 2004 17:09:36 -0800</pubDate>
	<category>coding</category>
	<category>expressions</category>
	<category>regular</category>
	<category>regularexpressions</category>
	<category>standards</category>
	<dc:creator>normy</dc:creator>
	</item>
	
	</channel>
</rss>

