Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

More noob - RegEx help....

LEGEND ,
Aug 14, 2007 Aug 14, 2007
I have syntactically improper markup on almost 100 pages in a javascript
line -

<script>
variable = "somevalue"X""
</script>

It should be

<script>
variable = "somevalue","X"
</script>

The trick is, on each page, "X" would have a different value. What would be
the REGEX to find the former and replace with the latter, substituting the
proper value?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



TOPICS
Server side applications
285
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2007 Aug 14, 2007
This should work:

Find:
([a-zA-Z0-9_]*)\s*=\s*"([^"]*)"([^"]*)""
Replace:
$1 = "$2","$3"


--
--
Tom Muck, Adobe Community Expert
Dreamweaver Extensions/Articles -- http://www.tom-muck.com/
Cartweaver Development Team - http://www.cartweaver.com/
Extending Knowledge Daily - http://www.communitymx.com/


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:f9tcd4$k5n$1@forums.macromedia.com...
>I have syntactically improper markup on almost 100 pages in a javascript
>line -
>
> <script>
> variable = "somevalue"X""
> </script>
>
> It should be
>
> <script>
> variable = "somevalue","X"
> </script>
>
> The trick is, on each page, "X" would have a different value. What would
> be the REGEX to find the former and replace with the latter, substituting
> the proper value?
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2007 Aug 14, 2007
Here's what I'm trying to match -

variable="First 100 Years Membership List "C"";

and it should read -

variable="First 100 Years Membership List ","C";

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tom Muck" <tommuck@NO-SPAM-hotmail.com> wrote in message
news:f9td50$l1p$1@forums.macromedia.com...
> This should work:
>
> Find:
> ([a-zA-Z0-9_]*)\s*=\s*"([^"]*)"([^"]*)""
> Replace:
> $1 = "$2","$3"
>
>
> --
> --
> Tom Muck, Adobe Community Expert
> Dreamweaver Extensions/Articles -- http://www.tom-muck.com/
> Cartweaver Development Team - http://www.cartweaver.com/
> Extending Knowledge Daily - http://www.communitymx.com/
>
>
> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:f9tcd4$k5n$1@forums.macromedia.com...
>>I have syntactically improper markup on almost 100 pages in a javascript
>>line -
>>
>> <script>
>> variable = "somevalue"X""
>> </script>
>>
>> It should be
>>
>> <script>
>> variable = "somevalue","X"
>> </script>
>>
>> The trick is, on each page, "X" would have a different value. What would
>> be the REGEX to find the former and replace with the latter, substituting
>> the proper value?
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> http://www.dreamweavermx-templates.com - Template Triage!
>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>> ==================
>>
>>
>>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 14, 2007 Aug 14, 2007
LATEST
If that is what you need to match, it matched.

Tom


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:f9tdte$lph$1@forums.macromedia.com...
> Here's what I'm trying to match -
>
> variable="First 100 Years Membership List "C"";
>
> and it should read -
>
> variable="First 100 Years Membership List ","C";
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
> "Tom Muck" <tommuck@NO-SPAM-hotmail.com> wrote in message
> news:f9td50$l1p$1@forums.macromedia.com...
>> This should work:
>>
>> Find:
>> ([a-zA-Z0-9_]*)\s*=\s*"([^"]*)"([^"]*)""
>> Replace:
>> $1 = "$2","$3"
>>
>>
>> --
>> --
>> Tom Muck, Adobe Community Expert
>> Dreamweaver Extensions/Articles -- http://www.tom-muck.com/
>> Cartweaver Development Team - http://www.cartweaver.com/
>> Extending Knowledge Daily - http://www.communitymx.com/
>>
>>
>> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
>> news:f9tcd4$k5n$1@forums.macromedia.com...
>>>I have syntactically improper markup on almost 100 pages in a javascript
>>>line -
>>>
>>> <script>
>>> variable = "somevalue"X""
>>> </script>
>>>
>>> It should be
>>>
>>> <script>
>>> variable = "somevalue","X"
>>> </script>
>>>
>>> The trick is, on each page, "X" would have a different value. What
>>> would be the REGEX to find the former and replace with the latter,
>>> substituting the proper value?
>>>
>>> --
>>> Murray --- ICQ 71997575
>>> Adobe Community Expert
>>> (If you *MUST* email me, don't LAUGH when you do so!)
>>> ==================
>>> http://www.dreamweavermx-templates.com - Template Triage!
>>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>>> ==================
>>>
>>>
>>>
>>
>>
>
>


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines