I have what seems to be a simple Expression but for the life of me I can't
get it to work:

What I want to do is replace the information between tags with vbCrLf:

This:
...
Rule>" jhsadkjsk asjlksd lkjlsadj "<Rule Id
...

With This:

...
Rule>
<Rule Id
...

Here is the code:

Set objRegExp = New RegExp
objRegExp.IgnoreCase = True
objRegExp.Global = True
objRegExp.Pattern = "[Rule>.<Rule Id]"
strNewText = objRegExp.Replace(strNewText, "Rule>" & vbCrLf &"<Rule Id")
Set objRegExp = Nothing

Thank you in advance for your help!

Re: RegExp by Ayush

Ayush
Thu Jan 25 11:24:06 CST 2007

Replied to [JHP]s message :
> I have what seems to be a simple Expression but for the life of me I can't
> get it to work:
>
> What I want to do is replace the information between tags with vbCrLf:

Change Pattern to :
"Rule>.*<Rule Id"




--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: RegExp by JHP

JHP
Thu Jan 25 11:52:09 CST 2007

Thank you for the quick response, but it didn't seem to work - I probably
need to give an exact example:

...
Rule>" 17 1
22 Total Overpay Charges "<Rule Id
...

I need everything between the two tags removed, including the carriage
return line feed.

Thank you for your continued support,


"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:%23Lw0tWKQHHA.1280@TK2MSFTNGP04.phx.gbl...
> Replied to [JHP]s message :
>> I have what seems to be a simple Expression but for the life of me I
>> can't get it to work:
>>
>> What I want to do is replace the information between tags with vbCrLf:
>
> Change Pattern to :
> "Rule>.*<Rule Id"
>
>
>
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: RegExp by Ayush

Ayush
Thu Jan 25 12:58:47 CST 2007

Replied to [JHP]s message :
> Thank you for the quick response, but it didn't seem to work - I probably
> need to give an exact example:
>
> ....
> Rule>" 17 1
> 22 Total Overpay Charges "<Rule Id
> ....
>
> I need everything between the two tags removed, including the carriage
> return line feed.
>
> Thank you for your continued support,


Use :
"Rule>[\s\S]*<Rule Id"


--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: RegExp by JHP

JHP
Thu Jan 25 13:29:38 CST 2007

Thank you very much - that worked great...

"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:OHoqjLLQHHA.3944@TK2MSFTNGP06.phx.gbl...
> Replied to [JHP]s message :
>> Thank you for the quick response, but it didn't seem to work - I probably
>> need to give an exact example:
>>
>> ....
>> Rule>" 17 1
>> 22 Total Overpay Charges "<Rule Id
>> ....
>>
>> I need everything between the two tags removed, including the carriage
>> return line feed.
>>
>> Thank you for your continued support,
>
>
> Use :
> "Rule>[\s\S]*<Rule Id"
>
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: RegExp by Ayush

Ayush
Thu Jan 25 13:47:32 CST 2007

Replied to [JHP]s message :
> Thank you very much - that worked great...

You are welcome .. that was from an example in VBscript Reference.


--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: RegExp by JHP

JHP
Thu Jan 25 14:25:50 CST 2007

I have another problem (I'm really bad at RegEx)... and I spent the last
hour looking for a resolve...

I want to remove all the double double (""a"") quotes, and replace them with
single double ("a") quotes... but

In my file I have the following:

=""2"" (not valid)

But also,

="" (valid)

Sometimes there is a space at the end followed by another tag:

=""3"" FrameId=""BR1""

and sometime not,

=""8wR4"">

And sometimes the value is correct:

="1"

Ayush or anyone following this thread - if you can help that would be
great - I will continue with the 'trial and error' I have going so far (with
no luck),


"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:%239anxmLQHHA.4424@TK2MSFTNGP06.phx.gbl...
> Replied to [JHP]s message :
>> Thank you very much - that worked great...
>
> You are welcome .. that was from an example in VBscript Reference.
>
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: RegExp by Ayush

Ayush
Thu Jan 25 16:39:06 CST 2007

Replied to [JHP]s message :
> I want to remove all the double double (""a"") quotes, and replace them with
> single double ("a") quotes... but
> =""2"" (not valid)
> ="" (valid)
> =""3"" FrameId=""BR1""
> =""8wR4"">
> ="1"

> Ayush or anyone following this thread - if you can help that would be
> great - I will continue with the 'trial and error', but so far no luck.

Pattern:
q & q & "(\w)*" & q & q

Replace with :
q & "$1" & q

where q is Chr(34) that is "

--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: RegExp by JHP

JHP
Thu Jan 25 17:57:05 CST 2007

Thank you so much - without you I would have been here all night - It worked
like a charm!!!

"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:ugKDqGNQHHA.1276@TK2MSFTNGP04.phx.gbl...
> Replied to [JHP]s message :
> > I want to remove all the double double (""a"") quotes, and replace them
> > with
> > single double ("a") quotes... but
> > =""2"" (not valid)
> > ="" (valid)
> > =""3"" FrameId=""BR1""
> > =""8wR4"">
> > ="1"
>
> > Ayush or anyone following this thread - if you can help that would be
> > great - I will continue with the 'trial and error', but so far no luck.
>
> Pattern:
> q & q & "(\w)*" & q & q
>
> Replace with :
> q & "$1" & q
>
> where q is Chr(34) that is "
>
> --
> ? Ayush
> -------------
> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
> Snip your long urls - http://snipurl.com/
> -------------



Re: RegExp by Ayush

Ayush
Thu Jan 25 18:02:32 CST 2007

Replied to [JHP]s message :
> Thank you so much - without you I would have been here all night - It worked
> like a charm!!!

You are welcome ..


--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: RegExp by E

E
Fri Jan 26 18:47:54 CST 2007

I just love regexp, it seems like magic when it works. :-)

JHP wrote:
> Thank you so much - without you I would have been here all night - It worked
> like a charm!!!
>
<SNIP>
>> Pattern:
>> q & q & "(\w)*" & q & q
>>
>> Replace with :
>> q & "$1" & q
>>
>> where q is Chr(34) that is "
>>
>> --
>> ? Ayush
>> -------------
>> Search - www.Google.com | Wikipedia - http://en.wikipedia.org
>> Snip your long urls - http://snipurl.com/
>> -------------
>
>