|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Regex help neededHi,
I'm trying to build a Regex expression that will extract the variable name from a COBOL layout. As an example, the Regex expression would operate as follows: 05 WS-MANUF-NAME-LEVEL2 PIC X(15) would become: WS-MANUF-NAME-LEVEL2 Thanks in advance. circuit_breaker wrote:
> Hi, If I remember my COBOL right, the level number is always two digits,> > I'm trying to build a Regex expression that will extract the variable > name from a COBOL layout. As an example, the Regex expression would > operate as follows: > > 05 WS-MANUF-NAME-LEVEL2 PIC X(15) > > would become: > WS-MANUF-NAME-LEVEL2 and variable names aren't allowed spaces. This quickly gives us \s*\d\d\s*(\S*)\s*.* which reads: some whitespace a digit a digit some whitespace any number of non-whitespace characters <------ remember this part of the match some whitespace anything else -- Larry Lard Replies to group please
Show quote
Hide quote
"circuit_breaker" <circuit_brea***@canada.com> schrieb I don't see the relation to the VB.Net language. RegEx are a part of the > Hi, > > I'm trying to build a Regex expression that will extract the > variable name from a COBOL layout. As an example, the Regex > expression would operate as follows: > > 05 WS-MANUF-NAME-LEVEL2 PIC X(15) > > would become: > WS-MANUF-NAME-LEVEL2 > > Thanks in advance. > Framework. Better place to ask: microsoft.public.dotnet.framework. You'll benefit from all the none-VB-ers, too. Armin
Show quote
Hide quote
"Armin Zingler" <az.nospam@freenet.de> wrote in message Ornews:ulc5hYXMGHA.140@TK2MSFTNGP12.phx.gbl... > "circuit_breaker" <circuit_brea***@canada.com> schrieb >> Hi, >> >> I'm trying to build a Regex expression that will extract the >> variable name from a COBOL layout. As an example, the Regex >> expression would operate as follows: >> >> 05 WS-MANUF-NAME-LEVEL2 PIC X(15) >> >> would become: >> WS-MANUF-NAME-LEVEL2 > I don't see the relation to the VB.Net language. RegEx are a part of the > Framework. Better place to ask: microsoft.public.dotnet.framework. You'll > benefit from all the none-VB-ers, too. ^\([! ]*\) \([! ]*\) ?* \2 |
|||||||||||||||||||||||