Home All Groups Group Topic Archive Search About
Author
14 Feb 2006 12:07 PM
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.

Author
14 Feb 2006 12:14 PM
Larry Lard
circuit_breaker wrote:
> 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

--
Larry Lard
Replies to group please
Author
14 Feb 2006 2:39 PM
Armin Zingler
Show quote Hide quote
"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
>
> 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
Author
15 Feb 2006 2:00 AM
Homer J Simpson
Show quote Hide quote
"Armin Zingler" <az.nospam@freenet.de> wrote in message
news: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.

Or

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

\2