<commit_before>$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ruby-jmeter'

test do
  threads count: 1 do
    visit name: 'Home', url: 'https://flooded.io' do
      regex pattern: "content='(.+?)' name='csrf-token'", name: 'csrf-token', match_number: 1, default: '424242'
      regex pattern: 'pattern', name: 'jmeter_variable_regex', variable: 'test'
    end
  end
end.run(path: '/usr/share/jmeter/bin/', gui: true)<commit_msg>add example with regex response headers<commit_after>$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'ruby-jmeter'

test do
  threads count: 1 do
    visit name: 'Home', url: 'https://flooded.io' do
      regex pattern: "content='(.+?)' name='csrf-token'", name: 'csrf-token', match_number: 1, default: '424242'
      regex pattern: 'pattern', name: 'jmeter_variable_regex', variable: 'test'
      regex pattern: 'pattern', name: 'jmeter_headers_regex', useHeaders: true
    end
  end
end.run(path: '/usr/local/share/jmeter-3.1/bin/', gui: true)
{'fraction_non_alphanumeric': 0.17881438289601556, 'fraction_numerical': 0.01749271137026239, 'mean_word_length': 4.537634408602151, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7646383', 'n_tokens_mistral': 383, 'n_tokens_neox': 358, 'n_words': 89}