i need a suggestion on how to do this in more elegant way
i have this regex that for which every line is evaluated through a while() loop. but some lines do not contain all necesery parameters for a regex to match and therefor if a parameter Positives is missing then the whole line would be skipped and that is not good. i know i could do it by splitting a line starting with a word Identities and then extract the data from it. but there are some complication that then appear and i wish to avoid that.Identities\s+=\s+(.+)\s+\((.+)\%\),\s+Positives =\s+(.+)\s+\((.+)\%\), +\s+Negatives\s+=\s+(.+)\s+\((.+)\%\)/g
so my question is: is there a more elegant way to match a line check if parameters(in this case Identities,Negatives,Positives )exists and if some are missing just ignore that and deal with ones that do exist.
thnx
Update:
That is it dreadpiratepeter !!
thnx
In reply to Regex question by baxy77bax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |