Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP and Java Runners #15

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open

Conversation

FelisPhasma
Copy link

In response to the wiki page on regex runners, I made an attempt at writing one for PHP. Here is a for a PHP regex runner. Notify my if it needs changes.

A quick implementation for a PHP Regex runner
A quick implementation for a PHP Regex runner
/**
* PHP regex runner for Refiddle
* Written by FelisPhasma
* Copyright (c) FelisPhasma 2015
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either license under the MIT or make public domain.

@phallguy
Copy link
Owner

phallguy commented Dec 2, 2015

Thanks for taking the time to do this. Couple things I'd need before I could test it and put it up:

  1. List of regex options that PHP supports and the corresponding regex letter. For example 'i' in /A-Z/i for a case insensitive match.
  2. Double check that preg_match_all parses a 'literal' regex. If not, you'd need to add your own parser to split a regex literal into the pattern and options.
  3. Support corpus tests in the evaluate script.

@FelisPhasma
Copy link
Author

It was my pleasure!
I've addressed the items you listed, here is the new code.

In response to the second item in your list, I use the following test strings to test both the evaluate code and the replace code:

$pattern = '/eat (apple|pear)/';
$corpus_text = "I like to eat apples on a rainy day, but on sunny days, I like to eat pears.";
$replace_text = 'eat yummy things';

@FelisPhasma FelisPhasma changed the title PHP Runner PHP and Java Runners Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants