Click here to Skip to main content
15,949,686 members
Home / Discussions / Regular Expressions
   

Regular Expressions

 
GeneralRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 10:58
professionalKornfeld Eliyahu Peter20-Mar-14 10:58 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 11:21
protectorMarco Bertschi20-Mar-14 11:21 
GeneralRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 11:28
professionalKornfeld Eliyahu Peter20-Mar-14 11:28 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 11:59
protectorMarco Bertschi20-Mar-14 11:59 
GeneralRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 12:08
professionalKornfeld Eliyahu Peter20-Mar-14 12:08 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 12:14
protectorMarco Bertschi20-Mar-14 12:14 
JokeRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 12:17
professionalKornfeld Eliyahu Peter20-Mar-14 12:17 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 20:23
protectorMarco Bertschi20-Mar-14 20:23 
GeneralRe: A little help needed... Pin
Kornfeld Eliyahu Peter20-Mar-14 22:42
professionalKornfeld Eliyahu Peter20-Mar-14 22:42 
AnswerRe: A little help needed... Pin
Marco Bertschi20-Mar-14 22:52
protectorMarco Bertschi20-Mar-14 22:52 
AnswerRe: A little help needed... Pin
Richard Deeming20-Mar-14 6:00
mveRichard Deeming20-Mar-14 6:00 
GeneralRe: A little help needed... Pin
Marco Bertschi20-Mar-14 7:02
protectorMarco Bertschi20-Mar-14 7:02 
AnswerRe: [Solved] Pin
Kenneth Haugland20-Mar-14 20:55
mvaKenneth Haugland20-Mar-14 20:55 
GeneralRe: [Solved] Pin
PIEBALDconsult25-Mar-14 12:30
mvePIEBALDconsult25-Mar-14 12:30 
QuestionMATLAB Code Pin
Member 1068110218-Mar-14 19:02
Member 1068110218-Mar-14 19:02 
QuestionRe: MATLAB Code Pin
Richard Deeming19-Mar-14 2:04
mveRichard Deeming19-Mar-14 2:04 
AnswerRe: MATLAB Code Pin
Kornfeld Eliyahu Peter19-Mar-14 5:00
professionalKornfeld Eliyahu Peter19-Mar-14 5:00 
QuestionParsing ASCII-Only string Pin
Marco Bertschi6-Feb-14 22:54
protectorMarco Bertschi6-Feb-14 22:54 
AnswerRe: Parsing ASCII-Only string Pin
Richard Deeming7-Feb-14 1:36
mveRichard Deeming7-Feb-14 1:36 
GeneralRe: Parsing ASCII-Only string Pin
Marco Bertschi7-Feb-14 1:50
protectorMarco Bertschi7-Feb-14 1:50 
GeneralRe: Parsing ASCII-Only string Pin
Richard Deeming7-Feb-14 2:04
mveRichard Deeming7-Feb-14 2:04 
QuestionRe: Parsing ASCII-Only string Pin
Marco Bertschi7-Feb-14 2:08
protectorMarco Bertschi7-Feb-14 2:08 
AnswerRe: Parsing ASCII-Only string Pin
Richard Deeming7-Feb-14 2:14
mveRichard Deeming7-Feb-14 2:14 
GeneralRe: Parsing ASCII-Only string Pin
Marco Bertschi7-Feb-14 2:33
protectorMarco Bertschi7-Feb-14 2:33 
QuestionParsing a string with match groups Pin
Dominick Marciano23-Aug-13 9:47
professionalDominick Marciano23-Aug-13 9:47 
Let me start by saying that I'm not the greatest with Regular Expressions, but from research it seems that they are the best way to go for what I need; I just don't fully understand how to use them with matching groups.

In my application I need to parse a boolean string that can have any number of parameters. The following are some examples:
Name=John or Name=Jane
Name=John or Name=Jane and Date=Now

I need to be parse any variation of these strings ('and' and 'or' are the only boolean operators that can be present) so that I get a list such as:
Name=John
or
Name=Jane
and
Date=Now

I don't need to parse the strings with the '=' sign, but I do need the 'or' & 'and' operators so when I build my query in code I know how to connect each statement to the next (ie:Name=John should be ORed with Name=Jane which should be ANDed with Date=Now) So far I have only been able to get a list such as
Name=John
Name=Jane
Date=Now

by using the following code:
VB
Dim Pattern As String = "(\S+\x3D\S+)"

While Regex.Matches(query, Pattern).Count > 0
   Dim oMatches As MatchCollection = Regex.Matches(query, Pattern)
   For Each oMatch In oMatches
      Dim Operand1 = oMatch.Groups(0).Value
   Next
End While

but I lose the boolean operators in the process. If anyone could please help me with a regular expression so I would get the groups I have now, but with the operators in between the appropriate expressions, it would be greatly appreciated.

Thanks.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.