Showing posts with label regex. Show all posts
Showing posts with label regex. Show all posts

Monday, June 4, 2012

Validate email address in Javascript?


How can an email address be validated in Javascript?



Though this solution may be simple, I'm sure this is one of those useful things that people will be Googling for and deserves its own entry on the site

Sunday, June 3, 2012

How do you implement a good profanity filter?


Many of us need to deal with user input, search queries, and situations where the input text can potentially contain profanity or undesirable language. Oftentimes this needs to be filtered out.

How does this giant regex work?


I recently found the code below in one of my directories, in a file called doc.php . The file functions or links to a file manager. It's quite nicely done. Basically, it lists all the files in the current directory, and it lets you change directories.

Friday, June 1, 2012

jQuery selector regular expressions


I am after documentation on using wildcard or regular expressions (not sure on the exact terminology) with a jQuery selector.

Tuesday, May 29, 2012

How does this giant regex work?


I recently found the code below in one of my directories, in a file called doc.php . The file functions or links to a file manager. It's quite nicely done. Basically, it lists all the files in the current directory, and it lets you change directories.

Wednesday, May 23, 2012

C++: what regex library should I use?


I'm working on a commercial (not open source) C++ project that runs on a linux-based system. I need to do some regex within the C++ code. (I know: I now have 2 problems.)

Friday, May 18, 2012

How does this giant regex work?


I recently found the code below in one of my directories, in a file called doc.php . The file functions or links to a file manager. It's quite nicely done. Basically, it lists all the files in the current directory, and it lets you change directories.

Wednesday, May 16, 2012

Best way to parse a text document


I'm trying to parse a plain text document in PHP but have no idea how to do it correctly. I want to separate each word, assign them an ID and save the result in JSON format.

Tuesday, May 15, 2012

Are Regular Expressions universal?


I would like to know if Regular Expressions are Universal for all languages like PHP, Javascript, etc.?

Thursday, May 10, 2012

Is handling of curly braces in javascript regex is the same across all modern browsers?


Curly braces in JavaScript regex is used to denote quantifiers. So writing

Why does the "g” modifier give different results when test() is called twice?


Given this code:




var reg = /a/g;
console.log(reg.test("a"));
console.log(reg.test("a"));



I get this result:

Scan Javascript for abusive functions and patterns


We have an OpenSource Extension Similar like Greasemonkey only used in Firefox . Users can submit (Java)scripts for other Users to run. This gets abused by sending malicious code.

Friday, May 4, 2012

Friday, February 17, 2012

Javascript regex replace weird behavior


I'm developing a js to dig up Bible references on Portuguese web pages, and link them to a youversion.com url.

How do I convert domain.com/foo/bar/baz/ into a string like "foo bar baz"?


Basically I want to be able to grab the ending of an url, and convert it into a string to be used somewhere.