By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,290 Members | 1,263 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,290 IT Pros & Developers. It's quick & easy.

Regex help needed

P: n/a
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.

Feb 14 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

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

Feb 14 '06 #2

P: n/a
"circuit_breaker" <ci*************@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

Feb 14 '06 #3

P: n/a

"Armin Zingler" <az*******@freenet.de> wrote in message
news:ul*************@TK2MSFTNGP12.phx.gbl...
"circuit_breaker" <ci*************@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

Feb 15 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.