Ich habe diesen regulären Ausdruck:boost :: regexp unerwartetes Verhalten
(?:^|\\n)[ \\t]*(-(.|\\n)*?)(?=\\n[ \\t]*-|$)
ich möchte es verwenden, um mit diesem Text
-h --help Show this screen.
--version Show version.
--prefix=<path> Set the specified path as the prefix
for paths mentioned below (except ones
specified manually).
-c, --config=<cfg-file> Configuration file name
[default: <prefix>/etc/myprog/protocols.conf].
--script=<asl-file> Input script file which will be played.
If not specified then contents of the
<prefix>/etc/myprog/script.active will be taken.
jede Option mit seiner Beschreibung zu erfahren. Mit <regex>
von GCC 5.3 dieser Ausdruck wie erwartet funktioniert, aber wenn ich die <boost/regex.hpp>
(die letzte Version in diesem Moment) umfassen paßt es
--prefix=<path> Set the specified path as the prefix
aber nicht
--prefix=<path> Set the specified path as the prefix
for paths mentioned below (except ones
specified manually).
jemand irgendwelche Ideen?
ADD:
ich dieses regexp bei http://www.regextester.com/ getestet - es ist zu wie erwartet verhalten hat.
ADD:
baute ich eine gemeinsame Bibliothek mit boost regexp Quellen ohne Änderungen in ihnen; Ich dies getan mit dieser Zeilen in Make-Datei:
g++ -std=c++0x -I../../include -O3 -Wall -c -fmessage-length=0 -fPIC -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -o "[email protected]" "$<"
und
g++ -Wl,--no-undefined -shared -o "libregex.so" $(OBJS) $(USER_OBJS) $(LIBS)
Vielleicht muss ich die Unicode-Optionen der boost :: regex anpassen ..
Try '" (?:^| \\ R) [\ t] * (- [ \\ s \\ S] *?) (? = \\ R [\ t] * - | $) "'. –
@ WiktorStribiżew, das funktioniert nicht. –