473,322 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

regular express, capture fields with ()

Know perl? What's the analog for this /string(\d{1,2})/ I can't get
anything to spin up.

And, once this is running, is only the last match available with
RegExp.lastParen?

string.match(/string(\d{1,2}); no go

Thanks.
Sep 12 '08 #1
6 905
oldyork90 wrote on 12 sep 2008 in comp.lang.javascript:
Know perl? What's the analog for this /string(\d{1,2})/ I can't get
anything to spin up.

And, once this is running, is only the last match available with
RegExp.lastParen?

string.match(/string(\d{1,2}); no go
Do you have a javascript Q?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 12 '08 #2
On Sep 12, 3:09 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
oldyork90 wrote on 12 sep 2008 in comp.lang.javascript:
Know perl? What's the analog for this /string(\d{1,2})/ I can't get
anything to spin up.
And, once this is running, is only the last match available with
RegExp.lastParen?
string.match(/string(\d{1,2}); no go

Do you have a javascript Q?

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
so, I take it string.match(/string(\d{1,2}); should work. Ok, I work
it. It has to be close.
Sep 12 '08 #3
oldyork90 <ol*******@yahoo.comwrites:
Know perl? What's the analog for this /string(\d{1,2})/ I can't get
anything to spin up.
jsvar r = "string1234".match(/string(\d{1,2})/)
jsr[1]
12
And, once this is running, is only the last match available with
RegExp.lastParen?
Erm. Yes? What else?
>
string.match(/string(\d{1,2}); no go
How do you figure?

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Sep 12 '08 #4
oldyork90 wrote on 12 sep 2008 in comp.lang.javascript:
On Sep 12, 3:09 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
>oldyork90 wrote on 12 sep 2008 in comp.lang.javascript:
Know perl? What's the analog for this /string(\d{1,2})/ I can't get
anything to spin up.
And, once this is running, is only the last match available with
RegExp.lastParen?
string.match(/string(\d{1,2}); no go

Do you have a javascript Q?
[please do not quote signatures on usenet]
so, I take it string.match(/string(\d{1,2}); should work. Ok, I work
it. It has to be close.
You work what? Perl?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Sep 13 '08 #5
oldyork90 wrote:
string.match(/string(\d{1,2}); no go
^ ^
You forgot to "close" the RegExp literal. Use the script console or a
debugger before you complain next time.

<http://jibbering.com/faq/>
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Sep 13 '08 #6
On Sep 13, 1:33 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
oldyork90 wrote:
string.match(/string(\d{1,2}); no go

^ ^
You forgot to "close" the RegExp literal. Use the script console or a
debugger before you complain next time.

<http://jibbering.com/faq/>

PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
That was just a typo. Turned out to be apache/cgi.
Sep 15 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

14
by: Tina Li | last post by:
Hello, I've been struggling with a regular expression for parsing XML files, which keeps giving the run time error "maximum recursion limit exceeded". Here is the pattern string: ...
4
by: Neri | last post by:
Some document processing program I write has to deal with documents that have headers and footers that are unnecessary for the main processing part. Therefore, I'm using a regular expression to go...
3
by: | last post by:
Hi I need to write one regex to read all the fields from the following lines / file format line 1 - some_alphanumeric,some_alphanumeric,"something, something",numbers_hyphenatedORnot line 2 -...
2
by: norton | last post by:
Hi, I am learning Regular Expression and currently i am trying to capture information from web page. I wrote the following code to capture the ID as well as the Title Dim regex = New Regex( _...
5
by: Cylix | last post by:
I am going to write a function that the search engine done. in search engine, we may using double quotation to specify a pharse like "I love you", How can I using regular expression to sperate...
3
by: Zach | last post by:
Say I have a string which is of the format {A, B, C, D} for some variable number of objects. I want a regular expression that will put each of A, B, C, and D into its own separate capture...
7
by: McHenry | last post by:
I would like a regex for the following html snippet: <h2>Field1</h2> <h3> $123,456.78 - $987,654.32 </h3>
3
by: Chris | last post by:
Hi everyone, I'm trying to parse through the contents of some text files with regular expressions, but am new to regular expressions and how to use them in VB.net. I'm pretty sure that the...
5
by: shawnmkramer | last post by:
Anyone every heard of the Regex.IsMatch and Regex.Match methods just hanging and eventually getting a message "Requested Service not found"? I have the following pattern: ^(?<OrgCity>(+)+),...
4
by: mosesdinakaran | last post by:
Can any one explain how the rule is applied for the following Regular expression $Str = 'the red king'; $Pattern = '/((red|white) (king|queen))/'; preg_match($Pattern,$Str,$Val); Result:
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.