 <?xml-stylesheet type="text/css" href="https://www.esdm.co.uk/Data/style/rss1.css" ?> <?xml-stylesheet type="text/xsl" href="https://www.esdm.co.uk/Data/style/rss1.xsl" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
  <channel>
    <title>The knowledge base blog</title>
    <link>https://www.esdm.co.uk/knowledge</link>
    <description />
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>mojoPortal Blog Module</generator>
    <language>en-GB</language>
    <ttl>120</ttl>
    <atom:link href="https://www.esdm.co.uk/Blog/RSS.aspx?p=138~108~179" rel="self" type="application/rss+xml" />
    <itunes:owner />
    <itunes:explicit>no</itunes:explicit>
    <item>
      <title>A regular expression for numbers from 0 to 100</title>
      <description><![CDATA[<p>I've been creating a web questionnaire (using the Forms Wizard module for mojoPortal CMS) that includes some questions where the answers were to be expressed as integer percentages. How to validate the responses? This was not quite as simple as I was hoping, as we need to use a RegularExpressionValidator and, as&nbsp;any fule kno<em>,</em> using regular expressions to solve a problem usually results in having two problems. So what's the expression? Of course regular expressions don't "understand" numbers,&nbsp;so&nbsp;it's not as simple as ^[0-100]$!</p>

<p>This expression seems to do the job without loopholes: ^([0-9]|[1-9][0-9]|100)$</p>

<p>If we want to permit decimals, then it gets more interesting. I'm no regexpert, but something like this should&nbsp;ensure we get either an integer from 0 to 100 or any decimal in between, with up to 2d.p. (also permitting 100.0 and 100.00!):</p>

<p>^100(\.[0]{1,2})?|([0-9]|[1-9][0-9])(\.[0-9]{1,2})?$</p>

<p>Spot any problems with these regular expressions...? Please comment and help me improve!</p>
<br /><a href='https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100'>Crispin Flower</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100'>...</a>]]></description>
      <link>https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</link>
      <author>crispin.flower@idoxgroup.com (Crispin Flower)</author>
      <comments>https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/a-regular-expression-for-numbers-from-0-to-100</guid>
      <pubDate>Fri, 29 Jul 2016 17:55:00 GMT</pubDate>
    </item>
    <item>
      <title>How to search the contents of files using regular expressions</title>
      <description><![CDATA[<div>
<p>Originally posted by Mike Lush, then augmented by Keith Westcott.</p>

<p>You're unlikely to think about this until you need to, but there is no obvious way of searching within a bunch of files for text using a regular expression. I needed to search within thousands of .tab files to find those with that contained a common error in the name of the raster file (all the rasters started with numbers, but some of the tab files lacked them, showing only e.g. File "SP8955.tif"). I needed to find files containing the regular expression File "[A-Za-z][A-Za-z] so that I could correct them by adding the relevant number.</p>
</div>

<div>
<p>The tool I discovered for doing this is AstroGrep. This will allow you to select a directory and search for files containing text, allowing you to specify regular expressions. It's basically an extension of the standard Windows file search and a modern version of Grep for DOS. You can also specify a text editor for files of a certain type and open for editing directly from the interface.</p>
</div>

<div>
<p>It's available for download from <a href="http://sourceforge.net/projects/astrogrep/" target="_new">http://sourceforge.net/projects/astrogrep/</a>. No install required.</p>

<p>Alternatively, for a meatier version there is Windows Grep (<a href="http://www.wingrep.com/" target="_new">http://www.wingrep.com/</a>). This has many more options, including being able to search binary as well as ASCII files and having a search and replace function.</p>
</div>
<br /><a href='https://www.esdm.co.uk/how-to-search-the-contents-of-files-using-regular-expressions'>Crispin Flower</a>&nbsp;&nbsp;<a href='https://www.esdm.co.uk/how-to-search-the-contents-of-files-using-regular-expressions'>...</a>]]></description>
      <link>https://www.esdm.co.uk/how-to-search-the-contents-of-files-using-regular-expressions</link>
      <author>crispin.flower@idoxgroup.com (Crispin Flower)</author>
      <comments>https://www.esdm.co.uk/how-to-search-the-contents-of-files-using-regular-expressions</comments>
      <guid isPermaLink="true">https://www.esdm.co.uk/how-to-search-the-contents-of-files-using-regular-expressions</guid>
      <pubDate>Thu, 09 Dec 2010 11:55:31 GMT</pubDate>
    </item>
  </channel>
</rss>