Hi There I were wondering if anyone can help me with a regex
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 9 textfields that I can place into my database
(#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#),
(#text1#,#text2#,#text3#,#text4#,#), <<<--- String breaks and mess up my insert
(#text1#,#text2#,#text3#,#text4#,#text5#,#text6#, #text7#, #text8#, #text9#);
Is there a way that I can write a regex to delete if the line is not having a start tag ( and and end * edit ** The lines will always have the start tag (# and always have a closing tag #)
I have tried /^(#.?#,#.?#,#.?#,#.?#,#.?#,#.?#,#.?#,#.?#,#.*?#)$/ig
but do not really have an idea how to do it?
Can anyone please help me...
I have created a page where you can insert a REGEX to see if your solution workds