473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Regex. Split or Split

Hi All,

I'm trying to split a string on every character. The string happens to be a
representation of a hex number. So, my regex expression is ([A-F,0-9]).
Seems simple, but for some reason, I'm not getting the results I expect.

Dim SA as string()
Dim S as string

S="FBE"
SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")

I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B", SA(2)="E",
but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".

If I change the expression to [A-F,0-9] (no parentheses), I get: SA(0)="",
SA(1)="", SA(2)="", SA(3)="".

Just for my own sanity, I've checked the pattern in Expresso and it returns
what I would expect.

I suppose I should mention I'm using VB.NET 2005 (just in case there's a
known issue with Regex in 2005).

TIA
Lee
Nov 21 '05 #1
7 2236
Lee,
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B", SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="", and
SA(3)="", as your string only contains delimiters. RegEx.Split returns the
strings between the delimiters, unless you use capturing groups (the
parenthesis in your expression) in which case it returns both the strings
between the delimiters & the delimiters.

The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing groups in
your expression is causing RegEx to return the 4 strings between the
delimiters, plus the 3 delimiters, ergo 7 values.
It sounds like you really want to return the list of matches, rather then
the stuff between the delimiters... Try RegEx.Matches, something like:

Dim input As String = "FBE"

Const pattern As String = "([A-F,0-9])"
Static parser As New Regex(pattern)

For Each match As Match In parser.Matches(input)
Debug.WriteLine(match.Value)
Next

Hope this helps
Jay

"lgbjr" <lg***@online.nospam> wrote in message
news:Ol**************@TK2MSFTNGP14.phx.gbl...
| Hi All,
|
| I'm trying to split a string on every character. The string happens to be
a
| representation of a hex number. So, my regex expression is ([A-F,0-9]).
| Seems simple, but for some reason, I'm not getting the results I expect.
|
| Dim SA as string()
| Dim S as string
|
| S="FBE"
| SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
|
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B", SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
|
| If I change the expression to [A-F,0-9] (no parentheses), I get: SA(0)="",
| SA(1)="", SA(2)="", SA(3)="".
|
| Just for my own sanity, I've checked the pattern in Expresso and it
returns
| what I would expect.
|
| I suppose I should mention I'm using VB.NET 2005 (just in case there's a
| known issue with Regex in 2005).
|
| TIA
| Lee
|
|
Nov 21 '05 #2
Thanks Jay,

I'm an idiot!! an hour or so ago, I was working on a split (really a split),
and just continued with split when I should have been using Matches. LOL! Of
course, Expresso was giving me the result I expected, because it wasn't
trying to split the string!

thanks for pointing out what should have been an obvious mistake.

Lee

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Lee,
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="", and
SA(3)="", as your string only contains delimiters. RegEx.Split returns the
strings between the delimiters, unless you use capturing groups (the
parenthesis in your expression) in which case it returns both the strings
between the delimiters & the delimiters.

The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing groups
in
your expression is causing RegEx to return the 4 strings between the
delimiters, plus the 3 delimiters, ergo 7 values.
It sounds like you really want to return the list of matches, rather then
the stuff between the delimiters... Try RegEx.Matches, something like:

Dim input As String = "FBE"

Const pattern As String = "([A-F,0-9])"
Static parser As New Regex(pattern)

For Each match As Match In parser.Matches(input)
Debug.WriteLine(match.Value)
Next

Hope this helps
Jay

"lgbjr" <lg***@online.nospam> wrote in message
news:Ol**************@TK2MSFTNGP14.phx.gbl...
| Hi All,
|
| I'm trying to split a string on every character. The string happens to
be
a
| representation of a hex number. So, my regex expression is ([A-F,0-9]).
| Seems simple, but for some reason, I'm not getting the results I expect.
|
| Dim SA as string()
| Dim S as string
|
| S="FBE"
| SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
|
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
|
| If I change the expression to [A-F,0-9] (no parentheses), I get:
SA(0)="",
| SA(1)="", SA(2)="", SA(3)="".
|
| Just for my own sanity, I've checked the pattern in Expresso and it
returns
| what I would expect.
|
| I suppose I should mention I'm using VB.NET 2005 (just in case there's a
| known issue with Regex in 2005).
|
| TIA
| Lee
|
|

Nov 21 '05 #3

By the way, the comma in your regex pattern is not part of the syntax
of [] (ie what you actually mean is [A-F0-9] - at the moment you would
match , as a hex digit)

lgbjr wrote:
Thanks Jay,

I'm an idiot!! an hour or so ago, I was working on a split (really a split), and just continued with split when I should have been using Matches. LOL! Of course, Expresso was giving me the result I expected, because it wasn't trying to split the string!

thanks for pointing out what should have been an obvious mistake.

Lee

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:%2****************@tk2msftngp13.phx.gbl...
Lee,
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="", | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="", and SA(3)="", as your string only contains delimiters. RegEx.Split returns the strings between the delimiters, unless you use capturing groups (the parenthesis in your expression) in which case it returns both the strings between the delimiters & the delimiters.

The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing groups in
your expression is causing RegEx to return the 4 strings between the delimiters, plus the 3 delimiters, ergo 7 values.
It sounds like you really want to return the list of matches, rather then the stuff between the delimiters... Try RegEx.Matches, something like:
Dim input As String = "FBE"

Const pattern As String = "([A-F,0-9])"
Static parser As New Regex(pattern)

For Each match As Match In parser.Matches(input)
Debug.WriteLine(match.Value)
Next

Hope this helps
Jay

"lgbjr" <lg***@online.nospam> wrote in message
news:Ol**************@TK2MSFTNGP14.phx.gbl...
| Hi All,
|
| I'm trying to split a string on every character. The string happens to be
a
| representation of a hex number. So, my regex expression is ([A-F,0-9]). | Seems simple, but for some reason, I'm not getting the results I expect. |
| Dim SA as string()
| Dim S as string
|
| S="FBE"
| SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
|
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="", | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
|
| If I change the expression to [A-F,0-9] (no parentheses), I get:
SA(0)="",
| SA(1)="", SA(2)="", SA(3)="".
|
| Just for my own sanity, I've checked the pattern in Expresso and it returns
| what I would expect.
|
| I suppose I should mention I'm using VB.NET 2005 (just in case there's a | known issue with Regex in 2005).
|
| TIA
| Lee
|
|


Nov 21 '05 #4
Why can't you use the .ToCharArray method of Strings?

"lgbjr" wrote:
Thanks Jay,

I'm an idiot!! an hour or so ago, I was working on a split (really a split),
and just continued with split when I should have been using Matches. LOL! Of
course, Expresso was giving me the result I expected, because it wasn't
trying to split the string!

thanks for pointing out what should have been an obvious mistake.

Lee

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Lee,
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="", and
SA(3)="", as your string only contains delimiters. RegEx.Split returns the
strings between the delimiters, unless you use capturing groups (the
parenthesis in your expression) in which case it returns both the strings
between the delimiters & the delimiters.

The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing groups
in
your expression is causing RegEx to return the 4 strings between the
delimiters, plus the 3 delimiters, ergo 7 values.
It sounds like you really want to return the list of matches, rather then
the stuff between the delimiters... Try RegEx.Matches, something like:

Dim input As String = "FBE"

Const pattern As String = "([A-F,0-9])"
Static parser As New Regex(pattern)

For Each match As Match In parser.Matches(input)
Debug.WriteLine(match.Value)
Next

Hope this helps
Jay

"lgbjr" <lg***@online.nospam> wrote in message
news:Ol**************@TK2MSFTNGP14.phx.gbl...
| Hi All,
|
| I'm trying to split a string on every character. The string happens to
be
a
| representation of a hex number. So, my regex expression is ([A-F,0-9]).
| Seems simple, but for some reason, I'm not getting the results I expect.
|
| Dim SA as string()
| Dim S as string
|
| S="FBE"
| SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
|
| I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
SA(2)="E",
| but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
|
| If I change the expression to [A-F,0-9] (no parentheses), I get:
SA(0)="",
| SA(1)="", SA(2)="", SA(3)="".
|
| Just for my own sanity, I've checked the pattern in Expresso and it
returns
| what I would expect.
|
| I suppose I should mention I'm using VB.NET 2005 (just in case there's a
| known issue with Regex in 2005).
|
| TIA
| Lee
|
|


Nov 21 '05 #5
Dennis,

Previously, that is exactly what I was doing:

Dim SA as Array
Dim S as String
S="FBE"
SA=S.ToCharArray

This works fine. but, I'm trying to use Options Strict now, which means I
can't use

Dim SA as Array

I have to use

Dim SA as String()

And 1-dimensional array of Char can not be converted to 1-dimensional array
of String. So, I decided to use a Regex Match to convert the string to a
string array.

LOL! As I was typing this, I just realized I can do Dim SA as Char(), then
use .ToCharArray!!

Thanks!!

Lee

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
Why can't you use the .ToCharArray method of Strings?

"lgbjr" wrote:
Thanks Jay,

I'm an idiot!! an hour or so ago, I was working on a split (really a
split),
and just continued with split when I should have been using Matches. LOL!
Of
course, Expresso was giving me the result I expected, because it wasn't
trying to split the string!

thanks for pointing out what should have been an obvious mistake.

Lee

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Lee,
> | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
> SA(2)="E",
> | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
> | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
> I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="",
> and
> SA(3)="", as your string only contains delimiters. RegEx.Split returns
> the
> strings between the delimiters, unless you use capturing groups (the
> parenthesis in your expression) in which case it returns both the
> strings
> between the delimiters & the delimiters.
>
> The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing
> groups
> in
> your expression is causing RegEx to return the 4 strings between the
> delimiters, plus the 3 delimiters, ergo 7 values.
>
>
> It sounds like you really want to return the list of matches, rather
> then
> the stuff between the delimiters... Try RegEx.Matches, something like:
>
> Dim input As String = "FBE"
>
> Const pattern As String = "([A-F,0-9])"
> Static parser As New Regex(pattern)
>
> For Each match As Match In parser.Matches(input)
> Debug.WriteLine(match.Value)
> Next
>
> Hope this helps
> Jay
>
>
>
> "lgbjr" <lg***@online.nospam> wrote in message
> news:Ol**************@TK2MSFTNGP14.phx.gbl...
> | Hi All,
> |
> | I'm trying to split a string on every character. The string happens
> to
> be
> a
> | representation of a hex number. So, my regex expression is
> ([A-F,0-9]).
> | Seems simple, but for some reason, I'm not getting the results I
> expect.
> |
> | Dim SA as string()
> | Dim S as string
> |
> | S="FBE"
> | SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
> |
> | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
> SA(2)="E",
> | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
> | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
> |
> | If I change the expression to [A-F,0-9] (no parentheses), I get:
> SA(0)="",
> | SA(1)="", SA(2)="", SA(3)="".
> |
> | Just for my own sanity, I've checked the pattern in Expresso and it
> returns
> | what I would expect.
> |
> | I suppose I should mention I'm using VB.NET 2005 (just in case
> there's a
> | known issue with Regex in 2005).
> |
> | TIA
> | Lee
> |
> |
>
>


Nov 21 '05 #6
lager,
| LOL! As I was typing this, I just realized I can do Dim SA as Char(), then
| use .ToCharArray!!

Also depending on what you are doing with the Char(), you may be able to
simply use the String.Chars property.

Something like:

Dim S As String
S = "FBE"
For index As Integer = 0 To S.Length - 1
Dim ch As Char = S.Chars(index)
If ch = ","c Then
' do something interesting with the comma
End If
Next

Hope this helps
Jay
"lgbjr" <lg***@online.nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
| Dennis,
|
| Previously, that is exactly what I was doing:
|
| Dim SA as Array
| Dim S as String
| S="FBE"
| SA=S.ToCharArray
|
| This works fine. but, I'm trying to use Options Strict now, which means I
| can't use
|
| Dim SA as Array
|
| I have to use
|
| Dim SA as String()
|
| And 1-dimensional array of Char can not be converted to 1-dimensional
array
| of String. So, I decided to use a Regex Match to convert the string to a
| string array.
|
| LOL! As I was typing this, I just realized I can do Dim SA as Char(), then
| use .ToCharArray!!
|
| Thanks!!
|
| Lee
|
| "Dennis" <De****@discussions.microsoft.com> wrote in message
| news:1D**********************************@microsof t.com...
| > Why can't you use the .ToCharArray method of Strings?
| >
| > "lgbjr" wrote:
| >
| >> Thanks Jay,
| >>
| >> I'm an idiot!! an hour or so ago, I was working on a split (really a
| >> split),
| >> and just continued with split when I should have been using Matches.
LOL!
| >> Of
| >> course, Expresso was giving me the result I expected, because it wasn't
| >> trying to split the string!
| >>
| >> thanks for pointing out what should have been an obvious mistake.
| >>
| >> Lee
| >>
| >> "Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in
message
| >> news:%2****************@tk2msftngp13.phx.gbl...
| >> > Lee,
| >> > | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
| >> > SA(2)="E",
| >> > | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| >> > | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
| >> > I would expect it to contain 4 elements, SA(0)="", SA(1)="",
SA(2)="",
| >> > and
| >> > SA(3)="", as your string only contains delimiters. RegEx.Split
returns
| >> > the
| >> > strings between the delimiters, unless you use capturing groups (the
| >> > parenthesis in your expression) in which case it returns both the
| >> > strings
| >> > between the delimiters & the delimiters.
| >> >
| >> > The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing
| >> > groups
| >> > in
| >> > your expression is causing RegEx to return the 4 strings between the
| >> > delimiters, plus the 3 delimiters, ergo 7 values.
| >> >
| >> >
| >> > It sounds like you really want to return the list of matches, rather
| >> > then
| >> > the stuff between the delimiters... Try RegEx.Matches, something
like:
| >> >
| >> > Dim input As String = "FBE"
| >> >
| >> > Const pattern As String = "([A-F,0-9])"
| >> > Static parser As New Regex(pattern)
| >> >
| >> > For Each match As Match In parser.Matches(input)
| >> > Debug.WriteLine(match.Value)
| >> > Next
| >> >
| >> > Hope this helps
| >> > Jay
| >> >
| >> >
| >> >
| >> > "lgbjr" <lg***@online.nospam> wrote in message
| >> > news:Ol**************@TK2MSFTNGP14.phx.gbl...
| >> > | Hi All,
| >> > |
| >> > | I'm trying to split a string on every character. The string happens
| >> > to
| >> > be
| >> > a
| >> > | representation of a hex number. So, my regex expression is
| >> > ([A-F,0-9]).
| >> > | Seems simple, but for some reason, I'm not getting the results I
| >> > expect.
| >> > |
| >> > | Dim SA as string()
| >> > | Dim S as string
| >> > |
| >> > | S="FBE"
| >> > | SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
| >> > |
| >> > | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
| >> > SA(2)="E",
| >> > | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
| >> > | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
| >> > |
| >> > | If I change the expression to [A-F,0-9] (no parentheses), I get:
| >> > SA(0)="",
| >> > | SA(1)="", SA(2)="", SA(3)="".
| >> > |
| >> > | Just for my own sanity, I've checked the pattern in Expresso and it
| >> > returns
| >> > | what I would expect.
| >> > |
| >> > | I suppose I should mention I'm using VB.NET 2005 (just in case
| >> > there's a
| >> > | known issue with Regex in 2005).
| >> > |
| >> > | TIA
| >> > | Lee
| >> > |
| >> > |
| >> >
| >> >
| >>
| >>
| >>
|
|
Nov 21 '05 #7
My Point exactly..why use Regex when one doesn't have to.

"lgbjr" wrote:
Dennis,

Previously, that is exactly what I was doing:

Dim SA as Array
Dim S as String
S="FBE"
SA=S.ToCharArray

This works fine. but, I'm trying to use Options Strict now, which means I
can't use

Dim SA as Array

I have to use

Dim SA as String()

And 1-dimensional array of Char can not be converted to 1-dimensional array
of String. So, I decided to use a Regex Match to convert the string to a
string array.

LOL! As I was typing this, I just realized I can do Dim SA as Char(), then
use .ToCharArray!!

Thanks!!

Lee

"Dennis" <De****@discussions.microsoft.com> wrote in message
news:1D**********************************@microsof t.com...
Why can't you use the .ToCharArray method of Strings?

"lgbjr" wrote:
Thanks Jay,

I'm an idiot!! an hour or so ago, I was working on a split (really a
split),
and just continued with split when I should have been using Matches. LOL!
Of
course, Expresso was giving me the result I expected, because it wasn't
trying to split the string!

thanks for pointing out what should have been an obvious mistake.

Lee

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Lee,
> | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
> SA(2)="E",
> | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
> | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
> I would expect it to contain 4 elements, SA(0)="", SA(1)="", SA(2)="",
> and
> SA(3)="", as your string only contains delimiters. RegEx.Split returns
> the
> strings between the delimiters, unless you use capturing groups (the
> parenthesis in your expression) in which case it returns both the
> strings
> between the delimiters & the delimiters.
>
> The pattern "[A-F,0-9]" returns the 4 that I expect. The capturing
> groups
> in
> your expression is causing RegEx to return the 4 strings between the
> delimiters, plus the 3 delimiters, ergo 7 values.
>
>
> It sounds like you really want to return the list of matches, rather
> then
> the stuff between the delimiters... Try RegEx.Matches, something like:
>
> Dim input As String = "FBE"
>
> Const pattern As String = "([A-F,0-9])"
> Static parser As New Regex(pattern)
>
> For Each match As Match In parser.Matches(input)
> Debug.WriteLine(match.Value)
> Next
>
> Hope this helps
> Jay
>
>
>
> "lgbjr" <lg***@online.nospam> wrote in message
> news:Ol**************@TK2MSFTNGP14.phx.gbl...
> | Hi All,
> |
> | I'm trying to split a string on every character. The string happens
> to
> be
> a
> | representation of a hex number. So, my regex expression is
> ([A-F,0-9]).
> | Seems simple, but for some reason, I'm not getting the results I
> expect.
> |
> | Dim SA as string()
> | Dim S as string
> |
> | S="FBE"
> | SA=RegularExpressions.Regex.Split(S,"([A-F,0-9])")
> |
> | I expect that SA will contain 3 elements: SA(0)="F", SA(1)="B",
> SA(2)="E",
> | but, what I'm getting is 7 elements: SA(0)="", SA(1)="F", SA(2)="",
> | SA(3)="B", SA(4)="", SA(5)="E", SA(6)="".
> |
> | If I change the expression to [A-F,0-9] (no parentheses), I get:
> SA(0)="",
> | SA(1)="", SA(2)="", SA(3)="".
> |
> | Just for my own sanity, I've checked the pattern in Expresso and it
> returns
> | what I would expect.
> |
> | I suppose I should mention I'm using VB.NET 2005 (just in case
> there's a
> | known issue with Regex in 2005).
> |
> | TIA
> | Lee
> |
> |
>
>


Nov 21 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: H | last post by:
This is kind of an followup on oneof my previous questions, and it has with RegEx to do. I have a string containing of several words. What would a good regex expression looklike to get one match...
6
by: Dave | last post by:
I'm struggling with something that should be fairly simple. I just don't know the regext syntax very well, unfortunately. I'd like to parse words out of what is basically a boolean search...
5
by: Bob | last post by:
I think this is very simple but I am having difficult doing it. Basically take a comma separated list: abc, def, ghi, jk A list with only one token does not have any commas: abc The first...
4
by: Cor | last post by:
Hi Newsgroup, I have given an answer in this newsgroup about a "Replace". There came an answer on that I did not understand, so I have done some tests. I got the idea that someone said,...
3
by: Craig Buchanan | last post by:
Is there a way to combine these two Replace into a single line? Regex.Replace(Subject, "\&", "&amp;") Regex.Replace(Subject, "\'", "&apos;") Perhaps Regex.Replace(Subject, "{\&|\'}", "{&amp;|&apos;}")...
3
by: Michael D Murphy | last post by:
Hi, I would like to know how to use Regular Expressions to iteratively return and print the items between the colons in the following string to say the console.. Any help would be appreciated....
7
by: Jordi Rico | last post by:
Hi, I know I can split a string into an array doing this: Dim s As String()=Regex.Split("One-Two-Three","-") So I would have: s(0)="One" s(1)="Two"
7
by: =?Utf-8?B?amFj?= | last post by:
Hi, I have problems with following code and don’t find the bug : // Set ArrayList aArray = new ArrayList(); regStr = new Regex(@"\?)*(\d+)\]"); if(text != null && regStr.IsMatch(text))...
1
by: mad.scientist.jr | last post by:
I am working in C# ASP.NET framework 1.1 and for some reason Regex.Split isn't working as expected. When trying to split a string, Split is returning an array with the entire string in element ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.