|
| ||||||||||
| Tags: cobol, compiled code, programming language, regular expression, source code |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Analyze COBOL source with Regex
I try to analyze a COBOL source file, I would recognize the term "PROCEDURE DIVISION. For this I use the following pattern: Pattern pattern = Pattern.compiles( "$^.*?(? i)\\bprocedure\\b.\\p (Space). (? i)\\bdivision\\b. * ", Pattern.Dotall | Pattern.MULTILINE ); This expression is preceded by white and only white. I tried without the line end and beginning of the line, nothing to do, it does not. Someone can help me? Thank you. |
|
#2
| |||
| |||
| Re: Analyze COBOL source with Regex
Hello, Proposal not guarantee the hypothesis that one or more lines are passed to the matcher Code: Pattern pattern = Pattern.compiles( "^\\p (Space) * procedure\\(p) + Space division .* $ ", Pattern.MULTILINE | Pattern.Case_insensitive ); - procedure - \ \ p (Space) + for at least one "white" - Division - $ .* To accept anything until the end of line I did not put that because I do not. between procedure and division and put case_insensitive to avoid (? i). |
|
#3
| |||
| |||
| Re: Analyze COBOL source with Regex
Hello, I was trying for a similar problem a few days before and here is the topic now, I am the interested if you have a solution for this, by the way your assumption is correct. In fact, I have forgotten the white top of the line (like what to write the problem and reread it makes a difference). Unfortunately it does not work. What is the maximum size of a String object? |
|
#4
| |||
| |||
| Re: Analyze COBOL source with Regex
Hello, After rereading my algo, I found it was not good, Our solutions are both correct . I did not put dotall because I do not. between procedure and division and put case_insensitive to avoid (? i). I at least learned how to do it. Thank you again for your availability. And if you have any other alternative solution for this then please let me know. |
|
#5
| |||
| |||
| Re: Analyze COBOL source with Regex
Hello, Thanks for your reply guys. I understand why a file of several thousand lines did not in a String. What idea indeed. It works best with an array of String. Ok, so, even i will also use the array of string now to do the things, and if you have any information about this, then please do post back. I have tried a code for this and I have got an error, but I think I can solve the error, if no then I will post here. |
|
#6
| |||
| |||
| Re: Analyze COBOL source with Regex
Hello, The problem is the same for all containers that have an index (table, CharSequence, Collection, some flows, ...) and / or table internally. But in good general index 2 ^ 31-1 (2 billion +) is already not so bad. I hope you are getting the thing what we are trying to explain to you, I recommend you to have a tutorial or a documentation on the regular expression on the how to use it with cobol programming language and then write the codes for it. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Analyze COBOL source with Regex" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to analyze BSOD Kernel Dump | Dwarner | Operating Systems | 5 | 23-03-2010 08:57 AM |
| How to Analyze Downloads from Internet | CAILYN | Networking & Security | 5 | 06-03-2010 11:05 AM |
| 3d analyze emulator for Windows | Deepest BLUE | Windows Software | 5 | 22-01-2010 05:21 AM |
| Debugging mode in Cobol | Fragman | Software Development | 5 | 02-01-2010 01:27 PM |
| Analyze your disk depth with Xinorbis | SoftwareGuy | Tips & Tweaks | 1 | 20-02-2009 10:40 AM |