473,226 Members | 1,480 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,226 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 2230
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: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.