A
ACalafiore
Guest
I don't know if this is the correct forum where to ask about Regex or even if there is one. but I'll try.
I need to analyze a list of text parameters so i choose to use Regex to identify them. But now that I'm trying it out there is one that matches only on the second match. How can I put the results in the first one?
Regex: (??<c>\s*(?:[c]|(?<isCircularStringList>[C]))\s*\((?<stringList>(?:[^ "]*(?: [^ "]*)*)|(?:"[^"]*"\s*)*)\)\s*)|(?<cm>cm\s*=\s*(?<stringListMessageCode>\d{1,8})\s*)|(?<d>\s*d=(?<decimalDigits>\d{1,6})\s*)|(?<f>[f|F]=?\s*(?<frame>\d{1,3})(?:\s*,\s*(?<mainFrameColor>\d{1,6}))?(?:\s*,\s*(?<secondaryFrameColor>\d{1,6}))?\s*)|(?<fn>fn\s*=?\s*(?<labelFont>\d{1,2})?\s*,?\s*(?<fieldFont>\d{1,2})?\s*)|(?<h>\s*h\s*\(\s*"(?<macroEditorFieldText>[^ "]*)"(?:\s *,\s * (?<macroEditorFieldDigits>\d{1,2}))?\s*\)\s*)|(?<i>\s*[i|I]\s*\((?<iconList>\d{1,6}(?:\s*,\s*\d{1,6})*\s*))|(?<m>\s*m\s*=\s*(??<min>(?<isNegative>-)?(?<variableType>[vVdDwW])?(?<minValue>\d+\.?\d*))|(?<minAlias>[^\s,]*)\s*))|(?<M>\s*M\s*=\s*(??<max>(?<isMaxNegative>-)?(?<maxVariableType>[vVdDwW])?(?<maxValue>\d+\.?\d*))|(?<maxAlias>[^\s,]*)\s*))|(?<ms>ms\s*=\s*(?<labelMessageCode>\d{1,8})\s*)|(?<o>o\s*=\s*(?<serializedPageOffsetMultiplier>\d{1,6})?\s*,?\s*(?<serializedPageOffsetSubtrahend>\d{1,6})?\s*)|(?<O>O\s*=\s*(?<offsetExpression>[^\s,]*))|(?<q>\s*q(?<optimizeLabelText>!(?<optimizeFieldText>!)?)?\s*=\s*(?<verticalLabelLocationExpression>[^\s,]*)\s*,\s*(?<hLabelLocationExpression>\d+)[^\s,]*,\s*(?<verticalFieldLocationExpression>[^\s,]*)\s*,\s*(?<hFieldLocationExpression>[^\s,]*)\s*,\s*(?<fieldLength>\d+))|(?<r>\s*[r|R]\s*)|(?<s>s\s*=?\s*(?<stringLength>\d{1,3})\s*)|(?<y>y\s*=\s*(?<lsPageOffsetMultiplier>\d{1,6})?\s*,?\s*(?<lsPageOffsetSubtrahend>\d{1,6})?\s*)|(?<Y>Y\s*=\s*(?<labelOffsetExpression>[^\s,]*))|(?<x>\s*x\s*))+
Text to analyze: fn=53,53 q=128,24,128,637,8, c("alpha beta" "gamma" "pluto")
I use this tool to debug but I'm not able to make the Regex match everything in a single Match: Regex101 - online regex editor and debugger
Hope you can help me, I just started using regex. Thank in advance,
Andrea
Continue reading...
I need to analyze a list of text parameters so i choose to use Regex to identify them. But now that I'm trying it out there is one that matches only on the second match. How can I put the results in the first one?
Regex: (??<c>\s*(?:[c]|(?<isCircularStringList>[C]))\s*\((?<stringList>(?:[^ "]*(?: [^ "]*)*)|(?:"[^"]*"\s*)*)\)\s*)|(?<cm>cm\s*=\s*(?<stringListMessageCode>\d{1,8})\s*)|(?<d>\s*d=(?<decimalDigits>\d{1,6})\s*)|(?<f>[f|F]=?\s*(?<frame>\d{1,3})(?:\s*,\s*(?<mainFrameColor>\d{1,6}))?(?:\s*,\s*(?<secondaryFrameColor>\d{1,6}))?\s*)|(?<fn>fn\s*=?\s*(?<labelFont>\d{1,2})?\s*,?\s*(?<fieldFont>\d{1,2})?\s*)|(?<h>\s*h\s*\(\s*"(?<macroEditorFieldText>[^ "]*)"(?:\s *,\s * (?<macroEditorFieldDigits>\d{1,2}))?\s*\)\s*)|(?<i>\s*[i|I]\s*\((?<iconList>\d{1,6}(?:\s*,\s*\d{1,6})*\s*))|(?<m>\s*m\s*=\s*(??<min>(?<isNegative>-)?(?<variableType>[vVdDwW])?(?<minValue>\d+\.?\d*))|(?<minAlias>[^\s,]*)\s*))|(?<M>\s*M\s*=\s*(??<max>(?<isMaxNegative>-)?(?<maxVariableType>[vVdDwW])?(?<maxValue>\d+\.?\d*))|(?<maxAlias>[^\s,]*)\s*))|(?<ms>ms\s*=\s*(?<labelMessageCode>\d{1,8})\s*)|(?<o>o\s*=\s*(?<serializedPageOffsetMultiplier>\d{1,6})?\s*,?\s*(?<serializedPageOffsetSubtrahend>\d{1,6})?\s*)|(?<O>O\s*=\s*(?<offsetExpression>[^\s,]*))|(?<q>\s*q(?<optimizeLabelText>!(?<optimizeFieldText>!)?)?\s*=\s*(?<verticalLabelLocationExpression>[^\s,]*)\s*,\s*(?<hLabelLocationExpression>\d+)[^\s,]*,\s*(?<verticalFieldLocationExpression>[^\s,]*)\s*,\s*(?<hFieldLocationExpression>[^\s,]*)\s*,\s*(?<fieldLength>\d+))|(?<r>\s*[r|R]\s*)|(?<s>s\s*=?\s*(?<stringLength>\d{1,3})\s*)|(?<y>y\s*=\s*(?<lsPageOffsetMultiplier>\d{1,6})?\s*,?\s*(?<lsPageOffsetSubtrahend>\d{1,6})?\s*)|(?<Y>Y\s*=\s*(?<labelOffsetExpression>[^\s,]*))|(?<x>\s*x\s*))+
Text to analyze: fn=53,53 q=128,24,128,637,8, c("alpha beta" "gamma" "pluto")
I use this tool to debug but I'm not able to make the Regex match everything in a single Match: Regex101 - online regex editor and debugger
Hope you can help me, I just started using regex. Thank in advance,
Andrea
Continue reading...