![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.javascript archiveRegExp and special caracters
From: arno <arno.@no-log.org>
Date: Sat Feb 04 2006 - 12:06:06 CET
Hi,
I want to search a substring within a string :
fonction (str, substr) {
My problem is that my string (and my substring) may contain the special
substr = 'a$b';
So in str.search(substr), the $ will be considered as an end of line
I found a solution by first escaping the $ :
fonction (str, substr) {
but I'd like to known if you think of a better way to do it, for example
thanx
|