<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Steven Godson</title>
    <description>The latest articles on DEV Community by Steven Godson (@wookiehunter).</description>
    <link>https://dev.to/wookiehunter</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F720641%2Fd2223474-2f5e-48ab-ba7d-facb089de1bd.jpg</url>
      <title>DEV Community: Steven Godson</title>
      <link>https://dev.to/wookiehunter</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wookiehunter"/>
    <language>en</language>
    <item>
      <title>5 things to consider when planning your business website</title>
      <dc:creator>Steven Godson</dc:creator>
      <pubDate>Sun, 10 Oct 2021 13:07:35 +0000</pubDate>
      <link>https://dev.to/wookiehunter/5-things-to-consider-when-planning-your-business-website-cp5</link>
      <guid>https://dev.to/wookiehunter/5-things-to-consider-when-planning-your-business-website-cp5</guid>
      <description>&lt;p&gt;As a business owner in this modern world of ours you want to be able to engage with as wide an audience as possible to maximise your potential revenue.&lt;/p&gt;

&lt;p&gt;There are many ways in which you can achieve this but most, if not in reality all, rely on having an internet presence. So what should this presence be?&lt;/p&gt;

&lt;p&gt;Social media is an obvious place to start. Huge audiences, ready built platforms, global reach etc. However, whilst social media platforms are superb for marketing and customer/client engagement, they are enhancements rather than a replacement for a website/app.&lt;/p&gt;

&lt;p&gt;The benefits of your business having a dedicated website are;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;bespoke styling and theme to match your businesses brand&lt;/li&gt;
&lt;li&gt;having the User Experience (UX) that you need driven through the User Interface (UI) that you want&lt;/li&gt;
&lt;li&gt;order lifecycle control from basket creation through to payment and order status management&lt;/li&gt;
&lt;li&gt;integration with your payment service&lt;/li&gt;
&lt;li&gt;you can share specialised content behind a secure login &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you have decided that your business deserves a website. What do you need to consider? the simple answer is "Lots!" but there are a number of key areas that will help get you started and ensure success. An overview of each of these areas and what they mean to you is summarised below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where should I host my site?
&lt;/h2&gt;

&lt;p&gt;This decision very much depends on a number of factors.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;how much control you want to have over the look and feel of your website?&lt;/li&gt;
&lt;li&gt;do you want to build / maintain the website yourself or get a professional to do the work?&lt;/li&gt;
&lt;li&gt;how much traffic are you expecting?&lt;/li&gt;
&lt;li&gt;how frequently will your website structure or functionality, not content, be likely to change?&lt;/li&gt;
&lt;li&gt;what technologies do I want my website built with?&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The specifics of which hosting provider you ultimately go with is a decision between you and, assuming you are not self-building, your web developer. The two high level choices are;&lt;/p&gt;

&lt;h3&gt;
  
  
  Hosted Service
&lt;/h3&gt;

&lt;p&gt;This is where you use a service such as Wix.com, GoDaddy.com, WordPress.com et, there are many to choose from, and build your website using their templates, 'wizards' etc.&lt;/p&gt;

&lt;p&gt;These are a, relatively, painless approach to building a website, especially for the non-technical, and you can be up and running in a fairly short period of time.&lt;/p&gt;

&lt;p&gt;There is, however, a trade off. &lt;/p&gt;

&lt;p&gt;Using one of these services means you have less control over how and where your website/data is hosted, as well as having to live with the constraints that the service provider places upon you in terms of what can and cannot be achieved within their service.&lt;/p&gt;

&lt;p&gt;This may be perfectly acceptable to you and your business, especially when starting out where you want something quick and easy, but be mindful of the future when your business is growing rapidly and you need to migrate to a more functionally rich solution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Self Hosted
&lt;/h3&gt;

&lt;p&gt;The title of this option is somewhat misleading in that you do not have to build your own data centre, networks etc, rather that you take responsibility, albeit sub-contracted out to cloud providers and professionals, for where and how your website/app is hosted as well as the maintenance of the solution.&lt;/p&gt;

&lt;p&gt;This opens up a cornucopia of possibilities and technology choices which, as a business owner, you may not want to spend time on. This is absolutely fine as you can leave a lot of these decisions to your trusted professionals who should be able to guide you down the right path depending on what business outcomes you want to achieve.&lt;/p&gt;

&lt;p&gt;There is, of course, a trade off. See what I did there...&lt;/p&gt;

&lt;p&gt;By implementing your website/app in this way it is quite possible that it will be more expensive than using a Hosted Service.&lt;/p&gt;

&lt;p&gt;However the benefits from this approach, which in my experience outweigh the costs, are;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;flexibility&lt;/li&gt;
&lt;li&gt;scaleability&lt;/li&gt;
&lt;li&gt;speed of change&lt;/li&gt;
&lt;li&gt;ability to try out new technologies&lt;/li&gt;
&lt;li&gt;ability to swap out providers to get better prices or enhanced services&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Domain name
&lt;/h2&gt;

&lt;p&gt;So firstly "What is a domain name?"...&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--obg9lArt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2iu1j1x6j4nmakrgakz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--obg9lArt--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2iu1j1x6j4nmakrgakz.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is a key decision as the domain name you choose needs to be;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;memorable&lt;/strong&gt; - choose something that will stick in the memory,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;meaningful&lt;/strong&gt; - relate to your business name or what your business does,&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;available&lt;/strong&gt; - you need to make sure that the domain name you want is available&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It is also worth considering whether you want to register, although not necessarily use, multiple top level domains, such as, .com, .co.uk, .uk etc. &lt;/p&gt;

&lt;p&gt;This is usually done to safeguard your business against competitors against trading under a similar web address and capitalising on your brand and hard work. These can be registered all together, some Registrars provide bulk discounts, or later on as your business grows.&lt;/p&gt;

&lt;p&gt;The one thing to be mindful of is that domain name registration is an ongoing cost, frequency dependent on which Registrar you choose, and needs to be maintained otherwise you lose rights to the domain name(s) and your website will no longer be reachable.&lt;/p&gt;

&lt;h2&gt;
  
  
  SEO / Analytics - putting you on the map, and keeping you there
&lt;/h2&gt;

&lt;p&gt;Search Engine Optimisation (SEO) is all about getting to Page 1 on a Google search (other search engines are apparently available) and can be seen as a form of wizardry at times.&lt;/p&gt;

&lt;p&gt;There are many articles that can be found online that go into this subject in much greater depth than I would want to in this article. Suffice to say that there are a few key considerations that you need to give consideration to when thinking about website/app for your business.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Metadata - this is the, mostly, unseen content in you site that search engines look for and index for users to search against. the main three are;

&lt;ul&gt;
&lt;li&gt;Title - the text that appears in your browser tab&lt;/li&gt;
&lt;li&gt;Description - tells search engines what your site or page is for&lt;/li&gt;
&lt;li&gt;Keywords - the words that you specifically would like search engines to include your site in searches for&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Sitemaps and Robots.txt - these are files that need to be created and stored in the root directory of your website/app and are specifically there to help search engines by telling what content is important and what can be ignored&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All this is great but unless you pro-actively monitoring your performance and adjusting accordingly your website is unlikely to rise to the heady heights of Page 1.&lt;/p&gt;

&lt;p&gt;There are many, free and paid for, services and tools that will help you do this. My recommendation is that you start off with a free one, such as Google Analytics, and see how you get on before progressing to a paid tool.&lt;/p&gt;

&lt;p&gt;If you are time poor, understandable as you are building the next mega corporation, then outsourcing this to a professional who will do the monitoring and maintenance for you is a great way to take the stress away.&lt;/p&gt;

&lt;h2&gt;
  
  
  Images - stock vs owned
&lt;/h2&gt;

&lt;p&gt;Depending on what your business does or is trying to market with a website then you will need to consider where your images come from and whether you want to pay a license fee or provide your own images, assuming you own the rights to use them, and have these on the site.&lt;/p&gt;

&lt;p&gt;I always look at it like this.&lt;/p&gt;

&lt;p&gt;Am I showing a proprietary product or service that I want to have specific images of on my website?&lt;/p&gt;

&lt;p&gt;If YES, then either hire a professional photographer to take the images you want (make sure the price includes you owning the right to own/use) or, if you are a budding photographer, take the images yourself and store them securely.&lt;/p&gt;

&lt;p&gt;If NO, then using stock images, from services such as Getty or Unsplash, is a great way to go. Just make sure you read the licensing terms and understand whether you need to add a 'credit' against each image or somewhere on your website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Content / Copy
&lt;/h2&gt;

&lt;p&gt;Similar to images the written content on your website/app also needs to be considered and either outsourced to professionals or, if you have the experience necessary qualifications / experience / skills, do the job yourself.&lt;/p&gt;

&lt;p&gt;Consideration should be given to bringing in professionals for the following areas;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Legal and Commercial&lt;/li&gt;
&lt;li&gt;Sales and Marketing&lt;/li&gt;
&lt;li&gt;Technical Writing&lt;/li&gt;
&lt;li&gt;Content creation e.g. articles or blogs&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;All of this can seen quite daunting, especially if you don't come from a technical background. &lt;/p&gt;

&lt;p&gt;That is why I started &lt;a href="https://www.xenos-design.co.uk"&gt;Xenos-Design Ltd&lt;/a&gt;, as I wanted to provide high quality services and use my decades of technical and service delivery experience to take the weight of your shoulders.&lt;/p&gt;

&lt;p&gt;I am always happy to have a chat, whether to offer advice or to discuss a project that you would like to undertake, and can be reached at &lt;a href="//mailto:steven@xenos-design.co.uk"&gt;steven@xenos-design.co.uk&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Introduction to RegEx</title>
      <dc:creator>Steven Godson</dc:creator>
      <pubDate>Sun, 10 Oct 2021 12:51:20 +0000</pubDate>
      <link>https://dev.to/wookiehunter/introduction-to-regex-dph</link>
      <guid>https://dev.to/wookiehunter/introduction-to-regex-dph</guid>
      <description>&lt;p&gt;So I thought it about time I did some discovery and learning around the use of RegEx what it can bring to a project.&lt;/p&gt;

&lt;p&gt;To ensure that I got a structured introduction I undertook the course called &lt;strong&gt;REGULAR EXPRESSIONS FOR BEGINNERS – UNIVERSAL&lt;/strong&gt; on Udemy by Edwin Diaz, which I thoroughly recommend as Edwin is great at boiling the essence of a topic down into something that is easily understood.&lt;/p&gt;

&lt;p&gt;The following are the notes that I took while working through the course along with some worked out examples, some which were derived from the course and some which I’ve implemented in other projects.&lt;/p&gt;

&lt;p&gt;Hopefully this will be of some use to you and give you a broad understanding of RegEx.&lt;/p&gt;

&lt;p&gt;I recommend that you use an online tool for working through this as it will help bring it to life. Personally I use &lt;a href="https://regex101.com/"&gt;https://RegEx101.com/&lt;/a&gt; as it will work with a number of languages, has a dictionary of syntax and will actually explain to you what you expression is doing as you write it out.&lt;/p&gt;

&lt;h2&gt;
  
  
  REGEX OPTIONS
&lt;/h2&gt;

&lt;p&gt;In its most basic form RegEx will match against a specified set of characters within a target string:&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will search for every instance of the string “&lt;strong&gt;car&lt;/strong&gt;” within a target string of text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will do the same as the above but will be case insensitive.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;gim&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will do the same as above but will search across multiple lines of text.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will search within a single line using a full stop/period to identify the end of the line.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;imgu&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will be case insensitive, search across multiple lines, will search globally and look at Unicode characters.&lt;/p&gt;

&lt;p&gt;It is important that you get the setting of these options correct in your expressions to ensure that your matching against exactly what you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  META CHARACTERS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;adding a full stop/period anywhere in your string is essentially adding a wildcard. This means that, under this example, the expression will match against anything that starts with the letter &lt;strong&gt;c&lt;/strong&gt; and ends with the letter &lt;strong&gt;r&lt;/strong&gt;. It will not care if there is a letter or a symbol in between them, so be careful if you specifically want to search for an actual full stop/period.&lt;/p&gt;

&lt;h2&gt;
  
  
  ESCAPING
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;c&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so if you want to search specifically for full stop/period, or if your search string includes something like a “&lt;strong&gt;/&lt;/strong&gt;” because you are searching a URL for example, then you will need to escape that particular character. This is done by adding a  “&lt;strong&gt;**” in front of the character so as you will see an example the expression of only return matches to “&lt;/strong&gt;c.r**”&lt;/p&gt;

&lt;p&gt;some language engines will automatically escape characters so RTFD…&lt;/p&gt;

&lt;h2&gt;
  
  
  MORE CHARACTERS
&lt;/h2&gt;

&lt;p&gt;escaping can also be used to match against a whole host of different characters or actions within your RegEx expression for example&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="nc"&gt;C\n\t\R&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will specifically look for &lt;strong&gt;C&lt;/strong&gt;, then a new line, then a tab and then an &lt;strong&gt;R&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;But be mindful that the characters work in different ways depending on what language engine you are working with e.g. JavaScript or.net or PHP et cetera so refer to the documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  RANGES
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;treats this as a range of letters to search for and will return every instance of each individual letter.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[a-z]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;search for every alphabetical letter and return every match. This is case sensitive so example only search for lowercase letters whereas &lt;strong&gt;[A-Z]&lt;/strong&gt; will only search for uppercase. They can both be combined in the same range. &lt;strong&gt;[0-9]&lt;/strong&gt; will also do the same thing, but for the range of numbers zero and nine. The ranges do not have to start or finish as stated above just as easily be &lt;strong&gt;[b-f]&lt;/strong&gt; for example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[abdq]werty
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;search for all of the letters within the range as well as anything that matches “&lt;strong&gt;werty&lt;/strong&gt;”.&lt;/p&gt;

&lt;p&gt;the range, start and end point can bhe anything you want it to be as long as it is separated by a [&lt;strong&gt;-&lt;/strong&gt;] within square brackets.&lt;/p&gt;

&lt;h2&gt;
  
  
  NEGATION
&lt;/h2&gt;

&lt;p&gt;negation is when you tell the expression to exclude something and which is done using the &lt;strong&gt;^&lt;/strong&gt; symbol (shift + 6 on Windows keyboard). An example of this would be &lt;strong&gt;[^cat]&lt;/strong&gt; which would tell your expression to ignore any of the letters within the range.&lt;/p&gt;

&lt;h2&gt;
  
  
  SHORTHAND
&lt;/h2&gt;

&lt;p&gt;so shorthand is, and don’t shout at me for this, a bit like a macro or short name function as you can type in \ followed by a specific character or letter and it will produce the equivalent of typing out a longer expression range. I have added a couple of examples below but for full details refer to the documentation language engine;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\s&lt;/strong&gt; - looks for any whitespace character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\S&lt;/strong&gt; - looks for any non-whitespace character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\d&lt;/strong&gt; - looks for any digit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\D&lt;/strong&gt; - looks for any non-digit.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\w&lt;/strong&gt; - looks for any word character.&lt;/p&gt;

&lt;p&gt;and the list goes on. What is good about this is that you combine them within ranges and negation to make your code shorter. &lt;/p&gt;

&lt;p&gt;But be mindful as some of them produce slightly odd results such as &lt;strong&gt;\b&lt;/strong&gt; which looks at the boundary of what it considers to be a word but will include digits e.g. it would match against all of &lt;strong&gt;Lettuce468&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;These can also be used to create a pattern against which to match if you need to be very specific, for example;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;w\w\w\w\w\w&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="n"&gt;xenos&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;design&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;co&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;uk&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;would match against my email address, or any email address under the same domain where the word in front of the @ symbol is six characters long.&lt;/p&gt;

&lt;h2&gt;
  
  
  REPETITION
&lt;/h2&gt;

&lt;p&gt;Quantifiers – these are meta characters when added tell you expression to select varying amounts of the character that proceeds it, for example;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a?&lt;/strong&gt; - will match zero or one of a, where a represents what you want to match against.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a*&lt;/strong&gt; - will look for from 0 to more of a. I have also seen as described as the Greedy quantify because it will match as many times as possible.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a+&lt;/strong&gt; - will look for one or more of a.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a{x}&lt;/strong&gt; - will look for the specified number of a where x equals a number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a{x,}&lt;/strong&gt; - will look for xc or more of a where x is a number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a{x,y}&lt;/strong&gt; - will look for the number of a’s between x and y.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;a*?&lt;/strong&gt; - This will match a from zero or more times, but as few times as possible. This is known as a lazy or reluctant quantifier.&lt;/p&gt;

&lt;p&gt;These can be combined to create an expression that will search for a pattern, an example of this would be&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;would match any set of values that look like this &lt;strong&gt;12345-6789&lt;/strong&gt; an obvious use case for this could be if you’re searching for telephone numbers in a dataset where there is a specified format. The same could obviously be done for text strings as well or indeed combinations of both.&lt;/p&gt;

&lt;h2&gt;
  
  
  GROUPING
&lt;/h2&gt;

&lt;p&gt;must be done outside of the character/range set otherwise parentheses will just be escaped, however, characters set/range can be put inside grouping so &lt;strong&gt;([0-9])&lt;/strong&gt; will work but &lt;strong&gt;[()]&lt;/strong&gt; will not.&lt;/p&gt;

&lt;p&gt;An example of how this would work is &lt;strong&gt;save(d)?&lt;/strong&gt; which makes ‘&lt;strong&gt;d&lt;/strong&gt;’ optional and therefore would match against both ‘&lt;strong&gt;save&lt;/strong&gt;’ and ‘&lt;strong&gt;saved&lt;/strong&gt;’.&lt;/p&gt;

&lt;h2&gt;
  
  
  ALTERNATION
&lt;/h2&gt;

&lt;p&gt;the use of the pipe symbol ‘&lt;strong&gt;|&lt;/strong&gt;’ (shift + \  on a windows keyboard) effectively works as an OR statement. However some nuances of it are;&lt;/p&gt;

&lt;p&gt;-     whatever is written on the left takes precedence.&lt;/p&gt;

&lt;p&gt;-     global needs to be switched on for it to work.&lt;/p&gt;

&lt;p&gt;-     it can be used as many times as needed.&lt;/p&gt;

&lt;p&gt;a more effective way to use this is to include grouping i.e. &lt;strong&gt;(Bat|Super)man&lt;/strong&gt; will return against both ‘&lt;strong&gt;Superman&lt;/strong&gt;’ and ‘&lt;strong&gt;Batman&lt;/strong&gt;’.&lt;/p&gt;

&lt;p&gt;Example to work in – &lt;strong&gt;(\w+|file\d {3}_export. sql)&lt;/strong&gt;      &lt;strong&gt;file201_export.sql&lt;/strong&gt;     remember that the right of the pipe sign takes precedence and will be classed as an eager function as is looking for all words so would return against an underscore but not a hyphen or a full stop.&lt;/p&gt;

&lt;p&gt;Alternation can also be used in a nested group i.e. &lt;strong&gt;(soup (bowl|spoon))&lt;/strong&gt; will return against ‘&lt;strong&gt;soup&lt;/strong&gt; &lt;strong&gt;bowl&lt;/strong&gt;’ and ‘&lt;strong&gt;soup spoon&lt;/strong&gt;’, be mindful of the spacing as this is quite key to a working.&lt;/p&gt;

&lt;h2&gt;
  
  
  ANCHORS
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;^s&lt;/strong&gt; - will look for the first ‘s’ in a string e.g. it has to be at the beginning of the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;s$&lt;/strong&gt; - as above but at the end of the string.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;^[a-z]&lt;/strong&gt; - will look for any texturing that starts with a lowercase letter.&lt;/p&gt;

&lt;h2&gt;
  
  
  WORD BOUNDARIES
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;\b&lt;/strong&gt; - this will match up to the boundary of each word or word character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\B -&lt;/strong&gt; this will match twin non-word boundary, which is somewhat confusing, as it will not match on any string of less than three word characters but on a string of more than three characters it will match as follows ‘t*&lt;em&gt;es&lt;/em&gt;*t’ as it treats the beginning and end characters as the boundaries themselves rather than the spaces around them as the boundary.&lt;/p&gt;

&lt;h2&gt;
  
  
  BACK REFERENCES
&lt;/h2&gt;

&lt;p&gt;is a way of referring to the string of text or digits within a grouping. &lt;/p&gt;

&lt;p&gt;Typically most engines let you save up to 9 back references, shown as follows &lt;strong&gt;day(light) \1&lt;/strong&gt; with the ‘&lt;strong&gt;\1&lt;/strong&gt;’ being the reference to the “variable”. This would only match if the texturing it is searching is written as follows &lt;strong&gt;daylight light&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nx"&gt;p&lt;/span&gt; &lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;para&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;Steven&lt;/span&gt; &lt;span class="nx"&gt;Godson&lt;/span&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="sr"&gt;/p&lt;/span&gt;&lt;span class="err"&gt;&amp;gt;
&lt;/span&gt;
&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;para&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;document&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getElementById&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;para&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;innerHTML&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;(\w&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)\s(\w&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;)&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;newString&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;para&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;$2&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newString&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;so you can add this to an HTML file, then run it in a browser and look at the console to see that all that has been console logged is the second part of my name e.g. “Godson” as the JavaScript will get the inner HTML from the paragraph element apply the pattern over it which was essentially searching for a ‘word space word’ pattern and assigning the variables &lt;strong&gt;$1&lt;/strong&gt; and &lt;strong&gt;$2&lt;/strong&gt; to the two groupings. &lt;/p&gt;

&lt;p&gt;Then the variable &lt;strong&gt;newString&lt;/strong&gt; will be assigned the value of &lt;strong&gt;$2&lt;/strong&gt; which is then console logged.&lt;/p&gt;

&lt;h2&gt;
  
  
  NON-CAPTURING GROUP
&lt;/h2&gt;

&lt;p&gt;this example we see yet another way a ‘&lt;strong&gt;?&lt;/strong&gt;’ can be used to do something different within your expression.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;food&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt;&lt;span class="n"&gt;travel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will match against “food and travel and food” because is repeating the first variable, whereas&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?:&lt;/span&gt;&lt;span class="n"&gt;food&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;travel&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;and&lt;/span&gt; &lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;will match against “food and travel and travel” because it is repeating the second variable which is travel.&lt;/p&gt;

&lt;p&gt;Using the “&lt;strong&gt;?:&lt;/strong&gt;” switches off that variable.&lt;/p&gt;

&lt;h2&gt;
  
  
  POSITIVE AND NEGATIVE ASSERTIONS
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Za&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?=&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this will search for any upper or lowercase letter that is followed by a comma.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Za&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?!&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this literally does the reverse (if != ,)  e.g. does not equal comma and so will match every string of upper and lowercase letters that do not end with a comma.&lt;/p&gt;

&lt;h2&gt;
  
  
  POSITIVE AND NEGATIVE LOOK AHEAD
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Za&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?&amp;lt;=&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;very similar to the previous section except that by adding the “&lt;strong&gt;&amp;lt;&lt;/strong&gt;” you’re telling the expression to look at what comes before e.g. under this example it would look for every texturing that is preceded by a comma.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Za&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?&amp;lt;!&lt;/span&gt;&lt;span class="p"&gt;,)&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;again, literally the reverse, where you are looking for everything that is not preceded by comma.&lt;/p&gt;

&lt;h2&gt;
  
  
  MULTILANGUAGE SYMBOL SUPPORT
&lt;/h2&gt;

&lt;p&gt;RegEx includes support for Unicode, so no matter what language you are searching against you will be able to use Unicode to create a match in your expression.&lt;/p&gt;

&lt;p&gt;You can find the full Unicode listings at &lt;a href="https://home.unicode.org/"&gt;https://home.unicode.org/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If it is to be included it in your ReEex expression as follows \u2022 using the “\” to escape the u so that it is turned into the Unicode character.&lt;/p&gt;

&lt;h2&gt;
  
  
  EXAMPLES
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Password Validation&lt;/strong&gt; – the following is an example of an expression that could be used to validate against contents of the users chosen password to ensure that it matches against the policy in place on our project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;?=&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;A&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Z&lt;/span&gt;&lt;span class="p"&gt;])(&lt;/span&gt;&lt;span class="o"&gt;?=&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;z&lt;/span&gt;&lt;span class="p"&gt;])(&lt;/span&gt;&lt;span class="o"&gt;?=&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="o"&gt;?=&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="err"&gt;$£&lt;/span&gt;&lt;span class="c1"&gt;#])\S{5,20}$/gm&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;(?=.*[A-Z])&lt;/strong&gt; – this validates against the password having at least one upper case character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(?=.*[a-z])&lt;/strong&gt; – this validates against the password having at least one lowercase character.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(?=.*\d)&lt;/strong&gt; – this validates against the password having at least one number.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;(?=.*[!$£#])&lt;/strong&gt; – this validates against password having at least one of the identified symbols within the square brackets.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;\S{5,20}&lt;/strong&gt; – this validates him the password being a minimum of 5 and a maximum of 20 characters.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pretty URLs&lt;/strong&gt; – the following example is something that I have deployed myself and is commonly seen on websites to make the URL in the browser more human readable. This example is specific to PHP running on an Apache server.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step One&lt;/em&gt; – ensure your Apache server has the rewrite engine switched on.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step Two&lt;/em&gt; – create a new file called .htaccess in your website’s root directory.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step Three&lt;/em&gt; – opening with your code editor and add the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;RewriteEngine&lt;/span&gt; &lt;span class="n"&gt;on&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;the switches the rewrite engine on*&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nc"&gt;RewriteRule&lt;/span&gt; &lt;span class="o"&gt;/^&lt;/span&gt;&lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="n"&gt;d&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;post&lt;/span&gt;&lt;span class="mf"&gt;.&lt;/span&gt;&lt;span class="n"&gt;php&lt;/span&gt;&lt;span class="o"&gt;?&lt;/span&gt;&lt;span class="n"&gt;p_id&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="no"&gt;NC&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nc"&gt;L&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;this tells the server to replace anything with a post.php?p_id=$1, where $1 equals the number identified in the group, and replaces it with post/post number e.g. &lt;strong&gt;domainname.com/posts/178&lt;/strong&gt;, with the &lt;strong&gt;NC&lt;/strong&gt; denoting that it is case insensitive and the &lt;strong&gt;L&lt;/strong&gt; denoting but this is the last rule that should be processed.&lt;/p&gt;

&lt;h2&gt;
  
  
  SUMMARY
&lt;/h2&gt;

&lt;p&gt;Hopefully this brief introduction to RegEx has sparked your interest to go and explore more for yourself and understand how this very powerful tool could be used in your projects. &lt;/p&gt;

&lt;p&gt;I’ve enjoyed learning about something that seemed to be quite daunting before, but now seems quite simple once you understand the syntax.&lt;/p&gt;

&lt;p&gt;I have added some references below to language specific documentation and a couple of tools that I found useful during this learning process.&lt;/p&gt;

&lt;h2&gt;
  
  
  REFERENCES AND RESOURCES
&lt;/h2&gt;

&lt;p&gt;.net - &lt;a href="https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#:~:text=A%20regular%20expression%20is%20a,For%20a%20brief%20introduction%2C%20see"&gt;https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expression-language-quick-reference#:~:text=A%20regular%20expression%20is%20a,For%20a%20brief%20introduction%2C%20see%20&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;JS - &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"&gt;https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PHP - &lt;a href="https://www.php.net/manual/en/reference.pcre.pattern.syntax.php"&gt;https://www.php.net/manual/en/reference.pcre.pattern.syntax.php&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Java - &lt;a href="https://www.w3schools.com/java/java_regex.asp"&gt;https://www.w3schools.com/java/java_RegEx.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Golang - &lt;a href="https://golang.org/pkg/regexp/syntax/"&gt;https://golang.org/pkg/RegExp/syntax/&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Online Tool - &lt;a href="https://regex101.com/"&gt;https://RegEx101.com/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>regex</category>
      <category>php</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
