List Info

Thread: asp.net find match value WITHOUT search string for "whatever: "




asp.net find match value WITHOUT search string for "whatever: "
country flaguser name
United States
2007-08-09 10:05:11
I have a string that looks like this:

'ACCEPT - The transaction succeeded. Merchant Reference
Code:OrderId
Request ID: 1865550982350176174087 Authorized Amount: 10.00
Authorization Code: 123456 Authorization Time:
2007-08-09T14:18:18Z


I need to pull out that string after "Request ID:
"


which in this case should be :


1865550982350176174087


This returns the full string with the search string:


Dim regexp As Regex = New Regex("Request ID:
(w+)",
RegexOptions.IgnoreCase)
Dim TransId As String = regexp.Match(CCOut).ToString
StatusLabel.Text = TransId.ToString


and this returns nothing:


Dim pattern As String = "Request ID: (w+)" &
Regex.Escape("Request
ID: ")
Dim match As Match = Regex.Match(CCOut, pattern)
StatusLabel.Text = match.Value.ToString


Thank you for any help or information!


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: asp.net find match value WITHOUT search string for "whatever: "
user name
2007-08-09 10:19:09

Request ID: +[0-9]+

The above regex may do what you want. Please tell me if it isn't working

regards,
  Lloyd

On 8/9/07, jobs < jobswebdos.com">jobswebdos.com> wrote:

I have a string that looks like this:

9;ACCEPT - The transaction succeeded. Merchant Reference Code:OrderId
Request ID: 1865550982350176174087 Authorized Amount: 10.00
Authorization Code: 123456 Authorization Time: 2007-08-09T14:18:18Z


I need to pull out that string after "Request ID: "


which in this case should be :


1865550982350176174087


This returns the full string with the search string:


Dim regexp As Regex = New Regex(&quot;Request ID: (w+)",
RegexOptions.IgnoreCase)
Dim TransId As String = regexp.Match(CCOut).ToString
StatusLabel.Text = TransId.ToString


and this returns nothing:


Dim pattern As String = "Request ID: (w+)" & Regex.Escape("Request
ID: ")
Dim match As Match = Regex.Match(CCOut, pattern)
StatusLabel.Text = match.Value.ToString


Thank you for any help or information!

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: asp.net find match value WITHOUT search string for "whatever: "
country flaguser name
United States
2007-08-09 19:57:47


On Aug 9, 11:19 am, "Lloyd K.L" <lloy...gmail.com> wrote:
> Request ID: +[0-9]+
>
> The above regex may do what you want. Please tell me if
it isn't working
>
> regards,
>   Lloyd

It's returning "Request ID: " too, I only want the
string that
follows. I have a simple workaround of removing that from
the match.
But is there a better way?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: asp.net find match value WITHOUT search string for "whatever: "
user name
2007-08-09 23:05:52
I am not a regex expert. But I think, in-order to match the string after "Request ID:" we would have to use it in the regular expression. What I would do in this case is, after getting the result, remove the Request ID part from that. (Though you know there is a "Request ID:" in the beginning of the matched string. If somebody have a better way, please suggest .....

Regards,
  Lloyd

On 8/10/07, jobs < jobswebdos.com">jobswebdos.com> wrote:



On Aug 9, 11:19 am, "Lloyd K.L" < lloy...gmail.com">lloy...gmail.com> wrote:
>; Request ID: +[0-9]+
&gt;
> The above regex may do what you want. Please tell me if it isn't working
>
> regards,
&gt; &nbsp; Lloyd

It&#39;s returning "Request ID: " too, I only want the string that
follows. I have a simple workaround of removing that from the match.
But is there a better way?

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: asp.net find match value WITHOUT search string for "whatever: "
country flaguser name
United States
2007-08-10 05:07:52
Hi jobs,

Llyod has the right expression. You may use braces to group
your
match. Try this.

Pattern:
Request ID:s*([0-9]+)

Match:
Request ID: 1865550982350176174087
$1:
1865550982350176174087

$1 is what you need. I am not sure where you are using this
but $1 or
1 would be 'group' your submatches.

Thanks!
Syd


On Aug 10, 9:05 am, "Lloyd K.L" <lloy...gmail.com> wrote:
> I am not a regex expert. But I think, in-order to match
the string after
> "Request ID:" we would have to use it in the
regular expression. What I
> would do in this case is, after getting the result,
remove the Request ID
> part from that. (Though you know there is a
"Request ID:" in the beginning
> of the matched string. If somebody have a better way,
please suggest .....
>
> Regards,
>   Lloyd
>
> On 8/10/07, jobs <j...webdos.com> wrote:
>
>
>
>
>
> > On Aug 9, 11:19 am, "Lloyd K.L"
<lloy...gmail.com> wrote:
> > > Request ID: +[0-9]+
>
> > > The above regex may do what you want. Please
tell me if it isn't working
>
> > > regards,
> > >   Lloyd
>
> > It's returning "Request ID: " too, I
only want the string that
> > follows. I have a simple workaround of removing
that from the match.
> > But is there a better way?- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: asp.net find match value WITHOUT search string for "whatever: "
user name
2007-08-10 08:09:29
Hi Sydches,

Can you give a full expression wich returns the digit part only. Am not familiar with this kind of expressions :(

Thanks,
&nbsp; Lloyd

On 8/10/07, syd......gmail.com">syd......gmail.com < sydchesgmail.com">sydchesgmail.com> wrote:

Hi jobs,

Llyod has the right expression. You may use braces to group your
match. Try this.

Pattern:
Request ID:s*([0-9]+)

Match:
Request ID: 1865550982350176174087
$1:
1865550982350176174087

$1 is what you need. I am not sure where you are using this but $1 or
1 would be 'group' your submatches.

Thanks!
Syd


On Aug 10, 9:05 am, "Lloyd K.L" < lloy...gmail.com">lloy...gmail.com> wrote:
>; I am not a regex expert. But I think, in-order to match the string after
&gt; "Request ID:" we would have to use it in the regular expression. What I
> would do in this case is, after getting the result, remove the Request ID
> part from that. (Though you know there is a "Request ID:" in the beginning
> of the matched string. If somebody have a better way, please suggest .....
>
> Regards,
&gt; &nbsp; Lloyd
>
> On 8/10/07, jobs < j...webdos.com">j...webdos.com> wrote:
&gt;
>
&gt;
>
>;
> > On Aug 9, 11:19 am, "Lloyd K.L" < lloy...gmail.com">lloy...gmail.com> wrote:
>; > > Request ID: +[0-9]+
&gt;
> > > The above regex may do what you want. Please tell me if it isn't working
>
> > > regards,
&gt; > >   Lloyd
>
> > It's returning "Request ID: " too, I only want the string that
> > follows. I have a simple workaround of removing that from the match.
&gt; > But is there a better way?- Hide quoted text -
>
>; - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.google.com/group/regex
-~----------~----~----~----~------~----~------~--~---

Re: asp.net find match value WITHOUT search string for "whatever: "
country flaguser name
United States
2007-08-13 03:41:33
Can't be done.
[0-9]+ would return anything containing digits.

1865550982350176174087
10
123456
2007
08
09
14
18
18
would all be matched if we used that.

The point is that "Request ID: " has to be used to
identify the
correct match.

I am not familiar with ASP.NET regex engine. But I would
recommend
looking up grouping of expressions in ASP.NET help.

Thanks!
Syd


On Aug 10, 6:09 pm, "Lloyd K.L" <lloy...gmail.com> wrote:
> Hi Sydches,
>
> Can you give a full expression wich returns the digit
part only. Am not
> familiar with this kind of expressions :(
>
> Thanks,
>   Lloyd
>
> On 8/10/07, syd......gmail.com <sydc...gmail.com> wrote:
>
>
>
>
>
> > Hi jobs,
>
> > Llyod has the right expression. You may use braces
to group your
> > match. Try this.
>
> > Pattern:
> > Request ID:s*([0-9]+)
>
> > Match:
> > Request ID: 1865550982350176174087
> > $1:
> > 1865550982350176174087
>
> > $1 is what you need. I am not sure where you are
using this but $1 or
> > 1 would be 'group' your submatches.
>
> > Thanks!
> > Syd
>
> > On Aug 10, 9:05 am, "Lloyd K.L"
<lloy...gmail.com> wrote:
> > > I am not a regex expert. But I think,
in-order to match the string after
> > > "Request ID:" we would have to use
it in the regular expression. What I
> > > would do in this case is, after getting the
result, remove the Request
> > ID
> > > part from that. (Though you know there is a
"Request ID:" in the
> > beginning
> > > of the matched string. If somebody have a
better way, please suggest
> > .....
>
> > > Regards,
> > >   Lloyd
>
> > > On 8/10/07, jobs <j...webdos.com> wrote:
>
> > > > On Aug 9, 11:19 am, "Lloyd
K.L" <lloy...gmail.com> wrote:
> > > > > Request ID: +[0-9]+
>
> > > > > The above regex may do what you
want. Please tell me if it isn't
> > working
>
> > > > > regards,
> > > > >   Lloyd
>
> > > > It's returning "Request ID: "
too, I only want the string that
> > > > follows. I have a simple workaround of
removing that from the match.
> > > > But is there a better way?- Hide quoted
text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


Re: asp.net find match value WITHOUT search string for "whatever: "
country flaguser name
United States
2007-08-14 13:24:08
> Can't be done.

Hi jobs,

Spoke too soon.

Here's the expression you should use:
(?<=Request ID:s*)([0-9]+)

Thanks!
Syd


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "Regex" group.
To post to this group, send email to regexgooglegroups.com
To unsubscribe from this group, send email to
regex-unsubscribegooglegroups.com
For more options, visit this group at http://groups.go
ogle.com/group/regex
-~----------~----~----~----~------~----~------~--~---


[1-8]

about | contact  Other archives ( Real Estate discussion Medical topics )