Re: Monster Regex

2010-12-06 Thread Jacob Munson

cfset str = reReplace(str,^\(,)
cfset str = reReplace(str,;\d+-\d+\),)


On Mon, Dec 6, 2010 at 12:03 PM, Rick Colman rcol...@cox.net wrote:

 Been whacking at this one for a while, and it eludes me.

 ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) ;0-9
 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA)
 ;1210-1218)

 remove only single leading paren (
 remove only trailing single paren )
 leave all others

 remove ;xxx-yyy at the end of each line (unix line) where xxx is a
 number and yyy is a number

 so that the result looks like:

 (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC)
 (E GAA)

 You will advance the state of genomic science !!!

 (yuck ... I hate RE ...)

 Rick


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339826
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


re: Monster Regex

2010-12-06 Thread Jason Fisher

Try this, where x is your original string:


clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)), 
(,))



From: Rick Colman rcol...@cox.net
Sent: Monday, December 06, 2010 2:04 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Monster Regex

Been whacking at this one for a while, and it eludes me.

((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) 
(I ATC) ;0-9
(T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) 
;1210-1218)

remove only single leading paren (
remove only trailing single paren )
leave all others

remove ;xxx-yyy at the end of each line (unix line) where xxx is a 
number and yyy is a number

so that the result looks like:

(T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA) 
(I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) 
(E GAA)

You will advance the state of genomic science !!!

(yuck ... I hate RE ...)

Rick



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339829
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Rick Colman

this mostly worked, but did not remove one of the last trailing double ))

results like:

(T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) 
(L CTG) (E GAG) (K AAA) (N AAC) (E GAA) )

On 12/6/2010 11:26 AM, Jason Fisher wrote:
 clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)),
 (,))



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339834
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Rick Colman

this removed the leading parent, but did not remove the ;xxx-yyy numbers 
at the end of each line or the final trailing paren )

like

(T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) 
;1210-1218 )

On 12/6/2010 11:16 AM, Jacob Munson wrote:
 cfset str = reReplace(str,^\(,)
 cfset str = reReplace(str,;\d+-\d+\),)


 On Mon, Dec 6, 2010 at 12:03 PM, Rick Colmanrcol...@cox.net  wrote:
 Been whacking at this one for a while, and it eludes me.

 ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) ;0-9
 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA)
 ;1210-1218)

 remove only single leading paren (
 remove only trailing single paren )
 leave all others

 remove ;xxx-yyy at the end of each line (unix line) where xxx is a
 number and yyy is a number

 so that the result looks like:

 (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC)
 (E GAA)

 You will advance the state of genomic science !!!

 (yuck ... I hate RE ...)

 Rick



 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339835
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Jason Fisher

Just add a space checker inside the '))', then, something like this:


clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((, 
(, all), )\s*), ), all)



From: Rick Colman rcol...@cox.net
Sent: Monday, December 06, 2010 3:28 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: Monster Regex

this mostly worked, but did not remove one of the last trailing double ))

results like:

(T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC) 
(L CTG) (E GAG) (K AAA) (N AAC) (E GAA) )

On 12/6/2010 11:26 AM, Jason Fisher wrote:
 clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)),
 (,))



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339837
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Jacob Munson

It worked in my test, but I now notice that you've got a space before the
trailing parens.  Try this for the second code bit:

cfset str = reReplace(str,;\d+-\d+\s*\),)

Sent with my Droid
On Dec 6, 2010 1:34 PM, Rick Colman rcol...@cox.net wrote:

 this removed the leading parent, but did not remove the ;xxx-yyy numbers
 at the end of each line or the final trailing paren )

 like

 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA)
 ;1210-1218 )

 On 12/6/2010 11:16 AM, Jacob Munson wrote:
 cfset str = reReplace(str,^\(,)
 cfset str = reReplace(str,;\d+-\d+\),)


 On Mon, Dec 6, 2010 at 12:03 PM, Rick Colmanrcol...@cox.net wrote:
 Been whacking at this one for a while, and it eludes me.

 ((T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) ;0-9
 (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC) (E GAA)
 ;1210-1218)

 remove only single leading paren (
 remove only trailing single paren )
 leave all others

 remove ;xxx-yyy at the end of each line (unix line) where xxx is a
 number and yyy is a number

 so that the result looks like:

 (T ACC) (I ATT) (T ACT) (P CCA) (E GAA) (T ACT) (S TCC) (R CGT) (P CCA)
 (I ATC) (T ACT) (M ATG) (D GAT) (H CAC) (L CTG) (E GAG) (K AAA) (N AAC)
 (E GAA)

 You will advance the state of genomic science !!!

 (yuck ... I hate RE ...)

 Rick





 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339838
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Rick Colman

getting malformed regular expression )\s*)

thank you !

On 12/6/2010 12:41 PM, Jason Fisher wrote:
 Just add a space checker inside the '))', then, something like this:


 clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((,
 (, all), )\s*), ), all)

 

 From: Rick Colmanrcol...@cox.net
 Sent: Monday, December 06, 2010 3:28 PM
 To: cf-talkcf-talk@houseoffusion.com
 Subject: Re: Monster Regex

 this mostly worked, but did not remove one of the last trailing double ))

 results like:

 (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC)
 (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) )

 On 12/6/2010 11:26 AM, Jason Fisher wrote:
 clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)),
 (,))


 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339840
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Jason Fisher

Ah, yep, forgot to escape the ) when I changed the outer function to 
REReplace:


clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((, 
(, all), \)\s*\), ), all)



From: Rick Colman rcol...@cox.net
Sent: Monday, December 06, 2010 3:55 PM
To: cf-talk cf-talk@houseoffusion.com
Subject: Re: Monster Regex

getting malformed regular expression )\s*)

thank you !

On 12/6/2010 12:41 PM, Jason Fisher wrote:
 Just add a space checker inside the '))', then, something like this:


 clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((,
 (, all), )\s*), ), all)

 

 From: Rick Colmanrcol...@cox.net
 Sent: Monday, December 06, 2010 3:28 PM
 To: cf-talkcf-talk@houseoffusion.com
 Subject: Re: Monster Regex

 this mostly worked, but did not remove one of the last trailing double 
))

 results like:

 (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC)
 (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) )

 On 12/6/2010 11:26 AM, Jason Fisher wrote:
 clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)),
 (,))


 



~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339843
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm


Re: Monster Regex

2010-12-06 Thread Rick Colman

worked!!  thank you.

On 12/6/2010 1:24 PM, Jason Fisher wrote:
 Ah, yep, forgot to escape the ) when I changed the outer function to
 REReplace:


 clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((,
 (, all), \)\s*\), ), all)

 

 From: Rick Colmanrcol...@cox.net
 Sent: Monday, December 06, 2010 3:55 PM
 To: cf-talkcf-talk@houseoffusion.com
 Subject: Re: Monster Regex

 getting malformed regular expression )\s*)

 thank you !

 On 12/6/2010 12:41 PM, Jason Fisher wrote:
 Just add a space checker inside the '))', then, something like this:


 clean = reReplace(replace(reReplace(x, \s*;\d+-\d+, , all), ((,
 (, all), )\s*), ), all)

 

 From: Rick Colmanrcol...@cox.net
 Sent: Monday, December 06, 2010 3:28 PM
 To: cf-talkcf-talk@houseoffusion.com
 Subject: Re: Monster Regex

 this mostly worked, but did not remove one of the last trailing double
 ))
 results like:

 (T ACT) (N AAC) (D GAT) (T ACT) (A GCT) (T ACT) (M ATG) (D GAT) (H CAC)
 (L CTG) (E GAG) (K AAA) (N AAC) (E GAA) )

 On 12/6/2010 11:26 AM, Jason Fisher wrote:
 clean = replaceList(reReplace(x, \s*;\d+-\d+, , all), ((,)),
 (,))




 

~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:339844
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm