need to get a number from an xml file using Regex [duplicate]
up vote
-1
down vote
favorite
This question already has an answer here:
Regex to extract attribute value
2 answers
Read XML Attribute using XmlDocument
7 answers
Getting attribute value of an XML Document using C#
6 answers
I have a scenario where I have an xml content and I need to get the version number from that file. For example below is the text.
<testing Version1 = "1.1" Version2 = "1.3">
<name> Example </Name>
<Description>sample description</Description>
</testing>
I need the Version2 value i.e., 1.3. Is it possible to get it by using Regex?
Thanks in Advance,
c#
marked as duplicate by CodeCaster
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 9 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
up vote
-1
down vote
favorite
This question already has an answer here:
Regex to extract attribute value
2 answers
Read XML Attribute using XmlDocument
7 answers
Getting attribute value of an XML Document using C#
6 answers
I have a scenario where I have an xml content and I need to get the version number from that file. For example below is the text.
<testing Version1 = "1.1" Version2 = "1.3">
<name> Example </Name>
<Description>sample description</Description>
</testing>
I need the Version2 value i.e., 1.3. Is it possible to get it by using Regex?
Thanks in Advance,
c#
marked as duplicate by CodeCaster
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 9 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2
Why not useXDocument
?
– cactuaroid
Nov 9 at 12:56
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04
add a comment |
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
This question already has an answer here:
Regex to extract attribute value
2 answers
Read XML Attribute using XmlDocument
7 answers
Getting attribute value of an XML Document using C#
6 answers
I have a scenario where I have an xml content and I need to get the version number from that file. For example below is the text.
<testing Version1 = "1.1" Version2 = "1.3">
<name> Example </Name>
<Description>sample description</Description>
</testing>
I need the Version2 value i.e., 1.3. Is it possible to get it by using Regex?
Thanks in Advance,
c#
This question already has an answer here:
Regex to extract attribute value
2 answers
Read XML Attribute using XmlDocument
7 answers
Getting attribute value of an XML Document using C#
6 answers
I have a scenario where I have an xml content and I need to get the version number from that file. For example below is the text.
<testing Version1 = "1.1" Version2 = "1.3">
<name> Example </Name>
<Description>sample description</Description>
</testing>
I need the Version2 value i.e., 1.3. Is it possible to get it by using Regex?
Thanks in Advance,
This question already has an answer here:
Regex to extract attribute value
2 answers
Read XML Attribute using XmlDocument
7 answers
Getting attribute value of an XML Document using C#
6 answers
c#
c#
asked Nov 9 at 12:53
Anish
565
565
marked as duplicate by CodeCaster
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 9 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by CodeCaster
StackExchange.ready(function()
if (StackExchange.options.isMobile) return;
$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');
$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();
);
);
);
Nov 9 at 13:04
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2
Why not useXDocument
?
– cactuaroid
Nov 9 at 12:56
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04
add a comment |
2
Why not useXDocument
?
– cactuaroid
Nov 9 at 12:56
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04
2
2
Why not use
XDocument
?– cactuaroid
Nov 9 at 12:56
Why not use
XDocument
?– cactuaroid
Nov 9 at 12:56
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
You can do it without a regular expression - example:
var xml = @"<testing Version1 = ""1.1"" Version2 = ""1.3"">
<Name> Example </Name>
<Description>sample description</Description>
</testing>";
string version2 = XElement.Parse(xml).Attribute("Version2").Value;
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
You can do it without a regular expression - example:
var xml = @"<testing Version1 = ""1.1"" Version2 = ""1.3"">
<Name> Example </Name>
<Description>sample description</Description>
</testing>";
string version2 = XElement.Parse(xml).Attribute("Version2").Value;
add a comment |
up vote
2
down vote
You can do it without a regular expression - example:
var xml = @"<testing Version1 = ""1.1"" Version2 = ""1.3"">
<Name> Example </Name>
<Description>sample description</Description>
</testing>";
string version2 = XElement.Parse(xml).Attribute("Version2").Value;
add a comment |
up vote
2
down vote
up vote
2
down vote
You can do it without a regular expression - example:
var xml = @"<testing Version1 = ""1.1"" Version2 = ""1.3"">
<Name> Example </Name>
<Description>sample description</Description>
</testing>";
string version2 = XElement.Parse(xml).Attribute("Version2").Value;
You can do it without a regular expression - example:
var xml = @"<testing Version1 = ""1.1"" Version2 = ""1.3"">
<Name> Example </Name>
<Description>sample description</Description>
</testing>";
string version2 = XElement.Parse(xml).Attribute("Version2").Value;
answered Nov 9 at 12:59
Rui Jarimba
6,93462958
6,93462958
add a comment |
add a comment |
2
Why not use
XDocument
?– cactuaroid
Nov 9 at 12:56
See: stackoverflow.com/questions/933687/…
– NoChance
Nov 9 at 13:04