Displaying 20 results from an estimated 100000 matches similar to: "Using a RegExp to exclude an email address"
2006 Jun 13
0
HTTP validation regexp, possible solution
There was an old email thread from the end of January 2006 discussing
regular expressions for matching URLs. I took some of the sample
expressions and tweaked them a bit to the point where I think they
are pretty useful. They pass all of my tests anyway. :-)
For a reminder, here''s a sample message from that thread. My code is
below it.
On Jan 26, 2006, at 5:28 AM, Nathaniel S.
2006 Sep 10
1
validates_format_of :something, :with => /REGEX/
Hi all,
I''m hoping to stir the Rails pot a little bit here, so please go easy
with me ;-)
Regular Expressions is the most densely inhumane language construct
ever invented in any ''civilisation'', and the fact that we still have
to dirty our minds with this in Rails is something that (sh/c)ould
ideally be corrected in Rails (preferably before the release of 1.2
2006 Feb 19
4
Multiple Characters Negate Using Regexp
Dear experts,
I am trying to build a regular expression to filter out anything between <script ... > and </script> tags where I can specify something using negate class to exclude more than one character in sequence.
I tried:
originalresponse.gsub(/<script([^>]+)>([^<]+)?<\/script>/,'''')
but obviously if the script has the
2007 Feb 16
13
negate the regexp in validates_format_of
Railsters:
ActiveRecord''s validation system puts other database systems to shame.
However, the newbies might not know how to write a regexp that
excludes a match, instead of tests for it. Understand - I''m just
asking this question to help them. I have been using Regexps since
''grep'' on Xenix! But the newbies here might not know how to do this:
2002 Nov 11
0
Regular Expression support
I have added regular expression support using a POSIX implementation.
The patch (against 2.5.5) is attached.
The implementation is simple and follows the same mechanism that is
implemented for normal searches.
I added these command line arguments:
--rexclude=PATTERN exclude files matching regexp PATTERN
--rexclude-from=FILE exclude regexp patterns listed in FILE
--rinclude=PATTERN
2008 Jun 07
3
DRY validates_format_of?
In a model I have following validates_format_of. Is there an easy way to
DRY this up? It seems to be rather repetitive.
validates_format_of :expiration_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :activation_date, :with =>
/^[0-9]{4}[-][0-9]{2}[-][0-9]{2}$/
validates_format_of :some_other_date, :with =>
2017 Mar 06
0
[PATCH v2] v2v: Fix invalid regexp in file_contexts file (RHBZ#1374232).
Instead of just documenting this bug, fix it in the file_contexts
file.
Replaces commit ad3c8fe7f49c4991e1aa536856a1a408f55d5409.
---
customize/SELinux_relabel.ml | 20 ++++++++++++++++++++
v2v/virt-v2v.pod | 11 -----------
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/customize/SELinux_relabel.ml b/customize/SELinux_relabel.ml
index fa9603c..d3b9325 100644
---
2003 Nov 26
0
Question about Unix file paths (and proposal for new regexp class)
> Date: Wed, 26 Nov 2003 13:52:44 +0100
> From: Martin Maechler <maechler@stat.math.ethz.ch>
> To: <Kurt.Hornik@wu-wien.ac.at>
> Cc: <r-devel@stat.math.ethz.ch>
> Subject: Re: [Rd] Question about Unix file paths
>
>
>
> >>>>> " Kurt" == Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>
> >>>>> on Wed, 26
2017 Mar 06
2
[PATCH] v2v: Fix invalid regexp in file_contexts file (RHBZ#1374232).
Instead of just documenting this bug, fix it in the file_contexts
file.
Replaces commit ad3c8fe7f49c4991e1aa536856a1a408f55d5409.
---
customize/SELinux_relabel.ml | 19 +++++++++++++++++++
v2v/virt-v2v.pod | 11 -----------
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/customize/SELinux_relabel.ml b/customize/SELinux_relabel.ml
index fa9603c..69a4779 100644
---
2016 May 31
2
sieve vacation script exclude based on sender email address
I thought I'd asked this question a few years ago but can't seem to find any eveidence of that so
here goes.
I've been looking at the sieve docs and recipes, done a lot of googling but no joy so far.
Using stanard vacation script and that works great, however I want to exclude certain sender
email addressess from ever receiving a vacation autoresponse, how do I go about adding that
2003 Apr 23
2
Fixing some exclude/include bugs
As threatened a while back, there are some exclude/include bugs that I'd
like to see fixed in rsync. Here is the patch:
http://www.blorf.net/rsync-exclude.patch
This fixes the following bugs:
- A non-anchored, slash-including pattern with a wildcard needs to be
matched at the end of the path (e.g. "CVS/R* should match throughout
the tree, not just at /CVS/R*).
- A leading
2024 Apr 11
3
Regexp pattern but fixed replacement?
I noticed this issue in stringr::str_replace, but it also affects sub()
in base R.
If the pattern in a call to one of these needs to be a regular
expression, then backslashes in the replacement text are treated specially.
For example,
gsub("a|b", "\\", "abcdef")
gives "def", not "\\\\def" as I wanted. To get the latter, I need to
escape
2005 Aug 10
5
validates_format_of on an optional field using :if
Hi there,
I''ve got the following in my model:
validates_format_of :postcode,
:with => /^([a-zA-Z]{1,2}[0-9]{1,2} [0-9]{1}[a-zA-Z]{2})$/,
:message => "is not valid",
:if => :postcode
... but it''s not working - it always insists on validation, even if postcode
is empty. Basically, the postcode field is optional, but if it''s filled in, I
want to
2006 Jan 20
4
validates_format_of > Invalid regular expression with simple pattern
Hello,
I try this :
validates_format_of :name , :with => /^[A-z0-9_.- ]*$/ , :message =>
"bad characters"
for accept any name with chars "A" to "z" , "0" to "9" , with "_" "."
"-" and " "
The pattern is really simple but I have this error :
SyntaxError in Login#register
2001 Oct 19
4
Exclude
Hi Folks,
I'm running rsync between an NT client and a Solaris 7 Server (Ver 2.4.6).
I'd like to be able to exclude the following directory:
/opt/IBMHTTPDLOG/archivelogs
but retrieve
/opt/IBMHTTPDLOG
My setup is:
rsync -av -p -e rsync@server1.cna.com:/opt/IBMHTTPDLOG/
F:/opt/IBMHTTDLOG
(client)
rsync --daemon --exclude-from=/etc/rsync.exclude
(server)
What I get is
2018 May 07
1
[PATCH] daemon: tweak regexp for file type detection (RHBZ#1575640)
Newer versions of file slightly changed the output, removing the comma
between the type, and the architecture string.
Tweak the regular expression so:
- the comma is optional, but if missing then only the architecture
string will follow
- the architecture string has no commas
---
daemon/filearch.ml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/daemon/filearch.ml
2007 May 22
1
regexp bug in very recent r-devel
completion is semi-broken in today's r-devel, and the reason seems to
be some regular expression changes:
> sessionInfo()
R version 2.6.0 Under development (unstable) (2007-05-22 r41673)
i686-pc-linux-gnu
locale:
[...]
attached base packages:
[1] "stats" "graphics" "grDevices" "utils" "datasets" "methods"
[7]
2017 Mar 06
0
Re: [PATCH] v2v: Fix invalid regexp in file_contexts file (RHBZ#1374232).
On Monday, 6 March 2017 11:43:14 CET Richard W.M. Jones wrote:
> Instead of just documenting this bug, fix it in the file_contexts
> file.
>
> Replaces commit ad3c8fe7f49c4991e1aa536856a1a408f55d5409.
> ---
> customize/SELinux_relabel.ml | 19 +++++++++++++++++++
> v2v/virt-v2v.pod | 11 -----------
> 2 files changed, 19 insertions(+), 11 deletions(-)
>
2009 Sep 28
2
dichromat, regexp, and grid objects
Dear list,
The dichromat package defines a dichromat function which "Collapses
red-green color distinctions to approximate the effect of the two
common forms of red-green colour blindness, protanopia and
deuteranopia."
library(dichromat)
library(grid)
colorStrip <-
function (colors = 1:3, draw = TRUE)
{
x <- seq(0, 1 - 1/length(colors), length = length(colors))
y <-
2006 Feb 21
2
validates_format_of :url, regexp?
Hey,
Does anybody have a regexp for validating URLs? I found this one and am
trying to adapt it:
^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\''\\\+&%\$#\=~_\-]+))*$
(http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21245168.html)
I also found this one, but, um,