codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Multiple words in regexp  blownose at 08:26 on Thursday, September 27, 2007
 

I have following..

strg: unsigned short int lngt:7

and i want $1 = strg and $2 = unsigned short int
how do I do this. I´ve tried (strg):\s?(\w+)\s+ and so on but it dosent work.

  Re: Multiple words in regexp  mimir at 20:29 on Thursday, September 27, 2007
 

the answer to your question is to do:

$1 = "strg";
$2 = "unsigned short int";


although i dont think thats what you ment to ask.





  Re: Multiple words in regexp  Sunil Kartikey at 09:08 on Tuesday, October 09, 2007
 

$str="strg: unsigned short int lngt:7";
$str =~ /(.*?):(.*) \w+:.*/;
print "\nfirst: $1\nsecond: $2\n";


output:--

first: strg
second: unsigned short int









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums
//








Recent Forum Threads
•  Ms word to be opened using javascript
•  Re: research the search - hash
•  Re: Multiple words in regexp
•  Re: How to open a MS Word document from Javascript
•  controlling an app in foreground from one running in background
•  Re: Plz its urgent:validation code
•  Carrying Value of Checkbox
•  problem in unzipping the zip files
•  Re: substitution using vars containing $1


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2007