Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7034649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:12:42+00:00 2026-05-28T01:12:42+00:00

I want a regular expression to extract text between EVALUATE and END-EVALAUTE or .

  • 0

I want a regular expression to extract text between EVALUATE and END-EVALAUTE or . which ever comes first.

Presently i am using regular expression:

EVALUATE\\s*(((?!EVALUATE|(END-EVALUATE|\\.)).)+)\\s*(END-EVALUATE|\\.)

But my problem is i do not want to consider . if it comes within double quotes.

Please suggest any better regular expression or correct the one i have mentioned above.

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T01:12:43+00:00Added an answer on May 28, 2026 at 1:12 am

    You could try this:

    EVALUATE("[^"]*"|((?!EVALUATE|END-EVALUATE)[^."])+)*(END-EVALUATE|\.)
    

    A Java demo:

    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    public class Main {
        public static void main(String[] args) throws Exception {
    
            String src =
                    "    EVALUATE WS-ADDITIONAL-FILE-WORK                           \n" +
                    "            WHEN \"ACCNT\"                                     \n" +
                    "                IF LINK-TRIG-FILE-NAME NOT = \"ACTMSTR   \"    \n" +
                    "                PERFORM 04510-GET-ACCOUNT-MASTER               \n" +
                    "                ELSE                                           \n" +
                    "                MOVE \"0106H\"             TO WS-ERROR-CODE    \n" +
                    "                PERFORM 09000-PROCESS-ABORT-ERROR              \n" +
                    "                END-IF                                         \n" +
                    "             WHEN \"ADDRM\"                                    \n" +
                    "                 IF LINK-TRIG-FILE-NAME NOT = \"ADDRMSTR  \"   \n" +
                    "                 IF PROGRAM-HBMS-RELEASE (1:3) > \"5.0\"       \n" +
                    "                   PERFORM 04520-GET-ADDRESS-MASTER            \n" +
                    "                 END-IF                                        \n" +
                    "                 ELSE                                          \n" +
                    "                   MOVE \"0106H\"        TO WS-ERROR-CODE      \n" +
                    "                 PERFORM 09000-PROCESS-ABORT-ERROR             \n" +
                    "                 END-IF                                        \n" +
                    "             WHEN OTHER                                        \n" +
                    "                 MOVE \"0106F\"             TO WS-ERROR-CODE   \n" +
                    "                 PERFORM 09000-PROCESS-ABORT-ERROR             \n" +
                    "    END-EVALUATE.                                                ";
    
            Matcher m = Pattern.compile("EVALUATE(\"[^\"]*\"|((?!EVALUATE|END-EVALUATE)[^.\"])+)*(END-EVALUATE|\\.)").matcher(src);
    
            while(m.find()) {
                System.out.println(m.group());
            }
        }
    }
    

    which prints:

    EVALUATE WS-ADDITIONAL-FILE-WORK                           
            WHEN "ACCNT"                                     
                IF LINK-TRIG-FILE-NAME NOT = "ACTMSTR   "    
                PERFORM 04510-GET-ACCOUNT-MASTER               
                ELSE                                           
                MOVE "0106H"             TO WS-ERROR-CODE    
                PERFORM 09000-PROCESS-ABORT-ERROR              
                END-IF                                         
            WHEN "ADDRM"                                    
                IF LINK-TRIG-FILE-NAME NOT = "ADDRMSTR  "   
                IF PROGRAM-HBMS-RELEASE (1:3) > "5.0"       
                  PERFORM 04520-GET-ADDRESS-MASTER            
                END-IF                                        
                ELSE                                          
                  MOVE "0106H"        TO WS-ERROR-CODE      
                PERFORM 09000-PROCESS-ABORT-ERROR             
                END-IF                                        
            WHEN OTHER                                        
                MOVE "0106F"             TO WS-ERROR-CODE   
                PERFORM 09000-PROCESS-ABORT-ERROR             
    END-EVALUATE
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to extract text from a column using regular expressions in Oracle 11g.
My application has a feature that parses text using a regular expression to extract
Using PHP Regular Expression I want to extract some value from code <?xml version=1.0
How can I extract the word following text: using a regular expression? The input
I want a regular expression to extract the title from a HTML page. Currently
I want regular expression in ruby on rails which remove all the html tags
i want a regular expression to validate string to have only text,operators and these
I'm trying to extract/match data from a string using regular expression but I don't
I'd like to extract the text from an HTML file using Python. I want
I want the regular expression to extract the &[1], &[2},&[3],&[4] values from the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.