https://software.codidact.com/categories/38/tags/3326.rssNew Posts Tagged 'regex' - Software DevelopmentSoftware Development - Codidact2023-10-06T17:11:26Zhttps://software.codidact.com/posts/289909Advanced Regex extension for VS Codematthewsnyderhttps://software.codidact.com/users/613082023-10-06T17:11:26Z2023-10-06T17:11:26Z<p>VS Code supports regex search, but the search/replace is UI is just a tiny dialog box. It's okay if you know regex well and the expression is not complex, but when trying to apply complicated ex...https://software.codidact.com/posts/289889Regex for simplifying Amazon product URLsmatthewsnyderhttps://software.codidact.com/users/613082023-10-04T02:01:52Z2023-10-04T07:57:56Z<p>Amazon product URLs are often very long, but on experimentation it is revealed that the following pattern is sufficient:</p>
<pre><code>https://www.amazon.com/{dp|gp}/$ID
</code></pre>
<p><co...https://software.codidact.com/posts/286570Vim: how to search for all instances of a string, except for those that are between two specific stringsTrevorhttps://software.codidact.com/users/542402022-06-10T05:07:27Z2022-06-10T16:55:43Z<p>Using Vim, I am trying to search for all instances of a specific string, except for those that fall somewhere in between two other specific strings.</p>
<p>For example, I want to determine all ...https://software.codidact.com/posts/282065What does the "\s" shorthand match?hkotsubohttps://software.codidact.com/users/530782021-06-07T13:26:36Z2022-01-17T17:55:50Z<p>I've seen some regular expressions (regex) using <code>\s</code> when they want to match a space, but I noticed that it also matches line breaks.</p>
<p>Example: the regex <code>[a-z]\s[0-9]</c...https://software.codidact.com/posts/280956Python Regex to parse multiple "word. word. word."CodeFarmerhttps://software.codidact.com/users/537802021-03-02T20:34:31Z2021-09-16T12:26:35Z<p>I'm trying to parse lines like "THIS. THAT..OTHER " so that <code>"THIS. THAT."</code> is found. There can be more than one <code><word><dot></code> separated by a space except n...https://software.codidact.com/posts/277222How can I emulate regular expression's branch reset in Java?hkotsubohttps://software.codidact.com/users/530782020-08-11T16:21:57Z2021-06-11T18:16:03Z<p>I've got this sample regex:</p>
<pre><code class="language-java">Pattern p = Pattern.compile("(?:([aeiou]+)[0-9]+|([123]+)[a-z]+)\\W+");
</code></pre>
<p>It basically has the following...https://software.codidact.com/posts/281049How to match standard email addresses with regex?deleted user#2021-03-13T15:57:03Z2021-03-14T00:45:33Z<p>I want to match standard email syntax (lowercased English, numbers and perhaps also some hyphens and underscores) with regex for a <code>sed</code> operation that matches and changes a single em...https://software.codidact.com/posts/279593How can I write an egrep (grep -E) regexp that matches lines containing two stanzas in arbitrary order?Caninahttps://software.codidact.com/users/80492020-11-28T13:58:40Z2020-12-17T11:51:58Z<p>I have line-based data on the form</p>
<pre><code>x1=y2; a3=b4; c5=d6; ...
</code></pre>
<p>Matching this with a extended regular expression is fairly straightforward; for example, one can do...https://software.codidact.com/posts/278539How do I configure Jenkins to strip the leading “origin/” in git branch parameter?Monica Celliohttps://software.codidact.com/users/80462020-10-15T15:47:37Z2020-10-16T17:14:31Z<p>I'm using Jenkins with a branch parameter to specify the branch to build from. Other stuff downstream needs the branch name to not have the leading "origin/" -- just "feature/blah...https://software.codidact.com/posts/277896Can regex be used to check if input conforms to a very strict subset of HTML?jlahttps://software.codidact.com/users/530992020-09-03T14:28:23Z2020-09-20T05:23:16Z<p><strong>Tldr;</strong> I don't need to parse HTML, but I need to check if user submitted input conforms to a very strict subset of HTML. Can regex be a suitable tool for this?</p>
<h1>Details</h...