Regex help needed

C

circuit_breaker

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.
 
L

Larry Lard

circuit_breaker said:
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

If I remember my COBOL right, the level number is always two digits,
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
 
A

Armin Zingler

circuit_breaker said:
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.


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.


Armin
 
H

Homer J Simpson

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.

Or

^\([! ]*\) \([! ]*\) ?*

\2
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top