I have the following string:
StartProgram 1 ""C:\Program Files\ABC\ABC XYZ"" CleanProgramTimeout 1 30
I need a regular expression to split this line but ignore spaces in double quotes in Perl.
The following is what I tried but it does not work.
(".*?"|\S+)
...
I am trying to split a string from a recordset that is in the format DD/MM/YYYY.
So basically something like:
Homework.Fields.Item("DateDue").Value.split("/")
But that doesn't work, Normally I can do:
String(Homework.Fields.Item("DateDue").Value).split("/")
But using String() turns the value into a long thing like:
Wed Oct 26 00:...
Hello,
I have a long string resulted from encoding a binary file -an image file- (in base 64). Is there a particulary method (or rule) I should follow when spliting it?
Edit:
I want to write the string to a xml file, but in order to do this I must split it in smaller chunks.
Edit2:
I would like to split it by length (I think that is more...
Hi guys, im currently having troubles on my codes in C#. I want to split strings with no fix values. here' my code please help me fix this.
protected void GridViewArchives_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
DataRowView drView = (DataRowView)e.Row.DataI...
Hi all,
Another n00b question.
$ab = "A00000001"
echo $a; // gives result "A"
echo $b; // gives result "1"
$ab = "B01250"
echo $a; // gives result "B"
echo $b; // gives result "1250"
What's the easiet single way to convert "ab" to "a" and "b" in both examples above?
Thanks!
...
Hi,
I am trying to split the text into words:
$delimiterList = array(" ", ".", "-", ",", ";", "_", ":",
"!", "?", "/", "(", ")", "[", "]", "{", "}", "<", ">", "\r", "\n",
'"');
$words = mb_split($delimiterList, $string);
which works quite fine with strings but I am stuck in some cases where I have to do with numb...
For example, if I had the following string:
"this-is-a-string"
Could I split it by every 2nd "-" rather than every "-" so that it returns two values ("this-is" and "a-string") rather than returning four?
...
I have a pipe delimited text file containing, among other things, a date and a number indicating the lines sequence elsewhere in the program. What I'm hoping to do is from that file create a hash using the year as the key and the value being the maximum sequence for that year (I essentially need to implement an auto-incremented key per y...
Hello.
Maybe a basic question but lets say I have a string that is 2000 characters long, I need to split this string into max 512 character chunks each.
Is there a nice way, eg. a loop for doing this?
Thank you :-)
...
I have a long UL list I need to break up in smaller lists containing about 20 items each.
I was thinking I could use something like
$(function() {
$("ul li:nth-child(20n)").after("</ul><ul>");
});
but that's not the case. Any idea how to use jQuery in a way that uses minimal CPU?
Thanks
...
Hi,
I got a string of such format:
"Wilbur Smith (Billy, son of John), Eddie Murphy (John), Elvis Presley, Jane Doe (Jane Doe)"
so basicly it's list of actor's names (optionally followed by their role in parenthesis). The role itself can contain comma (actor's name can not, I strongly hope so).
My goal is to split this string into ...
I'm trying to get the extension of a filename, but for some reason I can't make split work:
System.out.println(file.getName()); //gNVkN.png
System.out.println(file.getName().split(".").length); //0
What am I doing wrong?
...
I am using VB 9.0 to split a text file and then count occurrences of the term <sequence>. Supposing I want also to count occurrences of the same term in a different format, e.g. <sequence and then group them together such that I output the result to a text box, i.e.
txtMyTerms.Text=<sequence>+<sequence. How to do it?
My current code is...
I have the following vector:
tmp3 <- c("1500 2", "1500 1", "1510 2", "1510 1", "1520 2", "1520 1", "1530 2",
"1530 1", "1540 2", "1540 1")
I would like to just retain the second number in each of the atoms of this vector so it would read: c(2, 1,2,1,2,1,2,1,2,1).
...
Does anyone with more knowledge than me about regular expressions know how to split up html code so that all tags and all words are seperated ie.
<p>Some content <a href="www.test.com">A link</a></p>
Is seperated like this:
array = { [0]=>"<p>",
[1]=>"Some",
[2]=>"content",
[3]=>"<a href='www.test.com'>,...
Hi All,
I am new to java regex.Please help me.
Consider the below paragraph,
Paragraph :
Name abc
sadghsagh
hsajdjah Name
ggggggggg
!!!
Name ggg
dfdfddfdf Name
!!!
Name hhhh
sahdgashdg Name
asjdhjasdh
...
Suppose I have a string "AAA BBB CCC DDD EEE FFF".
How can I split the string and retrieve the nth substring, in a batch file?
The equivalent in C# would be
"AAA BBB CCC DDD EEE FFF".Split()[n]
EDIT
Thanks for the helpful answers. In the end I decided that this was trying to make a batchfile perform unnatural acts, so I went with...
Say, I have a string
"hello is it me you're looking for"
I want to cut part of this string out and return the new string, something like
s = string.cut(0,3);
s would now be equal to:
"lo is it me you're looking for"
EDIT: It may not be from 0 to 3. It could be from 5 to 7.
s = string.cut(5,7);
would return
"hellos it me you'...
I have string ling like this:
'Toy Stroy..(II) (1995)'
I want to split the line to two parts like this:
['Toy Story..(II)','1995']
How can I do it? thanks
...
Hi,
if I have a string, say:
my $string = "A, B,C, D , E ";
How can I put this into an array in Perl without the leading and trailing spaces? So what I want is only a single letter in each array element. What I currently do is this:
my @groups = split /,\s*/, $string;
But this is obviously not enough, as the trailing spaces are st...