Results 1 to 6 of 6

Thread: Analyze COBOL source with Regex

  1. #1
    Join Date
    Dec 2009
    Posts
    178

    Analyze COBOL source with Regex

    Hello,
    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. #2
    Join Date
    Nov 2009
    Posts
    583

    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 );
    - ^ \ \ p (Space) * to recognize "white" before the line
    - 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. #3
    Join Date
    Dec 2009
    Posts
    292

    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. #4
    Join Date
    Dec 2009
    Posts
    178

    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. #5
    Join Date
    Dec 2009
    Posts
    292

    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. #6
    Join Date
    Nov 2009
    Posts
    518

    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.

Similar Threads

  1. How to analyze BSOD Kernel Dump
    By Dwarner in forum Operating Systems
    Replies: 5
    Last Post: 23-03-2010, 08:57 AM
  2. How to Analyze Downloads from Internet
    By CAILYN in forum Networking & Security
    Replies: 5
    Last Post: 06-03-2010, 12:05 PM
  3. 3d analyze emulator for Windows
    By Deepest BLUE in forum Windows Software
    Replies: 5
    Last Post: 22-01-2010, 06:21 AM
  4. Debugging mode in Cobol
    By Fragman in forum Software Development
    Replies: 5
    Last Post: 02-01-2010, 02:27 PM
  5. Analyze your disk depth with Xinorbis
    By SoftwareGuy in forum Tips & Tweaks
    Replies: 1
    Last Post: 20-02-2009, 11:40 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,399,280.66239 seconds with 17 queries