Babi Astimal Astimal

Greenhorn
+ Follow
since Aug 06, 2019
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Babi Astimal Astimal

I have this message fault error:

Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.lang.NullPointerException
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at rexdemo4$Group.<init>(rexdemo4.java:41)
at rexdemo4.<clinit>(rexdemo4.java:28)



sorry I have to put the whole code thanks to correct me :

5 hours ago
hi Knute Snortum:

yes I have already started using textarea from my first message :

textarea.append().



Now how to put or call bellow code inside  the code listed above ?

6 hours ago
hi Knute Snortum  :

I have followed your advices from the begining

I have followed carey's advices also that was the answer listed bellow :


This is my approach to handling multiple regex's: I built a helper class called "Group" that is easily processed in a loop. And to reiterate: no GUI and no formatted output at this point.



I have posted more codes which show that i'm trying to do something.

carey code work fine but I can't find how to keep it and add textarea and button tha's why I asked help.



1 day ago
hi carey:

your code work fine I didn't pay attention all INFOP are gathered at once .

now just for design purpuse I want my result will be displayed inside JtextArea with  use of JRadioButton  in order to get bellow  information can you help us ?


LEVELINFO=DATA=INFO-0&&NAME=EQUIP&&VERAT2=v22&&CMD4= BYTE
LEVELINFO=DATA=INFOG-0&&MAC1=$1&&MAC2=IPARP  
LEVELINFO=DATA=INFOT-0  
LEVELINFO=DATA=INFOC-0&&ADRS=1&&4
LEVELINFO=DATA=IINFOP-0-0 &&NAMEPLAT=EQUIPW&&TI 0+&&VAL1=10&&VAL2=11&&13

thanks
2 days ago
hi Carey:

lines are  just  long for explanation purpuse  but it is noted .

1/ can you explain the use of breck in your code ?




2/  how to make a list of all found groups and then provide logic to pick the groups you want to print to a txt file?

thanks
2 days ago
hi Carey:

it works fine thanks a lot of .

I have two other questions :

1/   now I will add another regx but I want to make a loop to parse all   ( INFOP-) at once because the code display only  INFOP-0-0  and stop .

NB: INFOZ and INFOY  and INFOD their  related REGX will be added later and may be it is the same case with INFOP ( trough a loop)

I will add a new text file to explain that  ( https://www.cjoint.com/c/IHwmfnn17J5).

firstly bellow what I did:





2/  can we count the number of  EQUIPW by taken as condition only the last char ( W) .

for example in my DATA1 there is two EQUIPW  so I put the result in Jedittext or jlable ( found two )

if I change EQUIPW by EQUIPZ now the last char is changed to Z I will get ( one found EQUIPZ )

thanks


2 days ago
hi :

I have tried with this :

(?<infoc>INFOC-\\d{1,3})\\s+(?<adrs1>\\d{1,3}+).*" + NL  (  work fine ).

but secand and third not OK .



thanks
5 days ago
hi all:

the problem was in space now the first regx and second are workin fine .



2/ I'm working now on the third REGX but it is not working:



in order to have this :

LEVELINFO=DATA=INFOC-0&&ADRS=1&&4

Im' triying to get the first number which is 1 and the lasr number which is 4  from ADRS


6 days ago
hi all:

after made some correction only first REGX1 is displayed , but REXG2 no .

NB:  I use graphic to copy the final script from textarea at the end to notepad and save it for further use.

1 week ago
hi :

I did bellow code but I have defined macher1 to the pattern another fault was raised ( scanner closed):



1 week ago
hi :


I need to kown how to correct the Regx in order to add group name for INFO-:



thanks

1 week ago
hi Carey :

it works now but there is always new issue :

see bellow printout:



how to get the INFO- in order to have :

LEVELINFO=DATA=INFO-0&&NAME=EQUIP&&VERAT2=v22&&CMD4= BYTE .

2/  when I put textArea I have always bellow fault code :




3 /  see bellow new code :



thanks

1 week ago
hello:

even with naming group nothing is displayed (even  the complication work 100%).




thanks
1 week ago
hi all:

now it works after have added \\r? inside regx .

I'm experiencing two problem now I didn't notice before :

1/  after the word  INFO- ( after dash the value change ) it can be INFO-0  or INFO-1  or INFO-60. I have changed the  REGX but nothing was displayed .

the value of INFO-0 is not parsed in order to get :

( LEVELINFO=DATA=INFO-0&&NAME=EQUIP&&VERAT2=v22&&CMD4= BYTE )



2/ when I put texTarea.append( "LEVELINFO=DATA=" + matcher.group( "name" ) );  instead of  System.out.println( "LEVELINFO=DATA=" + matcher.group( "name" ) );


fault code listed bellow is raised :
             




the full code is listed bellow:



thanks for support and suggestion .
1 week ago
hi again:

I did what was recomanded the problem still the same nothing was displayed .



NB: I put my text file in the link listed bellow:

https://www.cjoint.com/c/IHopJI1ik6A

thanks
1 week ago