Giter Club home page Giter Club logo

regexprogram's People

Contributors

jelf avatar lethargilistic avatar liniarc avatar mnp avatar thinkaliker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

regexprogram's Issues

Back reference and Problem 6

I couldn't get past Problem 6 which requries the use of back reference \#, I think the code needs to be enbabled for back references (from 1.52 doc, the version I am using):

no_bk_refs: When set then backreferences are disabled. This bit is on by default for POSIX-Extended regular expressions, but can be unset to support for backreferences on.

I made the following change:

diff --git a/regex.cpp b/regex.cpp
index fd39b1b..8847690 100644
--- a/regex.cpp
+++ b/regex.cpp
@@ -289,7 +289,7 @@ void performRegex()
     {
         if (extended)
         {
-            r.assign(regexPattern.c_str(), regex::extended);
+            r.assign(regexPattern.c_str(), regex::extended & ~regex::no_bk_refs);
         }
         else
         {

It does work for me. I could confirm that with the first problem (a)b\1 to see it matching "aba". I am not familiar with Boost or C++, not sure if this is the right fix, or I'd just submit a PR.

(Can we get an option for jumping to problem # or a key to skip a problem?)

Build failure

regex.cpp:7:27: fatal error: boost/regex.hpp: No such file or directory
#include <boost/regex.hpp>

System is xubuntu-14.04

aa

ๅ•Šๅ•Š

-ltinfo not found when building on osx 10.10

these were my steps to get it running:

  1. brew install boost
  2. remove "-ltinfo" from makefile
  3. make
  4. ./regex

(btw -ltinfo not found was after installing boost and i already had ncurses)

Discussion, problem10

Is there anybody who can tell me how to pass problem10? I tried to use
foo\((.*?), (.*?)\)
and replaced with
bar\(\2, \1\)
It worked well on my local PC, but cannot pass the problem.

If I use .*? pattern, I cannot catch any part of string, what should I use to pass the problem?

a

a

I think game is not enough the list of answers

I think game is not enough the list of answers. For example:
I try to complete level 6. And have some problem. I understand the answer is ^(.)(.*)($1)$ (or $1 replace to \1), but I can't complete this level. And I want to correct learn regexp at previous levels. I think the game needed answers list, and list of beautiful solution

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.