Recent

Author Topic: TRegExpr  (Read 994 times)

BubikolRamios

  • Sr. Member
  • ****
  • Posts: 258
TRegExpr
« on: July 19, 2018, 02:23:20 pm »
test same regex on different strings
Code: Pascal  [Select][+][-]
  1.   if re.Exec('foo') then
  2.   begin
  3.  
  4.   end
  5.   else if  re.Exec('foo1') then
  6.   begin
  7.  
  8.   end
  9.   else if  re.Exec('foo2') then
  10.   begin
  11.  
  12.   end
  13. //.....
  14.  
  15.  

How to do other way around, nice code as above ? Test same string on different regex-es ? All I can figure out is ugly subbing if - s.
« Last Edit: July 19, 2018, 02:27:18 pm by BubikolRamios »
lazarus 3.2-fpc-3.2.2-win32/win64

 

TinyPortal © 2005-2018