I'm needing to get the information between /** and private ([var]); and parse it into an array for a js program.
I'm currently using this regex but having problems with it.
UPDATE: So some people have asked me what do I need this for, well to cut a long story short I need to mirror the information that the php crud generator sends through to the main class. Once I can get the annotations and the var names parsed into an array, Then I'll use that to generate (Something). So what I'm needing exactly is to first step: regex that gets everything between /** to private $(...); The problem is that the regex pull in the first annotation /** to the very last private var. so i just need something in my rexex that breaks each annotation up before further processing.
var myRegexp = /\/\*\*([\s\S\w\W\d\D]+)\*\/([\s]+)private ([\w\W\d\D]+);/g;
match = myRegexp.exec(entityString);
/**
* @var string
*
* @ORM\Column(name="var_1", .....)
*/
private $var1;
/**
* @var string
*
* @ORM\Column(name="document_path", ......)
*/
private $documentPath;
/**
* @var string
*
* @ORM\Column(name="document_type", .....)
*/
private $var2;
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="NONE")
*/
private $id;
/**
* @var \......\Entity\SomeEntity
*
* @ORM\ManyToOne(.....)
* @ORM\JoinColumns({
* @ORM\JoinColumn(......)
* })
*/
private $var3;