This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.
  • Index
  •  » Suggestions
  •  » Something that would make the coding of these forums a lot easier

#1 2012-08-12 15:54:33

jvvg
Scratcher
Registered: 2008-03-26
Posts: 1000+

Something that would make the coding of these forums a lot easier

I was looking at the source code of these forums for something, and found some regular expressions.

They looked like this:

Code:

'/http:\/\/.*(imgur|tinypic|imageshack|photobucket|modshare|scratch\.mit|scratchr\.org|wikipedia\.org|wikimedia\.org|\.edu).*\/.*/i

It looked like a big pain to escape all of those slashes.

However, in Perl Compatible Regular Expressions, you don't have to use a slash to delimit the start and end. You can use any kind of punctuation mark.
In FluxBB, they use a % sign (e.g. %http://(foo|bar)%i), and not have to escape all of those slashes.


http://tiny.cc/zwgbewhttp://tiny.cc/e1gbewhttp://tiny.cc/zygbewhttp://tiny.cc/izgbew
Goodbye, Scratch 1.4  sad                                                        Hello Scratch 2.0!  smile

Offline

 
  • Index
  •  » Suggestions
  •  » Something that would make the coding of these forums a lot easier

Board footer