Displaying 20 results from an estimated 20000 matches similar to: "Small regular expression question"
2010 Mar 31
3
regular expression help to extract specific strings from text
Dear all,
Lets say I have the following:
> x <- c("Eve: Going to try something new today...", "Adam: Hey @Eve, how are you finding R? #rstats", "Eve: @Adam, It's awesome, so much better at statistics that #Excel ever was! @Cain & @Able disagree though :(", "Adam: @Eve I'm sure they'll sort it out :)", "blahblah")
> x
[1]
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
2010 Aug 09
3
Regular Expression
Hi all,
>From a list of strings, I desire to filter out the followings:
1. Digits at the beginning of the strings
2. Character "SPE" following the digits (if it exists)
3. Any characters followed by hyphen
The following produces the desired result, but would like to know whether
this can be done more efficiently.
Any suggestions would be much appreciated.
dat <- c("2148
2006 Jan 25
24
RailsCron 0.2 plugin
I received feedback from some of you, saying that it would be cool if
RailsCron was even easier to manage. So I implemented a graceful
start/restart inside of the plugin''s init.rb. If you don''t like it,
comment it out and send me the feedback.
Also, I finished an update to RailsCron that allows you to attach
asynchronous processing methods to your ActiveRecord models. i.e.:
2002 Jun 15
3
refman.pdf - bookmarks & links broken (PR#1677)
Full_Name: Michael Peck
Version: 1.5.0 (12 Jun patch)
OS: win2k + sp2
Submission from: (NULL) (65.113.251.175)
Bookmarks from table of contents as well as links in text and index do not
work.
Using Acrobat Reader 5.0.5 9/24/01. [Same behavior was noted in Acrobat reader
4.0, so I downloaded the most recent version].
OS is Win 2k, R was installed from SetupRpatched.exe dated 12 June 02.
This
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,
2009 Jun 13
2
Help on Regular EXpression
hi
i need to validate user input for my designation field .
that field should accept(alphapets,numbers,-,&)
example => System support - Trainee
could u people help me with the reqular expression.
Thanks for any helps
--
Posted via http://www.ruby-forum.com/.
2017 Oct 09
0
Regular expression help
Hi Duncan,
why not split on / and take the correct elements? It is not as elegant as
regex but could do the trick.
Best,
Ulrik
On Mon, 9 Oct 2017 at 17:03 Duncan Murdoch <murdoch.duncan at gmail.com> wrote:
> I have a file containing "words" like
>
>
> a
>
> a/b
>
> a/b/c
>
> where there may be multiple words on a line (separated by spaces). The
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.
2009 Nov 13
5
Help with complicated regular expression
Colleagues,
I am using R (2.9.2, all platforms) to search for a complicated text
string using regular expressions. I would appreciate any help you can
provide.
The string consists of the following elements:
SOMEWORDWITHNOSPACES
any number of spaces and/or tabs
(
any number of spaces and/or tabs
integer
any number of spaces and/or tabs
)
Examples include:
WORD ( 123 )
WORD(1 )
2006 Jul 23
3
RfW 2.3.1: regular expressions to detect pairs of identical word-final character sequences
Dear all
I use R for Windows 2.3.1 on a fully updated Windows XP Home SP2 machine and I have two related regular expression problems.
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor
2010 Feb 08
2
the hat ^ in regular expression
Un texte encapsul? et encod? dans un jeu de caract?res inconnu a ?t? nettoy?...
Nom : non disponible
URL : <https://stat.ethz.ch/pipermail/r-help/attachments/20100208/52a6d080/attachment.pl>
2003 Jul 14
2
Subsetting a matrix
I'd welcome some comments or advice regarding the situation described
below.
The following illustrates what seems to me to be an inconsistency
in the behaviour of matrix subsetting:
> Z<-matrix(c(1.1,2.1,3.1,1.2,2.2,3.2,1.3,2.3,3.3),nrow=3)
> Z
[,1] [,2] [,3]
[1,] 1.1 1.2 1.3
[2,] 2.1 2.2 2.3
[3,] 3.1 3.2 3.3
> dim(Z)
[1] 3 3
>
2006 Jan 23
3
canreinvite always =no * no matter what we try :-(
been testing with a rather simple setup.
The mission is to actually get a reinvite to work on the lan.
I am trying with two sipura phones G.711 codec forced on both
both on the lan no nat no fancy options suchs as tT or H
No matter what we do asterisk hangs on to the media path, how
in the world do I get a reinvite to work where the media path
is actually handled by the two phones on the lan?
2005 Oct 10
1
using innov in arima.sim
Hello,
I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as
eps <- rnorm(n, sd=0.03)
z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps)
and
z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03),
I would expect z0 and z1 to be qualitatively similar. However, with n=10 the
2006 Jun 05
2
When adding a record in console, a parameter comes in as null even when I set it
In console, I am trying to create a User but the :account_id does not come
in. Console just gives me back :account_id => nil. Obviously I''m trying to
set it though. Silly console...
But, I can set the account_id column in my controller like so:
@user = User.new(params[:user])
@user.account_id = account.id
@user.save
Here''s what I give to the controller:
User.create :name
2017 Oct 09
8
Regular expression help
I have a file containing "words" like
a
a/b
a/b/c
where there may be multiple words on a line (separated by spaces).? The
a, b, and c strings can contain non-space, non-slash characters. I'd
like to use gsub() to extract the c strings (which should be empty if
there are none).
A real example is
"f 147/1315/587 2820/1320/587 3624/1321/587 1852/1322/587"
which
2006 Dec 02
1
Trouble passing arrays to C code
Hello,
I'm having more trouble with interfacing with C code. I have a
function in C that will return the result of its computation as 3
arrays. The signature of the function is as follows:
void lorenz_run(double x0, double y0, double z0, double h, int steps,
double *res_x, double *res_y, double *res_z)
The function works, as I've tested it from within C itself and the
results
2008 Feb 11
1
ctags support for puppet
This is a quick and dirty .ctags file that makes basic navigation
possible with vim and ctags, great if you have multiple files:
--langdef=puppet
--langmap=puppet:.pp
--regex-puppet=/^class[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^site[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^node[ \t]*([a-zA-Z0-9_\-]+)[ \t]*/\1/d,definition/
--regex-puppet=/^define[
2010 Jul 02
3
Good Package(s) for String and URL processing?
Are there packages that allow improved String and URL processing?
E.g. extract parts of a URLs such as sub-domains, top-level domain,
protocols (e.g. https, http, ftp), file type based on endings, check
if a URL is valid or not, etc...
I am currently only using split and paste. Are there better and more
efficient ways to handle strings e.g. finding sub-strings or to do
pattern matching?
What