syntax « Regular Expression « Javascript Data Type Q&A

Home
Javascript Data Type Q&A
1.Array
2.Clojure
3.date
4.decimal
5.function
6.global
7.loop
8.math
9.number
10.object
11.Regular Expression
12.scope
13.String
14.Var
15.variable
Javascript Data Type Q&A » Regular Expression » syntax 

1. Why do these javascript regex throw syntax errors?    stackoverflow.com

I am trying to validate a text string as a date before processing it, however both of the regex i have tried are throwing syntax errors and I can't see why. ...

2. syntax error with look-behind assertion in javascript regular expression    stackoverflow.com

I'm staring blank on this error, so I hope someone here can point out where I go wrong. This function should replace a parameter's value in a querystring with a new value:

function ...

3. /PM regex syntax for sending message in chat-room    stackoverflow.com

I am working on a AJAX/PHP chatroom and am currently stuck on the regex to detect if a user has send a PM & then work out who it is too ...

4. /regex/(string) considered harmful?    stackoverflow.com

In javascript you can match regular expression with regex(string) syntax. However the syntax isn't very used as far as I know, anybody know why?

5. Can anyone explain this JavaScript grammar(syntax) please?    stackoverflow.com

I'm reading a js file at here, on the very top of this js file you can find the following lines:

var 
gsAgent=navigator.userAgent.toLowerCase(),
gsAppVer=navigator.appVersion.toLowerCase(),
gsAppName=navigator.appName.toLowerCase(),
gbIsOpera=gsAgent.indexOf("opera")>-1,
gbIsKHTML=gsAgent.indexOf("khtml")>-1
||gsAgent.indexOf("konqueror")>-1||gsAgent.indexOf("applewebkit")>-1,
gbIsSafari=gsAgent.indexOf("applewebkit")>-1,
gbIsIE=(gsAgent.indexOf("compatible")>-1&&!gbIsOpera)
||gsAgent.indexOf("msie")>-1,
gbIsTT=gbIsIE?(gsAppVer.indexOf("tencenttraveler")!=-1?1:0):0,
gbIsFF=gsAgent.indexOf("gecko")>-1&&!gbIsKHTML,
gbIsNS=!gbIsIE&&!gbIsOpera&&!gbIsKHTML&&(gsAgent.indexOf("mozilla")==0)
&&(gsAppName=="netscape"),
gbIsAgentErr=!(gbIsOpera||gbIsKHTML||gbIsSafari||gbIsIE||gbIsTT
||gbIsFF||gbIsNS),
gbIsWin=gsAgent.inde 

6. javascript regex match function syntax help    stackoverflow.com

I have an input textbox that runs a js function on the keyup event to match for a valid string (domain name pattern match, the regex was found on here). ...

7. How to extract the webkit transformation syntax in Javascript    stackoverflow.com

I would like to extract the individual elements of a composite webkit transformation in Javascript. For example:

var act_transform = element.style.webkitTransform
gives me:
scale(0.6) translate(0px, 2236px) rotate(12deg)
What is good human readable, but terrible to ...

8. Question on this JavaScript Syntax ("What Does This Do?")    stackoverflow.com

John Resig wrote a nifty Class function, swanky. I'm trying to figure out what is going on, and have pretty much everything figured out except a single line:

fnTest = /xyz/.test(function () ...

9. JavaScript RegEx Syntax Error    stackoverflow.com

I have created the following Regular Expression in C# to extract tokens from a string in the format {token}. I developed the regex in C# and confirmed that it works.

// c#
var ...

10. Regex Syntax for string    stackoverflow.com

I have a regex that I'm trying use to validate against strings. Trying to catch anything that is not: Upper Case alpha, Number, -, /, does not contain spaces and must be ...

11. What are these javascript syntax called? "/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/"    stackoverflow.com

I have the following code as part of my email validation script. I'd like to learn more about the variable reg but don't know how to find relevant information because I ...

12. Ambiguous interface of RegExp    stackoverflow.com

Something very strange.

var body="Received: from  ([195.000.000.0])\r\nReceived: from  ([77.000.000.000]) by   (6.0.000.000)"
var lastMath="";
var subExp = "[\\[\\(](\\d+\\.\\d+\\.\\d+\\.\\d+)[\\]\\)]"
var re = new RegExp("Received\\: from.*?"+subExp +".*", "mg");
var re1 = new RegExp(subExp , ...

13. javascript: some problem with compiler interpreting // as comments in regex     stackoverflow.com

I've got this regular expression for validating phone numbers

^(\+?|(\(\+?[0-9]{1,3}\))|)([ 0-9.//-]|\([ 0-9.//-]+\))+((x|X|((e|E)(x|X)(t|T)))([ 0-9.//-]|\([ 0-9.//-]+\)))?$
I dugged it out from my C#/vb library and now i want to translate it into javascript. But it ...

14. JavaScript RegEx Syntax    stackoverflow.com

I'm writing C# code to parse JavaScript into tokens, and my knowledge of JavaScript is not 100%. One thing that threw me is that JavaScript regular expressions are not enclosed in quotes. ...

15. Javascript regex syntax for HTML5 input validation    stackoverflow.com

So there have been plenty of questions, and filtering through a few, I still dont know how to go about this... Pattern for:

  • Alphabets ONLY, no case sensitivity, no limit on character count ...

16. JavaScript RegExp syntax question    stackoverflow.com

I'll try to better explain myself ;-). I'm using RegexBuddy to try to find the solution. The target is JavaScript in a Konfabulator widget. The string I need to parse is :

18. Questions about Javascript Regex Syntax    stackoverflow.com

Can you explain the semantics of following regex? Especially, what ?: and () means?

/(?:^|:|,)(?:\s*\[)+/g
Thanks.

19. javascript syntax for regex using variable as pattern    stackoverflow.com

I have a variable patt with a dynamic numerical value

var patt = "%"+number+":";
What is the regex syntax for using it in the test() method? I have been using this format
var patt=/testing/g;
var ...

21. [Solved] JS RegEx Syntax Problem (was Not sure what is wrong here.)    forums.devshed.com

Input Data (00000.00)

java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.