Regex advice - 08/07/06 03:05 PM
hey guys,a little stuck with regex code and thought id come seek some advice,first 1 is:
would the following code match,as an example:
[08:47:17a EST] and [03:42:17p EST]
as an exact match on the format (not the numbers them selves)and if so,
how would i write the var so it will all be in 1 line,
would this work?
iv tried a couple ways but it seems to kill words like best , destination etc so this is why i need it to be an exact match and only block the examples.
Second part of this post is,when using special characters like « and »,example:
«(Jim)» «(Ben)» «(Freddie)» «(Mike)»
does the » have to be escaped at all or anything special on the way it has to be writing or would the following code pick up on the above
if you need anymore info plz ask away,TIA to anyone that can help
Code:
var %t = /^\[\d{2}:\d{2}:\d{2}p EST\]$/S var %t2 = /^\[\d{2}:\d{2}:\d{2}a EST\]$/S if (!$regex($1-,%t) && !$regex($1-,t2))
would the following code match,as an example:
[08:47:17a EST] and [03:42:17p EST]
as an exact match on the format (not the numbers them selves)and if so,
how would i write the var so it will all be in 1 line,
would this work?
Code:
var %t = /^\[\d{2}:\d{2}:\d{2}\(.+\) EST\]$/S if (!$regex($1-,%t))
iv tried a couple ways but it seems to kill words like best , destination etc so this is why i need it to be an exact match and only block the examples.
Second part of this post is,when using special characters like « and »,example:
«(Jim)» «(Ben)» «(Freddie)» «(Mike)»
does the » have to be escaped at all or anything special on the way it has to be writing or would the following code pick up on the above
Code:
var %n = /^\«\(?:Jim|Ben|Freddie|Mike\)»$/S if ($regex($1-,%n))
if you need anymore info plz ask away,TIA to anyone that can help