Skip to main content
Participant
December 18, 2006
Question

Regex

  • December 18, 2006
  • 2 replies
  • 495 views
I am using a regex to replace all the special characters, spaces from a string.

s1 = 'This is a sample code, please; look at page 49'

ReReplace(s1, "[,;\s]", ",", "ALL" )>

so basically..all words are seperated with commas now. However, I don't get number 49 as one of words, why is that so?
This topic has been closed for replies.

2 replies

December 18, 2006
yeah, it's working fine here too...so that's kinda weird. any other code relevant to that snippet that might be chopping off your last list element?

you -could- just do a listChangeDelims(s1, ' ', ',')...

altho even if that works, it doesn't solve the mystery of the disappearing 49 using the regex...
phollyAuthor
Participant
December 19, 2006
Is there any better regex other then what I am using to replace all or any kinds of characters and spaces from a line of text..viz !,:;?"&@-.%+..and so on..
December 18, 2006
not sure what you're asking. are you expecting a comma after the 49? or are you looking to remove the from the string?
phollyAuthor
Participant
December 18, 2006
Hi CJ - basically..using the rereplace is giving me

this, is, a, sample, code, please, look, at, page,

the number 49 is getting omitted altogether.