Chip,

I think what you want is to parse the path into its component parts.

This this pattern for matching:

([ \w\d-_]+):

This will match letters, numbers, spaces, underscores and dashes up to the
semi colon. You will want to use it in a loop like so:

$pattern:="([ \\w\\d-_]+):"
$start:=1
While(Match regex($patters;$text;$start;$aPos;$aLen))  //  pass arrays for
pos and len

//  $aLen[0]  will be the length of the entire match

// $aLen[1] will be the length of the match within the parens

APPEND TO ARRAY($aTheParts;Substring($text;$aPos{1};$aLen{1})

$start:=$aPos{0}+$aLen{0}  // move up to the next match

End while


On Wed, Nov 28, 2018 at 9:51 AM Chip Scheide via 4D_Tech <
4d_tech@lists.4d.com> wrote:

> can anyone who has a clue help me?
>
> I am looking at some code:
> Match regex($folderPathMotif;$File_Path;1;$path_pos;$path_len)
>
> where:
> ARRAY LONGINT($path_pos;0)
> ARRAY LONGINT($path_len;0)
> $folderPathMotif:="(.*:)"
> and
> File_Path is, well.., a file path on a Mac (so folder separator is ":")
>
> When the above regex runs, $Path_pos and $path_len each have 1 element,
> and that element is a reference to the LAST occurrence of ":" in the
> file path.
>
> Why does the regex not populate the arrays with the location of ALL
> occurrences of ":", or the first occurrence of ":"?
>
> Thanks for any help...
> and off Nug help is fine
> ---------------
> Gas is for washing parts
> Alcohol is for drinkin'
> Nitromethane is for racing
> **********************************************************************
> 4D Internet Users Group (4D iNUG)
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
> **********************************************************************



-- 
Kirk Brooks
San Francisco, CA
=======================

*We go vote - they go home*
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to