On Mon, May 29, 2017 at 8:29 PM, Tim Nevels via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> $regexPattern_t:="what do I put here"
>

Tim,

Try

SP_(\D{3}_|)(\d{2})(\d{2})(\d{2})
with properly escaped backslashes, it means
regexPattern_t:="SP_(\\D{3}_|)(\\d{2})(\\d{2})(\\d{2})"

This should catch for groups, first is empty or INS_ (with trailing _, was
lazy to remove it) and three groups of two digits each.
Test following code:
ARRAY TEXT($at;6)

$at{1}:="SP_050317"
$at{2}:="SP_050417"
$at{3}:="SP_050517"
$at{4}:="SP_INS_050317"
$at{5}:="SP_INS_050417"
$at{6}:="SP_INS_050517"

ARRAY LONGINT($start;0)
ARRAY LONGINT($len;0)

For ($i;1;6)
  $b:=Match
regex("SP_(\\D{3}_|)(\\d{2})(\\d{2})(\\d{2})";$at{$i};1;$start;$len)
  If ($b)
    $prefix:=Substring($at{$i};$start{1};$len{1}
    $day:=Substring($at{$i};$start{2};$len{2})
    $month:=Substring($at{$i};$start{3};$len{3})
    $year:=Substring($at{$i};$start{4};$len{4})
  End if
End for

-- 

Peter Bozek
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to