Re: Wierd regex problem (isn't it always)

2007-11-09 Thread Andy Jarrett
Thanks guys for all your help its been a good regex learning experience as usual for me :) @Ben yours is the one i've gone with thank for the comments and explanation Andy J On Nov 7, 2007 8:24 PM, Ben Doom [EMAIL PROTECTED] wrote: A handful of comments: Backreferencing a single, static

Wierd regex problem (isn't it always)

2007-11-07 Thread Andy Jarrett
Hi I'm trying to do a look through as string to find usernames and add a tags around them ala Twitter. The regex I think is fine but when I use reReplace 's back reference I'm not getting the result I thought I would of. Heres the code. Can anyone see anything obvious? Cheers, Andy !---

Re: Wierd regex problem (isn't it always)

2007-11-07 Thread Ben Doom
A handful of comments: Backreferencing a single, static character is silly. It just wastes memory and processor time. You're throwing it away, anyway. {1} is useless. It means one of. Which would just be the thing by itself. Second, {1,} is more commonly written +. Also, you are saying

RE: Wierd regex problem (isn't it always)

2007-11-07 Thread Bobby Hartsfield
http://acoderslife.com -Original Message- From: Andy Jarrett [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 07, 2007 2:04 PM To: CF-Talk Subject: Wierd regex problem (isn't it always) Hi I'm trying to do a look through as string to find usernames and add a tags around them ala

Re: Wierd regex problem (isn't it always)

2007-11-07 Thread Jon Clausen
Andy, I'm not a regex ninja, like some, but I think what you're looking for is this. Escape the space character (using ^) so that any backreferences stop at the space character. cfset reg = @([a-zA-Z0-9][^ ]+) / Then you can use the first backreference: cfset usernamePos = reReplace(str,

Regex problem.

2005-12-07 Thread J W
I have a regex brain teaser.. Well at least its teasing my brain. How do I lop off the end of a string up to and including the first ( for example: blah blah blah blah (2) (12345678) would become blah blah blah blah (2) Thanks! Jeff

RE: Regex problem.

2005-12-07 Thread Benjamin Paige
do you just not want to use string manipulation? -Original Message- From: J W [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 07, 2005 10:13 AM To: CF-Talk Subject: Regex problem. I have a regex brain teaser.. Well at least its teasing my brain. How do I lop off the end of a string

Re: Regex problem.

2005-12-07 Thread Ben Doom
Try something like: rereplace(string, (.*)\(.*?\), \1); Not tested, YMMV, and probably not very efficient. I'd probably look into more conventional string manipulation to take care of it. Like by finding all the open parens, and nixing everything from the last one on. --Ben J W wrote: I

Re: Regex problem.

2005-12-07 Thread J W
I know that I can do this with string manipulation but I thought that the regex would be more compact and faster. Am I assuming wrong? Jeff On 12/7/05, Benjamin Paige [EMAIL PROTECTED] wrote: do you just not want to use string manipulation?

Re: Regex problem.

2005-12-07 Thread Ben Doom
Regex is frequently more compact. Regex is rarely faster if there's a fairly simple way to do it using standard string manipulation. As much as I love regex, I'll use a couple of standard string manipulation functions instead if possible. --Ben J W wrote: I know that I can do this with

RE: Regex problem.

2005-12-07 Thread Benjamin Paige
Subject: Re: Regex problem. I know that I can do this with string manipulation but I thought that the regex would be more compact and faster. Am I assuming wrong? Jeff On 12/7/05, Benjamin Paige [EMAIL PROTECTED] wrote: do you just not want to use string manipulation

RE: Regex problem.

2005-12-07 Thread Ben Nadel
for Pedro -Original Message- From: J W [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 07, 2005 10:13 AM To: CF-Talk Subject: Regex problem. I have a regex brain teaser.. Well at least its teasing my brain. How do I lop off the end of a string up to and including the first ( for example

Re: Regex problem.

2005-12-07 Thread Ben Doom
Good call. Better than mine. I don't think you need the parens wrapping the literal parens, though. --Ben Ben Nadel wrote: REReplace(strInput, (\([0-9]+\))$, , ONE) Not tested removes ONE instance of the string ([:digit:]) that ENDS the string

RE: Regex problem.

2005-12-07 Thread Benjamin Paige
Wouldn't that replace the (2) as well? -Original Message- From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 07, 2005 11:28 AM To: CF-Talk Subject: Re: Regex problem. Good call. Better than mine. I don't think you need the parens wrapping the literal parens, though

RE: Regex problem.

2005-12-07 Thread Ben Nadel
Developer Nylon Technology 6 West 14th Street New York, NY 10011 212.691.1134 212.691.3477 fax www.nylontechnology.com Vote for Pedro -Original Message- From: Benjamin Paige [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 07, 2005 11:31 AM To: CF-Talk Subject: RE: Regex problem. Wouldn't

Yet another RegEx problem (But I nearly have it!)

2005-11-25 Thread Andy Mcshane
Hi all, I have to need to do the following; Change all instances of cfprocparam type=IN value=#whatever# cfsqltype=CF_SQL_WHATEVER [EMAIL PROTECTED] to become cfprocparam type=IN value=#whatever# cfsqltype=CF_SQL_WHATEVER In dreamweaver I am trying to use the find replace

RE: Yet another RegEx problem (But I nearly have it!)

2005-11-25 Thread Dave Watts
Hi all, I have to need to do the following; Change all instances of cfprocparam type=IN value=#whatever# cfsqltype=CF_SQL_WHATEVER [EMAIL PROTECTED] to become cfprocparam type=IN value=#whatever# cfsqltype=CF_SQL_WHATEVER In dreamweaver I am trying to use the

RE: Yet another RegEx problem (But I nearly have it!)

2005-11-25 Thread Andy McShane
No, I did not know this! I will have see if I can find where it is, thanks. -Original Message- From: Dave Watts [mailto:[EMAIL PROTECTED] Sent: 25 November 2005 17:16 To: CF-Talk Subject: RE: Yet another RegEx problem (But I nearly have it!) Hi all, I have to need to do the following

RE: Yet another RegEx problem (But I nearly have it!)

2005-11-25 Thread Dave Watts
No, I did not know this! I will have see if I can find where it is, thanks. Within Find Replace, choose Specific Tag and type in your tag, then choose With Attribute and type in your attribute, then select Remove Attribute and you should be all set. Dave Watts, CTO, Fig Leaf Software

Re: RegEx problem

2004-10-20 Thread Andy Jarrett
There's also CF RegEx at http://www.cfregex.com/ which is donationware Andy www.andyjarrett.co.uk On Tue, 19 Oct 2004 19:23:16 -0400, dave [EMAIL PROTECTED] wrote: http://www.regexbuddy.com/ so thats your secret charlie ;)

RegEx problem

2004-10-19 Thread Andy Jarrett
Hi there, Out of the following string i am trying to return only the value in the brackets user RegEx. String = German (Luxembourg) Is this possible in one Regex or does it have to be two? Cheers Andy J www.andyjarrett.co.uk

RE: RegEx problem

2004-10-19 Thread Matthew Walker
. To: CF-Talk Subject: RegEx problem Hi there, Out of the following string i am trying to return only the value in the brackets user RegEx. String = German (Luxembourg) Is this possible in one Regex or does it have to be two? Cheers Andy J www.andyjarrett.co.uk

RE: RegEx problem

2004-10-19 Thread dave
http://www.regexbuddy.com/ so thats your secret charlie ;) ~| This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting.

Re: RegEx problem

2004-10-19 Thread Andy Jarrett
set of brackets and nothing after the brackets. You could also use listLast() with delimiters: () -Original Message- From: Andy Jarrett [mailto:[EMAIL PROTECTED] Sent: Wednesday, 20 October 2004 12:04 p.m. To: CF-Talk Subject: RegEx problem Hi there, Out

Re: RegEx Problem Trying to Use Matched Text

2004-09-09 Thread Ben Doom
Sorry I didn't get back to this.I left early yesterday -- injury time. Anyway, Jeff already gave a good rundown of the classes available to you, so I'll just give an example. If you were searching for a simplified version of an email address like [EMAIL PROTECTED] you might look for

RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Josen Ruiseco
I am trying to follow the regex example on page 82 of Ben Forta's regular Expressions in 10 Minutes book. The example does a simple replace using matched text and reReplaceNoCase(). cfset newString = [EMAIL PROTECTED] #newString#br cfset newString = reReplaceNoCase(newString, ([EMAIL PROTECTED]),

RE: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Michael Dinowitz
CF user \1 rather than $1. It should be covered in the end of the book on language differences. _ From: Josen Ruiseco [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 1:27 PM To: CF-Talk Subject: RegEx Problem Trying to Use Matched Text I am trying to follow the regex example

RE: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Pascal Peters
In CF it is \1 : a href=""> Pascal -Original Message- From: Josen Ruiseco [mailto:[EMAIL PROTECTED] Sent: 08 September 2004 19:27 To: CF-Talk Subject: RegEx Problem Trying to Use Matched Text I am trying to follow the regex example on page 82 of Ben Forta's regular

Re: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Josen Ruiseco
Josen In CF it is \1 : a href=""> Pascal -Original Message- From: Josen Ruiseco [mailto:[EMAIL PROTECTED] Sent: 08 September 2004 19:27 To: CF-Talk Subject: RegEx Problem Trying to Use Matched Text I am trying to follow the regex example on page 82 of Ben Forta's regular

Re: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Ben Doom
CF5 doesn't support Perlish character classes (ie \w). IIRC, you can use [[:alnum:]] to replace them. BTW -- are you sure this is a direct copy from the book (aside from the \1 vs $1 change)?It looks odd in several ways to me. --Ben Josen Ruiseco wrote: I am using the following and I get

Re: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Josen Ruiseco
The regex used to find the email address and the replacement regex are from the book. The reReplaceNoCase and the output stuff is me. I do not follow you with the [[:alnum:]] example. Please expound. Josen CF5 doesn't support Perlish character classes (ie \w). IIRC, you can use [[:alnum:]] to

RE: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Jason Reichenbach
Heres a regex I use for email address finding. Maybe this can get you moving in the right direction cfset blah = ReFindNoCase([EMAIL PROTECTED]) _ From: Ben Doom [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 08, 2004 3:58 PM To: CF-Talk Subject: Re: RegEx Problem Trying to Use

Re: RegEx Problem Trying to Use Matched Text

2004-09-08 Thread Jeff Price
Josen, ColdFusion uses the POSIX regular _expression_ character sets which are listed below: alnum - the set of alpha-numeric characters alpha - the set of alphabetic characters blank - tab and space cntrl - the control characters digit - decimal digits graph - all printable characters except

RE: Regex problem

2004-05-28 Thread Pascal Peters
I don't want to be picky, but this won't work. He has a single quote too in his character set! -Original Message- From: Dave Carabetta [mailto:[EMAIL PROTECTED] Sent: donderdag 27 mei 2004 21:10 To: CF-Talk Subject: RE: Regex problem I have this _expression_ and it works great

RE: Regex problem

2004-05-28 Thread Dave Carabetta
That last quote within the brackets is a double quote, not a single quote typed twice. From: Pascal Peters [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: RE: Regex problem Date: Fri, 28 May 2004 09:39:54 +0200 I don't want to be picky, but this won't work

RE: Regex problem

2004-05-28 Thread Pascal Peters
I know, but there is a single quote between ? and / So for this to work, it should be REReplaceNoCase(clean, '[^a-z0-9.!?''/\- ]', '', 'all') -Original Message- From: Dave Carabetta [mailto:[EMAIL PROTECTED] Sent: vrijdag 28 mei 2004 16:01 To: CF-Talk Subject: RE: Regex problem

RE: Regex problem

2004-05-28 Thread Dave Carabetta
Ah, good catch. I misread your initial statement. From: Pascal Peters [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Subject: RE: Regex problem Date: Fri, 28 May 2004 16:41:58 +0200 I know, but there is a single quote between ? and / So for this to work, it should

Regex problem

2004-05-27 Thread Phillip B
I have this _expression_ and it works great. REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Now I need to add a to it with out it causing an error. How do I do that? Phillip B [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: Regex problem

2004-05-27 Thread Dain Anderson
Use two double quotes: REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Phillip B wrote: I have this _expression_ and it works great. REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Now I need to add a to it with out it causing an error. How do I do that? Phillip B [Todays Threads]

RE: Regex problem

2004-05-27 Thread Dave Carabetta
I have this _expression_ and it works great. REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Now I need to add a to it with out it causing an error. How do I do that? Couldn't you just do this instead? REReplaceNoCase(clean, '[^a-z0-9.!?'/\- ]', '', 'all') (I just changed your surrounding

Re: Regex problem

2004-05-27 Thread Phillip B
Thanks. :-] Dain Anderson wrote: Use two double quotes: REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Phillip B wrote: I have this _expression_ and it works great. REReplaceNoCase(clean, [^a-z0-9.!?'/\- ], , all) Now I need to add a to it with out it causing an error. How do I

RE: Javascript regex problem.

2003-10-07 Thread Pascal Peters
. Otherwise you will add a hyphen before each character. Pascal -Original Message- From: DURETTE, STEVEN J (AIT) [mailto:[EMAIL PROTECTED] Sent: maandag 6 oktober 2003 21:57 To: CF-Talk Subject: OT:_javascript_ regex problem. Hi all, I have a little problem with some _javascript_ and a regex

RE: Javascript regex problem.

2003-10-07 Thread DURETTE, STEVEN J (AIT)
, October 07, 2003 3:38 AM To: CF-Talk Subject: RE: _javascript_ regex problem. script language=_javascript_ !-- function dispTest(){ var UpdprojStart = ; //five spaces. UpdprojStart = UpdprojStart.replace(/\s+/ig, -); alert(| + UpdprojStart + |); UpdprojStart = 1 2 3 4 5; //a spacebefore each number

RE: Javascript regex problem.

2003-10-07 Thread Pascal Peters
PROTECTED] Sent: dinsdag 7 oktober 2003 12:31 To: CF-Talk Subject: RE: _javascript_ regex problem. Pascal, Thanks, it's weird though, I copied a regex from the _javascript_ reference and just replaced it with what came out of the vis regex editor.The reference had the quotes! Thanks again Steve

Re: OT:Javascript regex problem.

2003-10-07 Thread Ben Doom
Take the \s out of brackets.I suspect that's your problem.Also, you're replacing with a dash, not a blank. Or maybe I'm just tired. --Ben DURETTE, STEVEN J (AIT) wrote: Hi all, I have a little problem with some _javascript_ and a regex that I can't seem to figure out. I have the

Re: OT:Javascript regex problem.

2003-10-07 Thread Claude Schneegans
Hi, Don't ask me why, but you've got to pass your regular _expression_ between slashes, not quotes: try UpdprojStart = UpdprojStart.replace(/[\s]*/, -); One more stupidities of the pedantic object orientation of _javascript_ ;-)) [Todays Threads] [This Message] [Subscription] [Fast

Re: OT:Javascript regex problem.

2003-10-07 Thread Massimo, Tiziana e Federica
Don't ask me why, but you've got to pass your regular _expression_ between slashes, not quotes: try UpdprojStart = UpdprojStart.replace(/[\s]*/, -); One more stupidities of the pedantic object orientation of _javascript_ ;-)) I hate to be pedantic myself, but _javascript_ actually offer

OT:Javascript regex problem.

2003-10-06 Thread DURETTE, STEVEN J (AIT)
Hi all, I have a little problem with some _javascript_ and a regex that I can't seem to figure out. I have the following code: script language=_javascript_ !-- function dispTest(){ var UpdprojStart = ; //five spaces. UpdprojStart = UpdprojStart.replace([\s]*, -); alert(| + UpdprojStart + |);

Re: CF Regex problem

2002-08-28 Thread Jerry Johnson
Sweet. Thanks for the new info. Jerry Johnson [EMAIL PROTECTED] 08/27/02 03:54PM That's not 100% true. 1. If the first character of a set is a close bracket and there's no open bracket in the set, then it will match: []0-9] will match ]0123456789 2. If the open bracket is anywhere in the

CF Regex problem

2002-08-27 Thread Matthew Fusfield
Hi there, I'm having a problem in CF5 - if I try to use a regular expression to match a pattern that contains either the [ or ] characters, the find fails. I've already tried escaping each and using ascii character codes instead of the actual character, but I can't seem to make it work. If I

Re: CF Regex problem

2002-08-27 Thread Michael Dinowitz
I haven't seen such a problem in the past. If you can post your RegEx we can look it over and test it. Hi there, I'm having a problem in CF5 - if I try to use a regular expression to match a pattern that contains either the [ or ] characters, the find fails. I've already tried escaping each

CF Regex Problem

2002-08-27 Thread Matthew Fusfield
Hi there, I'm having a problem in CF5 - if I try to use a regular expression to match a pattern that contains either the [ or ] characters, the find fails. I've already tried escaping each and using ascii character codes instead of the actual character, but I can't seem to make it work. If I

Re: CF Regex problem

2002-08-27 Thread Jerry Johnson
From the Advanced Cold Fusion 5 Application Development, by Ben Forta, page 230: [ and ] Brackets delimit a character class and are not allowed within the class itself. Cold Fusion RegEx does not allow them as escaped characters. Of course, the [:punct:] class handles them as well as all the

Re: CF Regex problem

2002-08-27 Thread Michael Dinowitz
That's not 100% true. 1. If the first character of a set is a close bracket and there's no open bracket in the set, then it will match: []0-9] will match ]0123456789 2. If the open bracket is anywhere in the set without a close bracket, it'll match: [0-9[] will match [0123456789 [[0-9] will

RE: CF Regex problem

2002-08-27 Thread Matthew Fusfield
- From: Michael Dinowitz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 2:31 PM To: CF-Talk Subject: Re: CF Regex problem I haven't seen such a problem in the past. If you can post your RegEx we can look it over and test it. Hi there, I'm having a problem in CF5 - if I try to use

Re: CF Regex problem

2002-08-27 Thread Michael Dinowitz
is This is some text as you'd expect it to be. Thanks for any ideas, Matt -Original Message- From: Michael Dinowitz [mailto:[EMAIL PROTECTED]] Sent: Tuesday, August 27, 2002 2:31 PM To: CF-Talk Subject: Re: CF Regex problem I haven't seen such a problem in the past. If you