Italian regex.split - Filippo (first post)    Dec 04, 2023 Se vuoi un risultato del genere, allora dovresti scrivere così:
Dim components() As String
components = Regex.Split(",", "1,2,3,4")
For i = 0 To components.Length - 1
Log("components-" & i & "=" & components(i))
Next
Log: B4J Question how to find intervals i a string? - emexes (first post)    Dec 22, 2024   (1 reaction) I usually use Regex.Split because it puts all the fields (substrings) into an array ready for whatever the next processing step is.
The .Trim removes leading and trailing spaces.
You can just as easily use commas or semicolons or tabs as separators. Bug? Regex.Split - DonManfred (first post)    Mar 05, 2016   (4 reactions) "." is a special char and need to be escaped.
Dim Pass2() As String
Pass2=Regex.Split("\.","1111.1963")
Log("PassSize="&Pass2.Length)
For i = 0 To Pass2.Length-1
Log($"Pass ${Pass2(i)}"$)
Next B4A Question Regex.Split - DonManfred (first post)    Apr 06, 2017   (2 reactions) See https://en.wikipedia.org/wiki/Regular_expression
\n is a special command. I guess you need to escape it.
Dim s() As String = Regex.Split("\\n", "test\ncon virgola\ntest split")
Log(s.Length) B4A Question Split string from "-" to "-" - DonManfred (first post)    Nov 14, 2022   (1 reaction) CA100 is the SECOND value! Regex starts at the first - to split. means:
1st item is an empty string,
2nd Item CA100,
3rd Item ISTITUTO PERTINI VIA CARPACCIO N° 18 A
and 4th item N° 1 CHIAVE MECCANICA
Dim strBeforeSplit As String
strBeforeSplit="-CA100-ISTITUTO PERTINI VIA CARPACCIO N° 1 B4A Question The MySQL statement cannot find a result when searching for c based on the specified conditions a and b... - walt61 (first post)    Oct 26, 2024   (1 reaction) That would be regex.split(...) 'or regex.split2(...) B4J Tutorial [BANano] [VuetifyAD3] Small solutions to development hitches (Tricks and tracks) - Star-Dust (first post)    Jan 24, 2022   (4 reactions) REGEX SPLIT
I have found it very difficult to get SPLIT and REGEX generally seems like a complicated thing.
You will find following code suggested in several posts to get REGEX functions
From here
Dim str As String = "This is a test I'm doing to split a sentence into words."
Dim RegExp As B B4A Question load data into memory - William Lancee (first post)    Mar 16, 2021   (1 reaction) Caution with Regex.Split, it ignores trailing empty fields, leaving the number of fields per line short.
It is better to use StringUtils.LoadCSV or CSVParser, as @Erel recommended. B4J Question regex split a textarea to line by line - Erel (first post)    Dec 02, 2018   (1 reaction) Regex will not help here. The string itself is made of two lines.
You can disable text wrapping and it will then match the displayed text. B4A Question downloaded file to a list - a2stepper (first post)    Feb 10, 2015   (1 reaction) Man!!! then REGEX.Split is to simple, working in 5 minutes.
i've been spending last 3 hours trying to split using all sorts of mid left and right of string.
thanks. Page: 1   2   3   4   5   6   7   Powered by ColBERT |