liniarc / regexprogram Goto Github PK
View Code? Open in Web Editor NEWA simple regular app for solving problem
A simple regular app for solving problem
aaa'aaa
regex.com.cn is for sale in aliyun.com ,the price is 8888
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?)
regex.com.cn is for sale in aliyun.com,the price is 8888
regex.com.cn is for sale in aliyun.com ,the price is 8888
regex.cpp:7:27: fatal error: boost/regex.hpp: No such file or directory
#include <boost/regex.hpp>
System is xubuntu-14.04
ๅๅ
ad06f27c-b7d9-4d26-bdf9-44b263a43902
these were my steps to get it running:
(btw -ltinfo not found was after installing boost and i already had ncurses)
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
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 ^(.)(.*)(
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.