473,785 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regex help needed

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
3 1174

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
"circuit_breake r" <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.publi c.dotnet.framew ork. You'll
benefit from all the none-VB-ers, too.
Armin

Feb 14 '06 #3

"Armin Zingler" <az*******@free net.de> wrote in message
news:ul******** *****@TK2MSFTNG P12.phx.gbl...
"circuit_breake r" <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.publi c.dotnet.framew ork. You'll
benefit from all the none-VB-ers, too.


Or

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

\2

Feb 15 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
5730
by: alphatan | last post by:
Is there relative source or document for this purpose? I've searched the index of "Mastering Regular Expression", but cannot get the useful information for C. Thanks in advanced. -- Learning is to improve, but not to prove.
4
1517
by: H | last post by:
This is kind of an followup on oneof my previous questions, and it has with RegEx to do. I have a string containing of several words. What would a good regex expression looklike to get one match on every word ? For example : String myString =" This is the string that stupid H can't split up"; // A good RegEx needed here .. So the result would look something like this ;
2
6844
by: D | last post by:
My first attempt at this and I'm searching formulas like so RIGHT(TEXT(A15,'yy'),1)*1000+A15-CONCATENATE(1,'-','jan','-',TEXT(A15,'yy'))+1 I want to extract the row / col coordinates (A15 in above) so I'm using this +\d+\d* however I want unique ones and not 3 copies of A15 as the above returns.
17
1656
by: steve | last post by:
here's the deal...cvs, tick encapsulted data. trying to use regex's to validate records. here's an example row: 'AD,'BF','132465','06/09/2004','','BNSF','A','TYPE','1278','','BR','2999','' ,'LX','','01','09','1','','','','','','','','','CUSTOM JOB CODE TEST' record type is in the 8th column ('1278'). using regex b/c there are a miriad of types that cause other data w/n the record (or related records) to be in/valid. i'm having problems...
4
3076
by: Ya Ya | last post by:
Hi, I have a string with some fixed text and variable text. For example: "this is a fixed text THE NEEDED INFO more more fixed text". How do I get the the variable text (THE NEEDED INFO) from this string ? A simple example will help. Thanks. ra294@hotmail.com
5
1774
by: lgbjr | last post by:
Hello All, I have the following type of string: "X:Y\Z.exe" "123" What I need is an array of strings with the information from within each set of quotes. I was trying to use a Regex.Split, but I can't figure out how to escape a quote. The closest I got was Regex.split(String,"(\"")"), which gives me an array of strings: "X:Y\Z.exe
13
2378
by: Chris Lieb | last post by:
I am trying to write a regex that will parse BBcode into HTML using JavaScript. Everything was going smoothly using the string class replace() operator with regex's until I got to the list tag. Implementing the list tag itself was fairly easy. What was not was trying to handle the list items. For some reason, in BBcode, they didn't bother defining an end tag for a list item. I guess that they designed it with bad old HTML 3.2 in mind...
4
2798
by: ad | last post by:
I am useing VS2005 to develop wep application. I use a RegularExpress both in RegularExpressionValidator and Regex class to validate a value. The RegularExpress is 20|\-9|\-1|?\d{1} When I enter 33 and validate with RegularExpressionValidator, it fail to pass. But when I validate with regex class : Regex.IsMatch(Sight0L, @"20|\-9|\-1|?\d{1}");
3
1932
by: | last post by:
I'm analyzing large strings and finding matches using the Regex class. I want to find the context those matches are found in and to display excerpts of that context, just as a search engine might. In terms of code, what's the easiest way to make that happen? The code below works fine for identifying the matches, but it doesn't try to extract the surrounding context or display it: currPageText = numberOfMatches =...
4
1950
by: Flomo Togba Kwele | last post by:
I am having difficulty writing a Regex constructor. A line has a quote(") at its beginning and its end. I need to strip both characters off. If the line looks like "1", I need the result to be 1. If it were sed, I could just do s/^"// and s/"$//, but I'm confused with the quote escape characters. Also, can I do both replacements at once? I tried:
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9959
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8988
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.