techknight Well-Known Member Licensed User Longtime User Oct 1, 2020 #1 I am using a pipe | as the delimiter in regex split. But its not working. any ideas?
A arfprogramas Member Licensed User Longtime User Oct 1, 2020 #2 B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next The explanation: https://streamsets.com/documentatio...ollector/UserGuide/Apx-RegEx/RegEx-Title.html Upvote 0
B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next The explanation: https://streamsets.com/documentatio...ollector/UserGuide/Apx-RegEx/RegEx-Title.html
R rosippc64a Active Member Licensed User Longtime User Oct 1, 2020 #3 untested: regex.split("\x7c",str) ? Upvote 0
Midimaster Active Member Licensed User Oct 2, 2020 #4 why not: B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("|", str) For Each s In x Log(s) Next Upvote 0
why not: B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("|", str) For Each s In x Log(s) Next
Erel B4X founder Staff member Licensed User Longtime User Oct 2, 2020 #5 Midimaster said: why not: Click to expand... The pipe character has a special meaning in regex so it needs to be escaped. Upvote 0
Midimaster said: why not: Click to expand... The pipe character has a special meaning in regex so it needs to be escaped.
techknight Well-Known Member Licensed User Longtime User Oct 5, 2020 #6 arf programas said: B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next The explanation: https://streamsets.com/documentatio...ollector/UserGuide/Apx-RegEx/RegEx-Title.html Click to expand... I couldnt get this to work either. I ended up having to do this: B4X: Dim ResponseArray() As String = Regex.Split("[|]", ResponseString) Upvote 0
arf programas said: B4X: Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next The explanation: https://streamsets.com/documentatio...ollector/UserGuide/Apx-RegEx/RegEx-Title.html Click to expand... I couldnt get this to work either. I ended up having to do this: B4X: Dim ResponseArray() As String = Regex.Split("[|]", ResponseString)
Erel B4X founder Staff member Licensed User Longtime User Oct 5, 2020 #7 This code works correctly. I've just tried it. The output is: B4X: Sub Activity_Click Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next End Sub Copying updated assets files (4) *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** abc def efg Upvote 0
This code works correctly. I've just tried it. The output is: B4X: Sub Activity_Click Dim str As String = "abc|def|efg" Dim x() As String = Regex.Split("\|", str) For Each s In x Log(s) Next End Sub Copying updated assets files (4) *** Service (starter) Create *** ** Service (starter) Start ** ** Activity (main) Create, isFirst = true ** ** Activity (main) Resume ** abc def efg
techknight Well-Known Member Licensed User Longtime User Oct 5, 2020 #8 ok ill have to check the string coming from the server then to see if something is wrong with that. Maybe ill need to run some regex thing to clean up non printable characters. Upvote 0
ok ill have to check the string coming from the server then to see if something is wrong with that. Maybe ill need to run some regex thing to clean up non printable characters.