sed - regex idiom for excluding word while matching other conditions -


The problem is as follows: I need to match every line:

  • starts with
  • tags ; & Gt; <

    & lt; Div & gt; BubbleBall & lt; / Div & gt; BubbleBall & lt; / S & gt; & Lt; Div & gt; BubbleBall & lt; / Div & gt; & Lt; S & gt; BubbleBall & lt; / S & gt;

    I pre negative Lukahed and wildcard

    <> ^ & lt; Trying to insert (?!?! & Lt; s & gt;).) * & Lt; / S & gt; $

    And thought about it, but there is no success so far. I am also aware of

      grep -v  

    but I have a pure regex phrase that I can use in other references (e.g.

You can use the following regex:

  ^ (?. *  gt; & gt;) * * & Lt; / S & gt; $  

Explanation :

  ^ # is not the beginning of the string (?! # Is not it, to see if the :. * # \ n excluding any character (0 or more times) & lt; s & gt; # '& lt; s & gt;') # finally look forward & LT; # '& Lt;' . * # Excluding any character \ n (0 or more times) & lt; / S & gt; # '& Lt; / S & gt; $ # You can use the  -P  option before using an option \ n before, and end of string  

grep Which explains the pattern as a Pearl regular expression.

  grep -p '^ (?!. * Lt; H & gt;) & lt ;. * & Lt; / S & gt; $ ' 

You want to exclude on the left, ( is saying, throwing this garbage ) and referring to the place that you Capture group on the right side.

  ^. * Lt; S & gt; * | (& Lt .. * & lt; / a & gt;) $  


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -