vendredi 27 février 2015

Java Regex Parsing Sl1 Language?

I am trying to parse something by using Java Regex. I need to remove comments.



*TITLE CALC_ULSG_LINE
************************************************************************
***GA
* CALC_ULSG_LINE
*
* THIS PROCEDURE PERFORMS A CALCULATION TO CONVERT THE DMS-1U
* REMOTE CARRIER URBAN (RCU) SHELF, CARD (LINE CARD CARRIER),
* AND UNIT NUMBERS TO THE RCU LINE SUBGROUP AND LINE NUMBERS.
*
* THE INPUT IS THE SHELF, CARD, AND UNIT NUMBERS STORED IN
* THREE VARIABLES.
*
* THE OUTPUT IS THE LINE SUBGROUP AND LINE NUMBERS STORED IN ONE
* VARIABLE.
*
* IF THE INPUT CONTAINS INVALID NUMBERS, THE PROCEDURE RETURNS
* .FAIL.
**** COMMAND
***********************************************************************


As you see from above, Comment parts starts with * or more than one * for each line and after that it can be used whitespace(It is optional),and then it can be used any character. I want to remove everything inside of the stars.


I assigned this comment part to String and i am processing String line by line. I want to create generic pattern for every line.


Aucun commentaire:

Enregistrer un commentaire