1

I opened the Mozilla Firefox add-on Wappalizer and saw the following JavaScript. Is this a regular expression, and is it possible to use it in python?

    'CO2Stats':              { cats: { 1: 10 }, html: /src=("|')http:\/\/www\.co2stats\.com\/propres\.php/ },
    'CodeIgniter':           { cats: { 1: 18 }, headers: { 'Set-Cookie': /(exp_last_activity|exp_tracker|ci_session)/ }, implies: [ 'PHP' ] },
    'Commerce Server':       { cats: { 1:  6 }, headers: { 'COMMERCE-SERVER-SOFTWARE': /.+/ } },
    'comScore':              { cats: { 1: 10 }, html: /<i{1}frame[^>]* (id=("|')comscore("|')|scr=[^>]+comscore)/, env: /^_?COMSCORE$/i },
    'Concrete5':             { cats: { 1:  1 }, meta: { 'generator': /concrete5/i } },
1
  • 2
    sure, it's a js regular expression, it could be possible to translate it in python re Commented Jul 4, 2012 at 7:30

1 Answer 1

1

Yes, the strings that are in // here are regular expression and you can use them in python with help of the re module.

import re
if re.match('(exp_last_activity|exp_tracker|ci_session)', header_string):
  # do something

But you need to find what string you must analyze with this expressions, of course.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.