title: Regex for IFC with array attributed
body: <p>IFC is a variation of STEP files used for construction projects. The IFC contains information about the building being constructed. The file is text based and it easy to read. I am trying to parse this information into a python dictionary.
  The general format of each line will be similar to the following</p>
  <h1>2334=IFCMATERIALLAYERSETUSAGE(#2333,.AXIS2.,.POSITIVE.,-180.);</h1>
  <p>ideally this should be parsed int #2334, IFCMATERIALLAYERSETUSAGE, #2333,.AXIS2.,.POSITIVE.,-180.
  I found a solution <a href="https://stackoverflow.com/questions/41715407/regex-includes-two-matches-in-first-match">Regex includes two matches in first match</a>
  <a href="https://regex101.com/r/RHIu0r/10" rel="nofollow noreferrer">https://regex101.com/r/RHIu0r/10</a> for part of the problem.
  However, there are some cases the data contains arrays instead of values as the example below</p>
  <h1>2335=IFCRELASSOCIATESMATERIAL('2ON6$yXXD1GAAH8whbdZmc',#5,$,$,(#40,#221,#268,#281),#2334);</h1>
  <p>This case need to be parsed as #2335, IFCRELASSOCIATESMATERIAL, '2ON6$yXXD1GAAH8whbdZmc', #5,$,$, [#40,#221,#268,#281],#2334
  Where [#40,#221,#268,#281] is a stored in a single variable as an array
  The array can be in the middle or the last variable.</p>
  <p>Would you be able to assist in creating a regular expression to obtain desired results
  I have created <a href="https://regex101.com/r/mqrGka/1" rel="nofollow noreferrer">https://regex101.com/r/mqrGka/1</a> with cases to test</p>