const regex = new RegExp('public\\s(\\S*)\\s(\\S*)|=\\s(\\S*)|"(.*?)"', '')
const str = ` public bool ShouldMonitorSpoolFiles
{
get
{
return CheckMonitorSpoolFiles(CurrentConfiguration.POSSoftware);
}
}
public bool ExpectingEMFReceipt { get; set; }
public bool ForceEMFPrinting { get; set; }
public bool DisableEMFPrinting{ get; set; }
public bool OnlyValidDeliveryReceipt { get; set; }
public bool ShouldMonitorComPorts
{
get
{
return CheckMonitorCOMPorts(CurrentConfiguration.POSSoftware);
}
}
public static bool CheckMonitorCOMPorts(string processorName)
private string _CurrencyCode = "GBP";
public string CurrencyCode
{
get
{
return _CurrencyCode;
}
set
{
_CurrencyCode = value;
}
}
private string _DontStartasUser = "";
public string DontStartasUser
{
get
{
return _DontStartasUser;
}
set
{
_DontStartasUser = value;
}
}
public bool StartWatcherFromService { get; set; }
private string _OnlyStartasUser = "";
public string OnlyStartasUser
{
get
{
return _OnlyStartasUser;
}
set
{
_OnlyStartasUser = value;
}
}
public int FixedReceiptLineWidth { get; set; }
private string _extraNonFilteredCharactersRegex = "";
public string ExtraNonFilteredCharactersRegex
{
get
{
return _extraNonFilteredCharactersRegex;
}
set
{
_extraNonFilteredCharactersRegex = value;
}
}
`;
// Reset `lastIndex` if this regex is defined globally
// regex.lastIndex = 0;
let m;
if ((m = regex.exec(str)) !== null) {
// The result can be accessed through the `m`-variable.
m.forEach((match, groupIndex) => {
console.log(`Found match, group ${groupIndex}: ${match}`);
});
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for JavaScript, please visit: https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/Regular_Expressions