f



Regex

Hi friends,

I have a little question about a test that I want to build with a regular
expression.

*** Subject 1 : My users send me a dynamic list of parameters. One of this
parameter is Filename= with the name of a file and I want to catch the name
of the file and save it on a variable named TARGET.

I wrote a Prxchange call but it works (more or less) only if I have one
parameter.

data cc;
length c $ 60 Target $ 60;
input c $60.;
prxNum=prxParse('s/(filename+)=[ ]*([a-zA-Z]*).(txt)[ ]/$2/');

CALL prxChange (prxNum,1,c,Target ,newLength,wasTruncated,numberChanges);
datalines;
 filename=Premier.txt
filename=John.txt
filename= BaaBaa.txt
hello
;

=> But what is the syntax if I have something before and / or after ?:


data cc;
length c $ 60 Target $ 60;
input c $60.;

prxNum=prxParse('s/(filename+)=[ ]*([a-zA-Z]*).(txt)[ ]/$2/');

CALL prxChange (prxNum,1,c,Target ,newLength,wasTruncated,numberChanges);
datalines;
 filename=Premier.txt, path=toto
a=1,  b=2 , path=toto, filename=John.txt
a=1,b=2,filename= BaaBaa.txt
Prince
;


***Subject 2 : Now I want to analyze mystring named C and if I find the
parameter PATH=xxxx I want to delete it. I save the string in TARGET2. Is it
possible to do that ?

Thanks :-/

Stephane.
0
scolas (213)
8/2/2008 11:31:46 AM
comp.soft-sys.sas 142828 articles. 3 followers. Post Follow

0 Replies
1899 Views

Similar Articles

[PageSpeed] 26

Reply:

Similar Artilces:

soft that genereta regex
hi all, is there someone who knows if there is a software that by a given string returns the correct regular expression for extract him from a text? Thx a lot SHE -- Posted via Mailgate.ORG Server - http://www.Mailgate.ORG Sheela wrote: > hi all, > is there someone who knows if there is a software that by a given string > returns the correct regular expression for extract him from a text? > > Thx a lot > SHE > > Did you know that there are many many different regex, that can match one string and it is impossible to generate the one, that you really need. bette...

SAS CONNECT/SAS Display Manager or BASE SAS
Hi, We have SAS EBI Server license. Many or our SAS Programmer wants to use BASE SAS (or SAS Display Manager) instead of SAS Enterprise Guide. But As you know Windows Server comes with only two terminal licenses. I see that we have SAS/CONNECT license (which came with BI suite). Can I install BASE SAS on PC and use SAS/CONNECT to run code on the server? Or Do we have to buy PC license for BASE SAS? What's options we have. Please help. Thanks On Oct 21, 8:11=A0am, abcu...@YAHOO.COM (Abc Unha) wrote: > Hi, > We have SAS EBI Server license. Many or our SAS Programmer wants to =A0us...

RCR: regex + regex
Feedback on the following suggestion for ruby: by default allow for adding regex's i.e. >> /foo/ + /bar/ => /foobar/ Thoughts? -r -- Posted via http://www.ruby-forum.com/. On Oct 26, 2009, at 5:13 PM, Roger Pack wrote: > Feedback on the following suggestion for ruby: > by default allow for adding regex's > > i.e. >>> /foo/ + /bar/ > => /foobar/ > > Thoughts? > -r > -- irb> a=/foo/ => /foo/ irb> b=/bar/ => /bar/ irb> class Regexp irb> def +(other) irb> self.class.new(self.to_s + other.to_s) irb> end irb> end => nil irb> a+b => /(?-mix:foo)(?-mix:bar)/ This is obviously too naive an implementation, but if we change a to / foo/i then I'd expect "Foobar" =~ (a+b) to be true (well, I mean 0, of course) and "fooBar" =~ (a+b) to be nil. What might be the corresponding * or - behaviors? It seems like a * b is closer to /(a)*(b)/ than anything else I could think of and that immediately implies: a + b becomes: /(a)+(b)/ rather than just /(a)(b)/ The fact that + is a meaningful character in a Regexp makes a universal meaning for it as an operation *on* regexps a bit ambiguous. -Rob Rob Biedenharn http://agileconsultingllc.com Rob@AgileConsultingLLC.com > What might be the corresponding * or - behaviors? It seems like > a * b > is closer to > /(a)*(b)/ That's what I'd guess for *, as well. > than anything e...

Deploy to web server ( soft-sys )
I would like to run my script on a web server that I do not have root access with (i.e. cannot install anything). My script reads an image (from a given URL), uses some Image Processing Toolbox functions, then writes the image. No user input/output is needed and no GUI functionality, just file I/O. I have been playing with a simple hello-world script and the Compiler Toolbox, and I have been trying to run the resulting binaries from ssh on the web server (Linux environment), but what I am seeing is that the MCR must be installed to the deployed machine. Hopefully I am wrong about this, because I need everything completely self-contained so that I can run it strictly within my folder on the server. Can I please get a suggestion on how to proceed with this? Any direction would be greatly appreciated ASAP (project deadline approaching fast). Thanks! Take a look at the Web Figures section of the Java Builder documentation: http://www.mathworks.com/access/helpdesk/help/toolbox/javabuilder/ug/... Or you can use CGI to call your program on the server, have your program generate a JPEG, and then have the server send back a page with the JPEG's url embedded in it. A little tricky, but it can be done. "James " <jamesgpain...@removethis.gmail.com> wrote in message I will look over the documentation, but I believe my problem lies in the inability to use CGI to call the program, since the run-time components cannot be installed to the system folders. I do not hav...

Re: Need SAS RegEx Help ! #2
Alan: Thank you so much for taking the time assist us -- it works great ! It's not fun being in on the weekend, but thanks to you, we will be a little further along in this project. Again, thank you, it's much appreciated :-) ! -Gerry -----Original Message----- From: Alan Churchill [mailto:SASL001@savian.net] Sent: Friday, November 17, 2006 7:57 PM To: 'Gerry'; SAS-L@LISTSERV.UGA.EDU Subject: RE: Need SAS RegEx Help ! Even better: data _null_ ; input; _infile_ = prxchange('s/<href="\.{2}\//<href="\//',-1,_infile_) ; put _infile_; datalines; <href="../myimages/office/xxx.pdf">XXX</A> ; run; .... 33 data _null_ ; 34 input; 35 _infile_ = prxchange('s/<href="\.{2}\//<href="\//',-1,_infile_) ; 36 put _infile_; 37 datalines; <href="/myimages/office/xxx.pdf">XXX</A> NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 39 ; 40 run; Alan Churchill Savian "Bridging SAS and Microsoft Technologies" www.savian.net -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Gerry Sent: Friday, November 17, 2006 3:04 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Need SAS RegEx Help ! SAS RegEx Gurus: Below is test code that I was using to help one of our programmers. We've gotten through 4 programs so far, with sim...

computer 2008 model for soft ware sys..
wf fefh dfkl http://www.freewebs.com/thuiss/ http://indianfriendfinder.com/go/g906725-pmem ...

Is there any soft in Linux/Unix like sas in windwos?
Hi all, I'm a sas user. At the same time, I'm also a linux user. but there's one thing stop me from completely transforming to linux-sas. I'm statistical major, many our courses use sas as a tool. but I can not find sas in linux. Anyone know if there is some project to transplant sas to linux, like the counterpart of S-plus is R. Really hope that one day I could remotely use sas in linux like I did in R. Flamingo wrote: > Hi all, > I'm a sas user. At the same time, I'm also a linux user. but there's > one thing stop me from completely transforming to l...

Re: What r the data types in SAS? in Base SAS , and SAS SQL
> From: Amar Mundankar > Sent: Tuesday, July 21, 2009 8:10 AM > To: sas-l@uga.edu > Subject: What r the data types in SAS? in Base SAS , and SAS SQL > > Hi all, > What are the different data types in Base SAS and SAS SQL?? character, lengths from 1 to 32,000+ numeric: lengths from 2 to 8 dates are a subtype of numeric and are identified by their date, datetime, or time formats the new proc TSPL (Table Server Processing Language) supports ANSI data types: bigint, tinyint, etc. http://support.sas.com/documentation/cdl/en/tsag/30878/HTML/default/a003 065339.htm http://s...

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year.
I took the advanced exam this April because I wanted a relatively systematic way of assessing my knowledge of SAS in a short time span. For that purpose, it was worth it. Since I learn SAS by doing new tasks, or re-doing old tasks in a new way, I assume my knowledge of SAS is uneven, even though I am regarded as productive, and frequently creative in using SAS to solve our group's problems. I passed the test, with lower subscores on the components that I expected to be weakest on. I thought many of the questions made me think about some fundamental, sometimes subtle, features of the lan...

SAS-L Panel / SAS-L vs. SAS Institute Tech Support
[This is part of a report on a panel discussion about SAS-L which took place during the 2003 NESUG conference. Partcipants: Paul Dorfman, Ron Fehd, Phil Mason, Barbara Okerson, Dianne Louise Rhodes, David Septoff; also Ray Pass] On the subject of SAS-L vs. SAS Institute Tech Support ... Dianne noted that a real strength of SAS-L is that it functions 24 hours a day, seven days a week. She recalled a situation in which she helped somebody who had a project deadline on Christmas Eve. Ron pointed out that SI technical support sometimes is slower because problems often must be handed off, somet...

regex =~ string or string =~ regex?
Sometime I saw you wrote regex =~ string, while sometime you wrote string =~ regex. What's their difference and what's the recommended way? Thanks. Jenn. On 01/04/2010 10:27 AM, Ruby Newbee wrote: > Sometime I saw you wrote regex =~ string, while sometime you wrote > string =~ regex. > What's their difference and what's the recommended way? Thanks. The first version invokes method Regexp#=~ and the second version invokes String#=~ - which happen to do roughly the same although I believe the second one to be a tad slower. I personally prefer the first form becau...

To SAS or not To SAS (or whatever else)!!,
Hi all, This message is directed primarily to individuals in these groups who have long experience using both SPSS and SAS (or any other statistically oriented/data intensive analytic tools) with a heavy data volume and frequent reporting requirements. I am pretty open to any and all suggestions. In any normal context I wouldn't be caught dead with a SAS manual, and my obit will probably read, "We had to pull the SPSS manual from his cold dead hands, and needed to break some fingers to boot." BUT, I recently accepted a position where part of my responsibilities will involve...

SAS 9 and SAS 8
Could someone send me the papers or articles that gives the differences between sas 8 and sas 9 and new function and changes in sas 9. Thanks http://support.sas.com/documentation/whatsnew/index.html and many proceedings at http://www.lexjansen.com On Nov 20, 3:28=A0pm, pausha <paus...@gmail.com> wrote: > Could =A0someone send me the papers or articles that gives the > differences between sas 8 and sas 9 and new function and changes in > sas 9. > > Thanks ...

SAS and SAS/IML TO C
Dear Users, There's some way to convert SAS and/or SAS/IML codes to C code? Thanks, Ricardo=20 ***************************************************************************= ******* As informa=E7=F5es contidas nesta mensagem e no(s) arquivo(s) anexo(s) s=E3= o=20 endere=E7adas exclusivamente =E0(s) pessoa(s) e/ou institui=E7=E3o(=F5es) a= cima=20 indicada(s), podendo conter dados confidenciais, os quais n=E3o podem, sob = qualquer forma ou pretexto, ser utilizados, divulgados, alterados,=20 impressos ou copiados, total ou parcialmente, por pessoas n=E3o autorizadas= ..=20 Caso n=E3o sej...

SAS programming and SAS/BI
I'm considering a position that deals mostly with SAS/BI, but I currently do SAS programming. >From what I've read, it hasn't been to clear what all is involved with SAS/BI in terms SAS programming. So I take it there's really isn't much programming involved. So is SAS (i.e. data steps, procs, etc.) the back-bone of SAS/BI and is SAS code generated using the graphical interface of SAS/BI which can be saved and further customized ? Thanks. <div>Auto..,</div> <div>&nbsp;</div> <div>&nbsp;</div> <div>&gt;From what ...

perl regex to java regex
I am trying to convert a piece of code from using perl regexes to using java regexes. I need some help with converting the following two PERL syntax regex's to java syntax regex's. Can anyone please help 1. FIRST_PERL_REGEX = "/^[\\d]*$/" 2. SECOND_PERL_REGEX = "/^[\\d]*/" (All I am trying to do in the above regex's is try to look for an integer) essentially I need the equivalent FIRST_JAVA_REGEX and SECOND_JAVA_REGEX for the above. "Rick Venter" <rick_venter@yahoo.com> wrote in message news:e6f6eb95.0310290901.38be6c02@posting.google.com.....

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #10
I actually think you are straight-jacketing the interview for a senior person. I would definitely look for someone who thought outside of the box. That may be ways of doing things other than macros or ODS or else putting a new spin on them. I ditched most of the macro language a decade ago, for example. As a hiring manager, I always went for creativity and not specific skills on hand and was very pleased with my hires. But hey, I don't hire anymore so it isn't something I have to face. BTW, no client has ever asked me for certification nor have I been quizzed on specific SAS knowledg...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #3
Wow, that was a leap. Better not use Apache or PHP then. Andy >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On >Behalf Of ben.powell@CLA.CO.UK >Sent: Thursday, February 05, 2004 10:37 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) > >Sounds like R is the SAS equivalent of Linux .. who are >incidentally in all >sorts of a copy left/right mess at the moment. > >On Thu, 5 Feb 2004 09:39:37 -0500, Peter Flom <flom@NDRI.ORG> wrote: > >>I use both SAS a...

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #8
On Tue, 4 Sep 2007, Alan Churchill wrote: > It seems that a test like this would toss me out of the pool from the > get-go. Heck, maybe that's what the goal would be ;-] Well then, maybe the rest of us might have a chance then :) Given that I have not used SAS regularly in months, I would be hurting. Hopefully, I would not be tossed immediately either. Isn't one point of the test to allow a organization to call itself a partner or some other distinction? Maybe to be listed among companies on SI's websites? Kevin Kevin Viel, PhD Post-doctoral fellow Department of Geneti...

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #11
Kevin, Thank you for the nice words...I am sure I wouldn't have a chance on any stat exam, BTW. What I am good at is being in an absolute crisis and trying to get it solved with no time on the clock. That is why I think in a quirky manner. When the obvious isn't working, take a different path because there is simply no time left. It's what I did at MCI, SAS, and now as an independent. ....and that skill will not be measured on a certification exam or plopping me in front of a PC to hammer out an example SAS program. For any candidate, I can pick up their technical level with a few questions and watching their reactions. Alan Alan Churchill Savian www.savian.net -----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Kevin Roland Viel Sent: Tuesday, September 04, 2007 4:02 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. On Tue, 4 Sep 2007, Alan Churchill wrote: > It seems that a test like this would toss me out of the pool from the > get-go. Heck, maybe that's what the goal would be ;-] Well then, maybe the rest of us might have a chance then :) Given that I have not used SAS regularly in months, I would be hurting. Hopefully, I would not be tossed immediately either. Isn't one point of the test to allow a organization to call itself a partner or some other distinction? Maybe to be listed among companies on SI's websites? Kevin Kevin ...

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #4
Ed , I still contend and stick with they should both be able to program and know how SAS works. I prefer the intervewing company give a test, were the person being interviewed is sat in front a laptop or desktop and told to write code to solve some problems. No online help no books just the persona nd the computer. This weeds out those who can code and those who cant, from those who can you then talk to them about the code they wrote and you can deduce those who understand how SAS works and thos who dont. The pool you are left with are the qualified candidates atleast from a SAS perspecti...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #5
I think that SAS and R are very similar, even though their designs are very different. What matters is that both can be used to accomplish the same things - just as English and Swahilli serve the same purpose (communication) equally well. As for the copyleft "mess", do you really believe the propaganda and outright lies perpetrated by some companies? Remember, they want you to pay $$$ for your software, and copyleft poses a huge threat to that goal. -----Original Message----- From: Peter Flom [mailto:flom@NDRI.ORG] Sent: Thursday, February 05, 2004 12:57 PM To: SAS-L@LISTSERV.UGA....

Re: SAS Advanced Programming Exam for SAS 9: SAS Joke of the year. #7
Well Toby, let me ask something then. Since I am not an ODS fan and haven't used proc report/tabulate for some time, would that be an automatic disqualifier since you don't allow reference books or materials? SAS does not provide tools that help me code ODS (except for EG) and therefore a reference material is all I would need. Now, it's not like I haven't used proc report (used it extensively at one time), it's just that I prefer other means to produce the final output. It seems that a test like this would toss me out of the pool from the get-go. Heck, maybe that's wh...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #2
Sounds like R is the SAS equivalent of Linux .. who are incidentally in all sorts of a copy left/right mess at the moment. On Thu, 5 Feb 2004 09:39:37 -0500, Peter Flom <flom@NDRI.ORG> wrote: >I use both SAS and R; I"ve used SAS for 10 or 15 years, R for about 6 >months - 1 year. > >Each has strengths and weaknesses; I'd not like to give up either. > >Strengths of SAS (esp. compared to R) > >Tech support - I have SAS tech support's phone number and our license >number memorized. They're great. > >SAS-L - There's also an R-help list...

Re: R vs. SAS (was Replacement for SAS (SPSS vs. SAS, redux)) #4
No, sorry if I made it sound that way..... SAS and R are totally different in the way they work, how they are structured, what the statements look like, and so on. Not like French and Spanish, not even like English and Spanish. More like English and Swahilli. R has a lot in common with S Plus, both are based on the S language. But there is no hostility that I know of between S Plus and R (unlike the situation with Linux) Peter >>> <ben.powell@CLA.CO.UK> 2/5/2004 10:36:32 AM >>> wrote Sounds like R is the SAS equivalent of Linux .. who are incidentally in all sort...