Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing regex to find a pattern which does not start with a certain String
    primarykey
    data
    text
    <p>I need to regex-match numbers in a certain pattern which works already, but only if there is not <code>(+</code> right in front of it.</p> <p>Example Strings I want to have a valid match within: <code>12</code>, <code>12.5</code>, <code>200/300</code>, <code>200/300/400%</code>, <code>1/2/3/4/5/6/7</code></p> <p>Example Strings I want to have no valid match within: <code>(+10% juice)</code>, <code>(+4)</code></p> <p>I can already get all the valid matches with <code>(\d+[/%.]?)+</code>, but I need help to exclude the example Strings I want to have no valid match in (which means, only match if there is NOT the String <code>(+</code> right in front of the mentioned pattern).</p> <p>Can someone help me out? I have already experimented with the <code>!</code> (like <code>?!(\(\+)(\d+[/%.]?)+</code>) but for some reason I can't it to work the way I need it.</p> <p>(You can use <a href="http://gskinner.com/RegExr/" rel="nofollow">http://gskinner.com/RegExr/</a> to test regex live)</p> <p>EDIT: I did maybe use wrong words. I don't want to check if the searchstring does start with <code>(+</code> but I want to make sure that there is no <code>(+</code> right in front of my String.</p> <p>Try regexr with the following inputs:</p> <p>Match: <code>(\d+[/%.]?)+</code></p> <p>Check the checkbox for <code>global</code> (to search for more than one match within the text)</p> <p>Text:</p> <pre><code>this should find a match: 200/300/400 this shouldnt find any match at all: (+100%) this should find a match: 40/50/60% this should find a match: 175 </code></pre> <p>Currently it will find a match in all 4 lines. I want a regex that does no longer find a match in line 2.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload