Regex Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreRegex Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 21st, 2012, 09:35 AM
MaxJosh MaxJosh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 MaxJosh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 31 sec
Reputation Power: 0
Other - Need regex code for dreamweaver

Can anyone help? Need regex code for dreamweaver to make the curly bracket on the end of this line, drop to new line.
From:
// str_replace("needle", "replace text", haystack); {
To:
// str_replace("needle", "replace text", haystack);
{


Want it to affect any line starting with // and ending in ; {

Thanks!!

Max

Reply With Quote
  #2  
Old October 21st, 2012, 05:01 PM
spacebar208's Avatar
spacebar208 spacebar208 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Location: spaceBAR Central
Posts: 191 spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 9 h 59 m 25 sec
Reputation Power: 41
Try this:
Code:
Find:
//.+({)$
Replace:
\n$1

Reply With Quote
  #3  
Old October 21st, 2012, 05:28 PM
MaxJosh MaxJosh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 MaxJosh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 31 sec
Reputation Power: 0
Didn't work.
Thanks anyway.

Reply With Quote
  #4  
Old October 21st, 2012, 09:06 PM
spacebar208's Avatar
spacebar208 spacebar208 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Location: spaceBAR Central
Posts: 191 spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 9 h 59 m 25 sec
Reputation Power: 41
The find pattern(//.+({)$) matches your example below(Note: The '{' has to be at the end of the line):
Code:
// str_replace("needle", "replace text", haystack); {

Reply With Quote
  #5  
Old October 22nd, 2012, 04:16 AM
MaxJosh MaxJosh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 MaxJosh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 31 sec
Reputation Power: 0
Hi spacebar208, The { is at the end of the line (or seems to be), but it doesn't work.
Was reading that $ in Dreamweaver regex means end of file and not end of line, is this right?
Thanks!

Reply With Quote
  #6  
Old October 22nd, 2012, 11:48 AM
spacebar208's Avatar
spacebar208 spacebar208 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2012
Location: spaceBAR Central
Posts: 191 spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level)spacebar208 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 2 Days 9 h 59 m 25 sec
Reputation Power: 41
The '$' matches End of line, Check out this info on 'Dreamweaver' regular expressions:
http://www.adobe.com/devnet/dreamwe...ssions_pt1.html
http://www.adobe.com/devnet/dreamwe...ssions_pt2.html

Reply With Quote
  #7  
Old October 24th, 2012, 04:17 AM
MaxJosh MaxJosh is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 4 MaxJosh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 43 m 31 sec
Reputation Power: 0
Thanks!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreRegex Programming > Other - Need regex code for dreamweaver

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap