regex - Extract the matched pattern (Numbers +Name) in perl -


I used the pattern below to search and used string form to remove large strings. Example input string like

  loadStringCombo ('1', 10,1,10, maxcollippromboboxid, quatstyle = 'width: 50px;' quat)   

Expected Output

  (10,1,10, Maxcollippromboboxid,)   

But in this way, I'm getting the only Combobox 1 as the output.

  while (my $ st = $ str = ~ / [0-9] + [\,] [0-9] + [\,] [0-9] + [\, ] [0- 9A-ZA-Z] + [\,] / g) {my $ str3 = "Cambodia" $ cents; Push @ arry1, $ str3 "\ N"; Print @ saw1, "\ n"; Open the file, "& gt; test.txt" or $!! Print file @ arry1, "\ n"; }   

Please guide me to remove the value 10,1,10, MaxColProMcbxid.

Change this line:

  while (my $ st = $ Str = ~ / [0-9] + [[,, [0-9] + [\,] [0-9] + [\,] [0- 9A-Z-AG] + [\,]  
  By (my ($ st) = $ str = ~ / (\ d +, \ d +, \ D +, [0- 9 one-zA-Z] +,) / g) {  

Full loop:

  while ($ str = ~ / (\ D +, \ d +, \ d +, [0- 9a-zA-Z] +,) / g) {push @ ary1, "kababox $ 1"; } Use Data: Dumper; Print dumper \ @ Ary 1; Open my $ FILE, '& gt;', 'test.txt' or $!; Print $ FILE "@ arry1";    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -