I want to insert the following into a database:
(#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#), (#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#), (#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#);
but sometimes I will not have nine textfields that I can place into my database; e.g.
(#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#), (#text1#,#text2#,#text3#,#text4#,#), <<<--- String breaks and messes up my insert (#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#);
What regex will delete lines with fields that don't have both start and end tags? Edit: The lines themselves will always have the start tag (#
and the closing tag #)
.
I tried /^\(#.*?#,#.*?#,#.*?#,#.*?#,#.*?#,#.*?#,#.*?#,#.*?#,#.*?#\)$/ig
but it didn't work.
I created a page where you can insert a regex to see if your solution works.