2021年2月2日星期二

regular expression

The string is RMRIV43069411**2115.82

I do not know why there's asterisks in front of the 2115.82. How do I write a regular expression to get that returns only the number not the asterisks ?

The regular expression I tried is:

'''CUST_NUM_REMITT_AMT_REGEX => qr/^\w+  \w+  (.?)    (.?)$/  it is in a perl statement that is  ($edi_h{$process_data}{$get_remitt_data}{cust_num},   $edi_h{$process_data}{$get_remitt_data}{remitt_amt}) =   $rec =~ /$regex_h{CUST_NUM_REMITT_AMT_REGEX}/   if ($rec =~ /$regex_h{REMITT_IND}/);   ($edi_h{$process_data}{$get_remitt_data}{cust_num}) = " ";  '''  

This expression is returning blank customer number, but the amount has an asterisk in front of it. Is the question mark returning the result? There is this line earlier in the code '''$/ = $sav_delimiter; (@recs) = $file_data =~ /(.*?)\n/g; '''

https://stackoverflow.com/questions/66020676/regular-expression February 03, 2021 at 11:07AM

没有评论:

发表评论