I've a string like "Colors: yellow, green, white".
I need to get an array ("yellow", "green", "white") from it and it needs to be done with one regex.
I'm trying to apply something like
var result = Regex.Match("Colors: green, white, yellow", @":(\s(?<result>.*?)(,|$))*");
what I get is that result.Groups["result"]=="yellow"
How ca...
Hi
I have large forms in my GWT webapp. I'm using SmartGWT. The problem is that the classes that implements the forms are too large. The main reason is because each form has one or two TabSets with multiple tabs. The question is: Should I split this classes? Maybe one per tab?
Each class is responsible of instantiate the form (the most...
For my school projects, I was used to have one big repo with several subdirectories for the specific projects. Because I had no time, I always commited anything into the master branch.
The problem is, that this turns out to be unpracticable, as it becomes more and more difficult to revert older commits or figuring out which commit belon...
String to be split
abc:def:ghi\:klm:nop
String should be split based on ":"
"\" is escape character. So "\:" should not be treated as token.
split(":") gives
[abc]
[def]
[ghi\]
[klm]
[nop]
Required output is array of string
[abc]
[def]
[ghi\:klm]
[nop]
How can the \: be ignored
...
i want to split the String = "Asaf_ER_Army" by the "ER" seperator.
the Split function of String doesn't allow to split the string by more than one char.
how can i split a string by a 'more than one char' seperator?
...
I am trying to create a function that will split a string into search terms. Using this code will work fine:
string TestString = "This is a test";
string[] Terms;
Terms = TestString.Split(" ");
This will split my string into 4 strings: "This", "is", "a", "test".
However I want words that are enclosed in quotes to be treated as one wor...
Hi, i want group all words without white space e.g.:
I like stackoverflow
[0]I
[1]like
[2]stackoverflow
i know its a easy regex but i forgot how i do that xP.
...
I'm trying to parse arguments for a command, but if I were to put multiple spaces in a row, String.split() will leave empty Strings in the result array. Is there a way I can get rid of this?
For example: "abc 123".split(" ") results in {"abc", "", "", "", "", "123"} but what I really want is {"abc", "123"}
...
I have strings like "AMS.I-I.D. ver.5" and "AM0011 ver. 2", of which the "ver. *" needs to be stripped.
I have done that with: (^A.*)(ver.\s\d{1,2})
The problem occurs when there is no version number like "AM0003".
How can I make the (ver.\s\d{1,2}) part optional?
...
I looked in my book and in the documentation, and did this:
a = "hello"
b = a.split(sep= ' ')
print(b)
I get an error saying split() takes no keyword arguments. What is wrong?
I want to have ['h','e','l','l','o']
I tried not passing sep and just a.split(' '), and got ['hello']
...
Possible Duplicate:
C#: Convert string to model
Let's say I need to take a string and turn it into an array. This string has a single universal character to denote a new element. For example, I want to turn this string:
var s = "first|second|third";
Into this array:
var segments = new[]
{
"first",
"second",
"t...
Hi All,
I want to create a stored procedure which will do matching of two tables. My requirement is to match two tables based on the columns user passes as an input.
Syntax:
CREATE PROCEDURE reconcile.matchTables(IN TAB1 VARCHAR(25), IN TAB1 VARCHAR(25), IN COLS1 VARCHAR(250) , IN COLS2 VARCHAR(250))
EX:
matchTables('table1', 'table2...
hi i have an array of objects which need to be sorted (alphabet on name)
ArtistVO *artist1 = [ArtistVO alloc];
artist1.name = @"Trentemoeller";
artist1.imgPath = @"imgPath";
ArtistVO *artist2 = [ArtistVO alloc];
artist2.name = @"ATrentemoeller";
artist2.imgPath = @"imgPath2";
ArtistVO *artist3 = [ArtistVO alloc];
artist3.name = @"APh...
i have a string, something like this:
12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890.
and i have to split it.
the first 8, then the next 4 and so on.
Edit: i would prefer to define the length of the pieces in a separate file.
and the program to get the length form the e...
i have one table store post id and it's tags like :
Post_id | Tags
--------------------------------------
1 | keyword1,keyword2,keyword3
I want to loop though each row at this table and do :
put the keyword1,keyword2,keyword3 in new table :
word_id | word_value
-------------------------
1 | keyword1
2 ...
Hi all. I have this line as an example from a CSV file:
2412,21,"Which of the following is not found in all cells?","Curriculum","Life and Living Processes, Life Processes",,,1,0,"endofline"
I want to split it into an array. The immediate thought is to just split on commas, but some of the strings have commas in them, eg "Life and L...
Hi all,
I have tried approximately every possible combination of RegexOptions.MultiLine and escaped backslashes in order to split a text using \ as a separator.
I have this text:
The quick brown
Fox jumps\
Over the
Lazy dog\
I want to split it into
The quick brown
Fox jumps\
and
Over the
Lazy dog\
I have tried so far (togethe...
I have strings that look like this example:
"AAABBBCDEEEEBBBAA"
Any character is possible in the string.
I want to split it to a list like:
['AAA','BBB','C','D','EEEE','BBB','AA']
so every continuous stretch of the same characters goes to separate element of the split list.
I know that I can iterate over characters in the string, che...
I have a long tuple like
(2, 2, 10, 10, 344, 344, 45, 43, 2, 2, 10, 10, 12, 8, 2, 10)
and i am trying to split it into a tuple of tuples like
((2, 2, 10, 10), (344, 344, 45, 43), (2, 2, 10, 10), (12, 8, 2, 10))
I am new to python and am not very good with tuples o(2, 2, 10, 10, 344, 344, 45, 43, 2, 2, 10, 10, 12, 8, 2, 10)r lists. ...
When I try to split a string into a string list where each element represents a line of the initial string, I get the "square" character, which I think is a linefeed or something, at the start of each line, except the first line. How can I avoid that? My code is as follows:
Dim strList as List(Of String)
If Clipboard.ContainsText Then ...