You'd treat those characters as a character set like so:
cfset myString = 'a test ## to see . where I might find % in some string'
cfset matches = REFind('[##.\/%]',myString,1,true)
cfdump var=#myString#
cfdump var=#matches#
cfabort
Putting the characters inside the square brackets forces the
I thought you cannot just place a . or \ as they are special characters. I also
need to find a double . not a single.
right now I am using '[##\\%]' and it is returning true on every evaluation.
You'd treat those characters as a character set like so:
cfset myString = 'a test ## to see .
That is correct. Try this, with \ as escape character:
REFind('[##\.\\/%]',myString)
I thought you cannot just place a . or \ as they are special
characters. I also need to find a double . not a single.
right now I am using '[##\\%]' and it is returning true on every
evaluation.
I thought you cannot just place a . or \ as they are special
characters.
The . is not special when used within a character class (the square brackets).
i.e. You do *not* need to escape [.] - that will match dot, not 'any character'.
I also need to find a double . not a single.
A character
4 matches
Mail list logo