aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile2
-rw-r--r--lib/asn1/c_src/asn1_erl_nif.c38
-rw-r--r--lib/asn1/src/asn1ct.erl129
-rw-r--r--lib/asn1/src/asn1ct_check.erl140
-rw-r--r--lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl111
-rw-r--r--lib/asn1/src/asn1ct_constructed_per.erl40
-rw-r--r--lib/asn1/src/asn1ct_func.erl2
-rw-r--r--lib/asn1/src/asn1ct_gen.erl89
-rw-r--r--lib/asn1/src/asn1ct_gen_ber_bin_v2.erl308
-rw-r--r--lib/asn1/src/asn1ct_gen_per.erl64
-rw-r--r--lib/asn1/src/asn1ct_name.erl2
-rw-r--r--lib/asn1/src/asn1ct_parser2.erl2
-rw-r--r--lib/asn1/src/asn1ct_value.erl51
-rw-r--r--lib/asn1/src/asn1rt_nif.erl1
-rw-r--r--lib/asn1/src/asn1rtt_ber.erl33
-rw-r--r--lib/asn1/test/asn1_SUITE.erl1
-rw-r--r--lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn117
-rw-r--r--lib/common_test/doc/src/notes.xml117
-rw-r--r--lib/common_test/doc/src/write_test_chapter.xml2
-rw-r--r--lib/common_test/src/ct_release_test.erl2
-rw-r--r--lib/common_test/src/ct_slave.erl7
-rw-r--r--lib/common_test/src/test_server.erl17
-rw-r--r--lib/common_test/src/test_server_node.erl4
-rw-r--r--lib/common_test/vsn.mk2
-rw-r--r--lib/compiler/doc/src/notes.xml16
-rw-r--r--lib/compiler/src/Makefile1
-rw-r--r--lib/compiler/src/beam_disasm.erl3
-rw-r--r--lib/compiler/src/beam_record.erl106
-rw-r--r--lib/compiler/src/beam_type.erl47
-rw-r--r--lib/compiler/src/beam_validator.erl19
-rw-r--r--lib/compiler/src/compile.erl19
-rw-r--r--lib/compiler/src/compiler.app.src1
-rw-r--r--lib/compiler/src/core_scan.erl8
-rwxr-xr-xlib/compiler/src/genop.tab6
-rw-r--r--lib/compiler/test/Makefile1
-rw-r--r--lib/compiler/test/beam_type_SUITE.erl29
-rw-r--r--lib/compiler/test/compile_SUITE.erl69
-rw-r--r--lib/compiler/test/guard_SUITE.erl4
-rw-r--r--lib/compiler/test/misc_SUITE.erl17
-rw-r--r--lib/compiler/vsn.mk2
-rw-r--r--lib/crypto/c_src/crypto.c231
-rw-r--r--lib/crypto/doc/src/crypto.xml80
-rw-r--r--lib/crypto/doc/src/crypto_app.xml9
-rw-r--r--lib/crypto/doc/src/notes.xml34
-rw-r--r--lib/crypto/src/crypto.app.src2
-rw-r--r--lib/crypto/src/crypto.erl67
-rw-r--r--lib/crypto/test/crypto_SUITE.erl136
-rw-r--r--lib/crypto/vsn.mk2
-rw-r--r--lib/debugger/src/dbg_ieval.erl3
-rw-r--r--lib/debugger/src/dbg_wx_code.erl4
-rw-r--r--lib/debugger/src/dbg_wx_src_view.erl4
-rw-r--r--lib/debugger/src/dbg_wx_trace.erl5
-rw-r--r--lib/debugger/src/dbg_wx_win.erl4
-rw-r--r--lib/debugger/src/int.erl6
-rw-r--r--lib/debugger/test/int_SUITE.erl5
-rw-r--r--lib/dialyzer/doc/src/Makefile2
-rw-r--r--lib/dialyzer/doc/src/dialyzer.xml7
-rw-r--r--lib/dialyzer/doc/src/notes.xml42
-rw-r--r--lib/dialyzer/doc/src/ref_man.xml1
-rw-r--r--lib/dialyzer/doc/src/typer.xml157
-rw-r--r--lib/dialyzer/src/Makefile6
-rw-r--r--lib/dialyzer/src/dialyzer.app.src3
-rw-r--r--lib/dialyzer/src/dialyzer_dataflow.erl16
-rw-r--r--lib/dialyzer/src/dialyzer_options.erl3
-rw-r--r--lib/dialyzer/src/dialyzer_typesig.erl16
-rw-r--r--lib/dialyzer/src/typer.erl (renamed from lib/typer/src/typer.erl)0
-rw-r--r--lib/dialyzer/test/Makefile3
-rw-r--r--lib/dialyzer/test/abstract_SUITE.erl3
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/results/weird6
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl18
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning2.erl14
-rw-r--r--lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning3.erl19
-rw-r--r--lib/dialyzer/test/plt_SUITE.erl37
-rw-r--r--lib/dialyzer/test/typer_SUITE.erl158
-rw-r--r--lib/dialyzer/vsn.mk2
-rw-r--r--lib/diameter/doc/src/notes.xml49
-rw-r--r--lib/diameter/src/base/diameter.erl3
-rw-r--r--lib/diameter/src/base/diameter_config.erl5
-rw-r--r--lib/diameter/src/base/diameter_peer_fsm.erl71
-rw-r--r--lib/diameter/src/base/diameter_service.erl18
-rw-r--r--lib/diameter/src/base/diameter_sup.erl4
-rw-r--r--lib/diameter/src/base/diameter_traffic.erl263
-rw-r--r--lib/diameter/src/base/diameter_watchdog.erl28
-rw-r--r--lib/diameter/src/compiler/diameter_codegen.erl4
-rw-r--r--lib/diameter/src/diameter.appup.src14
-rw-r--r--lib/diameter/vsn.mk4
-rw-r--r--lib/edoc/src/edoc.erl2
-rw-r--r--lib/edoc/src/edoc_doclet.erl2
-rw-r--r--lib/edoc/src/edoc_extract.erl12
-rw-r--r--lib/edoc/src/edoc_layout.erl326
-rw-r--r--lib/edoc/src/edoc_report.erl2
-rw-r--r--lib/edoc/src/edoc_scanner.erl30
-rw-r--r--lib/edoc/src/edoc_specs.erl13
-rw-r--r--lib/edoc/test/edoc_SUITE.erl22
-rw-r--r--lib/edoc/test/edoc_SUITE_data/un_atom1.erl41
-rw-r--r--lib/edoc/test/edoc_SUITE_data/un_atom2.erl40
-rw-r--r--lib/erl_interface/doc/src/ei.xml20
-rw-r--r--lib/erl_interface/doc/src/notes.xml15
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c9
-rw-r--r--lib/erl_interface/src/encode/encode_atom.c64
-rw-r--r--lib/erl_interface/src/encode/encode_boolean.c8
-rw-r--r--lib/erl_interface/src/legacy/erl_eterm.c16
-rw-r--r--lib/erl_interface/src/legacy/erl_marshal.c13
-rw-r--r--lib/erl_interface/src/prog/erl_call.c3
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE.erl25
-rw-r--r--lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c18
-rw-r--r--lib/erl_interface/test/ei_decode_encode_SUITE.erl1
-rw-r--r--lib/erl_interface/test/ei_encode_SUITE.erl36
-rw-r--r--lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c10
-rw-r--r--lib/erl_interface/vsn.mk2
-rw-r--r--lib/eunit/doc/overview.edoc4
-rw-r--r--lib/eunit/src/eunit.erl2
-rw-r--r--lib/eunit/src/eunit_surefire.erl1
-rw-r--r--lib/hipe/amd64/Makefile1
-rw-r--r--lib/hipe/amd64/hipe_amd64_encode.erl2
-rw-r--r--lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl17
-rw-r--r--lib/hipe/amd64/hipe_amd64_registers.erl27
-rw-r--r--lib/hipe/arm/hipe_arm.erl7
-rw-r--r--lib/hipe/arm/hipe_arm.hrl1
-rw-r--r--lib/hipe/arm/hipe_arm_assemble.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_cfg.erl21
-rw-r--r--lib/hipe/arm/hipe_arm_defuse.erl2
-rw-r--r--lib/hipe/arm/hipe_arm_frame.erl22
-rw-r--r--lib/hipe/arm/hipe_arm_ra_finalise.erl25
-rw-r--r--lib/hipe/arm/hipe_arm_ra_postconditions.erl24
-rw-r--r--lib/hipe/arm/hipe_arm_subst.erl24
-rw-r--r--lib/hipe/cerl/erl_bif_types.erl5
-rw-r--r--lib/hipe/cerl/erl_types.erl33
-rw-r--r--lib/hipe/doc/src/notes.xml28
-rw-r--r--lib/hipe/flow/ebb.inc14
-rw-r--r--lib/hipe/icode/hipe_beam_to_icode.erl44
-rw-r--r--lib/hipe/icode/hipe_icode_range.erl20
-rw-r--r--lib/hipe/icode/hipe_icode_type.erl21
-rw-r--r--lib/hipe/llvm/Makefile3
-rw-r--r--lib/hipe/llvm/hipe_llvm_main.erl17
-rw-r--r--lib/hipe/llvm/hipe_llvm_merge.erl2
-rw-r--r--lib/hipe/llvm/hipe_rtl_to_llvm.erl2
-rw-r--r--lib/hipe/main/hipe.app.src4
-rw-r--r--lib/hipe/main/hipe.erl27
-rw-r--r--lib/hipe/misc/hipe_consttab.erl15
-rw-r--r--lib/hipe/misc/hipe_pack_constants.erl12
-rw-r--r--lib/hipe/opt/Makefile3
-rw-r--r--lib/hipe/opt/hipe_bb_weights.erl449
-rw-r--r--lib/hipe/opt/hipe_spillmin_color.erl90
-rw-r--r--lib/hipe/ppc/hipe_ppc.erl14
-rw-r--r--lib/hipe/ppc/hipe_ppc.hrl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_assemble.erl2
-rw-r--r--lib/hipe/ppc/hipe_ppc_cfg.erl37
-rw-r--r--lib/hipe/ppc/hipe_ppc_defuse.erl4
-rw-r--r--lib/hipe/ppc/hipe_ppc_frame.erl36
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_finalise.erl15
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_postconditions.erl24
-rw-r--r--lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl18
-rw-r--r--lib/hipe/ppc/hipe_ppc_subst.erl6
-rw-r--r--lib/hipe/regalloc/Makefile2
-rw-r--r--lib/hipe/regalloc/hipe_amd64_specific_sse2.erl43
-rw-r--r--lib/hipe/regalloc/hipe_arm_specific.erl39
-rw-r--r--lib/hipe/regalloc/hipe_coalescing_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl6
-rw-r--r--lib/hipe/regalloc/hipe_optimistic_regalloc.erl2
-rw-r--r--lib/hipe/regalloc/hipe_ppc_specific.erl30
-rw-r--r--lib/hipe/regalloc/hipe_ppc_specific_fp.erl30
-rw-r--r--lib/hipe/regalloc/hipe_range_split.erl1187
-rw-r--r--lib/hipe/regalloc/hipe_regalloc_loop.erl23
-rw-r--r--lib/hipe/regalloc/hipe_regalloc_prepass.erl71
-rw-r--r--lib/hipe/regalloc/hipe_restore_reuse.erl516
-rw-r--r--lib/hipe/regalloc/hipe_sparc_specific.erl30
-rw-r--r--lib/hipe/regalloc/hipe_sparc_specific_fp.erl30
-rw-r--r--lib/hipe/regalloc/hipe_x86_specific.erl39
-rw-r--r--lib/hipe/regalloc/hipe_x86_specific_x87.erl4
-rw-r--r--lib/hipe/rtl/hipe_icode2rtl.erl12
-rw-r--r--lib/hipe/rtl/hipe_rtl_binary_construct.erl170
-rw-r--r--lib/hipe/rtl/hipe_tagscheme.erl106
-rw-r--r--lib/hipe/sparc/hipe_sparc.erl14
-rw-r--r--lib/hipe/sparc/hipe_sparc.hrl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_assemble.erl2
-rw-r--r--lib/hipe/sparc/hipe_sparc_cfg.erl44
-rw-r--r--lib/hipe/sparc/hipe_sparc_defuse.erl4
-rw-r--r--lib/hipe/sparc/hipe_sparc_frame.erl36
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_finalise.erl15
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_postconditions.erl24
-rw-r--r--lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl18
-rw-r--r--lib/hipe/sparc/hipe_sparc_subst.erl6
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_bugs_hipe.erl42
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_edge_cases.erl142
-rw-r--r--lib/hipe/test/basic_SUITE_data/basic_tuples.erl14
-rw-r--r--lib/hipe/util/Makefile2
-rw-r--r--lib/hipe/util/hipe_dsets.erl84
-rw-r--r--lib/hipe/util/hipe_vectors.erl3
-rw-r--r--lib/hipe/vsn.mk2
-rw-r--r--lib/hipe/x86/hipe_rtl_to_x86.erl1
-rw-r--r--lib/hipe/x86/hipe_x86.erl14
-rw-r--r--lib/hipe/x86/hipe_x86.hrl2
-rw-r--r--lib/hipe/x86/hipe_x86_assemble.erl31
-rw-r--r--lib/hipe/x86/hipe_x86_cfg.erl22
-rw-r--r--lib/hipe/x86/hipe_x86_defuse.erl4
-rw-r--r--lib/hipe/x86/hipe_x86_frame.erl46
-rw-r--r--lib/hipe/x86/hipe_x86_postpass.erl8
-rw-r--r--lib/hipe/x86/hipe_x86_ra_finalise.erl10
-rw-r--r--lib/hipe/x86/hipe_x86_ra_postconditions.erl26
-rw-r--r--lib/hipe/x86/hipe_x86_subst.erl35
-rw-r--r--lib/ic/test/c_client_erl_server_SUITE_data/c_client.c4
-rw-r--r--lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c4
-rw-r--r--lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c4
-rw-r--r--lib/ic/test/erl_client_c_server_SUITE_data/c_server.c4
-rw-r--r--lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c4
-rw-r--r--lib/inets/doc/src/notes.xml56
-rw-r--r--lib/inets/src/ftp/ftp.erl28
-rw-r--r--lib/inets/src/http_client/httpc.erl10
-rw-r--r--lib/inets/src/http_client/httpc_response.erl3
-rw-r--r--lib/inets/src/http_lib/http_request.erl18
-rw-r--r--lib/inets/test/ftp_SUITE.erl73
-rw-r--r--lib/inets/test/httpc_SUITE.erl22
-rw-r--r--lib/inets/test/httpd_SUITE.erl18
-rw-r--r--lib/inets/vsn.mk2
-rw-r--r--lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java29
-rw-r--r--lib/jinterface/test/jinterface_SUITE_data/Maps.java10
-rw-r--r--lib/kernel/doc/src/gen_tcp.xml17
-rw-r--r--lib/kernel/doc/src/inet.xml34
-rw-r--r--lib/kernel/doc/src/notes.xml39
-rw-r--r--lib/kernel/src/application_controller.erl4
-rw-r--r--lib/kernel/src/dist_util.erl49
-rw-r--r--lib/kernel/src/inet.erl8
-rw-r--r--lib/kernel/src/inet_int.hrl1
-rw-r--r--lib/kernel/src/kernel.appup.src4
-rw-r--r--lib/kernel/src/kernel.erl244
-rw-r--r--lib/kernel/test/code_SUITE.erl17
-rw-r--r--lib/kernel/test/disk_log_SUITE.erl50
-rw-r--r--lib/kernel/test/erl_distribution_wb_SUITE.erl6
-rw-r--r--lib/kernel/test/inet_SUITE.erl70
-rw-r--r--lib/kernel/test/pg2_SUITE.erl27
-rw-r--r--lib/kernel/test/prim_file_SUITE.erl47
-rw-r--r--lib/kernel/vsn.mk2
-rw-r--r--lib/observer/doc/src/etop.xml8
-rw-r--r--lib/observer/doc/src/notes.xml41
-rw-r--r--lib/observer/doc/src/observer.xml2
-rw-r--r--lib/observer/doc/src/observer_ug.xml5
-rw-r--r--lib/observer/src/cdv_ets_cb.erl19
-rw-r--r--lib/observer/src/crashdump_viewer.erl6
-rw-r--r--lib/observer/src/crashdump_viewer.hrl1
-rw-r--r--lib/observer/src/observer_alloc_wx.erl55
-rw-r--r--lib/observer/src/observer_app_wx.erl10
-rw-r--r--lib/observer/src/observer_lib.erl13
-rw-r--r--lib/observer/src/observer_perf_wx.erl116
-rw-r--r--lib/observer/src/observer_port_wx.erl39
-rw-r--r--lib/observer/src/observer_pro_wx.erl34
-rw-r--r--lib/observer/src/observer_sys_wx.erl13
-rw-r--r--lib/observer/src/observer_trace_wx.erl71
-rw-r--r--lib/observer/src/observer_tv_table.erl30
-rw-r--r--lib/observer/src/observer_tv_wx.erl91
-rw-r--r--lib/observer/src/observer_wx.erl146
-rw-r--r--lib/observer/test/crashdump_helper.erl2
-rw-r--r--lib/observer/vsn.mk2
-rw-r--r--lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl15
-rw-r--r--lib/os_mon/doc/src/notes.xml15
-rw-r--r--lib/os_mon/vsn.mk2
-rw-r--r--lib/parsetools/doc/src/leex.xml5
-rw-r--r--lib/parsetools/doc/src/yecc.xml2
-rw-r--r--lib/parsetools/src/leex.erl92
-rw-r--r--lib/parsetools/src/yecc.erl246
-rw-r--r--lib/parsetools/src/yeccgramm.yrl45
-rw-r--r--lib/parsetools/src/yeccparser.erl192
-rw-r--r--lib/parsetools/test/leex_SUITE.erl45
-rw-r--r--lib/parsetools/test/yecc_SUITE.erl92
-rw-r--r--lib/public_key/doc/src/notes.xml28
-rw-r--r--lib/public_key/doc/src/public_key.xml10
-rw-r--r--lib/public_key/src/public_key.app.src2
-rw-r--r--lib/public_key/src/public_key.erl59
-rw-r--r--lib/public_key/test/erl_make_certs.erl14
-rw-r--r--lib/public_key/vsn.mk2
-rw-r--r--lib/reltool/doc/src/notes.xml21
-rw-r--r--lib/reltool/src/reltool.hrl6
-rw-r--r--lib/reltool/vsn.mk2
-rw-r--r--lib/runtime_tools/doc/src/notes.xml18
-rw-r--r--lib/runtime_tools/src/dyntrace.erl2
-rw-r--r--lib/runtime_tools/src/observer_backend.erl4
-rw-r--r--lib/runtime_tools/vsn.mk2
-rw-r--r--lib/sasl/doc/src/notes.xml22
-rw-r--r--lib/sasl/test/systools_SUITE.erl16
-rw-r--r--lib/sasl/vsn.mk2
-rw-r--r--lib/snmp/doc/src/notes.xml22
-rw-r--r--lib/ssh/doc/src/notes.xml96
-rw-r--r--lib/ssh/doc/src/ssh.xml46
-rw-r--r--lib/ssh/doc/src/ssh_app.xml4
-rw-r--r--lib/ssh/src/ssh.app.src6
-rw-r--r--lib/ssh/src/ssh.erl374
-rw-r--r--lib/ssh/src/ssh.hrl26
-rw-r--r--lib/ssh/src/ssh_acceptor.erl110
-rw-r--r--lib/ssh/src/ssh_acceptor_sup.erl57
-rw-r--r--lib/ssh/src/ssh_connection_handler.erl188
-rw-r--r--lib/ssh/src/ssh_connection_sup.erl28
-rw-r--r--lib/ssh/src/ssh_file.erl2
-rw-r--r--lib/ssh/src/ssh_options.erl84
-rw-r--r--lib/ssh/src/ssh_sftp.erl9
-rw-r--r--lib/ssh/src/ssh_sftpd.erl26
-rw-r--r--lib/ssh/src/ssh_subsystem_sup.erl73
-rw-r--r--lib/ssh/src/ssh_sup.erl75
-rw-r--r--lib/ssh/src/ssh_system_sup.erl194
-rw-r--r--lib/ssh/src/ssh_transport.erl47
-rw-r--r--lib/ssh/src/sshc_sup.erl43
-rw-r--r--lib/ssh/src/sshd_sup.erl109
-rw-r--r--lib/ssh/test/Makefile3
-rw-r--r--lib/ssh/test/ssh.spec3
-rw-r--r--lib/ssh/test/ssh_algorithms_SUITE.erl13
-rw-r--r--lib/ssh/test/ssh_basic_SUITE.erl34
-rw-r--r--lib/ssh/test/ssh_bench.spec3
-rw-r--r--lib/ssh/test/ssh_bench_SUITE.erl252
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_dsa (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_dsa)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/id_rsa (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/id_rsa)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521 (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key)0
-rw-r--r--lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key.pub (renamed from lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key.pub)0
-rw-r--r--lib/ssh/test/ssh_bench_dev_null.erl58
-rw-r--r--lib/ssh/test/ssh_benchmark_SUITE.erl571
-rw-r--r--lib/ssh/test/ssh_connection_SUITE.erl64
-rw-r--r--lib/ssh/test/ssh_options_SUITE.erl24
-rw-r--r--lib/ssh/test/ssh_relay.erl3
-rw-r--r--lib/ssh/test/ssh_sftp_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sftpd_SUITE.erl10
-rw-r--r--lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl2
-rw-r--r--lib/ssh/test/ssh_sup_SUITE.erl142
-rw-r--r--lib/ssh/test/ssh_test_lib.erl127
-rw-r--r--lib/ssh/test/ssh_to_openssh_SUITE.erl32
-rw-r--r--lib/ssh/test/ssh_trpt_test_lib.erl3
-rw-r--r--lib/ssh/vsn.mk2
-rw-r--r--lib/ssl/doc/src/notes.xml82
-rw-r--r--lib/ssl/doc/src/ssl.xml13
-rw-r--r--lib/ssl/src/dtls_connection.erl215
-rw-r--r--lib/ssl/src/dtls_handshake.erl34
-rw-r--r--lib/ssl/src/dtls_record.erl41
-rw-r--r--lib/ssl/src/dtls_socket.erl13
-rw-r--r--lib/ssl/src/dtls_udp_listener.erl62
-rw-r--r--lib/ssl/src/dtls_v1.erl25
-rw-r--r--lib/ssl/src/ssl.app.src2
-rw-r--r--lib/ssl/src/ssl.appup.src20
-rw-r--r--lib/ssl/src/ssl.erl160
-rw-r--r--lib/ssl/src/ssl_cipher.erl30
-rw-r--r--lib/ssl/src/ssl_connection.erl88
-rw-r--r--lib/ssl/src/ssl_connection.hrl3
-rw-r--r--lib/ssl/src/ssl_internal.hrl4
-rw-r--r--lib/ssl/src/ssl_record.erl62
-rw-r--r--lib/ssl/src/tls_connection.erl52
-rw-r--r--lib/ssl/src/tls_record.erl44
-rw-r--r--lib/ssl/test/Makefile3
-rw-r--r--lib/ssl/test/erl_make_certs.erl2
-rw-r--r--lib/ssl/test/ssl_ECC_SUITE.erl312
-rw-r--r--lib/ssl/test/ssl_basic_SUITE.erl185
-rw-r--r--lib/ssl/test/ssl_certificate_verify_SUITE.erl603
-rw-r--r--lib/ssl/test/ssl_packet_SUITE.erl10
-rw-r--r--lib/ssl/test/ssl_test_lib.erl484
-rw-r--r--lib/ssl/test/ssl_to_openssl_SUITE.erl114
-rw-r--r--lib/ssl/test/x509_test.erl343
-rw-r--r--lib/ssl/vsn.mk2
-rw-r--r--lib/stdlib/doc/src/assert_hrl.xml15
-rw-r--r--lib/stdlib/doc/src/erl_tar.xml4
-rw-r--r--lib/stdlib/doc/src/ets.xml19
-rw-r--r--lib/stdlib/doc/src/io_lib.xml14
-rw-r--r--lib/stdlib/doc/src/notes.xml104
-rw-r--r--lib/stdlib/doc/src/proplists.xml2
-rw-r--r--lib/stdlib/doc/src/rand.xml196
-rw-r--r--lib/stdlib/doc/src/re.xml320
-rw-r--r--lib/stdlib/doc/src/shell.xml4
-rw-r--r--lib/stdlib/doc/src/unicode_usage.xml31
-rw-r--r--lib/stdlib/src/c.erl4
-rw-r--r--lib/stdlib/src/epp.erl2
-rw-r--r--lib/stdlib/src/erl_anno.erl8
-rw-r--r--lib/stdlib/src/erl_compile.erl4
-rw-r--r--lib/stdlib/src/erl_lint.erl87
-rw-r--r--lib/stdlib/src/erl_parse.yrl39
-rw-r--r--lib/stdlib/src/erl_pp.erl133
-rw-r--r--lib/stdlib/src/erl_tar.erl65
-rw-r--r--lib/stdlib/src/escript.erl8
-rw-r--r--lib/stdlib/src/ets.erl28
-rw-r--r--lib/stdlib/src/io_lib.erl24
-rw-r--r--lib/stdlib/src/io_lib_pretty.erl14
-rw-r--r--lib/stdlib/src/otp_internal.erl178
-rw-r--r--lib/stdlib/src/qlc_pt.erl4
-rw-r--r--lib/stdlib/src/rand.erl537
-rw-r--r--lib/stdlib/src/re.erl7
-rw-r--r--lib/stdlib/src/shell.erl17
-rw-r--r--lib/stdlib/src/stdlib.appup.src4
-rw-r--r--lib/stdlib/test/beam_lib_SUITE.erl4
-rw-r--r--lib/stdlib/test/erl_lint_SUITE.erl85
-rw-r--r--lib/stdlib/test/erl_pp_SUITE.erl48
-rw-r--r--lib/stdlib/test/erl_scan_SUITE.erl6
-rw-r--r--lib/stdlib/test/ets_SUITE.erl451
-rw-r--r--lib/stdlib/test/filelib_SUITE.erl9
-rw-r--r--lib/stdlib/test/io_SUITE.erl29
-rw-r--r--lib/stdlib/test/io_proto_SUITE.erl272
-rw-r--r--lib/stdlib/test/rand_SUITE.erl636
-rw-r--r--lib/stdlib/test/re_SUITE.erl26
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput1310
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput10102
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput22396
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput315
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput420
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput5138
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput6465
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput7810
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput8453
-rw-r--r--lib/stdlib/test/re_SUITE_data/testoutput9110
-rw-r--r--lib/stdlib/test/re_testoutput1_replacement_test.erl10528
-rw-r--r--lib/stdlib/test/re_testoutput1_split_test.erl371
-rw-r--r--lib/stdlib/test/run_pcre_tests.erl3
-rw-r--r--lib/stdlib/test/shell_SUITE.erl23
-rw-r--r--lib/stdlib/test/tar_SUITE.erl96
-rw-r--r--lib/stdlib/vsn.mk2
-rw-r--r--lib/syntax_tools/src/erl_prettypr.erl2
-rw-r--r--lib/syntax_tools/src/erl_syntax.erl25
-rw-r--r--lib/tools/doc/src/notes.xml15
-rw-r--r--lib/tools/emacs/erldoc.el4
-rw-r--r--lib/tools/src/lcnt.erl56
-rw-r--r--lib/tools/src/make.erl5
-rw-r--r--lib/tools/src/tools.app.src3
-rw-r--r--lib/tools/test/Makefile4
-rw-r--r--lib/tools/test/make_SUITE.erl44
-rw-r--r--lib/tools/test/make_SUITE_data/incl_src/test_incl2.erl9
-rw-r--r--lib/tools/test/make_SUITE_data/test_incl.hrl1
-rw-r--r--lib/tools/test/make_SUITE_data/test_incl1.erl9
-rw-r--r--lib/tools/test/xref_SUITE.erl8
-rw-r--r--lib/tools/vsn.mk2
-rw-r--r--lib/typer/Makefile44
-rw-r--r--lib/typer/RELEASE_NOTES22
-rw-r--r--lib/typer/doc/Makefile40
-rw-r--r--lib/typer/doc/html/.gitignore0
-rw-r--r--lib/typer/doc/pdf/.gitignore0
-rw-r--r--lib/typer/doc/src/Makefile118
-rw-r--r--lib/typer/doc/src/book.xml42
-rw-r--r--lib/typer/doc/src/fascicules.xml12
-rw-r--r--lib/typer/doc/src/notes.xml111
-rw-r--r--lib/typer/doc/src/part_notes.xml36
-rw-r--r--lib/typer/doc/src/ref_man.xml36
-rw-r--r--lib/typer/doc/src/typer_app.xml44
-rw-r--r--lib/typer/ebin/.gitignore0
-rw-r--r--lib/typer/info2
-rw-r--r--lib/typer/src/Makefile111
-rw-r--r--lib/typer/src/typer.app.src11
-rw-r--r--lib/typer/src/typer.appup.src22
-rw-r--r--lib/typer/test/Makefile65
-rw-r--r--lib/typer/test/typer.spec1
-rw-r--r--lib/typer/test/typer_SUITE.erl57
-rw-r--r--lib/typer/vsn.mk1
-rw-r--r--lib/wx/c_src/wxe_impl.cpp28
-rw-r--r--lib/wx/c_src/wxe_impl.h2
-rw-r--r--lib/wx/examples/demo/demo.erl3
-rw-r--r--lib/wx/src/wxe_master.erl10
-rw-r--r--lib/xmerl/doc/src/notes.xml55
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_base.erlsrc60
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc38
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_list.erlsrc19
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc50
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc50
-rw-r--r--lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc50
-rw-r--r--lib/xmerl/vsn.mk2
467 files changed, 23788 insertions, 13320 deletions
diff --git a/lib/Makefile b/lib/Makefile
index 4740e6eb59..ae466ed518 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -35,7 +35,7 @@ ALL_ERLANG_APPLICATIONS = xmerl edoc erl_docgen snmp otp_mibs erl_interface \
public_key ssl observer odbc diameter \
cosTransactions cosEvent cosTime cosNotification \
cosProperty cosFileTransfer cosEventDomain et megaco \
- eunit ssh typer eldap dialyzer hipe
+ eunit ssh eldap dialyzer hipe
ifdef BUILD_ALL
ERLANG_APPLICATIONS += $(ALL_ERLANG_APPLICATIONS)
diff --git a/lib/asn1/c_src/asn1_erl_nif.c b/lib/asn1/c_src/asn1_erl_nif.c
index b29c9a7ed3..7b7e11b02d 100644
--- a/lib/asn1/c_src/asn1_erl_nif.c
+++ b/lib/asn1/c_src/asn1_erl_nif.c
@@ -901,31 +901,35 @@ static int ber_decode_tag(ErlNifEnv* env, ERL_NIF_TERM *tag, unsigned char *in_b
/* then get the tag number */
if ((tmp_tag = (int) INVMASK(in_buf[*ib_index],ASN1_CLASSFORM)) < 31) {
- *tag = enif_make_uint(env, tag_no + tmp_tag);
+ *tag = enif_make_uint(env, tag_no | tmp_tag);
(*ib_index)++;
} else {
- int n = 0; /* n is used to check that the 64K limit is not
- exceeded*/
-
/* should check that at least three bytes are left in
in-buffer,at least two tag byte and at least one length byte */
if ((*ib_index + 3) > in_buf_len)
return ASN1_VALUE_ERROR;
(*ib_index)++;
- /* The tag is in the following bytes in in_buf as
- 1ttttttt 1ttttttt ... 0ttttttt, where the t-bits
- is the tag number*/
- /* In practice is the tag size limited to 64K, i.e. 16 bits. If
- the tag is greater then 64K return an error */
- while (((tmp_tag = (int) in_buf[*ib_index]) >= 128) && n < 2) {
- /* m.s.b. = 1 */
- tag_no = tag_no + (MASK(tmp_tag,ASN1_LONG_TAG) << 7);
+ /*
+ * The tag is in the following bytes in in_buf as:
+ *
+ * 1ttttttt 0ttttttt
+ *
+ * or
+ *
+ * 0ttttttt
+ *
+ * where the t-bits is the tag number. If the tag does not
+ * fit in two tag bytes (16K), return an error.
+ */
+ if ((tmp_tag = (int) in_buf[*ib_index]) >= 128) {
+ tag_no = tag_no | (MASK(tmp_tag,ASN1_LONG_TAG) << 7);
(*ib_index)++;
- n++;
- };
- if ((n == 2) && in_buf[*ib_index] > 3)
- return ASN1_TAG_ERROR; /* tag number > 64K */
- tag_no = tag_no + in_buf[*ib_index];
+ }
+ tmp_tag = (int) in_buf[*ib_index];
+ if (tmp_tag >= 128) {
+ return ASN1_TAG_ERROR; /* tag number > 16K */
+ }
+ tag_no = tag_no | tmp_tag;
(*ib_index)++;
*tag = enif_make_uint(env, tag_no);
}
diff --git a/lib/asn1/src/asn1ct.erl b/lib/asn1/src/asn1ct.erl
index 9f77a557e5..58cbc89db5 100644
--- a/lib/asn1/src/asn1ct.erl
+++ b/lib/asn1/src/asn1ct.erl
@@ -23,10 +23,10 @@
%% Compile Time functions for ASN.1 (e.g ASN.1 compiler).
-%%-compile(export_all).
%% Public exports
-export([compile/1, compile/2]).
-export([test/1, test/2, test/3, value/2, value/3]).
+
%% Application internal exports
-export([compile_asn/3,compile_asn1/3,compile_py/3,compile/3,
vsn/0,
@@ -75,12 +75,9 @@
-define(ALTERNATIVE,alt).
-define(ALTERNATIVE_UNDECODED,alt_undec).
-define(ALTERNATIVE_PARTS,alt_parts).
-%-define(BINARY,bin).
%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This is the interface to the compiler
-%%
-%%
compile(File) ->
compile(File,[]).
@@ -751,7 +748,6 @@ remove_import_doubles([]) ->
remove_import_doubles(ImportList) ->
MergedImportList =
merge_symbols_from_module(ImportList,[]),
-%% io:format("MergedImportList: ~p~n",[MergedImportList]),
delete_double_of_symbol(MergedImportList,[]).
merge_symbols_from_module([Imp|Imps],Acc) ->
@@ -769,7 +765,6 @@ merge_symbols_from_module([Imp|Imps],Acc) ->
end,
Imps),
NewImps = lists:subtract(Imps,IfromModName),
-%% io:format("Imp: ~p~nIfromModName: ~p~n",[Imp,IfromModName]),
NewImp =
Imp#'SymbolsFromModule'{
symbols = lists:append(
@@ -835,7 +830,6 @@ generate({M,CodeTuple}, OutFile, EncodingRule, Options) ->
Code = #abst{name=M#module.name,
types=Types,values=Values,ptypes=Ptypes,
classes=Classes,objects=Objects,objsets=ObjectSets},
- debug_on(Options),
setup_bit_string_format(Options),
setup_legacy_erlang_types(Options),
asn1ct_table:new(check_functions),
@@ -855,7 +849,6 @@ generate({M,CodeTuple}, OutFile, EncodingRule, Options) ->
end,
asn1ct_gen:pgen(OutFile, Gen, Code),
- debug_off(Options),
cleanup_bit_string_format(),
erase(tlv_format), % used in ber
erase(class_default_type),% used in ber
@@ -990,12 +983,8 @@ get_input_file(Module,[]) ->
get_input_file(Module,[I|Includes]) ->
case (catch input_file_type(filename:join([I,Module]))) of
{single_file,FileName} ->
-%% case file:read_file_info(FileName) of
-%% {ok,_} ->
{file,FileName};
-%% _ -> get_input_file(Module,Includes)
-%% end;
- _ ->
+ _ ->
get_input_file(Module,Includes)
end.
@@ -1151,20 +1140,8 @@ is_asn1_flag(verbose) -> true;
%% 'warnings_as_errors' is intentionally passed through to the compiler.
is_asn1_flag(_) -> false.
-debug_on(Options) ->
- case lists:member(debug,Options) of
- true ->
- put(asndebug,true);
- _ ->
- true
- end.
-
-debug_off(_Options) ->
- erase(asndebug).
-
outfile(Base, Ext, Opts) ->
-% io:format("Opts. ~p~n",[Opts]),
Obase = case lists:keysearch(outdir, 1, Opts) of
{value, {outdir, Odir}} -> filename:join(Odir, Base);
_NotFound -> Base % Not found or bad format
@@ -1215,9 +1192,6 @@ compile_py(File,OutFile,Options) ->
compile(File, _OutFile, Options) ->
case compile(File, make_erl_options(Options)) of
{error,_Reason} ->
- %% case occurs due to error in asn1ct_parser2,asn1ct_check
-%% io:format("~p~n",[_Reason]),
-%% io:format("~p~n~s~n",[_Reason,"error"]),
error;
ok ->
ok;
@@ -1512,7 +1486,8 @@ create_pdec_inc_command(_ModName,_,[],Acc) ->
create_pdec_inc_command(ModName,{Comps1,Comps2},TNL,Acc)
when is_list(Comps1),is_list(Comps2) ->
create_pdec_inc_command(ModName,Comps1 ++ Comps2,TNL,Acc);
-%% The following two functionclauses matches on the type after the top type. This one if the top type had no tag, i.e. a CHOICE
+%% The following two clauses match on the type after the top
+%% type. This one if the top type had no tag, i.e. a CHOICE.
create_pdec_inc_command(ModN,Clist,[CL|_Rest],[[]]) when is_list(CL) ->
create_pdec_inc_command(ModN,Clist,CL,[]);
create_pdec_inc_command(ModN,Clist,[CL|_Rest],Acc) when is_list(CL) ->
@@ -1523,17 +1498,14 @@ create_pdec_inc_command(ModName,
prop=Prop}|Comps],
TNL=[C1|Cs],Acc) ->
case C1 of
-% Name ->
-% %% In this case C1 is an atom
-% TagCommand = get_tag_command(TS,?MANDATORY,Prop),
-% create_pdec_inc_command(ModName,get_components(TS#type.def),Cs,[TagCommand|Acc]);
{Name,undecoded} ->
TagCommand = get_tag_command(TS,?UNDECODED,Prop),
create_pdec_inc_command(ModName,Comps,Cs,concat_sequential(TagCommand,Acc));
{Name,parts} ->
TagCommand = get_tag_command(TS,?PARTS,Prop),
create_pdec_inc_command(ModName,Comps,Cs,concat_sequential(TagCommand,Acc));
- L when is_list(L) -> % I guess this never happens due to previous function clause
+ L when is_list(L) ->
+ %% I guess this never happens due to previous clause.
%% This case is only possible as the first element after
%% the top type element, when top type is SEGUENCE or SET.
%% Follow each element in L. Must note every tag on the
@@ -1555,8 +1527,6 @@ create_pdec_inc_command(ModName,
RestPartsList,[]),
create_pdec_inc_command(ModName,Comps,Cs,
[[?MANDATORY,InnerDirectives]|Acc]);
-% create_pdec_inc_command(ModName,Comps,Cs,
-% [InnerDirectives,?MANDATORY|Acc]);
[Opt,EncTag] ->
InnerDirectives =
create_pdec_inc_command(ModName,TS#type.def,
@@ -1564,9 +1534,8 @@ create_pdec_inc_command(ModName,
create_pdec_inc_command(ModName,Comps,Cs,
[[Opt,EncTag,InnerDirectives]|Acc])
end;
-% create_pdec_inc_command(ModName,CList,RestPartsList,Acc);
-%% create_pdec_inc_command(ModName,TS#type.def,RestPartsList,Acc);
- _ -> %% this component may not be in the config list
+ _ ->
+ %% this component may not be in the config list
TagCommand = get_tag_command(TS,?MANDATORY,Prop),
create_pdec_inc_command(ModName,Comps,TNL,concat_sequential(TagCommand,Acc))
end;
@@ -1577,7 +1546,6 @@ create_pdec_inc_command(ModName,
[{C1,Directive}|Rest],Acc) ->
case Directive of
List when is_list(List) ->
-% [Command,Tag] = get_tag_command(TS,?ALTERNATIVE,Prop),
TagCommand = get_tag_command(TS,?ALTERNATIVE,Prop),
CompAcc =
create_pdec_inc_command(ModName,
@@ -1586,9 +1554,6 @@ create_pdec_inc_command(ModName,
[Command,Tag] when is_atom(Command) ->
[[Command,Tag,CompAcc]|Acc];
[L1,_L2|Rest] when is_list(L1) ->
-% [LastComm|Comms] = lists:reverse(TagCommand),
-% [concat_sequential(lists:reverse(Comms),
-% [LastComm,CompAcc])|Acc]
case lists:reverse(TagCommand) of
[Atom|Comms] when is_atom(Atom) ->
[concat_sequential(lists:reverse(Comms),
@@ -1597,12 +1562,8 @@ create_pdec_inc_command(ModName,
[concat_sequential(lists:reverse(Comms),
[[Command2,Tag2,CompAcc]])|Acc]
end
-% [concat_sequential(lists:reverse(Comms),
-% InnerCommand)|Acc]
-
end,
create_pdec_inc_command(ModName,{'CHOICE',Comps},Rest,
-% [[Command,Tag,CompAcc]|Acc]);
NewAcc);
undecoded ->
TagCommand = get_tag_command(TS,?ALTERNATIVE_UNDECODED,Prop),
@@ -1658,7 +1619,6 @@ create_partial_decode_gen_info(_M1,{M2,_}) ->
throw({error,{"wrong module name in asn1 config file",
M2}}).
-%create_partial_decode_gen_info1(ModName,{ModName,TypeList}) ->
create_partial_decode_gen_info1(ModName,{FuncName,TypeList}) ->
case TypeList of
[TopType|Rest] ->
@@ -1678,11 +1638,6 @@ create_partial_decode_gen_info1(ModName,{FuncName,TypeList}) ->
end;
create_partial_decode_gen_info1(_,_) ->
ok.
-% create_partial_decode_gen_info1(_,[]) ->
-% [];
-% create_partial_decode_gen_info1(_M1,{M2,_}) ->
-% throw({error,{"wrong module name in asn1 config file",
-% M2}}).
%% create_pdec_command/4 for each name (type or component) in the
%% third argument, TypeNameList, a command is created. The command has
@@ -1698,7 +1653,6 @@ create_pdec_command(_ModName,_,[],Acc) ->
Fun(L,[H|Res],Fun)
end,
Remove_empty_lists(Acc,[],Remove_empty_lists);
-% lists:reverse(Acc);
create_pdec_command(ModName,[#'ComponentType'{name=C1,typespec=TS}|_Comps],
[C1|Cs],Acc) ->
%% this component is a constructed type or the last in the
@@ -1747,9 +1701,7 @@ create_pdec_command(ModName,TS=#type{def=Def},[C1|Cs],Acc) ->
create_pdec_command(_,_,TNL,_) ->
throw({error,{"unexpected error when creating partial "
"decode command",TNL}}).
-
-% get_components({'CHOICE',Components}) ->
-% Components;
+
get_components(#'SEQUENCE'{components={C1,C2}}) when is_list(C1),is_list(C2) ->
C1++C2;
get_components(#'SEQUENCE'{components=Components}) ->
@@ -1820,8 +1772,6 @@ get_tag_command(#type{tag=[Tag]},Command) ->
[Command,encode_tag_val(decode_class(Tag#tag.class),Tag#tag.form,
Tag#tag.number)];
get_tag_command(T=#type{tag=[Tag|Tags]},Command) ->
-% [get_tag_command(T#type{tag=[Tag]},Command)|
-% [get_tag_command(T#type{tag=Tags},Command)]].
TC = get_tag_command(T#type{tag=[Tag]},Command),
TCs = get_tag_command(T#type{tag=Tags},Command),
case many_tags(TCs) of
@@ -1849,7 +1799,6 @@ get_tag_command(#type{tag=Tag},Command,Prop) when is_record(Tag,tag) ->
get_tag_command(#type{tag=[Tag]},Command,Prop);
get_tag_command(T=#type{tag=[Tag|Tags]},Command,Prop) ->
[get_tag_command(T#type{tag=[Tag]},Command,Prop)|[
-% get_tag_command(T#type{tag=Tags},?MANDATORY,Prop)]].
get_tag_command(T#type{tag=Tags},Command,Prop)]].
anonymous_dec_command(?UNDECODED,'OPTIONAL') ->
@@ -1964,8 +1913,8 @@ read_config_data(Key) ->
true ->
case asn1ct_table:lookup(asn1_general,{asn1_config,Key}) of
[{_,Data}] -> Data;
- Err -> % Err is [] when nothing was saved in the ets table
-%% io:format("strange data from config file ~w~n",[Err]),
+ Err ->
+ %% Err is [] when nothing was saved in the ets table
Err
end
end.
@@ -1978,7 +1927,6 @@ read_config_data(Key) ->
%% saves input data in a new gen_state record
save_gen_state(exclusive_decode,{_,ConfList},PartIncTlvTagList) ->
- %ConfList=[{FunctionName,PatternList}|Rest]
State =
case get_gen_state() of
S when is_record(S,gen_state) -> S;
@@ -1988,14 +1936,12 @@ save_gen_state(exclusive_decode,{_,ConfList},PartIncTlvTagList) ->
inc_type_pattern=ConfList},
save_config(gen_state,StateRec);
save_gen_state(_,_,_) ->
-%% ok.
case get_gen_state() of
S when is_record(S,gen_state) -> ok;
_ -> save_config(gen_state,#gen_state{})
end.
save_gen_state(selective_decode,{_,Type_component_name_list}) ->
-%% io:format("Selective_decode: ~p~n",[Type_component_name_list]),
State =
case get_gen_state() of
S when is_record(S,gen_state) -> S;
@@ -2077,11 +2023,6 @@ update_gen_state(type_pattern,State,Data) ->
update_gen_state(func_name,State,Data) ->
save_gen_state(State#gen_state{func_name=Data});
update_gen_state(namelist,State,Data) ->
-% SData =
-% case Data of
-% [D] when is_list(D) -> D;
-% _ -> Data
-% end,
save_gen_state(State#gen_state{namelist=Data});
update_gen_state(tobe_refed_funcs,State,Data) ->
save_gen_state(State#gen_state{tobe_refed_funcs=Data});
@@ -2136,7 +2077,6 @@ get_tobe_refed_func(Name) ->
%% tuple. Do not save if it exists in generated_functions, because
%% then it will be or already is generated.
add_tobe_refed_func(Data) ->
- %%
{Name,SI,Pattern} =
fun({N,Si,P,_}) -> {N,Si,P};
(D) -> D end (Data),
@@ -2144,8 +2084,6 @@ add_tobe_refed_func(Data) ->
case SI of
I when is_integer(I) ->
fun(D) -> D end(Data);
-% fun({N,Ix,P}) -> {N,Ix+1,P};
-% ({N,Ix,P,T}) -> {N,Ix+1,P,T} end (Data);
_ ->
fun({N,_,P}) -> {N,0,P};
({N,_,P,T}) -> {N,0,P,T} end (Data)
@@ -2153,12 +2091,13 @@ add_tobe_refed_func(Data) ->
L = get_gen_state_field(generated_functions),
case generated_functions_member(get(currmod),Name,L,Pattern) of
- true -> % it exists in generated_functions, it has already
- % been generated or saved in tobe_refed_func
+ true ->
+ %% it exists in generated_functions, it has already
+ %% been generated or saved in tobe_refed_func
ok;
_ ->
add_once_tobe_refed_func(NewData),
- %%only to get it saved in generated_functions
+ %% only to get it saved in generated_functions
maybe_rename_function(tobe_refed,Name,Pattern)
end.
@@ -2173,16 +2112,13 @@ add_once_tobe_refed_func(Data) ->
({N,I,_,_}) when N==Name,I==Index -> true;
(_) -> false end,TRFL) of
[] ->
-%% case lists:keysearch(element(1,Data),1,TRFL) of
-%% false ->
update_gen_state(tobe_refed_funcs,[Data|TRFL]);
_ ->
ok
end.
-
-%% moves Name from the to be list to the generated list.
+%% Moves Name from the to be list to the generated list.
generated_refed_func(Name) ->
L = get_gen_state_field(tobe_refed_funcs),
NewL = lists:keydelete(Name,1,L),
@@ -2190,7 +2126,7 @@ generated_refed_func(Name) ->
L2 = get_gen_state_field(gen_refed_funcs),
update_gen_state(gen_refed_funcs,[Name|L2]).
-%% adds Data to gen_refed_funcs field in gen_state.
+%% Adds Data to gen_refed_funcs field in gen_state.
add_generated_refed_func(Data) ->
case is_function_generated(Data) of
true ->
@@ -2212,7 +2148,7 @@ next_refed_func() ->
reset_gen_state() ->
save_gen_state(#gen_state{}).
-%% adds Data to generated_functions field in gen_state.
+%% Adds Data to generated_functions field in gen_state.
add_generated_function(Data) ->
L = get_gen_state_field(generated_functions),
update_gen_state(generated_functions,[Data|L]).
@@ -2231,16 +2167,18 @@ maybe_rename_function(Mode,Name,Pattern) ->
{_,true} ->
L2 = generated_functions_filter(get(currmod),Name,L),
case lists:keysearch(Pattern,3,L2) of
- false -> %name existed, but not pattern
+ false ->
+ %% name existed, but not pattern
NextIndex = length(L2),
- %%rename function
+ %% rename function
Suffix = lists:concat(["_",NextIndex]),
NewName =
maybe_rename_function2(type_check(Name),Name,
Suffix),
add_generated_function({Name,NextIndex,Pattern}),
NewName;
- Value -> % name and pattern existed
+ Value ->
+ %% name and pattern existed
%% do not save any new index
Suffix = make_suffix(Value),
Name2 =
@@ -2250,9 +2188,9 @@ maybe_rename_function(Mode,Name,Pattern) ->
end,
lists:concat([Name2,Suffix])
end;
- {inc_disp,_} -> %% this is when
- %% decode_partial_inc_disp/2 is
- %% generated
+ {inc_disp,_} ->
+ %% this is when decode_partial_inc_disp/2 is
+ %% generated
add_generated_function({Name,0,Pattern}),
Name;
_ -> % this if call from add_tobe_refed_func
@@ -2298,23 +2236,12 @@ generated_functions_member(M,Name,[_|T]) ->
generated_functions_member(_,_,[]) ->
false.
-% generated_functions_member(M,Name,L) ->
-% case lists:keymember(Name,1,L) of
-% true ->
-% true;
-% _ ->
-% generated_functions_member1(M,Name,L)
-% end.
-% generated_functions_member1(M,#'Externaltypereference'{module=M,type=Name},L) ->
-% lists:keymember(Name,1,L);
-% generated_functions_member1(_,_,_) -> false.
-
generated_functions_filter(_,Name,L) when is_atom(Name);is_list(Name) ->
lists:filter(fun({N,_,_}) when N==Name -> true;
(_) -> false
end, L);
generated_functions_filter(M,#'Externaltypereference'{module=M,type=Name},L)->
- % remove toptypename from patterns
+ %% remove top typename from patterns
RemoveTType =
fun({N,I,[N,P]}) when N == Name ->
{N,I,P};
@@ -2351,8 +2278,6 @@ set_current_sindex(Index) ->
type_check(A) when is_atom(A) ->
atom;
-%% type_check(I) when is_integer(I) ->
-%% integer;
type_check(L) when is_list(L) ->
Pred = fun(X) when X=<255 ->
false;
diff --git a/lib/asn1/src/asn1ct_check.erl b/lib/asn1/src/asn1ct_check.erl
index 4f04b78241..e867b9606a 100644
--- a/lib/asn1/src/asn1ct_check.erl
+++ b/lib/asn1/src/asn1ct_check.erl
@@ -23,10 +23,9 @@
%% Main Module for ASN.1 compile time functions
-%-compile(export_all).
-export([check/2,storeindb/2,format_error/1]).
-%-define(debug,1).
-include("asn1_records.hrl").
+
%%% The tag-number for universal types
-define(N_BOOLEAN, 1).
-define(N_INTEGER, 2).
@@ -63,7 +62,8 @@
-define(TAG_CONSTRUCTED(Num),
#tag{class='UNIVERSAL',number=Num,type='IMPLICIT',form=32}).
--record(newt,{type=unchanged,tag=unchanged,constraint=unchanged,inlined=no}). % used in check_type to update type and tag
+%% used in check_type to update type and tag
+-record(newt,{type=unchanged,tag=unchanged,constraint=unchanged,inlined=no}).
check(S,{Types,Values,ParameterizedTypes,Classes,Objects,ObjectSets}) ->
%%Predicates used to filter errors
@@ -561,7 +561,6 @@ check_class_fields(S,[F|Fields],Acc) ->
D;
{undefined,user} ->
%% neither of {primitive,bif} or {constructed,bif}
-
{_,D} = get_referenced_type(S,#'Externaltypereference'{module=S#state.mname,type=Type#type.def}),
D;
_ ->
@@ -623,7 +622,6 @@ if_current_checked_type(S,#type{def=Def}) ->
CurrentModule = S#state.mname,
CurrentCheckedName = S#state.tname,
MergedModules = S#state.inputmodules,
- % CurrentCheckedModule = S#state.mname,
case Def of
#'Externaltypereference'{module=CurrentModule,
type=CurrentCheckedName} ->
@@ -656,7 +654,6 @@ check_pobjectset(S,PObjSet) ->
ClassName = #'Externaltypereference'{module=Mod,
type=get_datastr_name(Def)},
{valueset,Set} = ValueSet,
-% ObjectSet = #'ObjectSet'{class={objectclassname,ClassName},
ObjectSet = #'ObjectSet'{class=ClassName,
set=Set},
#pobjectsetdef{pos=Pos,name=Name,args=Args,class=Type#type.def,
@@ -1696,7 +1693,7 @@ check_value(OldS,V) when is_record(V,typedef) ->
%% reference to class
check_value(OldS,V#typedef{typespec=TS#'ObjectSet'{class=Eref}});
#typedef{typespec=HostType} ->
- % an ordinary value set with a type in #typedef.typespec
+ %% an ordinary value set with a type in #typedef.typespec
ValueSet0 = TS#'ObjectSet'.set,
Constr = check_constraints(OldS, HostType, [ValueSet0]),
Type = check_type(OldS,TSDef,TSDef#typedef.typespec),
@@ -2381,15 +2378,6 @@ normalize_s_of(SorS,S,Value,Type,NameList)
%% normalize_restrictedstring handles all format of restricted strings.
-%% tuple case
-% normalize_restrictedstring(_S,[Int1,Int2],_) when is_integer(Int1),is_integer(Int2) ->
-% {Int1,Int2};
-% %% quadruple case
-% normalize_restrictedstring(_S,[Int1,Int2,Int3,Int4],_) when is_integer(Int1),
-% is_integer(Int2),
-% is_integer(Int3),
-% is_integer(Int4) ->
-% {Int1,Int2,Int3,Int4};
%% character string list case
normalize_restrictedstring(S,[H|T],CType) when is_list(H);is_tuple(H) ->
[normalize_restrictedstring(S,H,CType)|normalize_restrictedstring(S,T,CType)];
@@ -2491,7 +2479,7 @@ check_ptype(S,Type,Ts) when is_record(Ts,type) ->
Ts#type{def=TDef}
end,
Ts2;
-%parameterized class
+%% parameterized class
check_ptype(_S,_PTDef,Ts) when is_record(Ts,objectclass) ->
throw({asn1_param_class,Ts}).
@@ -2506,8 +2494,6 @@ check_formal_parameter(_, #'Externaltypereference'{}) ->
check_formal_parameter(S, #'Externalvaluereference'{value=Name}) ->
asn1_error(S, {illegal_typereference,Name}).
-% check_type(S,Type,ObjSpec={{objectclassname,_},_}) ->
- % check_class(S,ObjSpec);
check_type(_S,Type,Ts) when is_record(Type,typedef),
(Type#typedef.checked==true) ->
Ts;
@@ -2606,7 +2592,6 @@ check_type(S=#state{recordtopname=TopName},Type,Ts) when is_record(Ts,type) ->
constraint = NewC};
_ ->
%% Here we only expand the tags and keep the ext ref.
-
NewExt = ExtRef#'Externaltypereference'{module=merged_mod(S,RefMod,Ext)},
TempNewDef#newt{
type = check_externaltypereference(S,NewExt),
@@ -2749,7 +2734,6 @@ check_type(S=#state{recordtopname=TopName},Type,Ts) when is_record(Ts,type) ->
case TopName of
[] ->
[get_datastr_name(Type)];
-% [Type#typedef.name];
_ ->
TopName
end,
@@ -2773,7 +2757,6 @@ check_type(S=#state{recordtopname=TopName},Type,Ts) when is_record(Ts,type) ->
case TopName of
[] ->
[get_datastr_name(Type)];
-% [Type#typedef.name];
_ ->
TopName
end,
@@ -2898,8 +2881,6 @@ tablecinf_choose(#'SEQUENCE'{tablecinf=TCI}) ->
get_innertag(_S,#'ObjectClassFieldType'{type=Type}) ->
case Type of
-% #type{tag=Tag} -> Tag;
-% {fixedtypevaluefield,_,#type{tag=[]}=T} -> get_taglist(S,T);
{fixedtypevaluefield,_,#type{tag=Tag}} -> Tag;
{TypeFieldName,_} when is_atom(TypeFieldName) -> [];
_ -> []
@@ -3754,14 +3735,8 @@ check_reference(S,#'Externaltypereference'{pos=Pos,module=Emod,type=Name}) ->
{ok,Imodule} ->
check_imported(S,Imodule,Name),
#'Externaltypereference'{module=Imodule,type=Name};
-%% case check_imported(S,Imodule,Name) of
-%% ok ->
-%% #'Externaltypereference'{module=Imodule,type=Name};
-%% Err ->
-%% Err
-%% end;
_ ->
- %may be a renamed type in multi file compiling!
+ %% may be a renamed type in multi file compiling!
{M,T}=get_renamed_reference(S,Name,Emod),
NewName = asn1ct:get_name_of_def(T),
NewPos = asn1ct:get_pos_of_def(T),
@@ -4170,7 +4145,6 @@ iof_associated_type(S,[]) ->
def=AssociateSeq}},
asn1_db:dbput(S#state.mname,'INSTANCE OF',TypeDef),
instance_of_decl(S#state.mname);
-%% put(instance_of,{generate,S#state.mname});
_ ->
instance_of_decl(S#state.mname),
ok
@@ -4199,14 +4173,12 @@ iof_associated_type1(S,C) ->
ObjectIdentifier =
#'ObjectClassFieldType'{classname=TypeIdentifierRef,
class=[],
-%% fieldname=[{valuefieldreference,id}],
fieldname={id,[]},
type={fixedtypevaluefield,id,
#type{def='OBJECT IDENTIFIER'}}},
Typefield =
#'ObjectClassFieldType'{classname=TypeIdentifierRef,
class=[],
-%% fieldname=[{typefieldreference,'Type'}],
fieldname={'Type',[]},
type=Typefield_type},
IOFComponents0 =
@@ -4360,11 +4332,11 @@ check_boolean(_S,_Constr) ->
check_octetstring(_S,_Constr) ->
ok.
-% check all aspects of a SEQUENCE
-% - that all component names are unique
-% - that all TAGS are ok (when TAG default is applied)
-% - that each component is of a valid type
-% - that the extension marks are valid
+%% check all aspects of a SEQUENCE
+%% - that all component names are unique
+%% - that all TAGS are ok (when TAG default is applied)
+%% - that each component is of a valid type
+%% - that the extension marks are valid
check_sequence(S,Type,Comps) ->
Components = expand_components(S,Comps),
@@ -4705,11 +4677,11 @@ check_objectidentifier(_S,_Constr) ->
check_relative_oid(_S,_Constr) ->
ok.
-% check all aspects of a CHOICE
-% - that all alternative names are unique
-% - that all TAGS are ok (when TAG default is applied)
-% - that each alternative is of a valid type
-% - that the extension marks are valid
+%% check all aspects of a CHOICE
+%% - that all alternative names are unique
+%% - that all TAGS are ok (when TAG default is applied)
+%% - that each alternative is of a valid type
+%% - that the extension marks are valid
check_choice(S,Type,Components) when is_list(Components) ->
Components1 = [C||C = #'ComponentType'{} <- Components],
case check_unique(Components1,#'ComponentType'.name) of
@@ -5063,12 +5035,12 @@ remove_doubles1(El,L) ->
%% referred to in the ObjectClassFieldType, and the name of the unique
%% field of the class of the ObjectClassFieldType.
%%
-% %% The level information outermost/innermost must be kept. There are
-% %% at least two possibilities to cover here for an outermost case: 1)
-% %% Both the simple table and the component relation have a common path
-% %% at least one step below the outermost level, i.e. the leading
-% %% information shall be on a sub level. 2) They don't have any common
-% %% path.
+%% The level information outermost/innermost must be kept. There are
+%% at least two possibilities to cover here for an outermost case: 1)
+%% Both the simple table and the component relation have a common path
+%% at least one step below the outermost level, i.e. the leading
+%% information shall be on a sub level. 2) They don't have any common
+%% path.
get_simple_table_info(S, Cs, AtLists) ->
[get_simple_table_info1(S, Cs, AtList, []) || AtList <- AtLists].
@@ -5109,10 +5081,10 @@ simple_table_info(S,#'ObjectClassFieldType'{classname=ClRef,
{_FirstFieldName,FieldNames} ->
lists:last(FieldNames)
end,
- %%ObjectClassFieldName is the last element in the dotted
- %%list of the ObjectClassFieldType. The last element may
- %%be of another class, that is referenced from the class
- %%of the ObjectClassFieldType
+ %% ObjectClassFieldName is the last element in the dotted list of
+ %% the ObjectClassFieldType. The last element may be of another
+ %% class, that is referenced from the class of the
+ %% ObjectClassFieldType
ClassDef =
case ObjectClass of
[] ->
@@ -5128,7 +5100,7 @@ simple_table_info(S,#'ObjectClassFieldType'{classname=ClRef,
%% the "name path" in the at-list to the component relation constraint
%% that must refer to a simple table constraint. The list is empty if
%% no component relation constraints were found.
-%%
+%%
%% NamePath has the names of all components that are followed from the
%% beginning of the search. CNames holds the names of all components
%% of the start level, this info is used if an outermost at-notation
@@ -5141,6 +5113,7 @@ any_component_relation(S,[#'ComponentType'{name=CName,typespec=Type}|Cs],CNames,
%% whether this constraint is relevant for the level
%% where the search started
AtNot = extract_at_notation(AtNotation),
+
%% evaluate_atpath returns the relative path to the
%% simple table constraint from where the component
%% relation is found.
@@ -5246,12 +5219,10 @@ get_components(_,#'SET'{components=Cs}) ->
tuple2complist(Cs);
get_components(_,{'CHOICE',Cs}) ->
tuple2complist(Cs);
-%do not step in inlined structures
+%%do not step in inlined structures
get_components(any,{'SEQUENCE OF',T = #type{def=_Def,inlined=no}}) ->
-% get_components(any,Def);
T;
get_components(any,{'SET OF',T = #type{def=_Def,inlined=no}}) ->
-% get_components(any,Def);
T;
get_components(_,_) ->
[].
@@ -5281,15 +5252,12 @@ extract_at_notation([{Level,ValueRefs}]) ->
componentrelation1(S,C = #type{def=Def,constraint=Constraint,tablecinf=TCI},
Path) ->
Ret =
-% case Constraint of
-% [{componentrelation,{_,_,ObjectSet},AtList}|_Rest] ->
case lists:keyfind(componentrelation, 1, Constraint) of
{_,{_,_,ObjectSet},AtList} ->
[{_,AL=[#'Externalvaluereference'{}|_R1]}|_R2] = AtList,
%% Note: if Path is longer than one,i.e. it is within
%% an inner type of the actual level, then the only
%% relevant at-list is of "outermost" type.
-%% #'ObjectClassFieldType'{class=ClassDef} = Def,
ClassDef = get_ObjectClassFieldType_classdef(S,Def),
AtPath =
lists:map(fun(#'Externalvaluereference'{value=V})->V end,
@@ -5375,7 +5343,6 @@ innertype_comprel1(S,T = #type{def=Def,constraint=Cons,tablecinf=TCI},Path) ->
%% relevent here.
[{_,AL=[#'Externalvaluereference'{value=_Attr}|_R1]}|_R2]
= AtList,
-%% #'ObjectClassFieldType'{class=ClassDef} = Def,
ClassDef = get_ObjectClassFieldType_classdef(S,Def),
AtPath =
lists:map(fun(#'Externalvaluereference'{value=V})->V end,
@@ -5444,7 +5411,7 @@ leading_attr_index1(S,[C|Cs],Arg={ObjectSet,_,CDef,P},
value_match(S,C,Name,SubAttr) ->
value_match(S,C,Name,SubAttr,[]). % C has name Name
value_match(_S,#'ComponentType'{},_Name,[],Acc) ->
- Acc;% do not reverse, indexes in reverse order
+ Acc; % do not reverse, indexes in reverse order
value_match(S,#'ComponentType'{typespec=Type},Name,[At|Ats],Acc) ->
InnerType = asn1ct_gen:get_inner(Type#type.def),
Components =
@@ -5514,8 +5481,6 @@ get_tableconstraint_info(S,Type,[C=#'ComponentType'{typespec=CheckedTs}|Cs],Acc)
CheckedTs#type{
def=NewOCFT
}};
-% constraint=[{tableconstraint_info,
-% FieldRef}]}};
{'SEQUENCE OF',SOType} when is_record(SOType,type),
(element(1,SOType#type.def)=='CHOICE') ->
CTypeList = element(2,SOType#type.def),
@@ -5618,51 +5583,6 @@ get_taglist1(S,[_H|Rest]) -> % skip EXTENSIONMARK
get_taglist1(_S,[]) ->
[].
-%% def_to_tag(S,Def) ->
-%% case asn1ct_gen:def_to_tag(Def) of
-%% {'UNIVERSAL',T} ->
-%% case asn1ct_gen:prim_bif(T) of
-%% true ->
-%% ?TAG_PRIMITIVE(tag_number(T));
-%% _ ->
-%% ?TAG_CONSTRUCTED(tag_number(T))
-%% end;
-%% _ -> []
-%% end.
-%% tag_number('BOOLEAN') -> 1;
-%% tag_number('INTEGER') -> 2;
-%% tag_number('BIT STRING') -> 3;
-%% tag_number('OCTET STRING') -> 4;
-%% tag_number('NULL') -> 5;
-%% tag_number('OBJECT IDENTIFIER') -> 6;
-%% tag_number('ObjectDescriptor') -> 7;
-%% tag_number('EXTERNAL') -> 8;
-%% tag_number('INSTANCE OF') -> 8;
-%% tag_number('REAL') -> 9;
-%% tag_number('ENUMERATED') -> 10;
-%% tag_number('EMBEDDED PDV') -> 11;
-%% tag_number('UTF8String') -> 12;
-%% %%tag_number('RELATIVE-OID') -> 13;
-%% tag_number('SEQUENCE') -> 16;
-%% tag_number('SEQUENCE OF') -> 16;
-%% tag_number('SET') -> 17;
-%% tag_number('SET OF') -> 17;
-%% tag_number('NumericString') -> 18;
-%% tag_number('PrintableString') -> 19;
-%% tag_number('TeletexString') -> 20;
-%% %%tag_number('T61String') -> 20;
-%% tag_number('VideotexString') -> 21;
-%% tag_number('IA5String') -> 22;
-%% tag_number('UTCTime') -> 23;
-%% tag_number('GeneralizedTime') -> 24;
-%% tag_number('GraphicString') -> 25;
-%% tag_number('VisibleString') -> 26;
-%% %%tag_number('ISO646String') -> 26;
-%% tag_number('GeneralString') -> 27;
-%% tag_number('UniversalString') -> 28;
-%% tag_number('CHARACTER STRING') -> 29;
-%% tag_number('BMPString') -> 30.
-
merge_tags(T1, T2) when is_list(T2) ->
merge_tags2(T1 ++ T2, []);
merge_tags(T1, T2) ->
diff --git a/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl b/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
index 16af09bca9..bfb69a09b3 100644
--- a/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1ct_constructed_ber_bin_v2.erl
@@ -32,17 +32,17 @@
-include("asn1_records.hrl").
--import(asn1ct_gen, [emit/1,demit/1,get_record_name_prefix/1]).
+-import(asn1ct_gen, [emit/1,get_record_name_prefix/1]).
-define(ASN1CT_GEN_BER,asn1ct_gen_ber_bin_v2).
-% the encoding of class of tag bits 8 and 7
+%% the encoding of class of tag bits 8 and 7
-define(UNIVERSAL, 0).
-define(APPLICATION, 16#40).
-define(CONTEXT, 16#80).
-define(PRIVATE, 16#C0).
-% primitive or constructed encoding % bit 6
+%% primitive or constructed encoding % bit 6
-define(PRIMITIVE, 0).
-define(CONSTRUCTED, 2#00100000).
@@ -103,7 +103,6 @@ gen_encode_sequence(Gen, Typename, #type{}=D) ->
uniqueclassfield=Unique} when Used /= Unique ->
false;
%% ObjectSet, name of the object set in constraints
- %%
#simpletableattributes{objectsetname=ObjectSetRef,
c_name=AttrN,
c_index=N,
@@ -230,7 +229,6 @@ gen_decode_sequence(Gen, Typename, #type{}=D) ->
usedclassfield=UniqueFieldName,
uniqueclassfield=UniqueFieldName,
valueindex=ValIndex} ->
-% {ObjectSetRef,AttrN,_N,UniqueFieldName} ->%% N is index of attribute that determines constraint
F = fun(#'ComponentType'{typespec=CT})->
case {asn1ct_gen:get_constraint(CT#type.constraint,componentrelation),CT#type.tablecinf} of
{no,[{objfun,_}|_]} -> true;
@@ -279,12 +277,12 @@ gen_decode_sequence(Gen, Typename, #type{}=D) ->
ValueMatch,"),",nl]),
gen_dec_postponed_decs(DecObj,PostponedDecArgs)
end,
- demit(["Result = "]), %dbg
%% return value as record
case Ext of
{ext,_,_} ->
emit(["case ",{prev,tlv}," of [] -> true; _ -> true end, % ... extra fields skipped",nl]);
- _ -> % noext | extensible
+ _ ->
+ %% noext | extensible
emit(["case ",{prev,tlv}," of",nl,
"[] -> true;",
"_ -> exit({error,{asn1, {unexpected,",{prev,tlv},
@@ -431,7 +429,6 @@ gen_decode_set(Gen, Typename, #type{}=D) ->
{DecObjInf,ValueIndex} =
case TableConsInfo of
-%% {ObjectSetRef,AttrN,_N,UniqueFieldName} ->%% N is index of attribute that determines constraint
#simpletableattributes{objectsetname=ObjectSetRef,
c_name=AttrN,
usedclassfield=UniqueFieldName,
@@ -446,7 +443,8 @@ gen_decode_set(Gen, Typename, #type{}=D) ->
end
end,
case lists:any(F,CompList) of
- true -> % when component relation constraint establish
+ true ->
+ %% when component relation constraint establish
%% relation from a component to another components
%% subtype component
{{AttrN,{deep,ObjectSetRef,UniqueFieldName,ValIndex}},
@@ -503,7 +501,6 @@ gen_decode_set(Gen, Typename, #type{}=D) ->
ValueMatch,"),",nl]),
gen_dec_postponed_decs(DecObj,PostponedDecArgs)
end,
- demit(["Result = "]), %dbg
%% return value as record
case Ext of
Extnsn when Extnsn =/= noext ->
@@ -722,7 +719,7 @@ gen_dec_sequence_call2(Erules,TopType,{Root1,EList,Root2},_Ext,DecObjInf) ->
length(Root1)+length(EList),noext,
DecObjInf,LA,ArgsAcc).
-%% returns a list of tags of the elements in the component (second
+%% Returns a list of tags of the elements in the component (second
%% root) list up to and including the first mandatory tag. See 24.6 in
%% X.680 (7/2002)
get_root2_taglist([],Acc) ->
@@ -811,8 +808,6 @@ gen_dec_set_cases(Erules,TopType,[Comp|RestComps],Pos) ->
[FirstTag|_] ->
[(?ASN1CT_GEN_BER:decode_class(FirstTag#tag.class) bsl 10) + FirstTag#tag.number]
end,
-% emit([indent(6),"%Tags: ",Tags,nl]),
-% emit([indent(6),"%Type#type.tag: ",Type#type.tag,nl]),
CaseFun = fun(TagList=[H|T],Fun,N) ->
Semicolon = case TagList of
[_Tag1,_|_] -> [";",nl];
@@ -827,7 +822,6 @@ gen_dec_set_cases(Erules,TopType,[Comp|RestComps],Pos) ->
emit([";",nl])
end,
CaseFun(Tags,CaseFun,0),
-%% emit([";",nl]),
gen_dec_set_cases(Erules,TopType,RestComps,Pos+1).
@@ -1007,14 +1001,6 @@ gen_enc_line(Erules,TopType,Cname,
["{",{curr,encBytes},",",{curr,encLen},"} = "],
EncObj)
end;
-% gen_enc_line(Erules,TopType,Cname,
-% Type=#type{constraint=[{componentrelation,_,_}],
-% def=#'ObjectClassFieldType'{type={typefield,_}}},
-% Element,Indent,OptOrMand=mandatory,EncObj)
-% when is_list(Element) ->
-% asn1ct_name:new(tmpBytes),
-% gen_enc_line(Erules,TopType,Cname,Type,Element,Indent,OptOrMand,
-% ["{",{curr,tmpBytes},",_} = "],EncObj);
gen_enc_line(Erules,TopType,Cname,Type,Element,Indent,OptOrMand,EncObj)
when is_list(Element) ->
gen_enc_line(Erules,TopType,Cname,Type,Element,Indent,OptOrMand,
@@ -1035,37 +1021,30 @@ gen_enc_line(Erules,TopType,Cname,Type,Element,Indent,OptOrMand,Assign,EncObj)
gen_optormand_case(OptOrMand, Erules, TopType, Cname, Type, Element),
case {Type,asn1ct_gen:get_constraint(Type#type.constraint,
componentrelation)} of
-% #type{constraint=[{tableconstraint_info,RefedFieldName}],
-% def={typefield,_}} ->
{#type{def=#'ObjectClassFieldType'{type={typefield,_},
fieldname=RefedFieldName}},
{componentrelation,_,_}} ->
{_LeadingAttrName,Fun} = EncObj,
- case RefedFieldName of
- {Name,RestFieldNames} when is_atom(Name) ->
- case OptOrMand of
- mandatory -> ok;
- _ ->
-% emit(["{",{curr,tmpBytes},",",{curr,tmpLen},
- emit(["{",{curr,tmpBytes},",_ } = "])
-% "} = "])
- end,
- emit([Fun,"(",{asis,Name},", ",Element,", ",
- {asis,RestFieldNames},"),",nl]),
- emit(IndDeep),
- case OptOrMand of
- mandatory ->
- emit(["{",{curr,encBytes},",",{curr,encLen},
- "} = ",
- {call,ber,encode_open_type,
- [{curr,tmpBytes},{asis,Tag}]},nl]);
- _ ->
- emit([{call,ber,encode_open_type,
- [{curr,tmpBytes},{asis,Tag}]}])
- end;
- Err ->
- throw({asn1,{'internal error',Err}})
- end;
+ {Name,RestFieldNames} = RefedFieldName,
+ true = is_atom(Name), %Assertion.
+ case OptOrMand of
+ mandatory -> ok;
+ _ ->
+ emit(["{",{curr,tmpBytes},",_ } = "])
+ end,
+ emit([Fun,"(",{asis,Name},", ",Element,", ",
+ {asis,RestFieldNames},"),",nl]),
+ emit(IndDeep),
+ case OptOrMand of
+ mandatory ->
+ emit(["{",{curr,encBytes},",",{curr,encLen},
+ "} = ",
+ {call,ber,encode_open_type,
+ [{curr,tmpBytes},{asis,Tag}]},nl]);
+ _ ->
+ emit([{call,ber,encode_open_type,
+ [{curr,tmpBytes},{asis,Tag}]}])
+ end;
_ ->
case WhatKind of
{primitive,bif} ->
@@ -1166,7 +1145,9 @@ gen_dec_line(Erules,TopType,Cname,CTags,Type,OptOrMand,DecObjInf) ->
gen_dec_call(InnerType,Erules,TopType,Cname,Type,
BytesVar,Tag,
mandatory,", mandatory, ",DecObjInf,OptOrMand);
- _ -> %optional or default or a mandatory component after an extensionmark
+ _ ->
+ %% optional or default, or a mandatory component after
+ %% an extension marker
{FirstTag,RestTag} =
case Tag of
[] ->
@@ -1241,9 +1222,9 @@ gen_dec_line(Erules,TopType,Cname,CTags,Type,OptOrMand,DecObjInf) ->
PostponedDec
end,
case DecObjInf of
- {Cname,ObjSet} -> % this must be the component were an object is
- %% choosen from the object set according to the table
- %% constraint.
+ {Cname,ObjSet} ->
+ %% This must be the component were an object is chosen
+ %% from the object set according to the table constraint.
ObjSetName = case ObjSet of
{deep,OSName,_,_} ->
OSName;
@@ -1280,10 +1261,7 @@ gen_dec_call({typefield,_},_,_,_Cname,Type,BytesVar,Tag,_,_,false,_) ->
[];
gen_dec_call({typefield,_},_,_,Cname,Type,BytesVar,Tag,_,_,_DecObjInf,OptOrMandComp) ->
call(decode_open_type, [BytesVar,{asis,Tag}]),
- RefedFieldName =
-% asn1ct_gen:get_constraint(Type#type.constraint,
-% tableconstraint_info),
- (Type#type.def)#'ObjectClassFieldType'.fieldname,
+ RefedFieldName = (Type#type.def)#'ObjectClassFieldType'.fieldname,
[{Cname,RefedFieldName,asn1ct_gen:mk_var(asn1ct_name:curr(term)),
asn1ct_gen:mk_var(asn1ct_name:curr(tmpterm)),Tag,OptOrMandComp}];
gen_dec_call(InnerType, Gen, TopType, Cname, Type, BytesVar,
@@ -1339,8 +1317,6 @@ gen_dec_call1(WhatKind, _, TopType, Cname, Type, BytesVar, Tag) ->
emit(["{'",asn1ct_gen:list2name([Cname|TopType]),"',",
BytesVar,"}"]);
_ ->
-% {DecFunName, _DecMod, _DecFun} =
-% case {asn1ct:get_gen_state_field(namelist),WhatKind} of
EmitDecFunCall =
fun(FuncName) ->
case {WhatKind,Type#type.tablecinf} of
@@ -1356,14 +1332,11 @@ gen_dec_call1(WhatKind, _, TopType, Cname, Type, BytesVar, Tag) ->
Sindex =
case WhatKind of
#'Externaltypereference'{} ->
-% asn1ct:maybe_rename_function(WhatKind,List),
SI = asn1ct:maybe_saved_sindex(WhatKind,List),
Saves = {WhatKind,SI,List},
asn1ct:add_tobe_refed_func(Saves),
SI;
_ ->
-% asn1ct:maybe_rename_function([Cname|TopType],
-% List),
SI = asn1ct:maybe_saved_sindex([Cname|TopType],List),
Saves = {[Cname|TopType],SI,List,Type},
asn1ct:add_tobe_refed_func(Saves),
@@ -1371,8 +1344,6 @@ gen_dec_call1(WhatKind, _, TopType, Cname, Type, BytesVar, Tag) ->
end,
asn1ct:update_gen_state(namelist,Rest),
Prefix=asn1ct:get_gen_state_field(prefix),
-% Suffix =
-% lists:concat(["_",asn1ct:latest_sindex()]),
Suffix =
case Sindex of
I when is_integer(I),I>0 -> lists:concat(["_",I]);
@@ -1380,8 +1351,6 @@ gen_dec_call1(WhatKind, _, TopType, Cname, Type, BytesVar, Tag) ->
end,
{DecFunName,_,_}=
mkfuncname(TopType,Cname,WhatKind,Prefix,Suffix),
-% SuffixedName =
-% lists:concat([DecFunName,asn1ct:latest_sindex()]),
EmitDecFunCall(DecFunName);
[{Cname,parts}|Rest] ->
asn1ct:update_gen_state(namelist,Rest),
@@ -1401,13 +1370,6 @@ gen_dec_call1(WhatKind, _, TopType, Cname, Type, BytesVar, Tag) ->
mkfuncname(TopType,Cname,WhatKind,"dec_",""),
EmitDecFunCall(DecFunName)
end
-% case {WhatKind,Type#type.tablecinf} of
-% {{constructed,bif},[{objfun,_}|_Rest]} ->
-% emit([DecFunName,"(",BytesVar,", ",{asis,Tag},
-% ", ObjFun)"]);
-% _ ->
-% emit([DecFunName,"(",BytesVar,", ",{asis,Tag},")"])
-% end
end.
@@ -1464,6 +1426,9 @@ print_attribute_comment(InnerType,Pos,Cname,Prop) ->
case InnerType of
#'Externaltypereference'{module=XModule,type=Name} ->
emit([nl,"%% attribute ",Cname,"(",Pos,") External ",XModule,":",Name]);
+ _ when is_tuple(InnerType) ->
+ emit([nl,"%% attribute ",Cname,"(",Pos,") with type "|
+ tuple_to_list(InnerType)]);
_ ->
emit([nl,"%% attribute ",Cname,"(",Pos,") with type ",InnerType])
end,
diff --git a/lib/asn1/src/asn1ct_constructed_per.erl b/lib/asn1/src/asn1ct_constructed_per.erl
index 9cd9864b80..986d88b677 100644
--- a/lib/asn1/src/asn1ct_constructed_per.erl
+++ b/lib/asn1/src/asn1ct_constructed_per.erl
@@ -30,9 +30,8 @@
-export([gen_decode_choice/3]).
-include("asn1_records.hrl").
-%-compile(export_all).
--import(asn1ct_gen, [emit/1,demit/1,get_record_name_prefix/1]).
+-import(asn1ct_gen, [emit/1,get_record_name_prefix/1]).
-type type_name() :: any().
@@ -357,7 +356,6 @@ gen_dec_constructed_imm(Erule, Typename, #type{}=D) ->
#'SEQUENCE'{tablecinf=TCI,components=CL} ->
{add_textual_order(CL),TCI};
#'SET'{tablecinf=TCI,components=CL} ->
-%% {add_textual_order(CL),TCI}
{CL,TCI} % the textual order is already taken care of
end,
Ext = extensible_dec(CompList),
@@ -375,13 +373,11 @@ gen_dec_constructed_imm(Erule, Typename, #type{}=D) ->
end,
ObjSetInfo =
case TableConsInfo of
-%% {ObjectSet,AttrN,N,UniqueFieldName} ->%% N is index of attribute that determines constraint
#simpletableattributes{objectsetname=ObjectSet,
c_name=AttrN,
usedclassfield=UniqueFieldName,
uniqueclassfield=UniqueFieldName,
valueindex=ValIndex} ->
-%% {AttrN,ObjectSet};
F = fun(#'ComponentType'{typespec=CT})->
case {asn1ct_gen:get_constraint(CT#type.constraint,componentrelation),CT#type.tablecinf} of
{no,[{objfun,_}|_R]} -> true;
@@ -686,10 +682,10 @@ gen_decode_choice(Erules,Typename,D) when is_record(D,type) ->
{'CHOICE',CompList} = D#type.def,
Ext = extensible_enc(CompList),
gen_dec_choice(Erules,Typename,CompList,Ext),
- emit({".",nl}).
+ emit([".",nl]).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Encode generator for SEQUENCE OF type
+%% Encode generator for SEQUENCE OF type
gen_encode_sof(Erule, Typename, SeqOrSetOf, D) ->
asn1ct_name:start(),
@@ -781,20 +777,20 @@ gen_decode_sof_components(Erule, Name, Typename, SeqOrSetOf, Cont) ->
case asn1ct_gen:type(Conttype) of
{primitive,bif} ->
asn1ct_gen_per:gen_dec_prim(Erule, Cont, "Bytes"),
- emit({com,nl});
+ emit([com,nl]);
{constructed,bif} ->
NewTypename = [Constructed_Suffix|Typename],
- emit({"'dec_",asn1ct_gen:list2name(NewTypename),
- "'(Bytes",ObjFun,"),",nl});
+ emit([{asis,dec_func(asn1ct_gen:list2name(NewTypename))},
+ "(Bytes",ObjFun,"),",nl]);
#'Externaltypereference'{}=Etype ->
asn1ct_gen_per:gen_dec_external(Etype, "Bytes"),
emit([com,nl]);
'ASN1_OPEN_TYPE' ->
asn1ct_gen_per:gen_dec_prim(Erule, #type{def='ASN1_OPEN_TYPE'},
"Bytes"),
- emit({com,nl});
+ emit([com,nl]);
_ ->
- emit({"'dec_",Conttype,"'(Bytes),",nl})
+ emit([{asis,dec_func(Conttype)},"(Bytes),",nl])
end,
emit([{asis,Name},"(Num-1, Remain",ObjFun,", [Term|Acc]).",nl]).
@@ -934,9 +930,7 @@ add_textual_order({R1,Ext,R2}) ->
{NewExt,Num2} = add_textual_order1(Ext,Num1),
{NewR2,_} = add_textual_order1(R2,Num2),
{NewR1,NewExt,NewR2}.
-%%add_textual_order1(Cs=[#'ComponentType'{textual_order=Int}|_],I)
-%% when is_integer(Int) ->
-%% {Cs,I};
+
add_textual_order1(Cs,NumIn) ->
lists:mapfoldl(fun(C=#'ComponentType'{},Num) ->
{C#'ComponentType'{textual_order=Num},
@@ -1494,9 +1488,9 @@ gen_dec_component_no_val(_, Type, {'DEFAULT',DefVal0}) ->
DefVal = asn1ct_gen:conform_value(Type, DefVal0),
emit([{asis,DefVal}]);
gen_dec_component_no_val(_, _, 'OPTIONAL') ->
- emit({"asn1_NOVALUE"});
+ emit(["asn1_NOVALUE"]);
gen_dec_component_no_val({ext,_,_}, _, mandatory) ->
- emit({"asn1_NOVALUE"}).
+ emit(["asn1_NOVALUE"]).
dec_map_extaddgroup_no_val(Ext, Type, Comp) ->
L0 = [dec_map_extaddgroup_no_val_1(N, P, Ext, Type) ||
@@ -1693,16 +1687,15 @@ gen_dec_line_other(Erule, Atype, TopType, Comp) ->
end;
{constructed,bif} ->
NewTypename = [Cname|TopType],
+ DecFunc = dec_func(asn1ct_gen:list2name(NewTypename)),
case Type#type.tablecinf of
[{objfun,_}|_R] ->
fun(BytesVar) ->
- emit({"'dec_",asn1ct_gen:list2name(NewTypename),
- "'(",BytesVar,", ObjFun)"})
+ emit([{asis,DecFunc},"(",BytesVar,", ObjFun)"])
end;
_ ->
fun(BytesVar) ->
- emit({"'dec_",asn1ct_gen:list2name(NewTypename),
- "'(",BytesVar,")"})
+ emit([{asis,DecFunc},"(",BytesVar,")"])
end
end
end.
@@ -1908,7 +1901,7 @@ emit_extaddgroupTerms(VarSeries,[_]) ->
ok;
emit_extaddgroupTerms(VarSeries,[_|Rest]) ->
asn1ct_name:new(VarSeries),
- emit({{curr,VarSeries},","}),
+ emit([{curr,VarSeries},","]),
emit_extaddgroupTerms(VarSeries,Rest);
emit_extaddgroupTerms(_,[]) ->
ok.
@@ -1990,3 +1983,6 @@ attribute_comment(InnerType, TextPos, Cname) ->
end,
Comment = ["attribute ",Cname,"(",TextPos,") with type ",DispType],
lists:concat(Comment).
+
+dec_func(Tname) ->
+ list_to_atom(lists:concat(["dec_",Tname])).
diff --git a/lib/asn1/src/asn1ct_func.erl b/lib/asn1/src/asn1ct_func.erl
index 0cd72acf9d..016161fcaf 100644
--- a/lib/asn1/src/asn1ct_func.erl
+++ b/lib/asn1/src/asn1ct_func.erl
@@ -65,7 +65,7 @@ generate(Fd) ->
Funcs = sofs:to_external(Funcs0),
ok = file:write(Fd, Funcs).
-is_used({_,_,_}=MFA) ->
+is_used({M,F,A}=MFA) when is_atom(M), is_atom(F), is_integer(A) ->
req({is_used,MFA}).
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index 9f628c7b04..fa312ed052 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -22,8 +22,7 @@
-include("asn1_records.hrl").
--export([demit/1,
- emit/1,
+-export([emit/1,
open_output_file/1,close_output_file/0,
get_inner/1,type/1,def_to_tag/1,prim_bif/1,
list2name/1,
@@ -191,13 +190,9 @@ pgen_partial_decode(_, _, _) ->
ok.
pgen_partial_inc_dec(Rtmod,Erules,Module) ->
-% io:format("Start partial incomplete decode gen?~n"),
case asn1ct:get_gen_state_field(inc_type_pattern) of
undefined ->
-% io:format("Partial incomplete decode gen not started: ~w~n",[asn1ct:get_gen_state_field(active)]),
ok;
-% [] ->
-% ok;
ConfList ->
PatternLists=lists:map(fun({_,P}) -> P end,ConfList),
pgen_partial_inc_dec1(Rtmod,Erules,Module,PatternLists),
@@ -215,11 +210,9 @@ pgen_partial_inc_dec1(Rtmod,Erules,Module,[P|Ps]) ->
asn1ct:update_gen_state(prefix,"dec-inc-"),
case asn1ct:maybe_saved_sindex(TopTypeName,P) of
I when is_integer(I),I > 0 ->
-% io:format("Index:~p~n",[I]),
asn1ct:set_current_sindex(I);
_I ->
asn1ct:set_current_sindex(0),
-% io:format("Index=~p~n",[_I]),
ok
end,
Rtmod:gen_decode(Erules,TypeDef),
@@ -250,8 +243,8 @@ gen_partial_inc_dec_refed_funcs(Rtmod, #gen{erule=ber}=Gen) ->
pgen_partial_dec(_Rtmod,Erules,_Module) ->
Type_pattern = asn1ct:get_gen_state_field(type_pattern),
-% io:format("Type_pattern: ~w~n",[Type_pattern]),
- %% Get the typedef of the top type and follow into the choosen components until the last type/component.
+ %% Get the typedef of the top type and follow into the choosen
+ %% components until the last type/component.
pgen_partial_types(Erules,Type_pattern),
ok.
@@ -266,7 +259,6 @@ pgen_partial_types(#gen{options=Options}=Gen, TypePattern) ->
pgen_partial_types1(Erules,[{FuncName,[TopType|RestTypes]}|Rest]) ->
-% emit([FuncName,"(Bytes) ->",nl]),
CurrMod = get(currmod),
TypeDef = asn1_db:dbget(CurrMod,TopType),
traverse_type_structure(Erules,TypeDef,RestTypes,FuncName,
@@ -291,8 +283,9 @@ traverse_type_structure(Erules,Type,[],FuncName,TopTypeName) ->
end,
Ctmod:gen_decode_selected(Erules,TypeDef,FuncName); % what if Type is #type{}
traverse_type_structure(Erules,#type{def=Def},[[N]],FuncName,TopTypeName)
- when is_integer(N) -> % this case a decode of one of the elements in
- % the SEQUENCE OF is required.
+ when is_integer(N) ->
+ %% In this case a decode of one of the elements in the SEQUENCE OF is
+ %% required.
InnerType = asn1ct_gen:get_inner(Def),
case InnerType of
'SEQUENCE OF' ->
@@ -368,8 +361,9 @@ traverse_type_structure(Erules,#typedef{typespec=Def},[T|Ts],FuncName,
TypeDef = asn1_db:dbget(M,TName),
traverse_type_structure(Erules,TypeDef,[T|Ts],FuncName,
[TypeDef#typedef.name]);
- _ -> %this may be a referenced type that shall be traversed or
- %the selected type
+ _ ->
+ %% This may be a referenced type that shall be traversed
+ %% or the selected type
traverse_type_structure(Erules,Def,Ts,FuncName,[T|TopTypeName])
end.
@@ -384,9 +378,7 @@ get_component(Name,{C1,C2}) when is_list(C1),is_list(C2) ->
get_component(Name,[C=#'ComponentType'{name=Name}|_Cs]) ->
C;
get_component(Name,[_C|Cs]) ->
- get_component(Name,Cs);
-get_component(Name,_) ->
- throw({error,{asn1,{internal_error,Name}}}).
+ get_component(Name,Cs).
%% generate code for all inner types that are called from the top type
%% of the partial incomplete decode and are defined within the top
@@ -451,7 +443,6 @@ pgen_partial_incomplete_decode1(#gen{erule=ber}) ->
lists:foreach(fun emit_partial_incomplete_decode/1,Data)
end,
GeneratedFs= asn1ct:get_gen_state_field(gen_refed_funcs),
-% io:format("GeneratedFs :~n~p~n",[GeneratedFs]),
gen_part_decode_funcs(GeneratedFs,0);
pgen_partial_incomplete_decode1(#gen{}) -> ok.
@@ -604,9 +595,7 @@ gen_encode_constructed(Erules,Typename,InnerType,D) when is_record(D,type) ->
Rtmod:gen_encode_sof(Erules,Typename,InnerType,D),
{_,Type} = D#type.def,
NameSuffix = asn1ct_gen:constructed_suffix(InnerType,Type#type.def),
- gen_types(Erules, [NameSuffix|Typename], Type, gen_encode);
- _ ->
- exit({nyi,InnerType})
+ gen_types(Erules, [NameSuffix|Typename], Type, gen_encode)
end;
gen_encode_constructed(Erules,Typename,InnerType,D)
when is_record(D,typedef) ->
@@ -879,7 +868,6 @@ gen_partial_inc_dispatcher(#gen{erule=ber}) ->
{_,undefined} ->
ok;
{Data1,Data2} ->
-% io:format("partial_incomplete_decode: ~p~ninc_type_pattern: ~p~n",[Data,Data2]),
gen_partial_inc_dispatcher(Data1, Data2, "")
end;
gen_partial_inc_dispatcher(#gen{}) ->
@@ -954,71 +942,39 @@ hrl_protector(OutFile) ->
end || C <- P].
-%% EMIT functions ************************
-%% ***************************************
-
- % debug generation
-demit(Term) ->
- case get(asndebug) of
- true -> emit(Term);
- _ ->true
- end.
-
- % always generation
emit(Term) ->
ok = file:write(get(gen_file_out), do_emit(Term)).
-do_emit({external,_M,T}) ->
- do_emit(T);
-
do_emit({prev,Variable}) when is_atom(Variable) ->
do_emit({var,asn1ct_name:prev(Variable)});
-
do_emit({next,Variable}) when is_atom(Variable) ->
do_emit({var,asn1ct_name:next(Variable)});
-
do_emit({curr,Variable}) when is_atom(Variable) ->
do_emit({var,asn1ct_name:curr(Variable)});
-
do_emit({var,Variable}) when is_atom(Variable) ->
[Head|V] = atom_to_list(Variable),
[Head-32|V];
-
-do_emit({var,Variable}) ->
- [Head|V] = Variable,
- [Head-32|V];
-
do_emit({asis,What}) ->
io_lib:format("~w", [What]);
-
do_emit({call,M,F,A}) ->
MFA = {M,F,length(A)},
asn1ct_func:need(MFA),
[atom_to_list(F),"(",call_args(A, "")|")"];
-
do_emit(nl) ->
"\n";
-
do_emit(com) ->
",";
-
-do_emit(tab) ->
- " ";
-
+do_emit([C|_]=Str) when is_integer(C) ->
+ Str;
+do_emit([_|_]=L) ->
+ [do_emit(E) || E <- L];
+do_emit([]) ->
+ [];
do_emit(What) when is_integer(What) ->
integer_to_list(What);
-
-do_emit(What) when is_list(What), is_integer(hd(What)) ->
- What;
-
do_emit(What) when is_atom(What) ->
- atom_to_list(What);
+ atom_to_list(What).
-do_emit(What) when is_tuple(What) ->
- [do_emit(E) || E <- tuple_to_list(What)];
-
-do_emit(What) when is_list(What) ->
- [do_emit(E) || E <- What].
call_args([A|As], Sep) ->
[Sep,do_emit(A)|call_args(As, ", ")];
@@ -1124,8 +1080,6 @@ gen_record(Gen, TorPtype, Name, #type{}=Type, Num) ->
case Seq#'SEQUENCE'.pname of
false ->
{record,Seq#'SEQUENCE'.components};
-%% _Pname when TorPtype == type ->
-%% false;
_ ->
{record,Seq#'SEQUENCE'.components}
end;
@@ -1138,8 +1092,6 @@ gen_record(Gen, TorPtype, Name, #type{}=Type, Num) ->
_ ->
{record,to_textual_order(Set#'SET'.components)}
end;
-% {'SET',{_,_CompList}} ->
-% {record,_CompList};
{'CHOICE',_CompList} -> {inner,Def};
{'SEQUENCE OF',_CompList} -> {['SEQOF'|Name],Def};
{'SET OF',_CompList} -> {['SETOF'|Name],Def};
@@ -1345,7 +1297,6 @@ get_inner({fixedtypevaluefield,_,Type}) ->
get_inner({typefield,TypeName}) ->
TypeName;
get_inner(#'ObjectClassFieldType'{type=Type}) ->
-% get_inner(Type);
Type;
get_inner(T) when is_tuple(T) ->
case element(1,T) of
@@ -1354,9 +1305,7 @@ get_inner(T) when is_tuple(T) ->
{valuefieldreference,FieldName} ->
get_fieldtype(element(2,Tuple),FieldName);
{typefieldreference,FieldName} ->
- get_fieldtype(element(2,Tuple),FieldName);
- {'EXIT',Reason} ->
- throw({asn1,{'internal error in get_inner/1',Reason}})
+ get_fieldtype(element(2,Tuple),FieldName)
end;
_ -> element(1,T)
end.
diff --git a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
index 6c6d4193f3..948566a6fc 100644
--- a/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
+++ b/lib/asn1/src/asn1ct_gen_ber_bin_v2.erl
@@ -35,21 +35,21 @@
-export([extaddgroup2sequence/1]).
-export([dialyzer_suppressions/1]).
--import(asn1ct_gen, [emit/1,demit/1]).
+-import(asn1ct_gen, [emit/1]).
- % the encoding of class of tag bits 8 and 7
+%% The encoding of class of tag bits 8 and 7
-define(UNIVERSAL, 0).
-define(APPLICATION, 16#40).
-define(CONTEXT, 16#80).
-define(PRIVATE, 16#C0).
- % primitive or constructed encoding % bit 6
+%% Primitive or constructed encoding % bit 6
-define(PRIMITIVE, 0).
-define(CONSTRUCTED, 2#00100000).
-define(T_ObjectDescriptor, ?UNIVERSAL bor ?PRIMITIVE bor 7).
- % restricted character string types
+%% Restricted character string types
-define(T_NumericString, ?UNIVERSAL bor ?PRIMITIVE bor 18). %can be constructed
-define(T_PrintableString, ?UNIVERSAL bor ?PRIMITIVE bor 19). %can be constructed
-define(T_TeletexString, ?UNIVERSAL bor ?PRIMITIVE bor 20). %can be constructed
@@ -107,20 +107,12 @@ gen_encode(Erules,Typename,Type) when is_record(Type,type) ->
case asn1ct_gen:type(InnerType) of
{constructed,bif} ->
- emit([nl,nl,nl,"%%================================"]),
- emit([nl,"%% ",asn1ct_gen:list2name(Typename)]),
- emit([nl,"%%================================",nl]),
- case length(Typename) of
- 1 -> % top level type
- emit(["'enc_",asn1ct_gen:list2name(Typename),
- "'(Val",ObjFun,") ->",nl]),
- emit([" 'enc_",asn1ct_gen:list2name(Typename),
- "'(Val, ", {asis,lists:reverse(Type#type.tag)},ObjFun,").",nl,nl]);
- _ -> % embedded type with constructed name
- true
- end,
- emit(["'enc_",asn1ct_gen:list2name(Typename),
- "'(Val, TagIn",ObjFun,") ->",nl," "]),
+ Func = {asis,enc_func(asn1ct_gen:list2name(Typename))},
+ emit([nl,nl,nl,"%%================================",nl,
+ "%% ",asn1ct_gen:list2name(Typename),nl,
+ "%%================================",nl,
+ Func,"(Val, TagIn",ObjFun,") ->",nl,
+ " "]),
asn1ct_gen:gen_encode_constructed(Erules,Typename,InnerType,Type);
_ ->
true
@@ -146,7 +138,7 @@ gen_encode_user(Erules, #typedef{}=D, Wrapper) ->
emit([nl,nl,"%%================================"]),
emit([nl,"%% ",Typename]),
emit([nl,"%%================================",nl]),
- FuncName = "'enc_" ++ asn1ct_gen:list2name(Typename) ++ "'",
+ FuncName = {asis,enc_func(asn1ct_gen:list2name(Typename))},
case Wrapper of
true ->
%% This is a top-level type. Generate an 'enc_Type'/1
@@ -169,9 +161,10 @@ gen_encode_user(Erules, #typedef{}=D, Wrapper) ->
gen_encode_prim(ber,Type,"TagIn","Val"),
emit([".",nl]);
#'Externaltypereference'{module=CurrentMod,type=Etype} ->
- emit([" 'enc_",Etype,"'(Val, TagIn).",nl]);
+ emit([" ",{asis,enc_func(Etype)},"(Val, TagIn).",nl]);
#'Externaltypereference'{module=Emod,type=Etype} ->
- emit([" '",Emod,"':'enc_",Etype,"'(Val, TagIn).",nl]);
+ emit([" ",{asis,Emod},":",{asis,enc_func(Etype)},
+ "(Val, TagIn).",nl]);
'ASN1_OPEN_TYPE' ->
emit(["%% OPEN TYPE",nl]),
gen_encode_prim(ber,
@@ -326,40 +319,39 @@ gen_decode(Erules,Type) when is_record(Type,typedef) ->
Tag = [(decode_class(X#tag.class) bsl 10) + X#tag.number || X <- InnerTag],
- FunctionName =
+ FuncName0 =
case {asn1ct:get_gen_state_field(active),
asn1ct:get_gen_state_field(prefix)} of
{true,Pref} ->
%% prevent duplicated function definitions
-% Pattern = asn1ct:get_gen_state_field(namelist),
-% FuncName=asn1ct:maybe_rename_function(Type#typedef.name,
-% Pattern),
case asn1ct:current_sindex() of
- I when is_integer(I),I>0 ->
- lists:concat([Pref,Type#typedef.name,"_",I]);
+ I when is_integer(I), I > 0 ->
+ [Pref,Type#typedef.name,"_",I];
_->
- lists:concat([Pref,Type#typedef.name])
- end; % maybe the current_sindex must be reset
- _ -> lists:concat(["dec_",Type#typedef.name])
+ [Pref,Type#typedef.name]
+ end;
+ {_,_} ->
+ ["dec_",Type#typedef.name]
end,
- emit({nl,nl}),
- emit(["'",FunctionName,"'(Tlv) ->",nl]),
- emit([" '",FunctionName,"'(Tlv, ",{asis,Tag},").",nl,nl]),
- emit(["'",FunctionName,"'(Tlv, TagIn) ->",nl]),
- dbdec(Type#typedef.name,"Tlv"),
+ FuncName = {asis,list_to_atom(lists:concat(FuncName0))},
+ emit([nl,nl,
+ FuncName,"(Tlv) ->",nl,
+ " ",FuncName,"(Tlv, ",{asis,Tag},").",nl,nl,
+ FuncName,"(Tlv, TagIn) ->",nl]),
gen_decode_user(Erules,Type).
gen_inc_decode(Erules,Type) when is_record(Type,typedef) ->
Prefix = asn1ct:get_gen_state_field(prefix),
Suffix = asn1ct_gen:index2suffix(asn1ct:current_sindex()),
- emit({nl,nl}),
- emit(["'",Prefix,Type#typedef.name,Suffix,"'(Tlv, TagIn) ->",nl]),
+ FuncName0 = [Prefix,Type#typedef.name,Suffix],
+ FuncName = {asis,list_to_atom(lists:concat(FuncName0))},
+ emit([nl,nl,
+ FuncName,"(Tlv, TagIn) ->",nl]),
gen_decode_user(Erules,Type).
%% gen_decode_selected exported function for selected decode
gen_decode_selected(Erules,Type,FuncName) ->
emit([FuncName,"(Bin) ->",nl]),
-% Pattern = asn1ct:get_gen_state_field(tag_pattern),
Patterns = asn1ct:read_config_data(partial_decode),
Pattern =
case lists:keysearch(FuncName,1,Patterns) of
@@ -398,12 +390,10 @@ gen_decode_selected_type(_Erules,TypeDef) ->
asn1ct_gen:list2name(TopType),"'"]),
emit([DecFunName,"(",BytesVar,
", ",{asis,Tag},")"]);
-% emit([";",nl]);
TheType ->
DecFunName = mkfuncname(TheType,dec),
emit([DecFunName,"(",BytesVar,
", ",{asis,Tag},")"])
-% emit([";",nl])
end.
%%===============================================================================
@@ -418,7 +408,6 @@ gen_decode(Erules,Typename,Type) when is_record(Type,type) ->
FunctionName =
case asn1ct:get_gen_state_field(active) of
true ->
-% Suffix = asn1ct_gen:index2suffix(SIndex),
Pattern = asn1ct:get_gen_state_field(namelist),
Suffix =
case asn1ct:maybe_saved_sindex(Typename,Pattern) of
@@ -431,8 +420,6 @@ gen_decode(Erules,Typename,Type) when is_record(Type,type) ->
_ ->
lists:concat(["'dec_",asn1ct_gen:list2name(Typename)])
end,
-% io:format("Typename: ~p,~n",[Typename]),
-% io:format("FunctionName: ~p~n",[FunctionName]),
case asn1ct_gen:type(InnerType) of
{constructed,bif} ->
ObjFun =
@@ -442,9 +429,7 @@ gen_decode(Erules,Typename,Type) when is_record(Type,type) ->
_ ->
""
end,
-% emit([Prefix,asn1ct_gen:list2name(Typename),"'(Tlv, TagIn",ObjFun,") ->",nl]),
emit([FunctionName,"'(Tlv, TagIn",ObjFun,") ->",nl]),
- dbdec(Typename,"Tlv"),
asn1ct_gen:gen_decode_constructed(Erules,Typename,InnerType,Type);
Rec when is_record(Rec,'Externaltypereference') ->
case {Typename,asn1ct:get_gen_state_field(namelist)} of
@@ -476,10 +461,10 @@ gen_decode(Erules,Typename,Type) when is_record(Type,type) ->
gen_decode(Erules,Tname,#'ComponentType'{name=Cname,typespec=Type}) ->
NewTname = [Cname|Tname],
- %% The tag is set to [] to avoid that it is
- %% taken into account twice, both as a component/alternative (passed as
- %% argument to the encode decode function and within the encode decode
- %% function it self.
+ %% The tag is set to [] to avoid that it is taken into account
+ %% twice, both as a component/alternative (passed as argument to
+ %% the encode/decode function), and within the encode decode
+ %% function itself.
NewType = Type#type{tag=[]},
case {asn1ct:get_gen_state_field(active),
asn1ct:get_tobe_refed_func(NewTname)} of
@@ -504,7 +489,7 @@ gen_decode_user(Erules,D) when is_record(D,typedef) ->
asn1ct_name:new(len),
gen_dec_prim(Def#type{def='ASN1_OPEN_TYPE'},
BytesVar, {string,"TagIn"}),
- emit({".",nl,nl});
+ emit([".",nl,nl]);
{primitive,bif} ->
asn1ct_name:new(len),
gen_dec_prim(Def, BytesVar, {string,"TagIn"}),
@@ -515,8 +500,7 @@ gen_decode_user(Erules,D) when is_record(D,typedef) ->
TheType ->
DecFunName = mkfuncname(TheType,dec),
emit([DecFunName,"(",BytesVar,
- ", TagIn)"]),
- emit([".",nl,nl])
+ ", TagIn).",nl,nl])
end.
@@ -746,9 +730,10 @@ gen_obj_code(Erules,_Module,Obj) when is_record(Obj,typedef) ->
#'Externaltypereference'{module=M,type=ClName} = Def#'Object'.classname,
Class = asn1_db:dbget(M,ClName),
{object,_,Fields} = Def#'Object'.def,
- emit({nl,nl,nl,"%%================================"}),
- emit({nl,"%% ",ObjName}),
- emit({nl,"%%================================",nl}),
+ emit([nl,nl,nl,
+ "%%================================",nl,
+ "%% ",ObjName,nl,
+ "%%================================",nl]),
EncConstructed =
gen_encode_objectfields(ClName,get_class_fields(Class),
ObjName,Fields,[]),
@@ -766,11 +751,9 @@ gen_encode_objectfields(ClassName,[{typefield,Name,OptOrMand}|Rest],
ObjName,ObjectFields,ConstrAcc) ->
EmitFuncClause =
fun(Arg) ->
- emit(["'enc_",ObjName,"'(",{asis,Name},
- ", ",Arg,", _RestPrimFieldName) ->",nl])
+ emit([{asis,enc_func(ObjName)},"(",{asis,Name},
+ ", ",Arg,", _RestPrimFieldName) ->",nl])
end,
-% emit(["'enc_",ObjName,"'(",{asis,Name},
-% ", Val, RestPrimFieldName) ->",nl]),
MaybeConstr=
case {get_object_field(Name,ObjectFields),OptOrMand} of
{false,'OPTIONAL'} ->
@@ -799,11 +782,9 @@ gen_encode_objectfields(ClassName,[{objectfield,Name,_,_,OptOrMand}|Rest],
CurrentMod = get(currmod),
EmitFuncClause =
fun(Args) ->
- emit(["'enc_",ObjName,"'(",{asis,Name},
+ emit([{asis,enc_func(ObjName)},"(",{asis,Name},
", ",Args,") ->",nl])
end,
-% emit(["'enc_",ObjName,"'(",{asis,Name},
-% ", Val,[H|T]) ->",nl]),
case {get_object_field(Name,ObjectFields),OptOrMand} of
{false,'OPTIONAL'} ->
EmitFuncClause("_,_"),
@@ -814,19 +795,14 @@ gen_encode_objectfields(ClassName,[{objectfield,Name,_,_,OptOrMand}|Rest],
{{Name,#'Externalvaluereference'{module=CurrentMod,
value=TypeName}},_} ->
EmitFuncClause(" Val, [H|T]"),
- emit({indent(3),"'enc_",TypeName,"'(H, Val, T)"});
+ emit([indent(3),{asis,enc_func(TypeName)},"(H, Val, T)"]);
{{Name,#'Externalvaluereference'{module=M,value=TypeName}},_} ->
EmitFuncClause(" Val, [H|T]"),
- emit({indent(3),"'",M,"':'enc_",TypeName,"'(H, Val, T)"});
- {{Name,TypeSpec},_} ->
+ emit([indent(3),{asis,M},":",{asis,enc_func(TypeName)},
+ "(H, Val, T)"]);
+ {{Name,#typedef{name=TypeName}},_} when is_atom(TypeName) ->
EmitFuncClause(" Val, [H|T]"),
- case TypeSpec#typedef.name of
- {ExtMod,TypeName} ->
- emit({indent(3),"'",ExtMod,"':'enc_",TypeName,
- "'(H, Val, T)"});
- TypeName ->
- emit({indent(3),"'enc_",TypeName,"'(H, Val, T)"})
- end
+ emit([indent(3),{asis,enc_func(TypeName)},"(H, Val, T)"])
end,
case more_genfields(Rest) of
true ->
@@ -862,10 +838,11 @@ gen_encode_field_call(_ObjName,_FieldName,
X <- OTag],
if
M == CurrentMod ->
- emit({" 'enc_",T,"'(Val, ",{asis,Tag},")"}),
+ emit([" ",{asis,enc_func(T)},"(Val, ",{asis,Tag},")"]),
[];
true ->
- emit({" '",M,"':'enc_",T,"'(Val, ",{asis,Tag},")"}),
+ emit([" ",{asis,M},":",{asis,enc_func(T)},
+ "(Val, ",{asis,Tag},")"]),
[]
end;
gen_encode_field_call(ObjName,FieldName,Type) ->
@@ -875,24 +852,21 @@ gen_encode_field_call(ObjName,FieldName,Type) ->
X#tag.form,X#tag.number)||
X <- OTag],
case Type#typedef.name of
- {primitive,bif} -> %%tag should be the primitive tag
-% OTag = Def#type.tag,
-% Tag = [encode_tag_val(decode_class(X#tag.class),
-% X#tag.form,X#tag.number)||
-% X <- OTag],
+ {primitive,bif} -> %tag should be the primitive tag
gen_encode_prim(ber,Def,{asis,lists:reverse(Tag)},
"Val"),
[];
{constructed,bif} ->
- emit({" 'enc_",ObjName,'_',FieldName,
- "'(Val,",{asis,Tag},")"}),
- [Type#typedef{name=list_to_atom(lists:concat([ObjName,'_',FieldName]))}];
+ Name = lists:concat([ObjName,'_',FieldName]),
+ emit([" ",{asis,enc_func(Name)},"(Val,",{asis,Tag},")"]),
+ [Type#typedef{name=list_to_atom(Name)}];
{ExtMod,TypeName} ->
- emit({" '",ExtMod,"':'enc_",TypeName,
- "'(Val,",{asis,Tag},")"}),
+ emit([" ",{asis,ExtMod},":",{asis,enc_func(TypeName)},
+ "(Val,",{asis,Tag},")"]),
[];
TypeName ->
- emit({" 'enc_",TypeName,"'(Val,",{asis,Tag},")"}),
+ emit([" ",{asis,enc_func(TypeName)},
+ "(Val,",{asis,Tag},")"]),
[]
end.
@@ -903,10 +877,10 @@ gen_encode_default_call(ClassName,FieldName,Type) ->
Tag = [encode_tag_val(decode_class(X#tag.class),X#tag.form,X#tag.number)|| X <- OTag],
case asn1ct_gen:type(InnerType) of
{constructed,bif} ->
- emit([" 'enc_",ClassName,'_',FieldName,"'",
+ Name = lists:concat([ClassName,'_',FieldName]),
+ emit([" ",{asis,enc_func(Name)},
"(Val, ",{asis,Tag},")"]),
- [#typedef{name=list_to_atom(lists:concat([ClassName,'_',FieldName])),
- typespec=Type}];
+ [#typedef{name=list_to_atom(Name),typespec=Type}];
{primitive,bif} ->
gen_encode_prim(ber,Type,{asis,lists:reverse(Tag)},"Val"),
[];
@@ -916,12 +890,6 @@ gen_encode_default_call(ClassName,FieldName,Type) ->
#'Externaltypereference'{module=Emod,type=Etype} ->
emit([" '",Emod,"':'enc_",Etype,"'(Val, ",{asis,Tag},")",nl]),
[]
-% 'ASN1_OPEN_TYPE' ->
-% emit(["%% OPEN TYPE",nl]),
-% gen_encode_prim(ber,
-% Type#type{def='ASN1_OPEN_TYPE'},
-% "TagIn","Val"),
-% emit([".",nl])
end.
%%%%%%%%%%%%%%%%
@@ -930,11 +898,9 @@ gen_decode_objectfields(ClassName,[{typefield,Name,OptOrMand}|Rest],
ObjName,ObjectFields,ConstrAcc) ->
EmitFuncClause =
fun(Arg) ->
- emit(["'dec_",ObjName,"'(",{asis,Name},
+ emit([{asis,dec_func(ObjName)},"(",{asis,Name},
", ",Arg,",_) ->",nl])
end,
-% emit(["'dec_",ObjName,"'(",{asis,Name},
-% ", Bytes, RestPrimFieldName) ->",nl]),
MaybeConstr=
case {get_object_field(Name,ObjectFields),OptOrMand} of
{false,'OPTIONAL'} ->
@@ -964,12 +930,9 @@ gen_decode_objectfields(ClassName,[{objectfield,Name,_,_,OptOrMand}|Rest],
CurrentMod = get(currmod),
EmitFuncClause =
fun(Args) ->
- emit(["'dec_",ObjName,"'(",{asis,Name},
+ emit([{asis,dec_func(ObjName)},"(",{asis,Name},
", ",Args,") ->",nl])
end,
-% emit(["'dec_",ObjName,"'(",{asis,Name},
-% ", Bytes,[H|T]) ->",nl]),
-% emit_tlv_format("Bytes"),
case {get_object_field(Name,ObjectFields),OptOrMand} of
{false,'OPTIONAL'} ->
EmitFuncClause("_,_"),
@@ -980,21 +943,14 @@ gen_decode_objectfields(ClassName,[{objectfield,Name,_,_,OptOrMand}|Rest],
{{Name,#'Externalvaluereference'{module=CurrentMod,
value=TypeName}},_} ->
EmitFuncClause("Bytes,[H|T]"),
- emit({indent(3),"'dec_",TypeName,"'(H, Bytes, T)"});
+ emit([indent(3),{asis,dec_func(TypeName)},"(H, Bytes, T)"]);
{{Name,#'Externalvaluereference'{module=M,value=TypeName}},_} ->
EmitFuncClause("Bytes,[H|T]"),
- emit({indent(3),"'",M,"':'dec_",TypeName,
- "'(H, Bytes, T)"});
- {{Name,TypeSpec},_} ->
- EmitFuncClause("Bytes,[H|T]"),
-% emit_tlv_format("Bytes"),
- case TypeSpec#typedef.name of
- {ExtMod,TypeName} ->
- emit({indent(3),"'",ExtMod,"':'dec_",TypeName,
- "'(H, Bytes, T)"});
- TypeName ->
- emit({indent(3),"'dec_",TypeName,"'(H, Bytes, T)"})
- end
+ emit([indent(3),{asis,M},":",{asis,dec_func(TypeName)},
+ "(H, Bytes, T)"]);
+ {{Name,#typedef{name=TypeName}},_} when is_atom(TypeName) ->
+ EmitFuncClause("Bytes,[H|T]"),
+ emit([indent(3),{asis,dec_func(TypeName)},"(H, Bytes, T)"])
end,
case more_genfields(Rest) of
true ->
@@ -1014,24 +970,20 @@ emit_tlv_format(Bytes) ->
notice_tlv_format_gen() ->
Module = get(currmod),
-% io:format("Noticed: ~p~n",[Module]),
case get(tlv_format) of
{done,Module} ->
ok;
- _ -> % true or undefined
+ _ -> % true or undefined
put(tlv_format,true)
end.
emit_tlv_format_function() ->
Module = get(currmod),
-% io:format("Tlv formated: ~p",[Module]),
case get(tlv_format) of
true ->
-% io:format(" YES!~n"),
emit_tlv_format_function1(),
put(tlv_format,{done,Module});
_ ->
-% io:format(" NO!~n"),
ok
end.
emit_tlv_format_function1() ->
@@ -1066,12 +1018,12 @@ gen_decode_field_call(_ObjName,_FieldName,Bytes,
X <- OTag],
if
M == CurrentMod ->
- emit({" 'dec_",T,"'(",Bytes,
- ", ",{asis,Tag},")"}),
+ emit([" ",{asis,dec_func(T)},"(",Bytes,
+ ", ",{asis,Tag},")"]),
[];
true ->
- emit({" '",M,"':'dec_",T,
- "'(",Bytes,", ",{asis,Tag},")"}),
+ emit([" ",{asis,M},":",{asis,dec_func(T)},
+ "(",Bytes,", ",{asis,Tag},")"]),
[]
end;
gen_decode_field_call(ObjName,FieldName,Bytes,Type) ->
@@ -1084,15 +1036,17 @@ gen_decode_field_call(ObjName,FieldName,Bytes,Type) ->
gen_dec_prim(Def, Bytes, Tag),
[];
{constructed,bif} ->
- emit({" 'dec_",ObjName,'_',FieldName,
- "'(",Bytes,",",{asis,Tag},")"}),
- [Type#typedef{name=list_to_atom(lists:concat([ObjName,'_',FieldName]))}];
+ Name = lists:concat([ObjName,"_",FieldName]),
+ emit([" ",{asis,dec_func(Name)},
+ "(",Bytes,",",{asis,Tag},")"]),
+ [Type#typedef{name=list_to_atom(Name)}];
{ExtMod,TypeName} ->
- emit({" '",ExtMod,"':'dec_",TypeName,
- "'(",Bytes,",",{asis,Tag},")"}),
+ emit([" ",{asis,ExtMod},":",{asis,dec_func(TypeName)},
+ "(",Bytes,",",{asis,Tag},")"]),
[];
TypeName ->
- emit({" 'dec_",TypeName,"'(",Bytes,",",{asis,Tag},")"}),
+ emit([" ",{asis,dec_func(TypeName)},
+ "(",Bytes,",",{asis,Tag},")"]),
[]
end.
@@ -1118,12 +1072,6 @@ gen_decode_default_call(ClassName,FieldName,Bytes,Type) ->
emit([" '",Emod,"':'dec_",Etype,"'(",Bytes,", ",
{asis,Tag},")",nl]),
[]
-% 'ASN1_OPEN_TYPE' ->
-% emit(["%% OPEN TYPE",nl]),
-% gen_encode_prim(ber,
-% Type#type{def='ASN1_OPEN_TYPE'},
-% "TagIn","Val"),
-% emit([".",nl])
end.
%%%%%%%%%%%
@@ -1162,15 +1110,15 @@ more_genfields([Field|Fields]) ->
gen_objectset_code(Erules,ObjSet) ->
ObjSetName = ObjSet#typedef.name,
Def = ObjSet#typedef.typespec,
-% {ClassName,ClassDef} = Def#'ObjectSet'.class,
#'Externaltypereference'{module=ClassModule,
type=ClassName} = Def#'ObjectSet'.class,
ClassDef = asn1_db:dbget(ClassModule,ClassName),
UniqueFName = Def#'ObjectSet'.uniquefname,
Set = Def#'ObjectSet'.set,
- emit({nl,nl,nl,"%%================================"}),
- emit({nl,"%% ",ObjSetName}),
- emit({nl,"%%================================",nl}),
+ emit([nl,nl,nl,
+ "%%================================",nl,
+ "%% ",ObjSetName,nl,
+ "%%================================",nl]),
case ClassName of
{_Module,ExtClassName} ->
gen_objset_code(Erules,ObjSetName,UniqueFName,Set,ExtClassName,ClassDef);
@@ -1200,19 +1148,20 @@ gen_objset_enc(Erules, ObjSetName, UniqueName,
{no_mod,no_name} ->
gen_inlined_enc_funs(Fields, ClFields, ObjSetName, Val, NthObj);
{CurrMod,Name} ->
- emit(["'getenc_",ObjSetName,"'(Id) when Id =:= ",
- {asis,Val}," ->",nl,
- " fun 'enc_",Name,"'/3;",nl]),
+ emit([asis_atom(["getenc_",ObjSetName]),
+ "(Id) when Id =:= ",{asis,Val}," ->",nl,
+ " fun ",asis_atom(["enc_",Name]),"/3;",nl]),
{[],NthObj};
{ModuleName,Name} ->
- emit(["'getenc_",ObjSetName,"'(Id) when Id =:= ",
- {asis,Val}," ->",nl]),
+ emit([asis_atom(["getenc_",ObjSetName]),
+ "(Id) when Id =:= ",{asis,Val}," ->",nl]),
emit_ext_fun(enc,ModuleName,Name),
emit([";",nl]),
{[],NthObj};
_ ->
- emit(["'getenc_",ObjSetName,"'(",{asis,Val},") ->",nl,
- " fun 'enc_",ObjName,"'/3;",nl]),
+ emit([asis_atom(["getenc_",ObjSetName]),
+ "(",{asis,Val},") ->",nl,
+ " fun ",asis_atom(["enc_",ObjName]),"/3;",nl]),
{[],NthObj}
end,
gen_objset_enc(Erules, ObjSetName, UniqueName, T, ClName, ClFields,
@@ -1220,7 +1169,7 @@ gen_objset_enc(Erules, ObjSetName, UniqueName,
%% See X.681 Annex E for the following case
gen_objset_enc(_,ObjSetName,_UniqueName,['EXTENSIONMARK'],_ClName,
_ClFields,_NthObj,Acc) ->
- emit(["'getenc_",ObjSetName,"'(_) ->",nl,
+ emit([asis_atom(["getenc_",ObjSetName]),"(_) ->",nl,
indent(2),"fun(_, Val, _RestPrimFieldName) ->",nl]),
emit_enc_open_type(4),
emit([nl,
@@ -1228,7 +1177,7 @@ gen_objset_enc(_,ObjSetName,_UniqueName,['EXTENSIONMARK'],_ClName,
Acc;
gen_objset_enc(_, ObjSetName, UniqueName, [], _, _, _, Acc) ->
emit_default_getenc(ObjSetName, UniqueName),
- emit({".",nl,nl}),
+ emit([".",nl,nl]),
Acc.
emit_ext_fun(EncDec,ModuleName,Name) ->
@@ -1236,14 +1185,15 @@ emit_ext_fun(EncDec,ModuleName,Name) ->
Name,"'(T,V,O) end"]).
emit_default_getenc(ObjSetName,UniqueName) ->
- emit(["'getenc_",ObjSetName,"'(ErrV) ->",nl]),
- emit([indent(3),"fun(C,V,_) -> exit({'Type not compatible with table constraint',{component,C},{value,V}, {unique_name_and_value,",{asis,UniqueName},", ErrV}}) end"]).
+ emit([asis_atom(["getenc_",ObjSetName]),"(ErrV) ->",nl,
+ indent(3),"fun(C,V,_) ->",nl,
+ "exit({'Type not compatible with table constraint',{component,C},{value,V}, {unique_name_and_value,",{asis,UniqueName},", ErrV}}) end"]).
%% gen_inlined_enc_funs for each object iterates over all fields of a
%% class, and for each typefield it checks if the object has that
%% field and emits the proper code.
gen_inlined_enc_funs(Fields, [{typefield,_,_}|_]=T, ObjSetName, Val, NthObj) ->
- emit(["'getenc_",ObjSetName,"'(",{asis,Val},") ->",nl,
+ emit([asis_atom(["getenc_",ObjSetName]),"(",{asis,Val},") ->",nl,
indent(3),"fun(Type, Val, _RestPrimFieldName) ->",nl,
indent(6),"case Type of",nl]),
gen_inlined_enc_funs1(Fields, T, ObjSetName, [], NthObj, []);
@@ -1283,8 +1233,8 @@ gen_inlined_enc_funs1(Fields, [{typefield,Name,_}|Rest], ObjSetName,
end,
{Acc0,0};
false ->
- %% This field was not present in the object thus there
- %% were no type in the table and we therefore generate
+ %% This field was not present in the object; thus, there
+ %% was no type in the table and we therefore generate
%% code that returns the input for application
%% treatment.
emit([indent(9),{asis,Name}," ->",nl]),
@@ -1322,7 +1272,6 @@ emit_inner_of_fun(TDef=#typedef{name={ExtMod,Name},typespec=Type},
InternalDefFunName) ->
OTag = Type#type.tag,
Tag = [encode_tag_val(decode_class(X#tag.class),X#tag.form,X#tag.number)|| X <- OTag],
-% remove Tag = [X#tag{class=decode_class(X#tag.class)}|| X <- OTag],
case {ExtMod,Name} of
{primitive,bif} ->
emit(indent(12)),
@@ -1333,20 +1282,14 @@ emit_inner_of_fun(TDef=#typedef{name={ExtMod,Name},typespec=Type},
InternalDefFunName,"'(Val, ",{asis,Tag},")"]),
{[TDef#typedef{name=InternalDefFunName}],1};
_ ->
- emit({indent(12),"'",ExtMod,"':'enc_",Name,"'(Val",{asis,Tag},")"}),
+ emit([indent(12),"'",ExtMod,"':'enc_",Name,"'(Val",{asis,Tag},")"]),
{[],0}
end;
emit_inner_of_fun(#typedef{name=Name},_) ->
-% OTag = Type#type.tag,
-% remove Tag = [X#tag{class=decode_class(X#tag.class)}|| X <- OTag],
-% Tag = [encode_tag_val(decode_class(X#tag.class),X#tag.form,X#tag.number)|| X <- OTag],
- emit({indent(12),"'enc_",Name,"'(Val)"}),
+ emit([indent(12),"'enc_",Name,"'(Val)"]),
{[],0};
emit_inner_of_fun(Type,_) when is_record(Type,type) ->
CurrMod = get(currmod),
-% OTag = Type#type.tag,
-% remove Tag = [X#tag{class=decode_class(X#tag.class)}|| X <- OTag],
-% Tag = [encode_tag_val(decode_class(X#tag.class),X#tag.form,X#tag.number)|| X <- OTag],
case Type#type.def of
Def when is_atom(Def) ->
OTag = Type#type.tag,
@@ -1384,18 +1327,19 @@ gen_objset_dec(Erules, ObjSName, UniqueName, [{ObjName,Val,Fields}|T],
{no_mod,no_name} ->
gen_inlined_dec_funs(Fields,ClFields,ObjSName,Val,NthObj);
{CurrMod,Name} ->
- emit(["'getdec_",ObjSName,"'(Id) when Id =:= ",
- {asis,Val}," ->",nl,
+ emit([asis_atom(["getdec_",ObjSName]),
+ "(Id) when Id =:= ",{asis,Val}," ->",nl,
" fun 'dec_",Name,"'/3;", nl]),
NthObj;
{ModuleName,Name} ->
- emit(["'getdec_",ObjSName,"'(Id) when Id =:= ",
- {asis,Val}," ->",nl]),
+ emit([asis_atom(["getdec_",ObjSName]),
+ "(Id) when Id =:= ",{asis,Val}," ->",nl]),
emit_ext_fun(dec,ModuleName,Name),
emit([";",nl]),
NthObj;
_ ->
- emit(["'getdec_",ObjSName,"'(",{asis,Val},") ->",nl,
+ emit([asis_atom(["getdec_",ObjSName]),
+ "(",{asis,Val},") ->",nl,
" fun 'dec_",ObjName,"'/3;", nl]),
NthObj
end,
@@ -1403,8 +1347,8 @@ gen_objset_dec(Erules, ObjSName, UniqueName, [{ObjName,Val,Fields}|T],
ClFields, NewNthObj);
gen_objset_dec(_,ObjSetName,_UniqueName,['EXTENSIONMARK'],_ClName,
_ClFields,_NthObj) ->
- emit(["'getdec_",ObjSetName,"'(_) ->",nl]),
- emit([indent(2),"fun(_,Bytes, _RestPrimFieldName) ->",nl]),
+ emit([asis_atom(["getdec_",ObjSetName]),"(_) ->",nl,
+ indent(2),"fun(_,Bytes, _RestPrimFieldName) ->",nl]),
emit_dec_open_type(4),
emit([nl,
indent(2),"end.",nl,nl]),
@@ -1495,7 +1439,6 @@ emit_dec_open_type(I) ->
emit_inner_of_decfun(#typedef{name={ExtName,Name},typespec=Type}, _Prop,
InternalDefFunName) ->
OTag = Type#type.tag,
-%% Tag = [X#tag{class=decode_class(X#tag.class)}|| X <- OTag],
Tag = [(decode_class(X#tag.class) bsl 10) + X#tag.number || X <- OTag],
case {ExtName,Name} of
{primitive,bif} ->
@@ -1504,8 +1447,6 @@ emit_inner_of_decfun(#typedef{name={ExtName,Name},typespec=Type}, _Prop,
0;
{constructed,bif} ->
emit([indent(12),"'dec_",
-% asn1ct_gen:list2name(InternalDefFunName),"'(Bytes, ",Prop,
-% ", ",{asis,Tag},")"]),
asn1ct_gen:list2name(InternalDefFunName),"'(Bytes, ",
{asis,Tag},")"]),
1;
@@ -1519,7 +1460,6 @@ emit_inner_of_decfun(#typedef{name=Name},_Prop,_) ->
0;
emit_inner_of_decfun(#type{}=Type, _Prop, _) ->
OTag = Type#type.tag,
-%% Tag = [X#tag{class=decode_class(X#tag.class)}|| X <- OTag],
Tag = [(decode_class(X#tag.class) bsl 10) + X#tag.number || X <- OTag],
CurrMod = get(currmod),
Def = Type#type.def,
@@ -1531,11 +1471,9 @@ emit_inner_of_decfun(#type{}=Type, _Prop, _) ->
gen_dec_prim(Type, "Bytes", Tag);
#'Externaltypereference'{module=CurrMod,type=T} ->
emit([indent(9),T," ->",nl,indent(12),"'dec_",T,
-% "'(Bytes, ",Prop,")"]);
"'(Bytes)"]);
#'Externaltypereference'{module=ExtMod,type=T} ->
emit([indent(9),T," ->",nl,indent(12),ExtMod,":'dec_",
-% T,"'(Bytes, ",Prop,")"])
T,"'(Bytes, ",{asis,Tag},")"])
end,
0.
@@ -1550,10 +1488,6 @@ gen_internal_funcs(Erules,[TypeDef|Rest]) ->
gen_internal_funcs(Erules,Rest).
-dbdec(Type,Arg) ->
- demit({"io:format(\"decoding: ",{asis,Type},"~w~n\",[",Arg,"]),",nl}).
-
-
decode_class('UNIVERSAL') ->
?UNIVERSAL;
decode_class('APPLICATION') ->
@@ -1605,7 +1539,7 @@ encode_tag_val(Class, Form, TagNo) ->
%%%%%%%%%%%
%% mk_object_val(Value) -> {OctetList, Len}
-%% returns a Val as a list of octets, the 8 bit is allways set to one except
+%% returns a Val as a list of octets, the 8 bit is always set to one except
%% for the last octet, where its 0
%%
@@ -1619,8 +1553,9 @@ mk_object_val(0, Ack, Len) ->
mk_object_val(Val, Ack, Len) ->
mk_object_val(Val bsr 7, [((Val band 127) bor 128) | Ack], Len + 1).
-%% For BER the ExtensionAdditionGroup notation has no impact on the encoding/decoding
-%% and therefore we only filter away the ExtensionAdditionGroup start and end markers
+%% For BER the ExtensionAdditionGroup notation has no impact on the
+%% encoding/decoding. Therefore we can filter away the
+%% ExtensionAdditionGroup start and end markers.
extaddgroup2sequence(ExtList) when is_list(ExtList) ->
lists:filter(fun(#'ExtensionAdditionGroup'{}) ->
false;
@@ -1632,3 +1567,12 @@ extaddgroup2sequence(ExtList) when is_list(ExtList) ->
call(F, Args) ->
asn1ct_func:call(ber, F, Args).
+
+enc_func(Tname) ->
+ list_to_atom(lists:concat(["enc_",Tname])).
+
+dec_func(Tname) ->
+ list_to_atom(lists:concat(["dec_",Tname])).
+
+asis_atom(List) ->
+ {asis,list_to_atom(lists:concat(List))}.
diff --git a/lib/asn1/src/asn1ct_gen_per.erl b/lib/asn1/src/asn1ct_gen_per.erl
index 9671a566bf..22719bba74 100644
--- a/lib/asn1/src/asn1ct_gen_per.erl
+++ b/lib/asn1/src/asn1ct_gen_per.erl
@@ -24,7 +24,6 @@
%% all types in an ASN.1 module
-include("asn1_records.hrl").
-%-compile(export_all).
-export([gen_dec_imm/2]).
-export([gen_dec_prim/3,gen_encode_prim_imm/3]).
@@ -35,15 +34,20 @@
-export([extaddgroup2sequence/1]).
-export([dialyzer_suppressions/1]).
--import(asn1ct_gen, [emit/1,demit/1]).
+-import(asn1ct_gen, [emit/1]).
-import(asn1ct_func, [call/3]).
-%% Generate ENCODING ******************************
-%%****************************************x
+%%****************************************
+%% Generate ENCODING
+%%****************************************
-dialyzer_suppressions(Erules) ->
- case asn1ct_func:is_used({Erules,complete,1}) of
+dialyzer_suppressions(#gen{erule=per,aligned=Aligned}) ->
+ Mod = case Aligned of
+ false -> uper;
+ true -> per
+ end,
+ case asn1ct_func:is_used({Mod,complete,1}) of
false ->
ok;
true ->
@@ -54,14 +58,6 @@ dialyzer_suppressions(Erules) ->
gen_encode(Erules,Type) when is_record(Type,typedef) ->
gen_encode_user(Erules,Type).
-%% case Type#typedef.typespec of
-%% Def when is_record(Def,type) ->
-%% gen_encode_user(Erules,Type);
-%% Def when is_tuple(Def),(element(1,Def) == 'Object') ->
-%% gen_encode_object(Erules,Type);
-%% Other ->
-%% exit({error,{asn1,{unknown,Other}}})
-%% end.
gen_encode(Erules,Typename,#'ComponentType'{name=Cname,typespec=Type}) ->
NewTypename = [Cname|Typename],
@@ -72,15 +68,14 @@ gen_encode(Erules,Typename,Type) when is_record(Type,type) ->
ObjFun =
case lists:keysearch(objfun,1,Type#type.tablecinf) of
{value,{_,_Name}} ->
-%% lists:concat([", ObjFun",Name]);
", ObjFun";
false ->
""
end,
case asn1ct_gen:type(InnerType) of
{constructed,bif} ->
- emit({"'enc_",asn1ct_gen:list2name(Typename),"'(Val",ObjFun,
- ") ->",nl}),
+ Func = enc_func(asn1ct_gen:list2name(Typename)),
+ emit([{asis,Func},"(Val",ObjFun,") ->",nl]),
asn1ct_gen:gen_encode_constructed(Erules,Typename,InnerType,Type);
_ ->
true
@@ -92,20 +87,21 @@ gen_encode_user(Erules,D) when is_record(D,typedef) ->
Typename = [D#typedef.name],
Def = D#typedef.typespec,
InnerType = asn1ct_gen:get_inner(Def#type.def),
- emit({"'enc_",asn1ct_gen:list2name(Typename),"'(Val) ->",nl}),
+ Func = enc_func(asn1ct_gen:list2name(Typename)),
+ emit([{asis,Func},"(Val) ->",nl]),
case asn1ct_gen:type(InnerType) of
{primitive,bif} ->
gen_encode_prim(Erules, Def),
- emit({".",nl});
+ emit([".",nl]);
'ASN1_OPEN_TYPE' ->
gen_encode_prim(Erules, Def#type{def='ASN1_OPEN_TYPE'}),
- emit({".",nl});
+ emit([".",nl]);
{constructed,bif} ->
asn1ct_gen:gen_encode_constructed(Erules,Typename,InnerType,D);
#'Externaltypereference'{module=CurrMod,type=Etype} ->
- emit({"'enc_",Etype,"'(Val).",nl,nl});
+ emit([{asis,enc_func(Etype)},"(Val).",nl]);
#'Externaltypereference'{module=Emod,type=Etype} ->
- emit({"'",Emod,"':'enc_",Etype,"'(Val).",nl,nl})
+ emit([{asis,Emod},":",enc_func(Etype),"(Val).",nl])
end.
@@ -220,7 +216,6 @@ gen_objectset_code(_Erules, _ObjSet) ->
gen_decode(Erules, #typedef{}=Type) ->
DecFunc = dec_func(Type#typedef.name),
emit([nl,nl,{asis,DecFunc},"(Bytes) ->",nl]),
- dbdec(Type#typedef.name),
gen_decode_user(Erules, Type).
gen_decode(Erules,Tname,#'ComponentType'{name=Cname,typespec=Type}) ->
@@ -241,17 +236,11 @@ gen_decode(Erules,Typename,Type) when is_record(Type,type) ->
emit([nl,
{asis,dec_func(asn1ct_gen:list2name(Typename))},
"(Bytes",ObjFun,") ->",nl]),
- dbdec(Typename),
asn1ct_gen:gen_decode_constructed(Erules,Typename,InnerType,Type);
_ ->
true
end.
-dbdec(Type) when is_list(Type)->
- demit({"io:format(\"decoding: ",asn1ct_gen:list2name(Type),"~w~n\",[Bytes]),",nl});
-dbdec(Type) ->
- demit({"io:format(\"decoding: ",{asis,Type},"~w~n\",[Bytes]),",nl}).
-
gen_decode_user(Erules,D) when is_record(D,typedef) ->
Typename = [D#typedef.name],
Def = D#typedef.typespec,
@@ -259,17 +248,15 @@ gen_decode_user(Erules,D) when is_record(D,typedef) ->
case asn1ct_gen:type(InnerType) of
{primitive,bif} ->
gen_dec_prim(Erules,Def,"Bytes"),
- emit({".",nl,nl});
+ emit([".",nl,nl]);
'ASN1_OPEN_TYPE' ->
gen_dec_prim(Erules,Def#type{def='ASN1_OPEN_TYPE'},"Bytes"),
- emit({".",nl,nl});
+ emit([".",nl,nl]);
{constructed,bif} ->
asn1ct_gen:gen_decode_constructed(Erules,Typename,InnerType,D);
#'Externaltypereference'{}=Etype ->
gen_dec_external(Etype, "Bytes"),
- emit([".",nl,nl]);
- Other ->
- exit({error,{asn1,{unknown,Other}}})
+ emit([".",nl,nl])
end.
gen_dec_external(Ext, BytesVar) ->
@@ -398,10 +385,11 @@ gen_dec_prim(Erule, Type, BytesVar) ->
asn1ct_imm:dec_code_gen(Imm, BytesVar).
-%% For PER the ExtensionAdditionGroup notation has significance for the encoding and decoding
-%% the components within the ExtensionAdditionGroup is treated in a similar way as if they
-%% have been specified within a SEQUENCE, therefore we construct a fake sequence type here
-%% so that we can generate code for it
+%% For PER the ExtensionAdditionGroup notation has significance for
+%% the encoding and decoding. The components within the
+%% ExtensionAdditionGroup is treated in a similar way as if they have
+%% been specified within a SEQUENCE. Therefore we construct a fake
+%% sequence type here so that we can generate code for it.
extaddgroup2sequence(ExtList) ->
extaddgroup2sequence(ExtList,0,[]).
diff --git a/lib/asn1/src/asn1ct_name.erl b/lib/asn1/src/asn1ct_name.erl
index 72d541cbbc..06f6604a26 100644
--- a/lib/asn1/src/asn1ct_name.erl
+++ b/lib/asn1/src/asn1ct_name.erl
@@ -20,7 +20,6 @@
%%
-module(asn1ct_name).
-%%-compile(export_all).
-export([start/0,
curr/1,
clear/0,
@@ -44,7 +43,6 @@ start() ->
end.
name_server_loop({Ref, Parent} = Monitor,Vars) ->
-%% io:format("name -- ~w~n",[Vars]),
receive
{_From,clear} ->
name_server_loop(Monitor, []);
diff --git a/lib/asn1/src/asn1ct_parser2.erl b/lib/asn1/src/asn1ct_parser2.erl
index 2de9b0e2f0..3f1819b660 100644
--- a/lib/asn1/src/asn1ct_parser2.erl
+++ b/lib/asn1/src/asn1ct_parser2.erl
@@ -1496,7 +1496,7 @@ parse_ContentsConstraint([{'ENCODED',_},{'BY',_}|Rest]) ->
parse_ContentsConstraint(Tokens) ->
parse_error(Tokens).
-% X.683 Parameterization of ASN.1 specifications
+%% X.683 Parameterization of ASN.1 specifications
parse_Governor(Tokens) ->
Flist = [fun parse_Type/1,
diff --git a/lib/asn1/src/asn1ct_value.erl b/lib/asn1/src/asn1ct_value.erl
index 8bd99d995b..f7d986aa91 100644
--- a/lib/asn1/src/asn1ct_value.erl
+++ b/lib/asn1/src/asn1ct_value.erl
@@ -24,12 +24,12 @@
%% The value is randomized within it's constraints
-include("asn1_records.hrl").
-%-compile(export_all).
-export([from_type/2]).
-%% Generate examples of values ******************************
-%%****************************************x
+%%****************************************
+%% Generate examples of values
+%%****************************************
from_type(M,Typename) ->
@@ -92,9 +92,6 @@ get_inner(T) when is_tuple(T) ->
Other ->
Other
end.
-%%get_inner(T) when is_tuple(T) -> element(1,T).
-
-
from_type_constructed(M,Typename,InnerType,D) when is_record(D,type) ->
case InnerType of
@@ -111,9 +108,7 @@ from_type_constructed(M,Typename,InnerType,D) when is_record(D,type) ->
'SET OF' ->
{_,Type} = D#type.def,
NameSuffix = asn1ct_gen:constructed_suffix(InnerType,Type#type.def),
- get_sequence_of(M,Typename,D,NameSuffix);
- _ ->
- exit({nyi,InnerType})
+ get_sequence_of(M,Typename,D,NameSuffix)
end.
get_sequence(M,Typename,Type) ->
@@ -147,7 +142,8 @@ get_choice(M,Typename,Type) ->
case TCompList of
[] ->
{asn1_EMPTY,asn1_EMPTY};
- {CompList,ExtList} -> % Should be enhanced to handle extensions too
+ {CompList,ExtList} ->
+ %% should be enhanced to handle extensions too.
CList = CompList ++ ExtList,
C = lists:nth(random(length(CList)),CList),
{C#'ComponentType'.name,from_type(M,Typename,C)};
@@ -247,14 +243,6 @@ from_type_prim(M, D) ->
_ ->
{2#11111111,2,2}
end;
-%% Sign1 = random_sign(integer),
-%% Sign2 = random_sign(integer),
-%% {Sign1*random(10000),2,Sign2*random(1028)};
-%% 2 ->
-%% %% base 10 tuple format
-%% Sign1 = random_sign(integer),
-%% Sign2 = random_sign(integer),
-%% {Sign1*random(10000),10,Sign2*random(1028)};
_ ->
%% base 10 string format, NR3 format
case random(2) of
@@ -302,9 +290,7 @@ from_type_prim(M, D) ->
16#ffff,16#ffee,16#10ffff,16#ffff,16#fff]),
unicode:characters_to_binary(L);
'UniversalString' ->
- adjust_list(size_random(C),c_string(C,"UniversalString"));
- XX ->
- exit({asn1_error,nyi,XX})
+ adjust_list(size_random(C),c_string(C,"UniversalString"))
end.
c_string(C,Default) ->
@@ -343,22 +329,6 @@ random_unnamed_bit_string(M, C) ->
{PadLen,<<BitString/bitstring,0:PadLen>>}
end.
-%% FIXME:
-%% random_sign(integer) ->
-%% case random(2) of
-%% 2 ->
-%% -1;
-%% _ ->
-%% 1
-%% end;
-%% random_sign(string) ->
-%% case random(2) of
-%% 2 ->
-%% "-";
-%% _ ->
-%% ""
-%% end.
-
random(Upper) ->
rand:uniform(Upper).
@@ -409,13 +379,6 @@ c_random(VRange,Single) ->
S;
{_,S} when is_list(S) ->
lists:nth(random(length(S)),S)
-%% {S1,S2} ->
-%% io:format("asn1ct_value: hejsan hoppsan~n");
-%% _ ->
-%% io:format("asn1ct_value: hejsan hoppsan 2~n")
-%% io:format("asn1ct_value: c_random/2: S1 = ~w~n"
-%% "S2 = ~w,~n",[S1,S2])
-%% exit(self(),goodbye)
end.
adjust_list(Len,Orig) ->
diff --git a/lib/asn1/src/asn1rt_nif.erl b/lib/asn1/src/asn1rt_nif.erl
index ff464885f6..e540b9f50d 100644
--- a/lib/asn1/src/asn1rt_nif.erl
+++ b/lib/asn1/src/asn1rt_nif.erl
@@ -26,6 +26,7 @@
decode_ber_tlv/1,
encode_ber_tlv/1]).
+-compile(no_native).
-on_load(load_nif/0).
-define(ASN1_NIF_VSN,1).
diff --git a/lib/asn1/src/asn1rtt_ber.erl b/lib/asn1/src/asn1rtt_ber.erl
index fdb9b9061f..882a25c332 100644
--- a/lib/asn1/src/asn1rtt_ber.erl
+++ b/lib/asn1/src/asn1rtt_ber.erl
@@ -92,7 +92,7 @@
-define(N_BMPString, 30).
-% the complete tag-word of built-in types
+%% The complete tag-word of built-in types
-define(T_BOOLEAN, ?UNIVERSAL bor ?PRIMITIVE bor 1).
-define(T_INTEGER, ?UNIVERSAL bor ?PRIMITIVE bor 2).
-define(T_BIT_STRING, ?UNIVERSAL bor ?PRIMITIVE bor 3). % can be CONSTRUCTED
@@ -137,11 +137,11 @@ ber_decode_erlang(Tlv) ->
decode_primitive(Bin) ->
{Form,TagNo,V,Rest} = decode_tag_and_length(Bin),
case Form of
- 1 -> % constructed
+ 1 -> % constructed
{{TagNo,decode_constructed(V)},Rest};
- 0 -> % primitive
+ 0 -> % primitive
{{TagNo,V},Rest};
- 2 -> % constructed indefinite
+ 2 -> % constructed indefinite
{Vlist,Rest2} = decode_constructed_indefinite(V,[]),
{{TagNo,Vlist},Rest2}
end.
@@ -165,31 +165,30 @@ decode_primitive_incomplete([[default,TagNo]],Bin) -> %default
{Form,TagNo,V,Rest} ->
decode_incomplete2(Form,TagNo,V,[],Rest);
_ ->
- %{asn1_DEFAULT,Bin}
asn1_NOVALUE
end;
-decode_primitive_incomplete([[default,TagNo,Directives]],Bin) -> %default, constructed type, Directives points into this type
+decode_primitive_incomplete([[default,TagNo,Directives]],Bin) ->
+ %% default, constructed type, Directives points into this type
case decode_tag_and_length(Bin) of
{Form,TagNo,V,Rest} ->
decode_incomplete2(Form,TagNo,V,Directives,Rest);
_ ->
- %{asn1_DEFAULT,Bin}
asn1_NOVALUE
end;
-decode_primitive_incomplete([[opt,TagNo]],Bin) -> %optional
+decode_primitive_incomplete([[opt,TagNo]],Bin) ->
+ %% optional
case decode_tag_and_length(Bin) of
{Form,TagNo,V,Rest} ->
decode_incomplete2(Form,TagNo,V,[],Rest);
_ ->
- %{{TagNo,asn1_NOVALUE},Bin}
asn1_NOVALUE
end;
-decode_primitive_incomplete([[opt,TagNo,Directives]],Bin) -> %optional
+decode_primitive_incomplete([[opt,TagNo,Directives]],Bin) ->
+ %% optional
case decode_tag_and_length(Bin) of
{Form,TagNo,V,Rest} ->
decode_incomplete2(Form,TagNo,V,Directives,Rest);
_ ->
- %{{TagNo,asn1_NOVALUE},Bin}
asn1_NOVALUE
end;
%% An optional that shall be undecoded
@@ -236,7 +235,8 @@ decode_primitive_incomplete([[alt_parts,TagNo]|RestAlts],Bin) ->
_ ->
decode_primitive_incomplete(RestAlts,Bin)
end;
-decode_primitive_incomplete([[undec,_TagNo]|_RestTag],Bin) -> %incomlete decode
+decode_primitive_incomplete([[undec,_TagNo]|_RestTag],Bin) ->
+ %% incomlete decode
decode_incomplete_bin(Bin);
decode_primitive_incomplete([[parts,TagNo]|_RestTag],Bin) ->
case decode_tag_and_length(Bin) of
@@ -301,7 +301,8 @@ decode_constructed_incomplete(Directives=[[Alt,_]|_],Bin)
{TagNo,Tlv};
{alt_parts,_} ->
[{TagNo,decode_parts_incomplete(V)}];
- no_match -> %% if a choice alternative was encoded that
+ no_match ->
+ %% if a choice alternative was encoded that
%% was not specified in the config file,
%% thus decode component anonomous.
{Tlv,_}=decode_primitive(Bin),
@@ -546,7 +547,7 @@ decode_tag_and_length(<<Class:2, Form:1, 31:5, Buffer/binary>>) ->
decode_tag(<<0:1,PartialTag:7, Buffer/binary>>, TagAck) ->
TagNo = (TagAck bsl 7) bor PartialTag,
{TagNo, Buffer};
-% more tags
+%% more tags
decode_tag(<<_:1,PartialTag:7, Buffer/binary>>, TagAck) ->
TagAck1 = (TagAck bsl 7) bor PartialTag,
decode_tag(Buffer, TagAck1).
@@ -941,12 +942,12 @@ encode_bit_string_bits(C, BitListVal, _NamedBitList, TagIn) when is_list(BitList
case length(BitListVal) of
BitSize when BitSize == Size ->
{Len, Unused, OctetList} = encode_bitstring(BitListVal),
- %%add unused byte to the Len
+ %% add unused byte to the Len
encode_tags(TagIn, [Unused | OctetList], Len+1);
BitSize when BitSize < Size ->
PaddedList = pad_bit_list(Size-BitSize,BitListVal),
{Len, Unused, OctetList} = encode_bitstring(PaddedList),
- %%add unused byte to the Len
+ %% add unused byte to the Len
encode_tags(TagIn, [Unused | OctetList], Len+1);
BitSize ->
exit({error,{asn1,
diff --git a/lib/asn1/test/asn1_SUITE.erl b/lib/asn1/test/asn1_SUITE.erl
index 580c919b9d..d99190b6b0 100644
--- a/lib/asn1/test/asn1_SUITE.erl
+++ b/lib/asn1/test/asn1_SUITE.erl
@@ -1108,6 +1108,7 @@ test_modules() ->
"From",
"H235-SECURITY-MESSAGES",
"H323-MESSAGES",
+ "HighTagNumbers",
"Import",
"Int",
"MAP-commonDataTypes",
diff --git a/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1 b/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1
new file mode 100644
index 0000000000..b681063965
--- /dev/null
+++ b/lib/asn1/test/asn1_SUITE_data/HighTagNumbers.asn1
@@ -0,0 +1,17 @@
+HighTagNumbers DEFINITIONS ::=
+BEGIN
+
+S ::= SEQUENCE {
+ a [127] INTEGER,
+ b [128] INTEGER,
+ c [150] INTEGER,
+ d [207] INTEGER,
+ e [255] INTEGER,
+ f [256] INTEGER,
+ g [7777] INTEGER,
+ h [9999] INTEGER,
+ i [16382] INTEGER,
+ j [16383] INTEGER
+}
+
+END
diff --git a/lib/common_test/doc/src/notes.xml b/lib/common_test/doc/src/notes.xml
index 83e6511c04..efeacd4a72 100644
--- a/lib/common_test/doc/src/notes.xml
+++ b/lib/common_test/doc/src/notes.xml
@@ -33,6 +33,123 @@
<file>notes.xml</file>
</header>
+<section><title>Common_Test 1.14</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>The following corrections and improvements are done in
+ the common_test hook handling:</p> <list> <item> <p>An
+ extra argument, <c>Suite</c>, is added as the first
+ argument to each of the following hook callback
+ functions:</p> <list>
+ <item><c>pre_init_per_group</c></item>
+ <item><c>post_init_per_group</c></item>
+ <item><c>pre_end_per_group</c></item>
+ <item><c>post_end_per_group</c></item>
+ <item><c>pre_init_per_testcase</c></item>
+ <item><c>post_init_per_testcase</c></item>
+ <item><c>pre_end_per_testcase</c></item>
+ <item><c>post_end_per_testcase</c></item>
+ <item><c>on_tc_fail</c></item>
+ <item><c>on_tc_skip</c></item> </list> <p>For backwards
+ compatibility, if the new function is not exported from a
+ hook callback module, <c>common_test</c> will fall back
+ to the old interface and call the function without the
+ <c>Suite</c> argument.</p> </item> <item> <p>If either
+ <c>init_per_suite</c> or <c>end_per_suite</c> exists, but
+ not the other, then the non-existing function will be
+ reported as failed with reason <c>undef</c> in the test
+ log. The same goes for <c>init/end_per_group</c>. This
+ has always been a requirement according to the user's
+ guide, but now <c>common_test</c> is more explicit in the
+ report.</p> </item> <item> <p>If <c>init_per_suite</c>
+ was exported from a test suite, but not
+ <c>end_per_suite</c>, then <c>pre/post_end_per_suite</c>
+ was called with <c>Suite=ct_framework</c> instead of the
+ correct suite name. This is now corrected.</p> </item>
+ <item> <p>If <c>end_per_group</c> was exported from a
+ suite, but not <c>init_per_group</c>, then
+ <c>end_per_group</c> was never called. This is now
+ corrected.</p> </item> <item> <p>Tests that were skipped
+ before calling <c>pre_init_per_*</c> got faulty calls to
+ the corresponding <c>post_init_per_*</c>. E.g. if a test
+ was skipped because <c>suite/0</c> failed, then
+ <c>post_init_per_suite</c> would be called even though
+ <c>pre_init_per_suite</c> and <c>init_per_suite</c> were
+ not called. This is now corrected so a <c>post_*</c>
+ callback will never be called unless the corresponding
+ <c>pre_*</c> callback has been called first.</p> </item>
+ <item> <p>Tests that were skipped before or in
+ <c>init_per_testcase</c> got faulty calls to
+ <c>pre_end_per_testcase</c> and
+ <c>post_end_per_testcase</c>. This is now corrected so
+ <c>pre/post_end_per_testcase</c> are not called when
+ <c>end_per_testcase</c> is not called.</p> </item> <item>
+ <p>If an exit signal causes the test case process to die
+ while running <c>init_per_testcase</c>, the case was
+ earlier reported as failed with reason <c>{skip,...}</c>.
+ This is now corrected so the case will be marked as
+ skipped.</p> </item> <item> <p>If an exist signal causes
+ the test case process to die while running
+ <c>end_per_testcase</c>, the case was earlier marked as
+ failed. This is now corrected so the status of the test
+ case is not changed - there is only a warning added to
+ the comment field.</p> </item> <item> <p>If a test case
+ was skipped because of option
+ <c>{force_stop,skip_rest}</c> or because of a failed
+ sequence, then no <c>tc_start</c> event would be sent,
+ only <c>tc_done</c>. This is now corrected so both events
+ are sent.</p> </item> <item> <p>When skipping or failing
+ in a configuration function, the configuration function
+ itself would get <c>{auto_skipped,Reason}</c>,
+ <c>{skipped,Reason}</c> or <c>{failed,Reason}</c> in the
+ hook callbacks <c>on_tc_skip</c> or <c>on_tc_fail</c>.
+ The other test cases that were skipped as a result of
+ this would only get <c>Reason</c> in <c>on_tc_skip</c>.
+ This is now corrected so even the configuration function
+ that caused the skip/fail will only get <c>Reason</c> in
+ the hook callback.</p> </item> </list>
+ <p>
+ Own Id: OTP-10599 Aux Id: kunagi-344 [255] </p>
+ </item>
+ <item>
+ <p>
+ When a test case was skipped by a <c>skip_cases</c>
+ statement in a test spec, then <c>cth_surefire</c> would
+ erroneously mark the previous test case as skipped in the
+ xml report. The actually skipped test case would not be
+ present in the xml report at all. This is now corrected.</p>
+ <p>
+ Own Id: OTP-14129 Aux Id: seq13244 </p>
+ </item>
+ <item>
+ <p>The <c>multiply_timetraps</c> and
+ <c>scale_timetraps</c> options did not work with test
+ specifications, which has been corrected.</p>
+ <p>
+ Own Id: OTP-14210</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ ct_testspec:get_tests/1 is added. This is used by rebar3
+ to get all directories that must be compiled when running
+ tests from testspec - instead of implementing testspec
+ parsing in rebar3.</p>
+ <p>
+ Own Id: OTP-14132</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Common_Test 1.13</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/common_test/doc/src/write_test_chapter.xml b/lib/common_test/doc/src/write_test_chapter.xml
index 6a0d87bcaf..c230148b29 100644
--- a/lib/common_test/doc/src/write_test_chapter.xml
+++ b/lib/common_test/doc/src/write_test_chapter.xml
@@ -1036,7 +1036,7 @@ Importance >= (100-VerbosityLevel)</pre>
<p>Note that the category argument is not required in order to only specify the
importance of a printout. Example:</p>
<pre>
-<c>ct:pal(?LOW_IMPORTANCE, "Info report: ~p", [Info])</c></pre>
+ct:pal(?LOW_IMPORTANCE, "Info report: ~p", [Info])</pre>
<p>Or perhaps in combination with constants:</p>
<pre>
-define(INFO, ?LOW_IMPORTANCE).
diff --git a/lib/common_test/src/ct_release_test.erl b/lib/common_test/src/ct_release_test.erl
index d783f8d04e..c53e72ee88 100644
--- a/lib/common_test/src/ct_release_test.erl
+++ b/lib/common_test/src/ct_release_test.erl
@@ -132,7 +132,7 @@
%%-----------------------------------------------------------------
-define(testnode, 'ct_release_test-upgrade').
--define(exclude_apps, [hipe, typer, dialyzer]). % never include these apps
+-define(exclude_apps, [hipe, dialyzer]). % never include these apps
%%-----------------------------------------------------------------
-record(ct_data, {from,to}).
diff --git a/lib/common_test/src/ct_slave.erl b/lib/common_test/src/ct_slave.erl
index 571958ca03..4188bd7c3b 100644
--- a/lib/common_test/src/ct_slave.erl
+++ b/lib/common_test/src/ct_slave.erl
@@ -309,7 +309,12 @@ is_started(ENode) ->
% make a Erlang node name from name and hostname
enodename(Host, Node) ->
- list_to_atom(atom_to_list(Node)++"@"++atom_to_list(Host)).
+ case lists:member($@, atom_to_list(Node)) of
+ true ->
+ Node;
+ false ->
+ list_to_atom(atom_to_list(Node)++"@"++atom_to_list(Host))
+ end.
% performs actual start of the "slave" node
do_start(Host, Node, Options) ->
diff --git a/lib/common_test/src/test_server.erl b/lib/common_test/src/test_server.erl
index be49191f2e..0256206e59 100644
--- a/lib/common_test/src/test_server.erl
+++ b/lib/common_test/src/test_server.erl
@@ -359,10 +359,10 @@ stick_all_sticky(Node,Sticky) ->
%% cover.
run_test_case_apply({Mod,Func,Args,Name,RunInit,TimetrapData}) ->
- case os:getenv("TS_RUN_VALGRIND") of
+ case is_valgrind() of
false ->
ok;
- _ ->
+ true ->
os:putenv("VALGRIND_LOGFILE_INFIX",atom_to_list(Mod)++"."++
atom_to_list(Func)++"-")
end,
@@ -1827,7 +1827,8 @@ timetrap_scale_factor() ->
{ 2, fun() -> has_lock_checking() end},
{ 3, fun() -> has_superfluous_schedulers() end},
{ 6, fun() -> is_debug() end},
- {10, fun() -> is_cover() end}
+ {10, fun() -> is_cover() end},
+ {10, fun() -> is_valgrind() end}
]).
timetrap_scale_factor(Scales) ->
@@ -2729,6 +2730,16 @@ is_commercial() ->
_ -> true
end.
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% is_valgrind() -> boolean()
+%%
+%% Returns true if valgrind is running, else false
+is_valgrind() ->
+ case os:getenv("TS_RUN_VALGRIND") of
+ false -> false;
+ _ -> true
+ end.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Apply given function and reply to caller or proxy.
diff --git a/lib/common_test/src/test_server_node.erl b/lib/common_test/src/test_server_node.erl
index 0b406c54cc..92c610730e 100644
--- a/lib/common_test/src/test_server_node.erl
+++ b/lib/common_test/src/test_server_node.erl
@@ -18,11 +18,11 @@
%% %CopyrightEnd%
%%
-module(test_server_node).
--compile(r12).
+-compile(r16).
%%%
%%% The same compiled code for this module must be possible to load
-%%% in R12B and later.
+%%% in R16B and later.
%%%
%% Test Controller interface
diff --git a/lib/common_test/vsn.mk b/lib/common_test/vsn.mk
index 2fab4d3883..e6ae8b2e7a 100644
--- a/lib/common_test/vsn.mk
+++ b/lib/common_test/vsn.mk
@@ -1 +1 @@
-COMMON_TEST_VSN = 1.13
+COMMON_TEST_VSN = 1.14
diff --git a/lib/compiler/doc/src/notes.xml b/lib/compiler/doc/src/notes.xml
index 2e58b68bf0..449453bf88 100644
--- a/lib/compiler/doc/src/notes.xml
+++ b/lib/compiler/doc/src/notes.xml
@@ -32,6 +32,22 @@
<p>This document describes the changes made to the Compiler
application.</p>
+<section><title>Compiler 7.0.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Minor internal changes. A typo in the documentation was
+ also fixed.</p>
+ <p>
+ Own Id: OTP-14240</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Compiler 7.0.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/compiler/src/Makefile b/lib/compiler/src/Makefile
index cf60355a40..59b80ade5d 100644
--- a/lib/compiler/src/Makefile
+++ b/lib/compiler/src/Makefile
@@ -63,6 +63,7 @@ MODULES = \
beam_peep \
beam_receive \
beam_reorder \
+ beam_record \
beam_split \
beam_trim \
beam_type \
diff --git a/lib/compiler/src/beam_disasm.erl b/lib/compiler/src/beam_disasm.erl
index c699672db1..8fd0b36d05 100644
--- a/lib/compiler/src/beam_disasm.erl
+++ b/lib/compiler/src/beam_disasm.erl
@@ -815,6 +815,9 @@ resolve_inst({is_tuple=I,Args0},_,_,_) ->
resolve_inst({test_arity=I,Args0},_,_,_) ->
[L|Args] = resolve_args(Args0),
{test,I,L,Args};
+resolve_inst({is_tagged_tuple=I,Args0},_,_,_) ->
+ [F|Args] = resolve_args(Args0),
+ {test,I,F,Args};
resolve_inst({select_val,Args},_,_,_) ->
[Reg,FLbl,{{z,1},{u,_Len},List0}] = Args,
List = resolve_args(List0),
diff --git a/lib/compiler/src/beam_record.erl b/lib/compiler/src/beam_record.erl
new file mode 100644
index 0000000000..419089b1bc
--- /dev/null
+++ b/lib/compiler/src/beam_record.erl
@@ -0,0 +1,106 @@
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2014-2017. All Rights Reserved.
+%%
+%% The contents of this file are subject to the Erlang Public License,
+%% Version 1.1, (the "License"); you may not use this file except in
+%% compliance with the License. You should have received a copy of the
+%% Erlang Public License along with this software. If not, it can be
+%% retrieved online at http://www.erlang.org/.
+%%
+%% Software distributed under the License is distributed on an "AS IS"
+%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
+%% the License for the specific language governing rights and limitations
+%% under the License.
+%%
+%% %CopyrightEnd%
+%%
+%% File: beam_record.erl
+%% Author: Björn-Egil Dahlberg
+%% Created: 2014-09-03
+%%
+
+-module(beam_record).
+-export([module/2]).
+
+%% Rewrite the instruction stream on tagged tuple tests.
+%% Tagged tuples means a tuple of any arity with an atom as its first element.
+%% Typically records, ok-tuples and error-tuples.
+%%
+%% from:
+%% ...
+%% {test,is_tuple,Fail,[Src]}.
+%% {test,test_arity,Fail,[Src,Sz]}.
+%% ...
+%% {get_tuple_element,Src,0,Dst}.
+%% ...
+%% {test,is_eq_exact,Fail,[Dst,Atom]}.
+%% ...
+%% to:
+%% ...
+%% {test,is_tagged_tuple,Fail,[Src,Sz,Atom]}.
+%% ...
+
+
+-import(lists, [reverse/1]).
+
+-spec module(beam_utils:module_code(), [compile:option()]) ->
+ {'ok',beam_utils:module_code()}.
+
+module({Mod,Exp,Attr,Fs0,Lc}, _Opt) ->
+ Fs = [function(F) || F <- Fs0],
+ {ok,{Mod,Exp,Attr,Fs,Lc}}.
+
+function({function,Name,Arity,CLabel,Is}) ->
+ try
+ Idx = beam_utils:index_labels(Is),
+ {function,Name,Arity,CLabel,rewrite(Is,Idx)}
+ catch
+ Class:Error ->
+ Stack = erlang:get_stacktrace(),
+ io:fwrite("Function: ~w/~w\n", [Name,Arity]),
+ erlang:raise(Class, Error, Stack)
+ end.
+
+rewrite(Is,Idx) ->
+ rewrite(Is,Idx,[]).
+
+rewrite([{test,is_tuple,Fail,[Src]}=I1,
+ {test,test_arity,Fail,[Src,N]}=I2|Is],Idx,Acc) ->
+ case is_tagged_tuple(Is,Fail,Src,Idx) of
+ no ->
+ rewrite(Is,Idx,[I2,I1|Acc]);
+ {Atom,[{block,[]}|Is1]} ->
+ rewrite(Is1,Idx,[{test,is_tagged_tuple,Fail,[Src,N,Atom]}|Acc]);
+ {Atom,Is1} ->
+ rewrite(Is1,Idx,[{test,is_tagged_tuple,Fail,[Src,N,Atom]}|Acc])
+ end;
+rewrite([I|Is],Idx,Acc) ->
+ rewrite(Is,Idx,[I|Acc]);
+rewrite([],_,Acc) -> reverse(Acc).
+
+is_tagged_tuple([{block,[{set,[Dst],[Src],{get_tuple_element,0}}=B|Bs]},
+ {test,is_eq_exact,Fail,[Dst,{atom,_}=Atom]}|Is],Fail,Src,Idx) ->
+
+ %% if Dst is killed in the instruction stream and at fail label,
+ %% we can safely remove get_tuple_element.
+ %%
+ %% if Dst is not killed in the stream, we cannot remove get_tuple_element
+ %% since it is referenced.
+
+ case is_killed(Dst,Is,Fail,Idx) of
+ true -> {Atom,[{block,Bs}|Is]};
+ false -> {Atom,[{block,[B|Bs]}|Is]}
+ end;
+is_tagged_tuple([{block,[{set,_,_,_}=B|Bs]},
+ {test,is_eq_exact,_,_}=I|Is],Fail,Src,Idx) ->
+ case is_tagged_tuple([{block,Bs},I|Is],Fail,Src,Idx) of
+ {Atom,[{block,Bsr}|Isr]} -> {Atom,[{block,[B|Bsr]}|Isr]};
+ no -> no
+ end;
+is_tagged_tuple(_Is,_Fail,_Src,_Idx) ->
+ no.
+
+is_killed(Dst,Is,{_,Lbl},Idx) ->
+ beam_utils:is_killed(Dst,Is,Idx) andalso
+ beam_utils:is_killed_at(Dst,Lbl,Idx).
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index 050c599d6b..7e9a243ada 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -26,6 +26,8 @@
-import(lists, [filter/2,foldl/3,keyfind/3,member/2,
reverse/1,reverse/2,sort/1]).
+-define(UNICODE_INT, {integer,{0,16#10FFFF}}).
+
-spec module(beam_utils:module_code(), [compile:option()]) ->
{'ok',beam_utils:module_code()}.
@@ -494,6 +496,10 @@ update({test,test_arity,_Fail,[Src,Arity]}, Ts0) ->
tdb_update([{Src,{tuple,Arity,[]}}], Ts0);
update({test,is_map,_Fail,[Src]}, Ts0) ->
tdb_update([{Src,map}], Ts0);
+update({get_map_elements,_,Src,{list,Elems0}}, Ts0) ->
+ {_Ss,Ds} = beam_utils:split_even(Elems0),
+ Elems = [{Dst,kill} || Dst <- Ds],
+ tdb_update([{Src,map}|Elems], Ts0);
update({test,is_nonempty_list,_Fail,[Src]}, Ts0) ->
tdb_update([{Src,nonempty_list}], Ts0);
update({test,is_eq_exact,_,[Reg,{atom,_}=Atom]}, Ts) ->
@@ -507,10 +513,39 @@ update({test,is_eq_exact,_,[Reg,{atom,_}=Atom]}, Ts) ->
end;
update({test,is_record,_Fail,[Src,Tag,{integer,Arity}]}, Ts) ->
tdb_update([{Src,{tuple,Arity,[Tag]}}], Ts);
-update({test,_Test,_Fail,_Other}, Ts) ->
- Ts;
+
+%% Binary matching
+
update({test,bs_get_integer2,_,_,Args,Dst}, Ts) ->
tdb_update([{Dst,get_bs_integer_type(Args)}], Ts);
+update({test,bs_get_utf8,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,?UNICODE_INT}], Ts);
+update({test,bs_get_utf16,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,?UNICODE_INT}], Ts);
+update({test,bs_get_utf32,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,?UNICODE_INT}], Ts);
+update({bs_init,_,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,kill}], Ts);
+update({bs_put,_,_,_}, Ts) ->
+ Ts;
+update({bs_save2,_,_}, Ts) ->
+ Ts;
+update({bs_restore2,_,_}, Ts) ->
+ Ts;
+update({bs_context_to_binary,Dst}, Ts) ->
+ tdb_update([{Dst,kill}], Ts);
+update({test,bs_start_match2,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,kill}], Ts);
+update({test,bs_get_binary2,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,kill}], Ts);
+update({test,bs_get_float2,_,_,_,Dst}, Ts) ->
+ tdb_update([{Dst,float}], Ts);
+
+update({test,_Test,_Fail,_Other}, Ts) ->
+ Ts;
+
+%% Calls
+
update({call_ext,Ar,{extfunc,math,Math,Ar}}, Ts) ->
case is_math_bif(Math, Ar) of
true -> tdb_update([{{x,0},float}], Ts);
@@ -537,9 +572,10 @@ update({call_ext,3,{extfunc,erlang,setelement,3}}, Ts0) ->
update({call,_Arity,_Func}, Ts) -> tdb_kill_xregs(Ts);
update({call_ext,_Arity,_Func}, Ts) -> tdb_kill_xregs(Ts);
update({make_fun2,_,_,_,_}, Ts) -> tdb_kill_xregs(Ts);
+update({call_fun, _}, Ts) -> tdb_kill_xregs(Ts);
+update({apply, _}, Ts) -> tdb_kill_xregs(Ts);
+
update({line,_}, Ts) -> Ts;
-update({bs_save2,_,_}, Ts) -> Ts;
-update({bs_restore2,_,_}, Ts) -> Ts;
%% The instruction is unknown. Kill all information.
update(_I, _Ts) -> tdb_new().
@@ -683,6 +719,9 @@ op_type('bsr') -> integer;
op_type('div') -> integer;
op_type(_) -> unknown.
+flush(Rs, [{set,[_],[_,_,_],{bif,is_record,_}}|_]=Is0, Acc0) ->
+ Acc = flush_all(Rs, Is0, Acc0),
+ {[],Acc};
flush(Rs, [{set,[_],[],{put_tuple,_}}|_]=Is0, Acc0) ->
Acc = flush_all(Rs, Is0, Acc0),
{[],Acc};
diff --git a/lib/compiler/src/beam_validator.erl b/lib/compiler/src/beam_validator.erl
index bf33ae0aeb..ca60e1b2de 100644
--- a/lib/compiler/src/beam_validator.erl
+++ b/lib/compiler/src/beam_validator.erl
@@ -623,17 +623,17 @@ valfun_4({test,bs_skip_utf16,{f,Fail},[Ctx,Live,_]}, Vst) ->
valfun_4({test,bs_skip_utf32,{f,Fail},[Ctx,Live,_]}, Vst) ->
validate_bs_skip_utf(Fail, Ctx, Live, Vst);
valfun_4({test,bs_get_integer2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, {integer, []}, Dst, Vst);
valfun_4({test,bs_get_float2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, {float, []}, Dst, Vst);
valfun_4({test,bs_get_binary2,{f,Fail},Live,[Ctx,_,_,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, term, Dst, Vst);
valfun_4({test,bs_get_utf8,{f,Fail},Live,[Ctx,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, {integer, []}, Dst, Vst);
valfun_4({test,bs_get_utf16,{f,Fail},Live,[Ctx,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, {integer, []}, Dst, Vst);
valfun_4({test,bs_get_utf32,{f,Fail},Live,[Ctx,_],Dst}, Vst) ->
- validate_bs_get(Fail, Ctx, Live, Dst, Vst);
+ validate_bs_get(Fail, Ctx, Live, {integer, []}, Dst, Vst);
valfun_4({bs_save2,Ctx,SavePoint}, Vst) ->
bsm_save(Ctx, SavePoint, Vst);
valfun_4({bs_restore2,Ctx,SavePoint}, Vst) ->
@@ -653,6 +653,9 @@ valfun_4({test,is_nonempty_list,{f,Lbl},[Cons]}, Vst) ->
valfun_4({test,test_arity,{f,Lbl},[Tuple,Sz]}, Vst) when is_integer(Sz) ->
assert_type(tuple, Tuple, Vst),
set_type_reg({tuple,Sz}, Tuple, branch_state(Lbl, Vst));
+valfun_4({test,is_tagged_tuple,{f,Lbl},[Src,Sz,_Atom]}, Vst) ->
+ validate_src([Src], Vst),
+ set_type_reg({tuple, Sz}, Src, branch_state(Lbl, Vst));
valfun_4({test,has_map_fields,{f,Lbl},Src,{list,List}}, Vst) ->
assert_type(map, Src, Vst),
assert_unique_map_keys(List),
@@ -791,12 +794,12 @@ verify_put_map(Fail, Src, Dst, Live, List, Vst0) ->
%%
%% Common code for validating bs_get* instructions.
%%
-validate_bs_get(Fail, Ctx, Live, Dst, Vst0) ->
+validate_bs_get(Fail, Ctx, Live, Type, Dst, Vst0) ->
bsm_validate_context(Ctx, Vst0),
verify_live(Live, Vst0),
Vst1 = prune_x_regs(Live, Vst0),
Vst = branch_state(Fail, Vst1),
- set_type_reg(term, Dst, Vst).
+ set_type_reg(Type, Dst, Vst).
%%
%% Common code for validating bs_skip_utf* instructions.
diff --git a/lib/compiler/src/compile.erl b/lib/compiler/src/compile.erl
index c849306c0d..019d8ba864 100644
--- a/lib/compiler/src/compile.erl
+++ b/lib/compiler/src/compile.erl
@@ -213,22 +213,14 @@ expand_opt(report, Os) ->
[report_errors,report_warnings|Os];
expand_opt(return, Os) ->
[return_errors,return_warnings|Os];
-expand_opt(r12, Os) ->
- [no_recv_opt,no_line_info,no_utf8_atoms|Os];
-expand_opt(r13, Os) ->
- [no_recv_opt,no_line_info,no_utf8_atoms|Os];
-expand_opt(r14, Os) ->
- [no_line_info,no_utf8_atoms|Os];
-expand_opt(r15, Os) ->
- [no_utf8_atoms|Os];
expand_opt(r16, Os) ->
- [no_utf8_atoms|Os];
+ [no_record_opt,no_utf8_atoms|Os];
expand_opt(r17, Os) ->
- [no_utf8_atoms|Os];
+ [no_record_opt,no_utf8_atoms|Os];
expand_opt(r18, Os) ->
- [no_utf8_atoms|Os];
+ [no_record_opt,no_utf8_atoms|Os];
expand_opt(r19, Os) ->
- [no_utf8_atoms|Os];
+ [no_record_opt,no_utf8_atoms|Os];
expand_opt({debug_info_key,_}=O, Os) ->
[encrypt_debug_info,O|Os];
expand_opt(no_float_opt, Os) ->
@@ -755,6 +747,8 @@ asm_passes() ->
{iff,dbsm,{listing,"bsm"}},
{unless,no_recv_opt,{pass,beam_receive}},
{iff,drecv,{listing,"recv"}},
+ {unless,no_record_opt,{pass,beam_record}},
+ {iff,drecord,{listing,"record"}},
{unless,no_stack_trimming,{pass,beam_trim}},
{iff,dtrim,{listing,"trim"}},
{pass,beam_flatten}]},
@@ -1849,6 +1843,7 @@ pre_load() ->
beam_opcodes,
beam_peep,
beam_receive,
+ beam_record,
beam_reorder,
beam_split,
beam_trim,
diff --git a/lib/compiler/src/compiler.app.src b/lib/compiler/src/compiler.app.src
index 3cb991687b..3961b2af86 100644
--- a/lib/compiler/src/compiler.app.src
+++ b/lib/compiler/src/compiler.app.src
@@ -38,6 +38,7 @@
beam_peep,
beam_receive,
beam_reorder,
+ beam_record,
beam_split,
beam_trim,
beam_type,
diff --git a/lib/compiler/src/core_scan.erl b/lib/compiler/src/core_scan.erl
index 15bfc78c8b..d7d5f900de 100644
--- a/lib/compiler/src/core_scan.erl
+++ b/lib/compiler/src/core_scan.erl
@@ -283,10 +283,12 @@ scan1([$$|Cs0], Toks, Pos) -> %Character constant
scan1(Cs, [{char,Pos,C}|Toks], Pos1);
scan1([$'|Cs0], Toks, Pos) -> %Atom (always quoted)
{S,Cs1,Pos1} = scan_string(Cs0, $', Pos),
- case catch list_to_atom(S) of
+ try binary_to_atom(list_to_binary(S), utf8) of
A when is_atom(A) ->
- scan1(Cs1, [{atom,Pos,A}|Toks], Pos1);
- _Error -> scan_error({illegal,atom}, Pos)
+ scan1(Cs1, [{atom,Pos,A}|Toks], Pos1)
+ catch
+ error:_ ->
+ scan_error({illegal,atom}, Pos)
end;
scan1([$"|Cs0], Toks, Pos) -> %String
{S,Cs1,Pos1} = scan_string(Cs0, $", Pos),
diff --git a/lib/compiler/src/genop.tab b/lib/compiler/src/genop.tab
index dcbdeb32e6..5e0c2b3ebf 100755
--- a/lib/compiler/src/genop.tab
+++ b/lib/compiler/src/genop.tab
@@ -537,3 +537,9 @@ BEAM_FORMAT_NUMBER=0
156: is_map/2
157: has_map_fields/3
158: get_map_elements/3
+
+## @spec is_tagged_tuple Lbl Reg N Atom
+## @doc Test the type of Reg and jumps to Lbl if it is not a tuple.
+## Test the arity of Reg and jumps to Lbl if it is not N.
+## Test the first element of the tuple and jumps to Lbl if it is not Atom.
+159: is_tagged_tuple/4
diff --git a/lib/compiler/test/Makefile b/lib/compiler/test/Makefile
index e338dbb4e3..63763f31b2 100644
--- a/lib/compiler/test/Makefile
+++ b/lib/compiler/test/Makefile
@@ -185,6 +185,7 @@ release_tests_spec: make_emakefile
echo "-module($$module). %% dummy .erl file" >$$file; \
done
$(INSTALL_DATA) $(ERL_DUMMY_FILES) "$(RELSYSDIR)"
+ rm $(ERL_DUMMY_FILES)
chmod -R u+w "$(RELSYSDIR)"
@tar cf - *_SUITE_data | (cd "$(RELSYSDIR)"; tar xf -)
diff --git a/lib/compiler/test/beam_type_SUITE.erl b/lib/compiler/test/beam_type_SUITE.erl
index 492067ef00..c11883d5ff 100644
--- a/lib/compiler/test/beam_type_SUITE.erl
+++ b/lib/compiler/test/beam_type_SUITE.erl
@@ -22,7 +22,7 @@
-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
init_per_group/2,end_per_group/2,
integers/1,coverage/1,booleans/1,setelement/1,cons/1,
- tuple/1]).
+ tuple/1,record_float/1,binary_float/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
@@ -37,7 +37,9 @@ groups() ->
booleans,
setelement,
cons,
- tuple
+ tuple,
+ record_float,
+ binary_float
]}].
init_per_suite(Config) ->
@@ -126,5 +128,28 @@ tuple(_Config) ->
do_tuple() ->
{0, _} = {necessary}.
+-record(x, {a}).
+
+record_float(_Config) ->
+ 17.0 = record_float(#x{a={0}}, 1700),
+ 23.0 = record_float(#x{a={0}}, 2300.0),
+ {'EXIT',{if_clause,_}} = (catch record_float(#x{a={1}}, 88)),
+ {'EXIT',{if_clause,_}} = (catch record_float(#x{a={}}, 88)),
+ {'EXIT',{if_clause,_}} = (catch record_float(#x{}, 88)),
+ ok.
+
+record_float(R, N0) ->
+ N = N0 / 100,
+ if element(1, R#x.a) =:= 0 ->
+ N
+ end.
+
+binary_float(_Config) ->
+ <<-1/float>> = binary_negate_float(<<1/float>>),
+ ok.
+
+binary_negate_float(<<Float/float>>) ->
+ <<-Float/float>>.
+
id(I) ->
I.
diff --git a/lib/compiler/test/compile_SUITE.erl b/lib/compiler/test/compile_SUITE.erl
index 10740ac2b0..474c3e2ca0 100644
--- a/lib/compiler/test/compile_SUITE.erl
+++ b/lib/compiler/test/compile_SUITE.erl
@@ -865,9 +865,7 @@ do_core_roundtrip_2(M, Core0, Outdir) ->
case cmp_core(Core0, Core, M) of
true -> ok;
false -> error
- end,
-
- ok.
+ end.
undo_var_translation(Tree) ->
F = fun(Node) ->
@@ -920,11 +918,72 @@ diff(E, E) ->
diff([H1|T1], [H2|T2]) ->
[diff(H1, H2)|diff(T1, T2)];
diff(T1, T2) when tuple_size(T1) =:= tuple_size(T2) ->
- L = diff(tuple_to_list(T1), tuple_to_list(T2)),
- list_to_tuple(L);
+ case cerl:is_c_var(T1) andalso cerl:is_c_var(T2) of
+ true ->
+ diff_var(T1, T2);
+ false ->
+ case cerl:is_c_map(T1) andalso cerl:is_c_map(T2) of
+ true ->
+ diff_map(T1, T2);
+ false ->
+ diff_tuple(T1, T2)
+ end
+ end;
diff(E1, E2) ->
{'DIFF',E1,E2}.
+diff_var(V1, V2) ->
+ case {cerl:var_name(V1),cerl:var_name(V2)} of
+ {Same,Same} ->
+ V1;
+ {Name1,Name2} ->
+ %% The inliner uses integers as variable names. Such integers
+ %% are read back as atoms.
+ case is_integer(Name1) andalso
+ list_to_atom(integer_to_list(Name1)) =:= Name2 of
+ true ->
+ V1;
+ _ ->
+ cerl:update_c_var(V1, {'DIFF',Name1,Name2})
+ end
+ end.
+
+%% Annotations for maps are not preserved exactly, but that is not
+%% a real problem. Workaround by not comparing all annotations when
+%% comparing maps.
+
+diff_map(M, M) ->
+ M;
+diff_map(M1, M2) ->
+ case cerl:get_ann(M1) =:= cerl:get_ann(M2) of
+ false ->
+ diff_tuple(M1, M2);
+ true ->
+ case remove_compiler_gen(M1) =:= remove_compiler_gen(M2) of
+ true ->
+ M1;
+ false ->
+ diff_tuple(M1, M2)
+ end
+ end.
+
+diff_tuple(T1, T2) ->
+ L = diff(tuple_to_list(T1), tuple_to_list(T2)),
+ list_to_tuple(L).
+
+remove_compiler_gen(M) ->
+ Arg0 = cerl:map_arg(M),
+ Arg = cerl:set_ann(Arg0, []),
+ Es0 = cerl:map_es(M),
+ Es = [remove_compiler_gen_1(Pair) || Pair <- Es0],
+ cerl:update_c_map(M, Arg, Es).
+
+remove_compiler_gen_1(Pair) ->
+ Op0 = cerl:map_pair_op(Pair),
+ Op = cerl:set_ann(Op0, []),
+ K = cerl:map_pair_key(Pair),
+ V = cerl:map_pair_val(Pair),
+ cerl:update_c_map_pair(Pair, Op, K, V).
%% Compile to Beam assembly language (.S) and then try to
%% run .S through the compiler again.
diff --git a/lib/compiler/test/guard_SUITE.erl b/lib/compiler/test/guard_SUITE.erl
index a662d85272..ccb9b58225 100644
--- a/lib/compiler/test/guard_SUITE.erl
+++ b/lib/compiler/test/guard_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2001-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2001-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1538,7 +1538,7 @@ literal_type_tests_1(Config) ->
Func = {function, Anno, test, 0, [{clause,Anno,[],[],Tests}]},
Form = [{attribute,Anno,module,Mod},
{attribute,Anno,compile,export_all},
- Func, {eof,Anno}],
+ Func, {eof,999}],
%% Print generated code for inspection.
lists:foreach(fun (F) -> io:put_chars([erl_pp:form(F),"\n"]) end, Form),
diff --git a/lib/compiler/test/misc_SUITE.erl b/lib/compiler/test/misc_SUITE.erl
index 621524114f..fa6d5ee957 100644
--- a/lib/compiler/test/misc_SUITE.erl
+++ b/lib/compiler/test/misc_SUITE.erl
@@ -280,6 +280,23 @@ silly_coverage(Config) when is_list(Config) ->
{block,[a|b]}]}],0},
expect_error(fun() -> beam_receive:module(ReceiveInput, []) end),
+ %% beam_record.
+ RecordInput = {?MODULE,[{foo,0}],[],
+ [{function,foo,1,2,
+ [{label,1},
+ {func_info,{atom,?MODULE},{atom,foo},1},
+ {label,2},
+ {test,is_tuple,{f,1},[{x,0}]},
+ {test,test_arity,{f,1},[{x,0},3]},
+ {block,[{set,[{x,1}],[{x,0}],{get_tuple_element,0}}]},
+ {test,is_eq_exact,{f,1},[{x,1},{atom,bar}]},
+ {block,[{set,[{x,2}],[{x,0}],{get_tuple_element,1}}|a]},
+ {test,is_eq_exact,{f,1},[{x,2},{integer,1}]},
+ {block,[{set,[{x,0}],[{atom,ok}],move}]},
+ return]}],0},
+
+ expect_error(fun() -> beam_record:module(RecordInput, []) end),
+
BeamZInput = {?MODULE,[{foo,0}],[],
[{function,foo,0,2,
[{label,1},
diff --git a/lib/compiler/vsn.mk b/lib/compiler/vsn.mk
index 9c3cf1f34b..5c87304a01 100644
--- a/lib/compiler/vsn.mk
+++ b/lib/compiler/vsn.mk
@@ -1 +1 @@
-COMPILER_VSN = 7.0.3
+COMPILER_VSN = 7.0.4
diff --git a/lib/crypto/c_src/crypto.c b/lib/crypto/c_src/crypto.c
index 9b5e1736a8..1f4ce9a3da 100644
--- a/lib/crypto/c_src/crypto.c
+++ b/lib/crypto/c_src/crypto.c
@@ -279,9 +279,19 @@ static void HMAC_CTX_free(HMAC_CTX *ctx)
#define EVP_MD_CTX_new() EVP_MD_CTX_create()
#define EVP_MD_CTX_free(ctx) EVP_MD_CTX_destroy(ctx)
+static INLINE void *BN_GENCB_get_arg(BN_GENCB *cb);
+
+static INLINE void *BN_GENCB_get_arg(BN_GENCB *cb)
+{
+ return cb->arg;
+}
+
static INLINE int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d);
+static INLINE void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d);
static INLINE int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q);
+static INLINE void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q);
static INLINE int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp);
+static INLINE void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp);
static INLINE int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
{
@@ -291,6 +301,13 @@ static INLINE int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
return 1;
}
+static INLINE void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
+{
+ *n = r->n;
+ *e = r->e;
+ *d = r->d;
+}
+
static INLINE int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
{
r->p = p;
@@ -298,6 +315,12 @@ static INLINE int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
return 1;
}
+static INLINE void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
+{
+ *p = r->p;
+ *q = r->q;
+}
+
static INLINE int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
{
r->dmp1 = dmp1;
@@ -306,6 +329,13 @@ static INLINE int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM
return 1;
}
+static INLINE void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp)
+{
+ *dmp1 = r->dmp1;
+ *dmq1 = r->dmq1;
+ *iqmp = r->iqmp;
+}
+
static INLINE int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key);
static INLINE int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g);
@@ -368,7 +398,11 @@ DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
*priv_key = dh->priv_key;
}
-#endif /* End of compatibility definitions. */
+#else /* End of compatibility definitions. */
+
+#define HAVE_OPAQUE_BN_GENCB
+
+#endif
/* NIF interface declarations */
static int load(ErlNifEnv* env, void** priv_data, ERL_NIF_TERM load_info);
@@ -391,10 +425,12 @@ static ERL_NIF_TERM hmac_final_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
static ERL_NIF_TERM cmac_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM block_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM aes_cfb_8_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM aes_cfb_128_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM aes_ige_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM aes_ctr_stream_init(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM aes_ctr_stream_encrypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM strong_rand_bytes_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM strong_rand_range_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM rand_uniform_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM mod_exp_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM dss_verify_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
@@ -406,6 +442,7 @@ static ERL_NIF_TERM rsa_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM ar
static ERL_NIF_TERM dss_sign_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM rsa_public_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM rsa_private_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
+static ERL_NIF_TERM rsa_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM dh_generate_parameters_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM dh_check(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
static ERL_NIF_TERM dh_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[]);
@@ -439,6 +476,7 @@ static EC_KEY* ec_key_new(ErlNifEnv* env, ERL_NIF_TERM curve_arg);
static int term2point(ErlNifEnv* env, ERL_NIF_TERM term,
EC_GROUP *group, EC_POINT **pptr);
#endif
+static ERL_NIF_TERM bin_from_bn(ErlNifEnv* env, const BIGNUM *bn);
static int library_refc = 0; /* number of users of this dynamic library */
@@ -465,6 +503,7 @@ static ErlNifFunc nif_funcs[] = {
{"aes_ctr_stream_encrypt", 2, aes_ctr_stream_encrypt},
{"aes_ctr_stream_decrypt", 2, aes_ctr_stream_encrypt},
{"strong_rand_bytes_nif", 1, strong_rand_bytes_nif},
+ {"strong_rand_range_nif", 1, strong_rand_range_nif},
{"rand_uniform_nif", 2, rand_uniform_nif},
{"mod_exp_nif", 4, mod_exp_nif},
{"dss_verify_nif", 4, dss_verify_nif},
@@ -476,6 +515,7 @@ static ErlNifFunc nif_funcs[] = {
{"dss_sign_nif", 3, dss_sign_nif},
{"rsa_public_crypt", 4, rsa_public_crypt},
{"rsa_private_crypt", 4, rsa_private_crypt},
+ {"rsa_generate_key_nif", 2, rsa_generate_key_nif},
{"dh_generate_parameters_nif", 2, dh_generate_parameters_nif},
{"dh_check", 1, dh_check},
{"dh_generate_key_nif", 4, dh_generate_key_nif},
@@ -925,6 +965,7 @@ static int initialize(ErlNifEnv* env, ERL_NIF_TERM load_info)
CRYPTO_set_dynlock_destroy_callback(ccb->dyn_destroy_function);
}
#endif /* OPENSSL_THREADS */
+
return 0;
}
@@ -1698,17 +1739,20 @@ static ERL_NIF_TERM block_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM
return enif_raise_exception(env, atom_notsup);
}
- if ((argv[0] == atom_aes_cfb8 || argv[0] == atom_aes_cfb128)
- && (key.size == 24 || key.size == 32)
-#ifdef FIPS_SUPPORT
- && !FIPS_mode()
-#endif
- ) {
+ if (argv[0] == atom_aes_cfb8
+ && (key.size == 24 || key.size == 32)) {
/* Why do EVP_CIPHER_CTX_set_key_length() fail on these key sizes?
* Fall back on low level API
*/
return aes_cfb_8_crypt(env, argc-1, argv+1);
}
+ else if (argv[0] == atom_aes_cfb128
+ && (key.size == 24 || key.size == 32)) {
+ /* Why do EVP_CIPHER_CTX_set_key_length() fail on these key sizes?
+ * Fall back on low level API
+ */
+ return aes_cfb_128_crypt_nif(env, argc-1, argv+1);
+ }
ivec_size = EVP_CIPHER_iv_length(cipher);
@@ -1784,6 +1828,31 @@ static ERL_NIF_TERM aes_cfb_8_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TERM
return ret;
}
+static ERL_NIF_TERM aes_cfb_128_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Key, IVec, Data, IsEncrypt) */
+ ErlNifBinary key, ivec, text;
+ AES_KEY aes_key;
+ unsigned char ivec_clone[16]; /* writable copy */
+ int new_ivlen = 0;
+ ERL_NIF_TERM ret;
+
+ if (!enif_inspect_iolist_as_binary(env, argv[0], &key)
+ || !(key.size == 16 || key.size == 24 || key.size == 32)
+ || !enif_inspect_binary(env, argv[1], &ivec) || ivec.size != 16
+ || !enif_inspect_iolist_as_binary(env, argv[2], &text)) {
+ return enif_make_badarg(env);
+ }
+
+ memcpy(ivec_clone, ivec.data, 16);
+ AES_set_encrypt_key(key.data, key.size * 8, &aes_key);
+ AES_cfb128_encrypt((unsigned char *) text.data,
+ enif_make_new_binary(env, text.size, &ret),
+ text.size, &aes_key, ivec_clone, &new_ivlen,
+ (argv[3] != atom_true));
+ CONSUME_REDS(env,text);
+ return ret;
+}
+
static ERL_NIF_TERM aes_ige_crypt_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Key, IVec, Data, IsEncrypt) */
#ifdef HAVE_AES_IGE
@@ -2279,6 +2348,41 @@ static int get_bn_from_bin(ErlNifEnv* env, ERL_NIF_TERM term, BIGNUM** bnp)
return 1;
}
+static ERL_NIF_TERM bin_from_bn(ErlNifEnv* env, const BIGNUM *bn)
+{
+ int bn_len;
+ unsigned char *bin_ptr;
+ ERL_NIF_TERM term;
+
+ /* Copy the bignum into an erlang binary. */
+ bn_len = BN_num_bytes(bn);
+ bin_ptr = enif_make_new_binary(env, bn_len, &term);
+ BN_bn2bin(bn, bin_ptr);
+
+ return term;
+}
+
+static ERL_NIF_TERM strong_rand_range_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (Range) */
+ BIGNUM *bn_range, *bn_rand;
+ ERL_NIF_TERM ret;
+
+ if(!get_bn_from_bin(env, argv[0], &bn_range)) {
+ return enif_make_badarg(env);
+ }
+
+ bn_rand = BN_new();
+ if (BN_rand_range(bn_rand, bn_range) != 1) {
+ ret = atom_false;
+ }
+ else {
+ ret = bin_from_bn(env, bn_rand);
+ }
+ BN_free(bn_rand);
+ BN_free(bn_range);
+ return ret;
+}
+
static ERL_NIF_TERM rand_uniform_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (Lo,Hi) */
BIGNUM *bn_from = NULL, *bn_to, *bn_rand;
@@ -2850,6 +2954,119 @@ static ERL_NIF_TERM rsa_private_crypt(ErlNifEnv* env, int argc, const ERL_NIF_TE
}
}
+/* Creates a term which can be parsed by get_rsa_private_key(). This is a list of plain integer binaries (not mpints). */
+static ERL_NIF_TERM put_rsa_private_key(ErlNifEnv* env, const RSA *rsa)
+{
+ ERL_NIF_TERM result[8];
+ const BIGNUM *n, *e, *d, *p, *q, *dmp1, *dmq1, *iqmp;
+
+ /* Return at least [E,N,D] */
+ n = NULL; e = NULL; d = NULL;
+ RSA_get0_key(rsa, &n, &e, &d);
+
+ result[0] = bin_from_bn(env, e); // Exponent E
+ result[1] = bin_from_bn(env, n); // Modulus N = p*q
+ result[2] = bin_from_bn(env, d); // Exponent D
+
+ /* Check whether the optional additional parameters are available */
+ p = NULL; q = NULL;
+ RSA_get0_factors(rsa, &p, &q);
+ dmp1 = NULL; dmq1 = NULL; iqmp = NULL;
+ RSA_get0_crt_params(rsa, &dmp1, &dmq1, &iqmp);
+
+ if (p && q && dmp1 && dmq1 && iqmp) {
+ result[3] = bin_from_bn(env, p); // Factor p
+ result[4] = bin_from_bn(env, q); // Factor q
+ result[5] = bin_from_bn(env, dmp1); // D mod (p-1)
+ result[6] = bin_from_bn(env, dmq1); // D mod (q-1)
+ result[7] = bin_from_bn(env, iqmp); // (1/q) mod p
+
+ return enif_make_list_from_array(env, result, 8);
+ } else {
+ return enif_make_list_from_array(env, result, 3);
+ }
+}
+
+static int check_erlang_interrupt(int maj, int min, BN_GENCB *ctxt)
+{
+ ErlNifEnv *env = BN_GENCB_get_arg(ctxt);
+
+ if (!enif_is_current_process_alive(env)) {
+ return 0;
+ } else {
+ return 1;
+ }
+}
+
+static ERL_NIF_TERM rsa_generate_key(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{/* (ModulusSize, PublicExponent) */
+ int modulus_bits;
+ BIGNUM *pub_exp, *three;
+ RSA *rsa;
+ int success;
+ ERL_NIF_TERM result;
+ BN_GENCB *intr_cb;
+#ifndef HAVE_OPAQUE_BN_GENCB
+ BN_GENCB intr_cb_buf;
+#endif
+
+ if (!enif_get_int(env, argv[0], &modulus_bits) || modulus_bits < 256) {
+ return enif_make_badarg(env);
+ }
+
+ if (!get_bn_from_bin(env, argv[1], &pub_exp)) {
+ return enif_make_badarg(env);
+ }
+
+ /* Make sure the public exponent is large enough (at least 3).
+ * Without this, RSA_generate_key_ex() can run forever. */
+ three = BN_new();
+ BN_set_word(three, 3);
+ success = BN_cmp(pub_exp, three);
+ BN_free(three);
+ if (success < 0) {
+ BN_free(pub_exp);
+ return enif_make_badarg(env);
+ }
+
+ /* For large keys, prime generation can take many seconds. Set up
+ * the callback which we use to test whether the process has been
+ * interrupted. */
+#ifdef HAVE_OPAQUE_BN_GENCB
+ intr_cb = BN_GENCB_new();
+#else
+ intr_cb = &intr_cb_buf;
+#endif
+ BN_GENCB_set(intr_cb, check_erlang_interrupt, env);
+
+ rsa = RSA_new();
+ success = RSA_generate_key_ex(rsa, modulus_bits, pub_exp, intr_cb);
+ BN_free(pub_exp);
+
+#ifdef HAVE_OPAQUE_BN_GENCB
+ BN_GENCB_free(intr_cb);
+#endif
+
+ if (!success) {
+ RSA_free(rsa);
+ return atom_error;
+ }
+
+ result = put_rsa_private_key(env, rsa);
+ RSA_free(rsa);
+
+ return result;
+}
+
+static ERL_NIF_TERM rsa_generate_key_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
+{
+ /* RSA key generation can take a long time (>1 sec for a large
+ * modulus), so schedule it as a CPU-bound operation. */
+ return enif_schedule_nif(env, "rsa_generate_key",
+ ERL_NIF_DIRTY_JOB_CPU_BOUND,
+ rsa_generate_key, argc, argv);
+}
+
static ERL_NIF_TERM dh_generate_parameters_nif(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{/* (PrimeLen, Generator) */
int prime_len, generator;
diff --git a/lib/crypto/doc/src/crypto.xml b/lib/crypto/doc/src/crypto.xml
index a4b34657ba..2718ee9055 100644
--- a/lib/crypto/doc/src/crypto.xml
+++ b/lib/crypto/doc/src/crypto.xml
@@ -77,7 +77,7 @@
<code>rsa_private() = [key_value()] = [E, N, D] | [E, N, D, P1, P2, E1, E2, C] </code>
<p>Where E is the public exponent, N is public modulus and D is
- the private exponent.The longer key format contains redundant
+ the private exponent. The longer key format contains redundant
information that will make the calculation faster. P1,P2 are first
and second prime factors. E1,E2 are first and second exponents. C
is the CRT coefficient. Terminology is taken from <url href="http://www.ietf.org/rfc/rfc3477.txt"> RFC 3447</url>.</p>
@@ -298,22 +298,32 @@
<func>
<name>generate_key(Type, Params) -> {PublicKey, PrivKeyOut} </name>
<name>generate_key(Type, Params, PrivKeyIn) -> {PublicKey, PrivKeyOut} </name>
- <fsummary>Generates a public keys of type <c>Type</c></fsummary>
+ <fsummary>Generates a public key of type <c>Type</c></fsummary>
<type>
- <v> Type = dh | ecdh | srp </v>
- <v>Params = dh_params() | ecdh_params() | SrpUserParams | SrpHostParams </v>
+ <v> Type = dh | ecdh | rsa | srp </v>
+ <v>Params = dh_params() | ecdh_params() | RsaParams | SrpUserParams | SrpHostParams </v>
+ <v>RsaParams = {ModulusSizeInBits::integer(), PublicExponent::key_value()}</v>
<v>SrpUserParams = {user, [Generator::binary(), Prime::binary(), Version::atom()]}</v>
<v>SrpHostParams = {host, [Verifier::binary(), Generator::binary(), Prime::binary(), Version::atom()]}</v>
- <v>PublicKey = dh_public() | ecdh_public() | srp_public() </v>
+ <v>PublicKey = dh_public() | ecdh_public() | rsa_public() | srp_public() </v>
<v>PrivKeyIn = undefined | dh_private() | ecdh_private() | srp_private() </v>
- <v>PrivKeyOut = dh_private() | ecdh_private() | srp_private() </v>
+ <v>PrivKeyOut = dh_private() | ecdh_private() | rsa_private() | srp_private() </v>
</type>
<desc>
- <p>Generates public keys of type <c>Type</c>.
- See also <seealso marker="public_key:public_key#generate_key-1">public_key:generate_key/1</seealso>
- May throw exception <c>low_entropy</c> in case the random generator
- failed due to lack of secure "randomness".
- </p>
+ <p>Generates a public key of type <c>Type</c>.
+ See also <seealso marker="public_key:public_key#generate_key-1">public_key:generate_key/1</seealso>.
+ May throw exception an exception of class <c>error</c>:
+ </p>
+ <list type="bulleted">
+ <item><c>badarg</c>: an argument is of wrong type or has an illegal value,</item>
+ <item><c>low_entropy</c>: the random generator failed due to lack of secure "randomness",</item>
+ <item><c>computation_failed</c>: the computation fails of another reason than <c>low_entropy</c>.</item>
+ </list>
+ <note>
+ <p>RSA key generation is only available if the runtime was
+ built with dirty scheduler support. Otherwise, attempting to
+ generate an RSA key will throw exception <c>error:notsup</c>.</p>
+ </note>
</desc>
</func>
@@ -511,7 +521,7 @@
scheme. <c>VerStr</c> contains a text variant of the version.</p>
<pre>
> <input>info_lib().</input>
-[{&lt;&lt;"OpenSSL"&gt;&gt;,9469983,&lt;&lt;"OpenSSL 0.9.8a 11 Oct 2005"&gt;&gt;}]
+[{&lt;&lt;"OpenSSL"&gt;&gt;,269484095,&lt;&lt;"OpenSSL 1.1.0c 10 Nov 2016""&gt;&gt;}]
</pre>
<note><p>
From OTP R16 the <em>numeric version</em> represents the version of the OpenSSL
@@ -648,10 +658,11 @@
</type>
<desc>
<p>Set the seed for PRNG to the given binary. This calls the
- RAND_seed function from openssl. Only use this if the system
- you are running on does not have enough "randomness" built in.
- Normally this is when <seealso marker="#strong_rand_bytes/1">
- strong_rand_bytes/1</seealso> returns <c>low_entropy</c></p>
+ RAND_seed function from openssl. Only use this if the system
+ you are running on does not have enough "randomness" built in.
+ Normally this is when
+ <seealso marker="#strong_rand_bytes/1">strong_rand_bytes/1</seealso>
+ throws <c>low_entropy</c></p>
</desc>
</func>
@@ -718,6 +729,43 @@
failed due to lack of secure "randomness".</p>
</desc>
</func>
+
+ <func>
+ <name>rand_seed() -> rand:state()</name>
+ <fsummary>Strong random number generation plugin state</fsummary>
+ <desc>
+ <p>
+ Creates state object for
+ <seealso marker="stdlib:rand">random number generation</seealso>,
+ in order to generate cryptographically strong random numbers
+ (based on OpenSSL's <c>BN_rand_range</c>),
+ and saves it on process dictionary before returning it as well.
+ See also
+ <seealso marker="stdlib:rand#seed-1">rand:seed/1</seealso>.
+ </p>
+ <p><em>Example</em></p>
+ <pre>
+_ = crypto:rand_seed(),
+_IntegerValue = rand:uniform(42), % [1; 42]
+_FloatValue = rand:uniform(). % [0.0; 1.0[</pre>
+ </desc>
+ </func>
+
+ <func>
+ <name>rand_seed_s() -> rand:state()</name>
+ <fsummary>Strong random number generation plugin state</fsummary>
+ <desc>
+ <p>
+ Creates state object for
+ <seealso marker="stdlib:rand">random number generation</seealso>,
+ in order to generate cryptographically strongly random numbers
+ (based on OpenSSL's <c>BN_rand_range</c>).
+ See also
+ <seealso marker="stdlib:rand#seed_s-1">rand:seed_s/1</seealso>.
+ </p>
+ </desc>
+ </func>
+
<func>
<name>stream_init(Type, Key) -> State</name>
<fsummary></fsummary>
diff --git a/lib/crypto/doc/src/crypto_app.xml b/lib/crypto/doc/src/crypto_app.xml
index a958bdfcb7..6950dfeec3 100644
--- a/lib/crypto/doc/src/crypto_app.xml
+++ b/lib/crypto/doc/src/crypto_app.xml
@@ -42,9 +42,12 @@
<title>DEPENDENCIES</title>
<p>The current crypto implementation uses nifs to interface
- OpenSSLs crypto library and requires <em>OpenSSL</em> package
- version 0.9.8 or higher. FIPS mode support requires at least
- version 1.0.1 and a FIPS capable OpenSSL installation.</p>
+ OpenSSLs crypto library and may work with limited functionality
+ with as old versions as <em>OpenSSL</em> 0.9.8c.
+ FIPS mode support requires at least
+ version 1.0.1 and a FIPS capable OpenSSL installation. We recommend using a
+ version that is officially supported by the OpenSSL project. API compatible backends like
+ LibreSSL should also work.</p>
<p>Source releases of OpenSSL can be downloaded from the <url href="http://www.openssl.org">OpenSSL</url> project home page,
or mirror sites listed there.
diff --git a/lib/crypto/doc/src/notes.xml b/lib/crypto/doc/src/notes.xml
index 53ea6bb58b..887aeca680 100644
--- a/lib/crypto/doc/src/notes.xml
+++ b/lib/crypto/doc/src/notes.xml
@@ -31,6 +31,40 @@
</header>
<p>This document describes the changes made to the Crypto application.</p>
+<section><title>Crypto 3.7.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix a bug with AES CFB 128 for 192 and 256 bit keys.
+ Thanks to kellymclaughlin !</p>
+ <p>
+ Own Id: OTP-14313 Aux Id: PR-1393 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Crypto 3.7.3</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The implementation of the key exchange algorithms
+ diffie-hellman-group-exchange-sha* are optimized, up to a
+ factor of 11 for the slowest ( = biggest and safest)
+ group size.</p>
+ <p>
+ Own Id: OTP-14169 Aux Id: seq-13261 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Crypto 3.7.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/crypto/src/crypto.app.src b/lib/crypto/src/crypto.app.src
index 460894c012..3bf4279ae1 100644
--- a/lib/crypto/src/crypto.app.src
+++ b/lib/crypto/src/crypto.app.src
@@ -25,6 +25,6 @@
{registered, []},
{applications, [kernel, stdlib]},
{env, [{fips_mode, false}]},
- {runtime_dependencies, ["erts-6.0","stdlib-2.0","kernel-3.0"]}]}.
+ {runtime_dependencies, ["erts-9.0","stdlib-3.4","kernel-5.3"]}]}.
diff --git a/lib/crypto/src/crypto.erl b/lib/crypto/src/crypto.erl
index 5a915d4233..765998b85d 100644
--- a/lib/crypto/src/crypto.erl
+++ b/lib/crypto/src/crypto.erl
@@ -30,6 +30,11 @@
-export([hmac/3, hmac/4, hmac_init/2, hmac_update/2, hmac_final/1, hmac_final_n/2]).
-export([cmac/3, cmac/4]).
-export([exor/2, strong_rand_bytes/1, mod_pow/3]).
+-export([rand_seed/0]).
+-export([rand_seed_s/0]).
+-export([rand_plugin_next/1]).
+-export([rand_plugin_uniform/1]).
+-export([rand_plugin_uniform/2]).
-export([rand_uniform/2]).
-export([block_encrypt/3, block_decrypt/3, block_encrypt/4, block_decrypt/4]).
-export([next_iv/2, next_iv/3]).
@@ -40,9 +45,14 @@
-export([ec_curve/1, ec_curves/0]).
-export([rand_seed/1]).
+-deprecated({rand_uniform, 2, next_major_release}).
+
%% This should correspond to the similar macro in crypto.c
-define(MAX_BYTES_TO_NIF, 20000). %% Current value is: erlang:system_info(context_reductions) * 10
+%% Used by strong_rand_float/0
+-define(HALF_DBL_EPSILON, 1.1102230246251565e-16). % math:pow(2, -53)
+
%%-type ecdsa_digest_type() :: 'md5' | 'sha' | 'sha256' | 'sha384' | 'sha512'.
-type crypto_integer() :: binary() | integer().
%%-type ec_named_curve() :: atom().
@@ -54,6 +64,7 @@
%%-type ec_curve() :: ec_named_curve() | ec_curve_spec().
%%-type ec_key() :: {Curve :: ec_curve(), PrivKey :: binary() | undefined, PubKey :: ec_point() | undefined}.
+-compile(no_native).
-on_load(on_load/0).
-define(CRYPTO_NIF_VSN,302).
@@ -283,9 +294,11 @@ stream_decrypt(State, Data0) ->
stream_crypt(fun do_stream_decrypt/2, State, Data, erlang:byte_size(Data), MaxByts, []).
%%
-%% RAND - pseudo random numbers using RN_ functions in crypto lib
+%% RAND - pseudo random numbers using RN_ and BN_ functions in crypto lib
%%
-spec strong_rand_bytes(non_neg_integer()) -> binary().
+-spec rand_seed() -> rand:state().
+-spec rand_seed_s() -> rand:state().
-spec rand_uniform(crypto_integer(), crypto_integer()) ->
crypto_integer().
@@ -297,6 +310,43 @@ strong_rand_bytes(Bytes) ->
strong_rand_bytes_nif(_Bytes) -> ?nif_stub.
+rand_seed() ->
+ rand:seed(rand_seed_s()).
+
+rand_seed_s() ->
+ {#{ type => ?MODULE,
+ bits => 64,
+ next => fun ?MODULE:rand_plugin_next/1,
+ uniform => fun ?MODULE:rand_plugin_uniform/1,
+ uniform_n => fun ?MODULE:rand_plugin_uniform/2},
+ no_seed}.
+
+rand_plugin_next(Seed) ->
+ {bytes_to_integer(strong_rand_range(1 bsl 64)), Seed}.
+
+rand_plugin_uniform(State) ->
+ {strong_rand_float(), State}.
+
+rand_plugin_uniform(Max, State) ->
+ {bytes_to_integer(strong_rand_range(Max)) + 1, State}.
+
+
+strong_rand_range(Range) when is_integer(Range), Range > 0 ->
+ BinRange = int_to_bin(Range),
+ strong_rand_range(BinRange);
+strong_rand_range(BinRange) when is_binary(BinRange) ->
+ case strong_rand_range_nif(BinRange) of
+ false ->
+ erlang:error(low_entropy);
+ <<BinResult/binary>> ->
+ BinResult
+ end.
+strong_rand_range_nif(_BinRange) -> ?nif_stub.
+
+strong_rand_float() ->
+ WholeRange = strong_rand_range(1 bsl 53),
+ ?HALF_DBL_EPSILON * bytes_to_integer(WholeRange).
+
rand_uniform(From,To) when is_binary(From), is_binary(To) ->
case rand_uniform_nif(From,To) of
<<Len:32/integer, MSB, Rest/binary>> when MSB > 127 ->
@@ -325,6 +375,7 @@ rand_uniform_pos(_,_) ->
rand_uniform_nif(_From,_To) -> ?nif_stub.
+
-spec rand_seed(binary()) -> ok.
rand_seed(Seed) ->
rand_seed_nif(Seed).
@@ -452,6 +503,15 @@ generate_key(srp, {user, [Generator, Prime, Version]}, PrivateArg)
end,
user_srp_gen_key(Private, Generator, Prime);
+generate_key(rsa, {ModulusSize, PublicExponent}, undefined) ->
+ case rsa_generate_key_nif(ModulusSize, ensure_int_as_bin(PublicExponent)) of
+ error ->
+ erlang:error(computation_failed,
+ [rsa,{ModulusSize,PublicExponent}]);
+ Private ->
+ {lists:sublist(Private, 2), Private}
+ end;
+
generate_key(ecdh, Curve, PrivKey) ->
ec_key_generate(nif_curve_params(Curve), ensure_int_as_bin(PrivKey)).
@@ -787,6 +847,11 @@ rsa_verify_nif(_Type, _Digest, _Signature, _Key) -> ?nif_stub.
ecdsa_verify_nif(_Type, _Digest, _Signature, _Curve, _Key) -> ?nif_stub.
%% Public Keys --------------------------------------------------------------------
+%% RSA Rivest-Shamir-Adleman functions
+%%
+
+rsa_generate_key_nif(_Bits, _Exp) -> ?nif_stub.
+
%% DH Diffie-Hellman functions
%%
diff --git a/lib/crypto/test/crypto_SUITE.erl b/lib/crypto/test/crypto_SUITE.erl
index 31f4e89ffe..54bd729e7e 100644
--- a/lib/crypto/test/crypto_SUITE.erl
+++ b/lib/crypto/test/crypto_SUITE.erl
@@ -36,7 +36,9 @@ all() ->
{group, non_fips},
mod_pow,
exor,
- rand_uniform
+ rand_uniform,
+ rand_plugin,
+ rand_plugin_s
].
groups() ->
@@ -119,7 +121,8 @@ groups() ->
{sha384, [], [hash, hmac]},
{sha512, [], [hash, hmac]},
{rsa, [], [sign_verify,
- public_encrypt
+ public_encrypt,
+ generate
]},
{dss, [], [sign_verify]},
{ecdsa, [], [sign_verify]},
@@ -247,6 +250,21 @@ init_per_testcase(cmac, Config) ->
% The CMAC functionality was introduced in OpenSSL 1.0.1
{skip, "OpenSSL is too old"}
end;
+init_per_testcase(generate, Config) ->
+ case proplists:get_value(type, Config) of
+ rsa ->
+ % RSA key generation is a lengthy process, and is only available
+ % if dirty CPU scheduler support was enabled for this runtime.
+ case try erlang:system_info(dirty_cpu_schedulers) of
+ N -> N > 0
+ catch
+ error:badarg -> false
+ end of
+ true -> Config;
+ false -> {skip, "RSA key generation requires dirty scheduler support."}
+ end;
+ _ -> Config
+ end;
init_per_testcase(_Name,Config) ->
Config.
@@ -470,6 +488,17 @@ rand_uniform(Config) when is_list(Config) ->
10 = byte_size(crypto:strong_rand_bytes(10)).
%%--------------------------------------------------------------------
+rand_plugin() ->
+ [{doc, "crypto rand plugin testing (implicit state / process dictionary)"}].
+rand_plugin(Config) when is_list(Config) ->
+ rand_plugin_aux(implicit_state).
+
+rand_plugin_s() ->
+ [{doc, "crypto rand plugin testing (explicit state)"}].
+rand_plugin_s(Config) when is_list(Config) ->
+ rand_plugin_aux(explicit_state).
+
+%%--------------------------------------------------------------------
%% Internal functions ------------------------------------------------
%%--------------------------------------------------------------------
hash(_, [], []) ->
@@ -756,7 +785,10 @@ do_generate({ecdh = Type, Curve, Priv, Pub}) ->
ok;
{Other, _} ->
ct:fail({{crypto, generate_key, [Type, Priv, Curve]}, {expected, Pub}, {got, Other}})
- end.
+ end;
+do_generate({rsa = Type, Mod, Exp}) ->
+ {Pub,Priv} = crypto:generate_key(Type, {Mod,Exp}),
+ do_sign_verify({rsa, sha256, Pub, Priv, rsa_plain()}).
notsup(Fun, Args) ->
Result =
@@ -932,6 +964,101 @@ crypto_rand_uniform(L,H) ->
ct:fail({"Not in interval", R1, L, H})
end.
+foldallmap(_Fun, AccN, []) ->
+ {true, AccN};
+foldallmap(Fun, AccN, [H|T]) ->
+ case Fun(H, AccN) of
+ {true, AccM} -> foldallmap(Fun, AccM, T);
+ {{false, Result}, AccM} -> {Result, AccM}
+ end.
+
+allmap(_Fun, []) ->
+ true;
+allmap(Fun, [H|T]) ->
+ case Fun(H) of
+ true -> allmap(Fun, T);
+ {false, Result} -> Result
+ end.
+
+rand_plugin_aux(StateType) ->
+ {Seeder, SeedExporter, FloatGenerator, IntegerGenerator} = rand_plugin_functions(StateType),
+ State0 = Seeder(),
+ {crypto, no_seed} = SeedExporter(State0),
+ {FloatTestResult, State1} = rand_plugin_aux_floats(State0, FloatGenerator),
+ case FloatTestResult of
+ true ->
+ {IntegerTestResult, _State2} = rand_plugin_aux_integers(State1, IntegerGenerator),
+ IntegerTestResult;
+ {false, _} ->
+ FloatTestResult
+ end.
+
+% returns {Seeder, SeedExporter, FloatGenerator, IntegerGenerator} with consistent signatures
+rand_plugin_functions(implicit_state) ->
+ {fun () -> crypto:rand_seed(), implicit_state end,
+ fun (implicit_state) -> rand:export_seed() end,
+ fun (implicit_state) -> {rand:uniform(), implicit_state} end,
+ fun (N, implicit_state) -> {rand:uniform(N), implicit_state} end};
+rand_plugin_functions(explicit_state) ->
+ {fun crypto:rand_seed_s/0,
+ fun rand:export_seed_s/1,
+ fun rand:uniform_s/1,
+ fun rand:uniform_s/2}.
+
+rand_plugin_aux_floats(State0, FloatGenerator) ->
+ {FloatSamples, State1} =
+ lists:mapfoldl(
+ fun (_, StateAcc) ->
+ FloatGenerator(StateAcc)
+ end,
+ State0,
+ lists:seq(1, 10000)),
+
+ {allmap(
+ fun (V) ->
+ (V >= 0.0 andalso V < 1.0)
+ orelse {false, ct:fail({"Float sample not in interval", V, 0.0, 1.0})}
+ end,
+ FloatSamples),
+ State1}.
+
+rand_plugin_aux_integers(State0, IntegerGenerator) ->
+ MaxIntegerCeiling = 1 bsl 32,
+ {IntegerCeilings, State1} =
+ lists:mapfoldl(
+ fun (_, StateAcc) ->
+ IntegerGenerator(MaxIntegerCeiling, StateAcc)
+ end,
+ State0,
+ lists:seq(1, 100)),
+
+ foldallmap(
+ fun (Ceiling, StateAcc) ->
+ case Ceiling >= 1 andalso Ceiling =< MaxIntegerCeiling of
+ false ->
+ {{false, ct:fail({"Integer ceiling not in interval",
+ Ceiling, 1, MaxIntegerCeiling})},
+ StateAcc};
+ true ->
+ foldallmap(
+ fun (_, SubStateAcc) ->
+ {Sample, NewSubStateAcc} = IntegerGenerator(Ceiling, SubStateAcc),
+ case Sample >= 1 andalso Sample =< Ceiling of
+ false ->
+ {{false, ct:fail({"Integer sample not in interval",
+ Sample, 1, Ceiling})},
+ NewSubStateAcc};
+ true ->
+ {true, NewSubStateAcc}
+ end
+ end,
+ StateAcc,
+ lists:seq(1, 100))
+ end
+ end,
+ State1,
+ IntegerCeilings).
+
%%--------------------------------------------------------------------
%% Test data ------------------------------------------------
%%--------------------------------------------------------------------
@@ -1008,7 +1135,8 @@ group_config(rsa = Type, Config) ->
rsa_oaep(),
no_padding()
],
- [{sign_verify, SignVerify}, {pub_priv_encrypt, PubPrivEnc} | Config];
+ Generate = [{rsa, 2048, 17}, {rsa, 3072, 65537}],
+ [{sign_verify, SignVerify}, {pub_priv_encrypt, PubPrivEnc}, {generate, Generate} | Config];
group_config(dss = Type, Config) ->
Msg = dss_plain(),
Public = dss_params() ++ [dss_public()],
diff --git a/lib/crypto/vsn.mk b/lib/crypto/vsn.mk
index 38e2db9033..f3e0623ac9 100644
--- a/lib/crypto/vsn.mk
+++ b/lib/crypto/vsn.mk
@@ -1 +1 @@
-CRYPTO_VSN = 3.7.2
+CRYPTO_VSN = 3.7.4
diff --git a/lib/debugger/src/dbg_ieval.erl b/lib/debugger/src/dbg_ieval.erl
index f5e079ef7e..88c7caacb0 100644
--- a/lib/debugger/src/dbg_ieval.erl
+++ b/lib/debugger/src/dbg_ieval.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1486,7 +1486,6 @@ guard_expr({map,_,E0,Fs0}, Bs) ->
Value = lists:foldl(fun ({map_assoc,K,V}, Mi) -> maps:put(K,V,Mi);
({map_exact,K,V}, Mi) -> maps:update(K,V,Mi) end,
E, Fs),
- io:format("~p~n", [{E,Value}]),
{value,Value};
guard_expr({bin,_,Flds}, Bs) ->
{value,V,_Bs} =
diff --git a/lib/debugger/src/dbg_wx_code.erl b/lib/debugger/src/dbg_wx_code.erl
index 473963500a..bca8a0d241 100644
--- a/lib/debugger/src/dbg_wx_code.erl
+++ b/lib/debugger/src/dbg_wx_code.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -190,6 +190,6 @@ find(Ed, Str, Case, Next) ->
keyWords() ->
L = ["after","begin","case","try","cond","catch","andalso","orelse",
- "end","fun","if","let","of","query","receive","when","bnot","not",
+ "end","fun","if","let","of","receive","when","bnot","not",
"div","rem","band","and","bor","bxor","bsl","bsr","or","xor"],
lists:flatten([K ++ " " || K <- L] ++ [0]).
diff --git a/lib/debugger/src/dbg_wx_src_view.erl b/lib/debugger/src/dbg_wx_src_view.erl
index 207c407fbc..ee8eb72407 100644
--- a/lib/debugger/src/dbg_wx_src_view.erl
+++ b/lib/debugger/src/dbg_wx_src_view.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -62,6 +62,6 @@ code_area(Parent, Sizer) ->
keyWords() ->
L = ["after","begin","case","try","cond","catch","andalso","orelse",
- "end","fun","if","let","of","query","receive","when","bnot","not",
+ "end","fun","if","let","of","receive","when","bnot","not",
"div","rem","band","and","bor","bxor","bsl","bsr","or","xor"],
lists:flatten([K ++ " " || K <- L] ++ [0]).
diff --git a/lib/debugger/src/dbg_wx_trace.erl b/lib/debugger/src/dbg_wx_trace.erl
index 29c8e8cefb..f4ee30618c 100644
--- a/lib/debugger/src/dbg_wx_trace.erl
+++ b/lib/debugger/src/dbg_wx_trace.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -524,7 +524,8 @@ gui_cmd({edit, {Var, Value}}, State) ->
cancel ->
State;
{Var, Term} ->
- Cmd = atom_to_list(Var)++"="++io_lib:format("~w", [Term]),
+ %% The space after "=" is needed for handling "B= <<1>>".
+ Cmd = atom_to_list(Var)++"= "++io_lib:format("~w", [Term]),
gui_cmd({user_command, lists:flatten(Cmd)}, State)
end.
diff --git a/lib/debugger/src/dbg_wx_win.erl b/lib/debugger/src/dbg_wx_win.erl
index d302423077..2c9d83ea74 100644
--- a/lib/debugger/src/dbg_wx_win.erl
+++ b/lib/debugger/src/dbg_wx_win.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -276,7 +276,7 @@ verify(Type, Str) ->
case erl_scan:string(Str) of
{ok, Tokens, _EndLine} when Type==term ->
- case erl_parse:parse_term(Tokens++[{dot, 1}]) of
+ case erl_parse:parse_term(Tokens++[{dot, erl_anno:new(1)}]) of
{ok, Value} -> {edit, Value};
_Error ->
ignore
diff --git a/lib/debugger/src/int.erl b/lib/debugger/src/int.erl
index e5bade9abe..fdf5957182 100644
--- a/lib/debugger/src/int.erl
+++ b/lib/debugger/src/int.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -533,7 +533,9 @@ load({Mod, Src, Beam, BeamBin, Exp, Abst}, Dist) ->
case erl_prim_loader:get_file(filename:absname(Src)) of
{ok, SrcBin, _} ->
MD5 = code:module_md5(BeamBin),
- Bin = term_to_binary({interpreter_module,Exp,Abst,SrcBin,MD5}),
+ SrcBin1 = unicode:characters_to_binary(SrcBin, enc(SrcBin)),
+ true = is_binary(SrcBin1),
+ Bin = term_to_binary({interpreter_module,Exp,Abst,SrcBin1,MD5}),
{module, Mod} = dbg_iserver:safe_call({load, Mod, Src, Bin}),
_ = everywhere(Dist,
fun() ->
diff --git a/lib/debugger/test/int_SUITE.erl b/lib/debugger/test/int_SUITE.erl
index f697ace4e5..cb1fcb83f3 100644
--- a/lib/debugger/test/int_SUITE.erl
+++ b/lib/debugger/test/int_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -241,7 +241,8 @@ interpretable(Config) when is_list(Config) ->
true = code:del_path(PrivDir),
%% {error, no_src}
- {ok, lists2, Binary} = compile:forms([{attribute,1,module,lists2}], []),
+ A1 = erl_anno:new(1),
+ {ok, lists2, Binary} = compile:forms([{attribute,A1,module,lists2}], []),
code:load_binary(lists2, "unknown", Binary),
{error, no_src} = int:interpretable(lists2),
diff --git a/lib/dialyzer/doc/src/Makefile b/lib/dialyzer/doc/src/Makefile
index 77d0a6fc68..8fe6cd30eb 100644
--- a/lib/dialyzer/doc/src/Makefile
+++ b/lib/dialyzer/doc/src/Makefile
@@ -34,7 +34,7 @@ RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
# Target Specs
# ----------------------------------------------------
XML_APPLICATION_FILES = ref_man.xml
-XML_REF3_FILES = dialyzer.xml
+XML_REF3_FILES = dialyzer.xml typer.xml
XML_PART_FILES = part.xml part_notes.xml
XML_CHAPTER_FILES = dialyzer_chapter.xml notes.xml
diff --git a/lib/dialyzer/doc/src/dialyzer.xml b/lib/dialyzer/doc/src/dialyzer.xml
index 4b7eb4ad68..e34ffd6def 100644
--- a/lib/dialyzer/doc/src/dialyzer.xml
+++ b/lib/dialyzer/doc/src/dialyzer.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2006</year><year>2016</year>
+ <year>2006</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -457,11 +457,6 @@ dialyzer --plts plt_1 ... plt_n -- files_to_analyze</code>
<c>gui/1</c></seealso> below (<c>WarnOpts</c>).</p>
<note>
- <p>Attribute <c>-dialyzer()</c> is not checked by the Erlang
- compiler, but by Dialyzer itself.</p>
- </note>
-
- <note>
<p>Warning option <c>-Wrace_conditions</c> has no effect when
set in source files.</p>
</note>
diff --git a/lib/dialyzer/doc/src/notes.xml b/lib/dialyzer/doc/src/notes.xml
index 54abd09504..cd4ec4c068 100644
--- a/lib/dialyzer/doc/src/notes.xml
+++ b/lib/dialyzer/doc/src/notes.xml
@@ -32,6 +32,48 @@
<p>This document describes the changes made to the Dialyzer
application.</p>
+<section><title>Dialyzer 3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Fix a bug concerning parameterized opaque types. </p>
+ <p>
+ Own Id: OTP-14130</p>
+ </item>
+ <item>
+ <p> Improve a few warnings. One of them could cause a
+ crash. </p>
+ <p>
+ Own Id: OTP-14177</p>
+ </item>
+ <item>
+ <p>The dialyzer and observer applications will now use a
+ portable way to find the home directory. That means that
+ there is no longer any need to manually set the HOME
+ environment variable on Windows.</p>
+ <p>
+ Own Id: OTP-14249 Aux Id: ERL-161 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p> The peak memory consumption is reduced. </p><p> The
+ evaluation of huge SCCs in <c>dialyzer_typesig</c> is
+ optimized. </p><p> Analyzing modules with binary
+ construction with huge strings is now much faster. </p>
+ <p>
+ Own Id: OTP-14126 Aux Id: ERL-308 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Dialyzer 3.0.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/dialyzer/doc/src/ref_man.xml b/lib/dialyzer/doc/src/ref_man.xml
index ddac047f2e..d820fc5e00 100644
--- a/lib/dialyzer/doc/src/ref_man.xml
+++ b/lib/dialyzer/doc/src/ref_man.xml
@@ -31,5 +31,6 @@
<description>
</description>
<xi:include href="dialyzer.xml"/>
+ <xi:include href="typer.xml"/>
</application>
diff --git a/lib/dialyzer/doc/src/typer.xml b/lib/dialyzer/doc/src/typer.xml
new file mode 100644
index 0000000000..abd7f07ccf
--- /dev/null
+++ b/lib/dialyzer/doc/src/typer.xml
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<erlref>
+ <header>
+ <copyright>
+ <year>2006</year><year>2016</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder>
+ </copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+
+ <title>typer</title>
+ <prepared></prepared>
+ <docno></docno>
+ <date>2017-04-13</date>
+ <rev></rev>
+ <file>type.xml</file>
+ </header>
+ <module>typer</module>
+ <modulesummary>Typer, a Type annotator for ERlang programs.
+ </modulesummary>
+ <description>
+ <p>TypEr shows type information for Erlang modules to the user.
+ Additionally, it can annotate the code of files with such type
+ information.</p>
+ </description>
+
+ <section>
+ <marker id="command_line"></marker>
+ <title>Using TypEr from the Command Line</title>
+ <p>TypEr is used from the command-line. This section provides a
+ brief description of the options. The same information can be
+ obtained by writing the following in a shell:</p>
+
+ <code type="none">
+typer --help</code>
+
+ <p><em>Usage:</em></p>
+
+ <code type="none">
+typer [--help] [--version] [--plt PLT] [--edoc]
+ [--show | --show-exported | --annotate | --annotate-inc-files]
+ [-Ddefine]* [-I include_dir]* [-pa dir]* [-pz dir]*
+ [-T application]* [-r] file*</code>
+
+ <note>
+ <p>* denotes that multiple occurrences of the option are possible.</p>
+ </note>
+
+ <p><em>Options:</em></p>
+
+ <taglist>
+
+ <tag><c>--r</c></tag>
+ <item>
+ <p>Search directories recursively for .erl files below them.</p>
+ </item>
+ <tag><c>--show</c></tag>
+ <item>
+ <p>Print type specifications for all functions on stdout.
+ (This is the default behaviour; this option is not really
+ needed.)</p>
+ </item>
+
+ <tag><c>--show-exported</c> (or <c>show_exported</c>)</tag>
+ <item>
+ <p>Same as <c>--show</c>, but print specifications for
+ exported functions only. Specs are displayed sorted
+ alphabetically on the function's name.</p>
+ </item>
+
+ <tag><c>--annotate</c></tag>
+ <item>
+ <p>Annotate the specified files with type specifications.</p>
+ </item>
+
+ <tag><c>--annotate-inc-files</c></tag>
+ <item>
+ <p>Same as <c>--annotate</c> but annotates all
+ <c>-include()</c> files as well as all .erl files. (Use this
+ option with caution - it has not been tested much).</p>
+ </item>
+
+ <tag><c>--edoc</c></tag>
+ <item>
+ <p>Print type information as Edoc <c>@spec</c> comments, not
+ as type specs.</p>
+ </item>
+
+ <tag><c>--plt</c></tag>
+ <item>
+ <p>Use the specified dialyzer PLT file rather than the default one.</p>
+ </item>
+
+ <tag><c>-T file*</c></tag>
+ <item>
+ <p>The specified file(s) already contain type specifications
+ and these are to be trusted in order to print specs for the
+ rest of the files. (Multiple files or dirs, separated by
+ spaces, can be specified.)</p>
+ </item>
+
+ <tag><c>-Dname</c> (or <c>-Dname=value</c>)</tag>
+ <item>
+ <p>Pass the defined name(s) to TypEr. (**)</p>
+ </item>
+
+ <tag><c>-I</c></tag>
+ <item>
+ <p>Pass the include_dir to TypEr. (**)</p>
+ </item>
+
+ <tag><c>-pa dir</c></tag>
+ <item>
+ <p>Include <c>dir</c> in the path for Erlang. This is useful
+ when analyzing files that have <c>-include_lib()</c>
+ directives or use parse transforms.</p>
+ </item>
+
+ <tag><c>-pz dir</c></tag>
+ <item>
+ <p>Include <c>dir</c> in the path for Erlang. This is useful
+ when analyzing files that have <c>-include_lib()</c>
+ directives or use parse transforms.</p>
+ </item>
+
+ <tag><c>--version</c> (or <c>-v</c>)</tag>
+ <item>
+ <p>Print the TypEr version and some more information and
+ exit.</p>
+ </item>
+
+ </taglist>
+
+ <note>
+ <p>** options <c>-D</c> and <c>-I</c> work both
+ from the command line and in the TypEr GUI; the syntax of
+ defines and includes is the same as that used by
+ <seealso marker="erts:erlc">erlc(1)</seealso>.</p>
+ </note>
+
+ </section>
+
+</erlref>
diff --git a/lib/dialyzer/src/Makefile b/lib/dialyzer/src/Makefile
index 256f20f549..28f74ed441 100644
--- a/lib/dialyzer/src/Makefile
+++ b/lib/dialyzer/src/Makefile
@@ -68,7 +68,8 @@ MODULES = \
dialyzer_typesig \
dialyzer_coordinator \
dialyzer_worker \
- dialyzer_utils
+ dialyzer_utils \
+ typer
HRL_FILES= dialyzer.hrl dialyzer_gui_wx.hrl
ERL_FILES= $(MODULES:%=%.erl)
@@ -117,6 +118,9 @@ $(EBIN)/dialyzer_plt.$(EMULATOR): dialyzer_plt.erl ../vsn.mk
$(EBIN)/dialyzer_gui_wx.$(EMULATOR): dialyzer_gui_wx.erl ../vsn.mk
$(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) dialyzer_gui_wx.erl
+$(EBIN)/typer.$(EMULATOR): typer.erl ../vsn.mk
+ $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) typer.erl
+
$(APP_TARGET): $(APP_SRC) ../vsn.mk
$(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
diff --git a/lib/dialyzer/src/dialyzer.app.src b/lib/dialyzer/src/dialyzer.app.src
index f517c51ec1..5f803875b0 100644
--- a/lib/dialyzer/src/dialyzer.app.src
+++ b/lib/dialyzer/src/dialyzer.app.src
@@ -43,7 +43,8 @@
dialyzer_typesig,
dialyzer_utils,
dialyzer_timing,
- dialyzer_worker]},
+ dialyzer_worker,
+ typer]},
{registered, []},
{applications, [compiler, hipe, kernel, stdlib, wx]},
{env, []},
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl
index dc2238e63a..4c29b4f1eb 100644
--- a/lib/dialyzer/src/dialyzer_dataflow.erl
+++ b/lib/dialyzer/src/dialyzer_dataflow.erl
@@ -1344,8 +1344,6 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) ->
{Msg, Force} =
case t_is_none(ArgType0) of
true ->
- PatString = format_patterns(Pats),
- PatTypes = [PatString, format_type(OrigArgType, State1)],
%% See if this is covered by an earlier clause or if it
%% simply cannot match
OrigArgTypes =
@@ -1353,14 +1351,24 @@ do_clause(C, Arg, ArgType0, OrigArgType, Map, State, Warns) ->
true -> Any = t_any(), [Any || _ <- Pats];
false -> t_to_tlist(OrigArgType)
end,
+ PatString = format_patterns(Pats),
+ ArgTypeString = format_type(OrigArgType, State1),
+ BindResOrig =
+ bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1),
Tag =
- case bind_pat_vars(Pats, OrigArgTypes, [], Map1, State1) of
+ case BindResOrig of
{error, bind, _, _, _} -> pattern_match;
{error, record, _, _, _} -> record_match;
{error, opaque, _, _, _} -> opaque_match;
{_, _} -> pattern_match_cov
end,
- {{Tag, PatTypes}, false};
+ PatTypes = case BindResOrig of
+ {error, opaque, _, _, OpaqueType} ->
+ [PatString, ArgTypeString,
+ format_type(OpaqueType, State1)];
+ _ -> [PatString, ArgTypeString]
+ end,
+ {{Tag, PatTypes}, false};
false ->
%% Try to find out if this is a default clause in a list
%% comprehension and suppress this. A real Hack(tm)
diff --git a/lib/dialyzer/src/dialyzer_options.erl b/lib/dialyzer/src/dialyzer_options.erl
index 616e8834f5..ec3f41311d 100644
--- a/lib/dialyzer/src/dialyzer_options.erl
+++ b/lib/dialyzer/src/dialyzer_options.erl
@@ -277,6 +277,9 @@ assert_solvers([Term|_]) ->
-spec build_warnings([atom()], dial_warn_tags()) -> dial_warn_tags().
+%% The warning options are checked by the code linter.
+%% The function erl_lint:is_module_dialyzer_option/1 must
+%% be updated if options are added or removed.
build_warnings([Opt|Opts], Warnings) ->
NewWarnings =
case Opt of
diff --git a/lib/dialyzer/src/dialyzer_typesig.erl b/lib/dialyzer/src/dialyzer_typesig.erl
index c4f8adf7ee..c3ba44fde7 100644
--- a/lib/dialyzer/src/dialyzer_typesig.erl
+++ b/lib/dialyzer/src/dialyzer_typesig.erl
@@ -2080,8 +2080,6 @@ v2_solve_disjunct(Disj, Map, V2State0) ->
var_occurs_everywhere(V, Masks, NotFailed) ->
ordsets:is_subset(NotFailed, get_mask(V, Masks)).
--dialyzer({no_improper_lists, [v2_solve_disj/10, v2_solve_conj/12]}).
-
v2_solve_disj([I|Is], [C|Cs], I, Map0, V2State0, UL, MapL, Eval, Uneval,
Failed0) ->
Id = C#constraint_list.id,
@@ -2100,10 +2098,10 @@ v2_solve_disj([I|Is], [C|Cs], I, Map0, V2State0, UL, MapL, Eval, Uneval,
end;
v2_solve_disj([], [], _I, _Map, V2State, UL, MapL, Eval, Uneval, Failed) ->
{ok, V2State, lists:reverse(Eval), UL, MapL, lists:reverse(Uneval), Failed};
-v2_solve_disj(every_i, Cs, I, Map, V2State, UL, MapL, Eval, Uneval, Failed) ->
+v2_solve_disj([every_i], Cs, I, Map, V2State, UL, MapL, Eval, Uneval, Failed) ->
NewIs = case Cs of
[] -> [];
- _ -> [I|every_i]
+ _ -> [I, every_i]
end,
v2_solve_disj(NewIs, Cs, I, Map, V2State, UL, MapL, Eval, Uneval, Failed);
v2_solve_disj(Is, [C|Cs], I, Map, V2State, UL, MapL, Eval, Uneval0, Failed) ->
@@ -2199,11 +2197,11 @@ v2_solve_conj([], _Cs, _I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
v2_solve_conj(NewFlags, Cs, 1, Map, Conj, IsFlat, V2State,
[], [], [U|VarsUp], Map, NewFlags)
end;
-v2_solve_conj(every_i, Cs, I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
+v2_solve_conj([every_i], Cs, I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
LastMap, LastFlags) ->
NewIs = case Cs of
[] -> [];
- _ -> [I|every_i]
+ _ -> [I, every_i]
end,
v2_solve_conj(NewIs, Cs, I, Map, Conj, IsFlat, V2State, UL, NewFs, VarsUp,
LastMap, LastFlags);
@@ -2225,8 +2223,8 @@ add_mask_to_flags(Flags, [Im|M], I, L) when I > Im ->
add_mask_to_flags(Flags, [_|M], _I, L) ->
{umerge_mask(Flags, M), lists:reverse(L)}.
-umerge_mask(every_i, _F) ->
- every_i;
+umerge_mask([every_i]=Is, _F) ->
+ Is;
umerge_mask(Is, F) ->
lists:umerge(Is, F).
@@ -2242,7 +2240,7 @@ get_flags(#v2_state{constr_data = ConData}=V2State0, C) ->
error ->
?debug("get_flags Id=~w Flags=all ~w\n", [Id, length(Cs)]),
V2State = V2State0#v2_state{constr_data = maps:put(Id, {[],[]}, ConData)},
- {V2State, every_i};
+ {V2State, [every_i]};
{ok, failed} ->
{V2State0, failed_list};
{ok, {Part,U}} when U =/= [] ->
diff --git a/lib/typer/src/typer.erl b/lib/dialyzer/src/typer.erl
index 18c4fe902d..18c4fe902d 100644
--- a/lib/typer/src/typer.erl
+++ b/lib/dialyzer/src/typer.erl
diff --git a/lib/dialyzer/test/Makefile b/lib/dialyzer/test/Makefile
index 0d8fba438c..43c8a61ce1 100644
--- a/lib/dialyzer/test/Makefile
+++ b/lib/dialyzer/test/Makefile
@@ -13,7 +13,8 @@ AUXILIARY_FILES=\
file_utils.erl\
dialyzer_SUITE.erl\
abstract_SUITE.erl\
- plt_SUITE.erl
+ plt_SUITE.erl\
+ typer_SUITE.erl
# ----------------------------------------------------
# Release directory specification
diff --git a/lib/dialyzer/test/abstract_SUITE.erl b/lib/dialyzer/test/abstract_SUITE.erl
index 0e84dfab24..37fb39cf27 100644
--- a/lib/dialyzer/test/abstract_SUITE.erl
+++ b/lib/dialyzer/test/abstract_SUITE.erl
@@ -83,7 +83,8 @@ generated_case(Config) when is_list(Config) ->
Config, [], []),
ok.
-test(Prog, Config, COpts, DOpts) ->
+test(Prog0, Config, COpts, DOpts) ->
+ Prog = erl_parse:anno_from_term(Prog0),
{ok, BeamFile} = compile(Config, Prog, COpts),
run_dialyzer(Config, succ_typings, [BeamFile], DOpts).
diff --git a/lib/dialyzer/test/opaque_SUITE_data/results/weird b/lib/dialyzer/test/opaque_SUITE_data/results/weird
new file mode 100644
index 0000000000..d7f57cd152
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/results/weird
@@ -0,0 +1,6 @@
+
+weird_warning1.erl:15: Matching of pattern {'a', Dict} tagged with a record name violates the declared type of #b{q::queue:queue(_)}
+weird_warning2.erl:13: Matching of pattern <{'b', Queue}, Key, Value> tagged with a record name violates the declared type of <#a{d::dict:dict(_,_)},'my_key','my_value'>
+weird_warning3.erl:14: The call weird_warning3:add_element(#a{d::queue:queue(_)},'my_key','my_value') does not have a term of type #a{d::dict:dict(_,_)} | #b{q::queue:queue(_)} (with opaque subterms) as 1st argument
+weird_warning3.erl:16: The attempt to match a term of type #a{d::queue:queue(_)} against the pattern {'a', Dict} breaks the opacity of queue:queue(_)
+weird_warning3.erl:18: Matching of pattern {'b', Queue} tagged with a record name violates the declared type of #a{d::queue:queue(_)}
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl
new file mode 100644
index 0000000000..094138e72b
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning1.erl
@@ -0,0 +1,18 @@
+-module(weird_warning1).
+-export([public_func/0]).
+
+-record(a, {
+ d = dict:new() :: dict:dict()
+ }).
+
+-record(b, {
+ q = queue:new() :: queue:queue()
+ }).
+
+public_func() ->
+ add_element(#b{}, my_key, my_value).
+
+add_element(#a{d = Dict}, Key, Value) ->
+ dict:store(Key, Value, Dict);
+add_element(#b{q = Queue}, Key, Value) ->
+ queue:in({Key, Value}, Queue).
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning2.erl b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning2.erl
new file mode 100644
index 0000000000..4e4512157b
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning2.erl
@@ -0,0 +1,14 @@
+-module(weird_warning2).
+-export([public_func/0]).
+
+-record(a, {d = dict:new() :: dict:dict()}).
+
+-record(b, {q = queue:new() :: queue:queue()}).
+
+public_func() ->
+ add_element(#a{}, my_key, my_value).
+
+add_element(#a{d = Dict}, Key, Value) ->
+ dict:store(Key, Value, Dict);
+add_element(#b{q = Queue}, Key, Value) ->
+ queue:in({Key, Value}, Queue).
diff --git a/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning3.erl b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning3.erl
new file mode 100644
index 0000000000..b70ca645cb
--- /dev/null
+++ b/lib/dialyzer/test/opaque_SUITE_data/src/weird/weird_warning3.erl
@@ -0,0 +1,19 @@
+-module(weird_warning3).
+-export([public_func/0]).
+
+-record(a, {
+ d = dict:new() :: dict:dict()
+ }).
+
+-record(b, {
+ q = queue:new() :: queue:queue()
+ }).
+
+public_func() ->
+ %% Notice that t_to_string() will create "#a{d::queue:queue(_)}".
+ add_element({a, queue:new()}, my_key, my_value).
+
+add_element(#a{d = Dict}, Key, Value) ->
+ dict:store(Key, Value, Dict);
+add_element(#b{q = Queue}, Key, Value) ->
+ queue:in({Key, Value}, Queue).
diff --git a/lib/dialyzer/test/plt_SUITE.erl b/lib/dialyzer/test/plt_SUITE.erl
index fbfa979e1b..92c63bdb0c 100644
--- a/lib/dialyzer/test/plt_SUITE.erl
+++ b/lib/dialyzer/test/plt_SUITE.erl
@@ -259,24 +259,41 @@ remove_plt(Config) ->
{init_plt, Plt}] ++ Opts),
ok.
+%% ERL-283, OTP-13979. As of OTP-14323 this test no longer does what
+%% it is designed to do--the linter stops every attempt to run the
+%% checks of Dialyzer's on bad dialyzer attributes. For the time
+%% being, the linter's error message are checked instead. The test
+%% needs to be updated when/if the Dialyzer can analyze Core Erlang
+%% without compiling abstract code.
bad_dialyzer_attr(Config) ->
+ PrivDir = ?config(priv_dir, Config),
+ Source = lists:concat([dial, ".erl"]),
+ Filename = filename:join(PrivDir, Source),
+ ok = dialyzer_common:check_plt(PrivDir),
+ PltFilename = dialyzer_common:plt_file(PrivDir),
+ Opts = [{files, [Filename]},
+ {check_plt, false},
+ {from, src_code},
+ {init_plt, PltFilename}],
+
Prog1 = <<"-module(dial).
-dialyzer({no_return, [undef/0]}).">>,
- {ok, Beam1} = compile(Config, Prog1, dial, []),
+ ok = file:write_file(Filename, Prog1),
{dialyzer_error,
- "Analysis failed with error:\n"
- "Could not scan the following file(s):\n"
- " Unknown function undef/0 in line " ++ _} =
- (catch run_dialyzer(plt_build, [Beam1], [])),
+ "Analysis failed with error:\n" ++ Str1} =
+ (catch dialyzer:run(Opts)),
+ P1 = string:str(Str1, "dial.erl:2: function undef/0 undefined"),
+ true = P1 > 0,
Prog2 = <<"-module(dial).
-dialyzer({no_return, [{undef,1,2}]}).">>,
- {ok, Beam2} = compile(Config, Prog2, dial, []),
+ ok = file:write_file(Filename, Prog2),
{dialyzer_error,
- "Analysis failed with error:\n"
- "Could not scan the following file(s):\n"
- " Bad function {undef,1,2} in line " ++ _} =
- (catch run_dialyzer(plt_build, [Beam2], [])),
+ "Analysis failed with error:\n" ++ Str2} =
+ (catch dialyzer:run(Opts)),
+ P2 = string:str(Str2, "dial.erl:2: badly formed dialyzer "
+ "attribute: {no_return,{undef,1,2}}"),
+ true = P2 > 0,
ok.
diff --git a/lib/dialyzer/test/typer_SUITE.erl b/lib/dialyzer/test/typer_SUITE.erl
new file mode 100644
index 0000000000..da5b961643
--- /dev/null
+++ b/lib/dialyzer/test/typer_SUITE.erl
@@ -0,0 +1,158 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2017. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(typer_SUITE).
+
+-export([all/0,suite/0,groups/0,init_per_suite/1,end_per_suite/1,
+ init_per_group/2,end_per_group/2,
+ smoke/1]).
+
+-include_lib("common_test/include/ct.hrl").
+
+suite() -> [{ct_hooks,[ts_install_cth]}].
+
+all() ->
+ [smoke].
+
+groups() ->
+ [].
+
+init_per_suite(Config) ->
+ OutDir = proplists:get_value(priv_dir, Config),
+ case dialyzer_common:check_plt(OutDir) of
+ fail -> {skip, "Plt creation/check failed."};
+ ok -> [{dialyzer_options, []}|Config]
+ end.
+
+end_per_suite(_Config) ->
+ ok.
+
+init_per_group(_GroupName, Config) ->
+ Config.
+
+end_per_group(_GroupName, Config) ->
+ Config.
+
+smoke(Config) ->
+ Code = <<"-module(typer_test_module).
+ -compile([export_all,nowarn_export_all]).
+ a(L) ->
+ L ++ [1,2,3].">>,
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Src = filename:join(PrivDir, "typer_test_module.erl"),
+ ok = file:write_file(Src, Code),
+ Args = "--plt " ++ PrivDir ++ "dialyzer_plt",
+ Res = ["^$",
+ "^%% File:",
+ "^%% ----",
+ "^-spec a",
+ "^_OK_"],
+ run(Config, Args, Src, Res),
+ ok.
+
+typer() ->
+ case os:find_executable("typer") of
+ false ->
+ ct:fail("Can't find typer");
+ Typer ->
+ Typer
+ end.
+
+%% Runs a command.
+
+run(Config, Args0, Name, Expect) ->
+ Args = Args0 ++ " " ++ Name,
+ Result = run_command(Config, Args),
+ verify_result(Result, Expect).
+
+verify_result(Result, Expect) ->
+ Messages = split(Result, [], []),
+ io:format("Result: ~p", [Messages]),
+ io:format("Expected: ~p", [Expect]),
+ match_messages(Messages, Expect).
+
+split([$\n|Rest], Current, Lines) ->
+ split(Rest, [], [lists:reverse(Current)|Lines]);
+split([$\r|Rest], Current, Lines) ->
+ split(Rest, Current, Lines);
+split([Char|Rest], Current, Lines) ->
+ split(Rest, [Char|Current], Lines);
+split([], [], Lines) ->
+ lists:reverse(Lines);
+split([], Current, Lines) ->
+ split([], [], [lists:reverse(Current)|Lines]).
+
+match_messages([Msg|Rest1], [Regexp|Rest2]) ->
+ case re:run(Msg, Regexp, [{capture,none}, unicode]) of
+ match ->
+ ok;
+ nomatch ->
+ io:format("Not matching: ~s\n", [Msg]),
+ io:format("Regexp : ~s\n", [Regexp]),
+ ct:fail(message_mismatch)
+ end,
+ match_messages(Rest1, Rest2);
+match_messages([], [Expect|Rest]) ->
+ ct:fail({too_few_messages, [Expect|Rest]});
+match_messages([Msg|Rest], []) ->
+ ct:fail({too_many_messages, [Msg|Rest]});
+match_messages([], []) ->
+ ok.
+
+%% Runs the command using os:cmd/1.
+%%
+%% Returns the output from the command (as a list of characters with
+%% embedded newlines). The very last line will indicate the
+%% exit status of the command, where _OK_ means zero, and _ERROR_
+%% a non-zero exit status.
+
+run_command(Config, Args) ->
+ TmpDir = filename:join(proplists:get_value(priv_dir, Config), "tmp"),
+ file:make_dir(TmpDir),
+ {RunFile, Run, Script} = run_command(TmpDir, os:type(), Args),
+ ok = file:write_file(filename:join(TmpDir, RunFile),
+ unicode:characters_to_binary(Script)),
+ io:format("~ts\n", [Script]),
+ os:cmd(Run).
+
+run_command(Dir, {win32, _}, Args) ->
+ BatchFile = filename:join(Dir, "run.bat"),
+ Run = re:replace(filename:rootname(BatchFile), "/", "\\",
+ [global,{return,list}]),
+ Typer = typer(),
+ {BatchFile,
+ Run,
+ ["@echo off\r\n",
+ "\"",Typer,"\" ",Args, "\r\n",
+ "if errorlevel 1 echo _ERROR_\r\n",
+ "if not errorlevel 1 echo _OK_\r\n"]};
+run_command(Dir, {unix, _}, Args) ->
+ TyperDir = filename:dirname(typer()),
+ Name = filename:join(Dir, "run"),
+ {Name,
+ "/bin/sh " ++ Name,
+ ["#!/bin/sh\n",
+ "PATH=\"",TyperDir,":$PATH\"\n",
+ "typer ",Args,"\n",
+ "case $? in\n",
+ " 0) echo '_OK_';;\n",
+ " *) echo '_ERROR_';;\n",
+ "esac\n"]};
+run_command(_Dir, Other, _Args) ->
+ ct:fail("Don't know how to test exit code for ~p", [Other]).
diff --git a/lib/dialyzer/vsn.mk b/lib/dialyzer/vsn.mk
index 9830a36e60..0919fba834 100644
--- a/lib/dialyzer/vsn.mk
+++ b/lib/dialyzer/vsn.mk
@@ -1 +1 @@
-DIALYZER_VSN = 3.0.3
+DIALYZER_VSN = 3.1
diff --git a/lib/diameter/doc/src/notes.xml b/lib/diameter/doc/src/notes.xml
index c2bbed2e5a..70e1880be5 100644
--- a/lib/diameter/doc/src/notes.xml
+++ b/lib/diameter/doc/src/notes.xml
@@ -43,6 +43,30 @@ first.</p>
<!-- ===================================================================== -->
+<section><title>diameter 1.12.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ An improvement in the handling of peer failover in
+ diameter 1.12.1 adversely affected performance when
+ sending requests. Further, the inefficient use of a
+ public table to route incoming answers has been removed.</p>
+ <p>
+ Own Id: OTP-14206</p>
+ </item>
+ <item>
+ <p>
+ Fixed xml issues in old release notes</p>
+ <p>
+ Own Id: OTP-14269</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>diameter 1.12.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
@@ -255,8 +279,8 @@ first.</p>
Fix decode of Grouped AVPs containing errors.</p>
<p>
RFC 6733 says this of Failed-AVP in 7.5:</p>
- <p>
- <taglist><item><p><c> In the case where the offending AVP
+
+ <taglist><tag></tag><item><p><c> In the case where the offending AVP
is embedded within a Grouped AVP, the Failed-AVP MAY
contain the grouped AVP, which in turn contains the
single offending AVP. The same method MAY be employed if
@@ -265,11 +289,11 @@ first.</p>
the grouped AVP hierarchy up to the single offending AVP.
This enables the recipient to detect the location of the
offending AVP when embedded in a
- group.</c></p></item></taglist></p>
+ group.</c></p></item></taglist>
<p>
It says this of DIAMETER_INVALID_AVP_LENGTH in 7.1.5:</p>
- <p>
- <taglist><item><p><c> The request contained an AVP with
+
+ <taglist><tag></tag><item><p><c> The request contained an AVP with
an invalid length. A Diameter message indicating this
error MUST include the offending AVPs within a Failed-AVP
AVP. In cases where the erroneous AVP length value
@@ -284,7 +308,8 @@ first.</p>
the minimum AVP header length, it is sufficient to
include an offending AVP header that is formulated by
padding the incomplete AVP header with zero up to the
- minimum AVP header length.</c></p></item></taglist></p>
+ minimum AVP header length.</c></p></item></taglist>
+
<p>
The AVPs placed in the errors field of a diameter_packet
record are intended to be appropriate for inclusion in a
@@ -949,8 +974,8 @@ first.</p>
Be lenient with the M-bit in Grouped AVPs.</p>
<p>
RFC 6733 says this, in 4.4:</p>
- <p>
- <taglist><item><p><c>Receivers of a Grouped AVP that does
+
+ <taglist><tag></tag><item><p><c>Receivers of a Grouped AVP that does
not have the 'M' (mandatory) bit set and one or more of
the encapsulated AVPs within the group has the 'M'
(mandatory) bit set MAY simply be ignored if the Grouped
@@ -958,14 +983,14 @@ first.</p>
encapsulated AVP with its 'M' (mandatory) bit set is
further encapsulated within other sub-groups, i.e., other
Grouped AVPs embedded within the Grouped
- AVP.</c></p></item></taglist></p>
+ AVP.</c></p></item></taglist>
<p>
The first sentence is mangled but take it to mean this:</p>
- <p>
- <taglist><item><p><c>An unrecognized AVP of type Grouped
+
+ <taglist><tag></tag><item><p><c>An unrecognized AVP of type Grouped
that does not set the 'M' bit MAY be ignored even if one
of its encapsulated AVPs sets the 'M'
- bit.</c></p></item></taglist></p>
+ bit.</c></p></item></taglist>
<p>
This is a bit of a non-statement since if the AVP is
unrecognized then its type is unknown. We therefore don't
diff --git a/lib/diameter/src/base/diameter.erl b/lib/diameter/src/base/diameter.erl
index e8f2f63f86..253f64133c 100644
--- a/lib/diameter/src/base/diameter.erl
+++ b/lib/diameter/src/base/diameter.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -377,6 +377,7 @@ call(SvcName, App, Message) ->
| {capabilities, [capability()]}
| {capabilities_cb, evaluable()}
| {capx_timeout, 'Unsigned32'()}
+ | {capx_strictness, boolean()}
| {disconnect_cb, evaluable()}
| {dpr_timeout, 'Unsigned32'()}
| {dpa_timeout, 'Unsigned32'()}
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl
index 1b48c0431f..e10804c931 100644
--- a/lib/diameter/src/base/diameter_config.erl
+++ b/lib/diameter/src/base/diameter_config.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -580,6 +580,9 @@ opt({K, Tmo})
K == dpa_timeout ->
?IS_UINT32(Tmo);
+opt({capx_strictness, B}) ->
+ is_boolean(B);
+
opt({length_errors, T}) ->
lists:member(T, [exit, handle, discard]);
diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl
index 4b394a2dbe..46d231da74 100644
--- a/lib/diameter/src/base/diameter_peer_fsm.erl
+++ b/lib/diameter/src/base/diameter_peer_fsm.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -128,6 +128,7 @@
%% outgoing DPR; boolean says whether or not
%% the request was sent explicitly with
%% diameter:call/4.
+ strict :: boolean(),
length_errors :: exit | handle | discard,
incoming_maxlen :: integer() | infinity}).
@@ -233,6 +234,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) ->
proplists:get_value(dpa_timeout, Opts, ?DPA_TIMEOUT)}),
Tmo = proplists:get_value(capx_timeout, Opts, ?CAPX_TIMEOUT),
+ Strictness = proplists:get_value(capx_strictness, Opts, true),
OnLengthErr = proplists:get_value(length_errors, Opts, exit),
{TPid, Addrs} = start_transport(T, Rest, Svc),
@@ -246,6 +248,7 @@ i({Ack, WPid, {M, Ref} = T, Opts, {SvcOpts, Nodes, Dict0, Svc}}) ->
mode = M,
service = svc(Svc, Addrs),
length_errors = OnLengthErr,
+ strict = Strictness,
incoming_maxlen = Maxlen}.
%% The transport returns its local ip addresses so that different
%% transports on the same service can use different local addresses.
@@ -454,6 +457,9 @@ transition({timeout, _}, _) ->
%% Outgoing message.
transition({send, Msg}, S) ->
outgoing(Msg, S);
+transition({send, Msg, Route}, S) ->
+ put_route(Route),
+ outgoing(Msg, S);
%% Request for graceful shutdown at remove_transport, stop_service of
%% application shutdown.
@@ -483,8 +489,10 @@ transition({'DOWN', _, process, TPid, _},
= S) ->
start_next(S);
-%% Transport has died after connection timeout.
-transition({'DOWN', _, process, _, _}, _) ->
+%% Transport has died after connection timeout, or handler process has
+%% died.
+transition({'DOWN', _, process, Pid, _}, _) ->
+ erase_route(Pid),
ok;
%% State query.
@@ -494,6 +502,40 @@ transition({state, Pid}, #state{state = S, transport = TPid}) ->
%% Crash on anything unexpected.
+%% put_route/1
+%%
+%% Map identifiers in an outgoing request to be able to lookup the
+%% handler process when the answer is received.
+
+put_route({Pid, Ref, Seqs}) ->
+ MRef = monitor(process, Pid),
+ put(Pid, Seqs),
+ put(Seqs, {Pid, Ref, MRef}).
+
+%% get_route/1
+
+get_route(#diameter_packet{header = #diameter_header{is_request = false}}
+ = Pkt) ->
+ Seqs = diameter_codec:sequence_numbers(Pkt),
+ case erase(Seqs) of
+ {Pid, Ref, MRef} ->
+ demonitor(MRef),
+ erase(Pid),
+ {Pid, Ref, self()};
+ undefined ->
+ false
+ end;
+
+get_route(_) ->
+ false.
+
+%% erase_route/1
+
+erase_route(Pid) ->
+ erase(erase(Pid)).
+
+%% capx/1
+
capx(recv_CER) ->
'CER';
capx({'Wait-CEA', _, _}) ->
@@ -576,8 +618,7 @@ incoming({Msg, NPid}, S) ->
T
catch
{?MODULE, Name, Pkt} ->
- S#state.parent ! {recv, self(), Name, {Pkt, NPid}},
- rcv(Name, Pkt, S)
+ incoming(Name, Pkt, NPid, S)
end;
incoming(Msg, S) ->
@@ -585,10 +626,15 @@ incoming(Msg, S) ->
recv(Msg, S)
catch
{?MODULE, Name, Pkt} ->
- S#state.parent ! {recv, self(), Name, Pkt},
- rcv(Name, Pkt, S)
+ incoming(Name, Pkt, false, S)
end.
+%% incoming/4
+
+incoming(Name, Pkt, NPid, #state{parent = Pid} = S) ->
+ Pid ! {recv, self(), get_route(Pkt), Name, Pkt, NPid},
+ rcv(Name, Pkt, S).
+
%% recv/2
recv(#diameter_packet{header = #diameter_header{} = Hdr}
@@ -614,6 +660,17 @@ recv1(_,
when M < size(Bin) ->
invalid(false, incoming_maxlen_exceeded, {size(Bin), H});
+%% Ignore anything but an expected CER/CEA if so configured. This is
+%% non-standard behaviour.
+recv1(Name, _, #state{state = {'Wait-CEA', _, _},
+ strict = false})
+ when Name /= 'CEA' ->
+ ok;
+recv1(Name, _, #state{state = recv_CER,
+ strict = false})
+ when Name /= 'CER' ->
+ ok;
+
%% Incoming request after outgoing DPR: discard. Don't discard DPR, so
%% both ends don't do so when sending simultaneously.
recv1(Name,
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index ccf68f4d93..e4f77e3a24 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1858,13 +1858,6 @@ eq(Any, Id, PeerId) ->
%% OctetString() can be specified as an iolist() so test for string
%% rather then term equality.
-%% transports/1
-
-transports(#state{watchdogT = WatchdogT}) ->
- ets:select(WatchdogT, [{#watchdog{peer = '$1', _ = '_'},
- [{'is_pid', '$1'}],
- ['$1']}]).
-
%% ---------------------------------------------------------------------------
%% # service_info/2
%% ---------------------------------------------------------------------------
@@ -1887,7 +1880,6 @@ transports(#state{watchdogT = WatchdogT}) ->
-define(ALL_INFO, [capabilities,
applications,
transport,
- pending,
options]).
%% The rest.
@@ -1981,7 +1973,6 @@ complete_info(Item, #state{service = Svc} = S) ->
applications -> info_apps(S);
transport -> info_transport(S);
options -> info_options(S);
- pending -> info_pending(S);
keys -> ?ALL_INFO ++ ?CAP_INFO ++ ?OTHER_INFO;
all -> service_info(?ALL_INFO, S);
statistics -> info_stats(S);
@@ -2189,13 +2180,6 @@ info_apps(#state{service = #diameter_service{applications = Apps}}) ->
mk_app(#diameter_app{} = A) ->
lists:zip(record_info(fields, diameter_app), tl(tuple_to_list(A))).
-%% info_pending/1
-%%
-%% One entry for each outgoing request whose answer is outstanding.
-
-info_pending(#state{} = S) ->
- diameter_traffic:pending(transports(S)).
-
%% info_info/1
%%
%% Extract process_info from connections info.
diff --git a/lib/diameter/src/base/diameter_sup.erl b/lib/diameter/src/base/diameter_sup.erl
index 482289cb9a..01c51f0856 100644
--- a/lib/diameter/src/base/diameter_sup.erl
+++ b/lib/diameter/src/base/diameter_sup.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
-define(TABLES, [{diameter_sequence, [set]},
{diameter_service, [set, {keypos, 3}]},
- {diameter_request, [bag]},
+ {diameter_request, [set]},
{diameter_config, [bag, {keypos, 2}]}]).
%% start_link/0
diff --git a/lib/diameter/src/base/diameter_traffic.erl b/lib/diameter/src/base/diameter_traffic.erl
index d93a3e71e3..bc1ccf4feb 100644
--- a/lib/diameter/src/base/diameter_traffic.erl
+++ b/lib/diameter/src/base/diameter_traffic.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2013-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2013-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,7 @@
-export([send_request/4]).
%% towards diameter_watchdog
--export([receive_message/4]).
+-export([receive_message/6]).
%% towards diameter_peer_fsm and diameter_watchdog
-export([incr/4,
@@ -40,11 +40,11 @@
%% towards diameter_service
-export([make_recvdata/1,
peer_up/1,
- peer_down/1,
- pending/1]).
+ peer_down/1]).
-%% towards ?MODULE
--export([send/1]). %% send from remote node
+%% internal
+-export([send/1, %% send from remote node
+ init/1]). %% monitor process start
-include_lib("diameter/include/diameter.hrl").
-include("diameter_internal.hrl").
@@ -57,14 +57,12 @@
-define(DEFAULT_TIMEOUT, 5000). %% for outgoing requests
-define(DEFAULT_SPAWN_OPTS, []).
-%% Table containing outgoing requests for which a reply has yet to be
-%% received.
+%% Table containing outgoing entries that live and die with
+%% peer_up/down. The name is historic, since the table used to contain
+%% information about outgoing requests for which an answer has yet to
+%% be received.
-define(REQUEST_TABLE, diameter_request).
-%% Workaround for dialyzer's lack of understanding of match specs.
--type match(T)
- :: T | '_' | '$1' | '$2' | '$3' | '$4'.
-
%% Record diameter:call/4 options are parsed into.
-record(options,
{filter = none :: diameter:peer_filter(),
@@ -72,7 +70,7 @@
timeout = ?DEFAULT_TIMEOUT :: 0..16#FFFFFFFF,
detach = false :: boolean()}).
-%% Term passed back to receive_message/4 with every incoming message.
+%% Term passed back to receive_message/6 with every incoming message.
-record(recvdata,
{peerT :: ets:tid(),
service_name :: diameter:service_name(),
@@ -87,12 +85,12 @@
%% Record stored in diameter_request for each outgoing request.
-record(request,
- {ref :: match(reference()), %% used to receive answer
- caller :: match(pid()), %% calling process
- handler :: match(pid()), %% request process
- transport :: match(pid()), %% peer process
- caps :: match(#diameter_caps{}), %% of connection
- packet :: match(#diameter_packet{})}). %% of request
+ {ref :: reference(), %% used to receive answer
+ caller :: pid() | undefined, %% calling process
+ handler :: pid(), %% request process
+ transport :: pid() | undefined, %% peer process
+ caps :: #diameter_caps{} | undefined, %% of connection
+ packet :: #diameter_packet{} | undefined}). %% of request
%% ---------------------------------------------------------------------------
%% # make_recvdata/1
@@ -113,26 +111,27 @@ make_recvdata([SvcName, PeerT, Apps, SvcOpts | _]) ->
%% peer_up/1
%% ---------------------------------------------------------------------------
-%% Insert an element that is used to detect whether or not there has
-%% been a failover when inserting an outgoing request.
+%% Start a process that dies with peer_down/1, on which request
+%% processes can monitor. There is no other process that dies with
+%% peer_down since failover doesn't imply the loss of transport in the
+%% case of a watchdog transition into state SUSPECT.
peer_up(TPid) ->
- ets:insert(?REQUEST_TABLE, {TPid}).
+ proc_lib:start(?MODULE, init, [TPid]).
+
+init(TPid) ->
+ ets:insert(?REQUEST_TABLE, {TPid, self()}),
+ proc_lib:init_ack(self()),
+ proc_lib:hibernate(erlang, exit, [{shutdown, TPid}]).
%% ---------------------------------------------------------------------------
%% peer_down/1
%% ---------------------------------------------------------------------------
peer_down(TPid) ->
- ets:delete_object(?REQUEST_TABLE, {TPid}),
- lists:foreach(fun failover/1, ets:lookup(?REQUEST_TABLE, TPid)).
-%% Note that a request process can store its request after failover
-%% notifications are sent here: insert_request/2 sends the notification
-%% in that case.
-
-%% failover/1
-
-failover({_TPid, {Pid, TRef}}) ->
- Pid ! {failover, TRef}.
+ [{_, Pid}] = ets:lookup(?REQUEST_TABLE, TPid),
+ ets:delete(?REQUEST_TABLE, TPid),
+ Pid ! ok, %% make it die
+ Pid.
%% ---------------------------------------------------------------------------
%% incr/4
@@ -207,54 +206,25 @@ incr_rc(Dir, Pkt, TPid, Dict0) ->
incr_rc(Dir, Pkt, TPid, {Dict0, Dict0, Dict0}).
%% ---------------------------------------------------------------------------
-%% pending/1
-%% ---------------------------------------------------------------------------
-
-pending(TPids) ->
- MatchSpec = [{{'$1',
- #request{caller = '$2',
- handler = '$3',
- transport = '$4',
- _ = '_'},
- '_'},
- [?ORCOND([{'==', T, '$4'} || T <- TPids])],
- [{{'$1', [{{caller, '$2'}},
- {{handler, '$3'}},
- {{transport, '$4'}}]}}]}],
-
- try
- ets:select(?REQUEST_TABLE, MatchSpec)
- catch
- error: badarg -> [] %% service has gone down
- end.
-
-%% ---------------------------------------------------------------------------
-%% # receive_message/4
+%% # receive_message/6
%%
%% Handle an incoming Diameter message.
%% ---------------------------------------------------------------------------
-%% Handle an incoming Diameter message in the watchdog process. This
-%% used to come through the service process but this avoids that
-%% becoming a bottleneck.
+%% Handle an incoming Diameter message in the watchdog process.
-receive_message(TPid, {Pkt, NPid}, Dict0, RecvData) ->
- NPid ! {diameter, incoming(TPid, Pkt, Dict0, RecvData)};
+receive_message(TPid, Route, Pkt, false, Dict0, RecvData) ->
+ incoming(TPid, Route, Pkt, Dict0, RecvData);
-receive_message(TPid, Pkt, Dict0, RecvData) ->
- incoming(TPid, Pkt, Dict0, RecvData).
+receive_message(TPid, Route, Pkt, NPid, Dict0, RecvData) ->
+ NPid ! {diameter, incoming(TPid, Route, Pkt, Dict0, RecvData)}.
%% incoming/4
-incoming(TPid, Pkt, Dict0, RecvData)
+incoming(TPid, Route, Pkt, Dict0, RecvData)
when is_pid(TPid) ->
#diameter_packet{header = #diameter_header{is_request = R}} = Pkt,
- recv(R,
- (not R) andalso lookup_request(Pkt, TPid),
- TPid,
- Pkt,
- Dict0,
- RecvData).
+ recv(R, Route, TPid, Pkt, Dict0, RecvData).
%% recv/6
@@ -269,8 +239,8 @@ recv(true, false, TPid, Pkt, Dict0, T) ->
end;
%% ... answer to known request ...
-recv(false, #request{ref = Ref, handler = Pid} = Req, _, Pkt, Dict0, _) ->
- Pid ! {answer, Ref, Req, Dict0, Pkt},
+recv(false, {Pid, Ref, TPid}, _, Pkt, Dict0, _) ->
+ Pid ! {answer, Ref, TPid, Dict0, Pkt},
{answer, Pid};
%% Note that failover could have happened prior to this message being
@@ -1503,32 +1473,39 @@ send_R(Pkt0,
packet = Pkt0},
incr(send, Pkt, TPid, AppDict),
- TRef = send_request(TPid, Pkt, Req, SvcName, Timeout),
+ {TRef, MRef} = zend_requezt(TPid, Pkt, Req, SvcName, Timeout),
Pid ! Ref, %% tell caller a send has been attempted
handle_answer(SvcName,
App,
- recv_A(Timeout, SvcName, App, Opts, {TRef, Req})).
+ recv_A(Timeout, SvcName, App, Opts, {TRef, MRef, Req})).
%% recv_A/5
-recv_A(Timeout, SvcName, App, Opts, {TRef, #request{ref = Ref} = Req}) ->
+recv_A(Timeout, SvcName, App, Opts, {TRef, MRef, #request{ref = Ref} = Req}) ->
%% Matching on TRef below ensures we ignore messages that pertain
%% to a previous transport prior to failover. The answer message
- %% includes the #request{} since it's not necessarily Req; that
- %% is, from the last peer to which we've transmitted.
+ %% includes the pid of the transport on which it was received,
+ %% which may not be the last peer to which we've transmitted.
receive
- {answer = A, Ref, Rq, Dict0, Pkt} -> %% Answer from peer
- {A, Rq, Dict0, Pkt};
+ {answer = A, Ref, TPid, Dict0, Pkt} -> %% Answer from peer
+ {A, #request{} = erase(TPid), Dict0, Pkt};
{timeout = Reason, TRef, _} -> %% No timely reply
{error, Req, Reason};
- {failover, TRef} -> %% Service says peer has gone down
- retransmit(pick_peer(SvcName, App, Req, Opts),
- Req,
- Opts,
- SvcName,
- Timeout)
+ {'DOWN', MRef, process, _, _} when false /= MRef -> %% local peer_down
+ failover(SvcName, App, Req, Opts, Timeout);
+ {failover, TRef} -> %% local or remote peer_down
+ failover(SvcName, App, Req, Opts, Timeout)
end.
+%% failover/5
+
+failover(SvcName, App, Req, Opts, Timeout) ->
+ retransmit(pick_peer(SvcName, App, Req, Opts),
+ Req,
+ Opts,
+ SvcName,
+ Timeout).
+
%% handle_answer/3
handle_answer(SvcName, App, {error, Req, Reason}) ->
@@ -1705,44 +1682,63 @@ encode(DictT, TPid, #diameter_packet{bin = undefined} = Pkt) ->
encode(_, _, #diameter_packet{} = Pkt) ->
Pkt.
+%% zend_requezt/5
+%%
+%% Strip potentially large record fields that aren't used by the
+%% processes the records can be send to, possibly on a remote node.
+
+zend_requezt(TPid, Pkt, Req, SvcName, Timeout) ->
+ put(TPid, Req),
+ send_request(TPid, z(Pkt), Req, SvcName, Timeout).
+
%% send_request/5
send_request(TPid, #diameter_packet{bin = Bin} = Pkt, Req, _SvcName, Timeout)
when node() == node(TPid) ->
Seqs = diameter_codec:sequence_numbers(Bin),
TRef = erlang:start_timer(Timeout, self(), TPid),
- Entry = {Seqs, #request{handler = Pid} = Req, TRef},
-
- %% Ensure that request table is cleaned even if the process is
- %% killed.
- spawn(fun() -> diameter_lib:wait([Pid]), delete_request(Entry) end),
-
- insert_request(Entry),
- send(TPid, Pkt),
- TRef;
+ send(TPid, Pkt, _Route = {self(), Req#request.ref, Seqs}),
+ {TRef, _MRef = peer_monitor(TPid, TRef)};
%% Send using a remote transport: spawn a process on the remote node
%% to relay the answer.
send_request(TPid, #diameter_packet{} = Pkt, Req, SvcName, Timeout) ->
TRef = erlang:start_timer(Timeout, self(), TPid),
- T = {TPid, Pkt, Req, SvcName, Timeout, TRef},
+ T = {TPid, Pkt, z(Req), SvcName, Timeout, TRef},
spawn(node(TPid), ?MODULE, send, [T]),
- TRef.
+ {TRef, false}.
+
+%% z/1
+%%
+%% Avoid sending potentially large terms unnecessarily. The records
+%% themselves are retained since they're sent between nodes in send/1
+%% and changing what's sent causes upgrade issues.
+
+z(#request{ref = Ref, handler = Pid}) ->
+ #request{ref = Ref,
+ handler = Pid};
+
+z(#diameter_packet{header = H, bin = Bin, transport_data = T}) ->
+ #diameter_packet{header = H,
+ bin = Bin,
+ transport_data = T}.
%% send/1
send({TPid, Pkt, #request{handler = Pid} = Req0, SvcName, Timeout, TRef}) ->
Req = Req0#request{handler = self()},
- recv(TPid, Pid, TRef, send_request(TPid, Pkt, Req, SvcName, Timeout)).
+ recv(TPid, Pid, TRef, zend_requezt(TPid, Pkt, Req, SvcName, Timeout)).
%% recv/4
%%
%% Relay an answer from a remote node.
-recv(TPid, Pid, TRef, LocalTRef) ->
+recv(TPid, Pid, TRef, {LocalTRef, MRef}) ->
receive
{answer, _, _, _, _} = A ->
Pid ! A;
+ {'DOWN', MRef, process, _, _} ->
+ Pid ! {failover, TRef};
{failover = T, LocalTRef} ->
Pid ! {T, TRef};
T ->
@@ -1751,14 +1747,13 @@ recv(TPid, Pid, TRef, LocalTRef) ->
%% send/2
-send(Pid, Pkt) -> %% Strip potentially large message terms.
- #diameter_packet{header = H,
- bin = Bin,
- transport_data = T}
- = Pkt,
- Pid ! {send, #diameter_packet{header = H,
- bin = Bin,
- transport_data = T}}.
+send(Pid, Pkt) ->
+ Pid ! {send, Pkt}.
+
+%% send/3
+
+send(Pid, Pkt, Route) ->
+ Pid ! {send, Pkt, Route}.
%% retransmit/4
@@ -1768,8 +1763,8 @@ retransmit({TPid, Caps, App}
= Req,
SvcName,
Timeout) ->
- have_request(Pkt0, TPid) %% Don't failover to a peer we've
- andalso ?THROW(timeout), %% already sent to.
+ undefined == get(TPid) %% Don't failover to a peer we've
+ orelse ?THROW(timeout), %% already sent to.
Pkt = make_retransmit_packet(Pkt0),
@@ -1822,56 +1817,20 @@ resend_request(Pkt0,
?LOG(retransmission, Pkt#diameter_packet.header),
incr(TPid, {msg_id(Pkt, AppDict), send, retransmission}),
- TRef = send_request(TPid, Pkt, Req, SvcName, Tmo),
- {TRef, Req}.
-
-%% insert_request/1
-
-insert_request({_Seqs, #request{transport = TPid}, TRef} = T) ->
- ets:insert(?REQUEST_TABLE, [T, {TPid, {self(), TRef}}]),
- is_peer_up(TPid)
- orelse (self() ! {failover, TRef}). %% failover/1 may have missed
-
-%% is_peer_up/1
-%%
-%% Is the entry written by peer_up/1 and deleted by peer_down/1 still
-%% in the request table?
+ {TRef, MRef} = zend_requezt(TPid, Pkt, Req, SvcName, Tmo),
+ {TRef, MRef, Req}.
-is_peer_up(TPid) ->
- Spec = [{{TPid}, [], ['$_']}],
- '$end_of_table' /= ets:select(?REQUEST_TABLE, Spec, 1).
+%% peer_monitor/2
-%% lookup_request/2
-%%
-%% Note the match on both the key and transport pid. The latter is
-%% necessary since the same Hop-by-Hop and End-to-End identifiers are
-%% reused in the case of retransmission.
-
-lookup_request(Msg, TPid) ->
- Seqs = diameter_codec:sequence_numbers(Msg),
- Spec = [{{Seqs, #request{transport = TPid, _ = '_'}, '_'},
- [],
- ['$_']}],
- case ets:select(?REQUEST_TABLE, Spec) of
- [{_, Req, _}] ->
- Req;
- [] ->
+peer_monitor(TPid, TRef) ->
+ case ets:lookup(?REQUEST_TABLE, TPid) of %% at peer_up/1
+ [{_, MPid}] ->
+ monitor(process, MPid);
+ [] -> %% transport has gone down
+ self() ! {failover, TRef},
false
end.
-%% delete_request/1
-
-delete_request({_Seqs, #request{handler = Pid, transport = TPid}, TRef} = T) ->
- Spec = [{R, [], [true]} || R <- [T, {TPid, {Pid, TRef}}]],
- ets:select_delete(?REQUEST_TABLE, Spec).
-
-%% have_request/2
-
-have_request(Pkt, TPid) ->
- Seqs = diameter_codec:sequence_numbers(Pkt),
- Pat = {Seqs, #request{transport = TPid, _ = '_'}, '_'},
- '$end_of_table' /= ets:select(?REQUEST_TABLE, [{Pat, [], ['$_']}], 1).
-
%% get_destination/2
get_destination(Dict, Msg) ->
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl
index 2ba60a65fb..f28b8f2910 100644
--- a/lib/diameter/src/base/diameter_watchdog.erl
+++ b/lib/diameter/src/base/diameter_watchdog.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -283,7 +283,7 @@ event(Msg,
?LOG(transition, {From, To}).
data(Msg, TPid, reopen, okay) ->
- {recv, TPid, 'DWA', _Pkt} = Msg, %% assert
+ {recv, TPid, false, 'DWA', _Pkt, _NPid} = Msg, %% assert
{TPid, T} = eraser(open),
[T];
@@ -447,12 +447,14 @@ transition({'DOWN', _, process, TPid, _Reason} = D,
end;
%% Incoming message.
-transition({recv, TPid, Name, PktT}, #watchdog{transport = TPid} = S) ->
+transition({recv, TPid, Route, Name, Pkt, NPid},
+ #watchdog{transport = TPid}
+ = S) ->
try
- incoming(Name, PktT, S)
+ incoming(Name, Pkt, NPid, S)
catch
#watchdog{dictionary = Dict0, receive_data = T} = NS ->
- diameter_traffic:receive_message(TPid, PktT, Dict0, T),
+ diameter_traffic:receive_message(TPid, Route, Pkt, NPid, Dict0, T),
NS
end;
@@ -582,15 +584,17 @@ send_watchdog(#watchdog{pending = false,
%% Don't count encode errors since we don't expect any on DWR/DWA.
-%% incoming/3
+%% incoming/4
-incoming(Name, {Pkt, NPid}, S) ->
- NS = recv(Name, Pkt, S),
- NPid ! {diameter, discard},
- NS;
+incoming(Name, Pkt, false, S) ->
+ recv(Name, Pkt, S);
-incoming(Name, Pkt, S) ->
- recv(Name, Pkt, S).
+incoming(Name, Pkt, NPid, S) ->
+ try
+ recv(Name, Pkt, S)
+ after
+ NPid ! {diameter, discard}
+ end.
%% recv/3
diff --git a/lib/diameter/src/compiler/diameter_codegen.erl b/lib/diameter/src/compiler/diameter_codegen.erl
index 864d5f0691..928ae37e7f 100644
--- a/lib/diameter/src/compiler/diameter_codegen.erl
+++ b/lib/diameter/src/compiler/diameter_codegen.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -184,7 +184,7 @@ erl_forms(Mod, ParseD) ->
f_enumerated_avp(ParseD),
f_empty_value(ParseD),
f_dict(ParseD),
- {eof, erl_anno:new(?LINE)}]],
+ {eof, ?LINE}]],
lists:append(Forms).
diff --git a/lib/diameter/src/diameter.appup.src b/lib/diameter/src/diameter.appup.src
index b1b8e38d39..eb5a5a44f3 100644
--- a/lib/diameter/src/diameter.appup.src
+++ b/lib/diameter/src/diameter.appup.src
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -50,10 +50,8 @@
{"1.11", [{restart_application, diameter}]}, %% 18.1
{"1.11.1", [{restart_application, diameter}]}, %% 18.2
{"1.11.2", [{restart_application, diameter}]}, %% 18.3
- {"1.12", [{load_module, diameter_lib}, %% 19.0
- {load_module, diameter_traffic},
- {load_module, diameter_tcp},
- {load_module, diameter_sctp}]}
+ {"1.12", [{restart_application, diameter}]}, %% 19.0
+ {"1.12.1", [{restart_application, diameter}]} %% 19.1
],
[
{"0.9", [{restart_application, diameter}]},
@@ -85,9 +83,7 @@
{"1.11", [{restart_application, diameter}]},
{"1.11.1", [{restart_application, diameter}]},
{"1.11.2", [{restart_application, diameter}]},
- {"1.12", [{load_module, diameter_sctp},
- {load_module, diameter_tcp},
- {load_module, diameter_traffic},
- {load_module, diameter_lib}]}
+ {"1.12", [{restart_application, diameter}]},
+ {"1.12.1", [{restart_application, diameter}]}
]
}.
diff --git a/lib/diameter/vsn.mk b/lib/diameter/vsn.mk
index 23219950bb..94d9d72a48 100644
--- a/lib/diameter/vsn.mk
+++ b/lib/diameter/vsn.mk
@@ -1,6 +1,6 @@
# %CopyrightBegin%
#
-# Copyright Ericsson AB 2010-2016. All Rights Reserved.
+# Copyright Ericsson AB 2010-2017. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,5 +17,5 @@
# %CopyrightEnd%
APPLICATION = diameter
-DIAMETER_VSN = 1.12.1
+DIAMETER_VSN = 1.12.2
APP_VSN = $(APPLICATION)-$(DIAMETER_VSN)$(PRE_VSN)
diff --git a/lib/edoc/src/edoc.erl b/lib/edoc/src/edoc.erl
index 7276a57268..b641118c5d 100644
--- a/lib/edoc/src/edoc.erl
+++ b/lib/edoc/src/edoc.erl
@@ -197,7 +197,7 @@ application(App, Dir, Options) when is_atom(App) ->
?OVERVIEW_FILE),
Opts = Options ++ [{source_path, [Src]},
subpackages,
- {title, io_lib:fwrite("The ~s application", [App])},
+ {title, io_lib:fwrite("The ~ts application", [App])},
{overview, Overview},
{dir, filename:join(Dir, ?EDOC_DIR)},
{includes, [filename:join(Dir, "include")]}],
diff --git a/lib/edoc/src/edoc_doclet.erl b/lib/edoc/src/edoc_doclet.erl
index 006b07574b..6e17ec0af0 100644
--- a/lib/edoc/src/edoc_doclet.erl
+++ b/lib/edoc/src/edoc_doclet.erl
@@ -152,7 +152,7 @@ title(App, Options) ->
if App == ?NO_APP ->
"Overview";
true ->
- io_lib:fwrite("Application: ~s", [App])
+ io_lib:fwrite("Application: ~ts", [App])
end).
diff --git a/lib/edoc/src/edoc_extract.erl b/lib/edoc/src/edoc_extract.erl
index 68edad1a3e..390851e9ef 100644
--- a/lib/edoc/src/edoc_extract.erl
+++ b/lib/edoc/src/edoc_extract.erl
@@ -488,8 +488,15 @@ find_names([P | Ps], Ns) ->
find_names([P1 | Ps], Ns);
record_expr ->
A = erl_syntax:record_expr_type(P),
- N = list_to_atom(capitalize(erl_syntax:atom_name(A))),
- find_names(Ps, [N | Ns]);
+ AtomName = erl_syntax:atom_name(A),
+ Atom = list_to_atom(AtomName),
+ case AtomName =:= lists:flatten(io_lib:write_atom(Atom)) of
+ true ->
+ N = list_to_atom(capitalize(AtomName)),
+ find_names(Ps, [N | Ns]);
+ false ->
+ find_names(Ps, Ns)
+ end;
infix_expr ->
%% this can only be a '++' operation
P1 = erl_syntax:infix_expr_right(P),
@@ -540,6 +547,7 @@ tidy_name_1(Cs) -> [$_ | Cs].
%% Change initial character from lowercase to uppercase.
capitalize([C | Cs]) when C >= $a, C =< $z -> [C - 32 | Cs];
+capitalize([C | Cs]) when C >= $\340, C =< $\376, C /= $\367 -> [C - 32 | Cs];
capitalize(Cs) -> Cs.
%% Collects the tags belonging to each entry, checks them, expands
diff --git a/lib/edoc/src/edoc_layout.erl b/lib/edoc/src/edoc_layout.erl
index 9407ae1321..5b1889ab06 100644
--- a/lib/edoc/src/edoc_layout.erl
+++ b/lib/edoc/src/edoc_layout.erl
@@ -109,14 +109,20 @@ module(Element, Options) ->
stylesheet,
index_columns,
sort_functions,
+ encoding,
pretty_printer}).
init_opts(Element, Options) ->
+ Encoding = case get_attrval(encoding, Element) of
+ "latin1" -> latin1;
+ _ -> utf8
+ end,
R = #opts{root = get_attrval(root, Element),
index_columns = proplists:get_value(index_columns,
Options, 1),
sort_functions = proplists:get_value(sort_functions,
Options, true),
+ encoding = Encoding,
pretty_printer = proplists:get_value(pretty_printer,
Options, '')
},
@@ -183,8 +189,9 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
Desc = get_content(description, Es),
ShortDesc = get_content(briefDescription, Desc),
FullDesc = get_content(fullDescription, Desc),
- Functions = [{function_name(E), E} || E <- get_content(functions, Es)],
- Types = [{type_name(E), E} || E <- get_content(typedecls, Es)],
+ Functions = [{function_name(E, Opts), E} ||
+ E <- get_content(functions, Es)],
+ Types = [{type_name(E, Opts), E} || E <- get_content(typedecls, Es)],
SortedFs = if Opts#opts.sort_functions -> lists:sort(Functions);
true -> Functions
end,
@@ -198,7 +205,7 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
++ [?NL]
++ version(Es)
++ since(Es)
- ++ behaviours(Es, Name)
+ ++ behaviours(Es, Name, Opts)
++ authors(Es)
++ references(Es)
++ sees(Es)
@@ -214,8 +221,8 @@ layout_module(#xmlElement{name = module, content = Es}=E, Opts) ->
++ functions(SortedFs, Opts)
++ [hr, ?NL]
++ navigation("bottom")
- ++ timestamp()),
- Encoding = get_attrval(encoding, E),
+ ++ footer()),
+ Encoding = Opts#opts.encoding,
xhtml(Title, stylesheet(Opts), Body, Encoding).
module_params(Es) ->
@@ -228,12 +235,8 @@ module_params(Es) ->
[element(1, First) | [ {[", ",A]} || {A, _D} <- Rest]]
end.
-timestamp() ->
- [?NL, {p, [{i, [io_lib:fwrite("Generated by EDoc, ~s, ~s.",
- [edoc_lib:datestr(date()),
- edoc_lib:timestr(time())])
- ]}]},
- ?NL].
+footer() ->
+ [?NL, {p, [{i, ["Generated by EDoc"]}]}, ?NL].
stylesheet(Opts) ->
case Opts#opts.stylesheet of
@@ -371,7 +374,7 @@ function(Name, E=#xmlElement{content = Es}, Opts) ->
case typespec(get_content(typespec, Es), Opts) of
[] ->
signature(get_content(args, Es),
- get_attrval(name, E));
+ atom(get_attrval(name, E), Opts));
Spec -> Spec
end},
?NL]
@@ -391,8 +394,8 @@ function(Name, E=#xmlElement{content = Es}, Opts) ->
++ sees(Es)
++ todos(Es)).
-function_name(E) ->
- atom(get_attrval(name, E)) ++ "/" ++ get_attrval(arity, E).
+function_name(E, Opts) ->
+ atom(get_attrval(name, E), Opts) ++ "/" ++ get_attrval(arity, E).
function_header(Name, E, Private) ->
case is_exported(E) of
@@ -453,7 +456,7 @@ throws(Es, Opts) ->
[] -> [];
Es1 ->
%% Doesn't use format_type; keep it short!
- [{p, (["throws ", {tt, t_utype(get_elem(type, Es1))}]
+ [{p, (["throws ", {tt, t_utype(get_elem(type, Es1), Opts)}]
++ local_defs(get_elem(localdef, Es1), Opts))},
?NL]
end.
@@ -462,7 +465,7 @@ throws(Es, Opts) ->
typespec([], _Opts) -> [];
typespec(Es, Opts) ->
- Name = t_name(get_elem(erlangName, Es)),
+ Name = t_name(get_elem(erlangName, Es), Opts),
Defs = get_elem(localdef, Es),
[Type] = get_elem(type, Es),
format_spec(Name, Type, Defs, Opts) ++ local_defs(Defs, Opts).
@@ -483,12 +486,12 @@ typedecl(Name, E=#xmlElement{content = Es}, Opts) ->
++ [{p, typedef(get_content(typedef, Es), Opts)}, ?NL]
++ fulldesc(Es)).
-type_name(#xmlElement{content = Es}) ->
- t_name(get_elem(erlangName, get_content(typedef, Es))).
+type_name(#xmlElement{content = Es}, Opts) ->
+ t_name(get_elem(erlangName, get_content(typedef, Es)), Opts).
typedef(Es, Opts) ->
- Name = ([t_name(get_elem(erlangName, Es)), "("]
- ++ seq(fun t_utype_elem/1, get_content(argtypes, Es), [")"])),
+ Name = ([t_name(get_elem(erlangName, Es), Opts), "("]
+ ++ seq(t_utype_elem_fun(Opts), get_content(argtypes, Es), [")"])),
(case get_elem(type, Es) of
[] -> [{b, ["abstract datatype"]}, ": ", {tt, Name}];
Type -> format_type(Name, Name, Type, [], Opts)
@@ -509,7 +512,9 @@ local_defs(Es0, Last, Opts) ->
localdef(E = #xmlElement{content = Es}, Last, Opts) ->
Name = case get_elem(typevar, Es) of
[] ->
- label_anchor(N0 = t_abstype(get_content(abstype, Es)), E);
+ label_anchor(N0 = t_abstype(get_content(abstype, Es),
+ Opts),
+ E);
[V] ->
N0 = t_var(V)
end,
@@ -520,97 +525,99 @@ localdef(E = #xmlElement{content = Es}, Last, Opts) ->
%% (fast) Erlang pretty printer).
format_spec(Name, Type, Defs, #opts{pretty_printer = erl_pp}=Opts) ->
try
- L = t_clause(Name, Type),
- O = pp_clause(Name, Type),
- {R, ".\n"} = etypef(L, O),
+ L = t_clause(Name, Type, Opts),
+ O = pp_clause(Name, Type, Opts),
+ {R, ".\n"} = etypef(L, O, Opts),
[{pre, R}]
catch _:_ ->
%% Should not happen.
format_spec(Name, Type, Defs, Opts#opts{pretty_printer=''})
end;
-format_spec(Sep, Type, Defs, _Opts) ->
+format_spec(Sep, Type, Defs, Opts) ->
%% Very limited formatting.
Br = if Defs =:= [] -> br; true -> [] end,
- [{tt, t_clause(Sep, Type)}, Br].
+ [{tt, t_clause(Sep, Type, Opts)}, Br].
-t_clause(Name, Type) ->
+t_clause(Name, Type, Opts) ->
#xmlElement{content = [#xmlElement{name = 'fun', content = C}]} = Type,
- [Name] ++ t_fun(C).
+ [Name] ++ t_fun(C, Opts).
-pp_clause(Pre, Type) ->
+pp_clause(Pre, Type, Opts) ->
Types = ot_utype([Type]),
- Atom = lists:duplicate(iolist_size(Pre), $a),
+ Atom = lists:duplicate(string_length(Pre), $a),
Attr = {attribute,0,spec,{{list_to_atom(Atom),0},[Types]}},
- L1 = erl_pp:attribute(erl_parse:new_anno(Attr)),
+ L1 = erl_pp:attribute(erl_parse:new_anno(Attr),
+ [{encoding, Opts#opts.encoding}]),
"-spec " ++ L2 = lists:flatten(L1),
L3 = Pre ++ lists:nthtail(length(Atom), L2),
- re:replace(L3, "\n ", "\n", [{return,list},global]).
+ re:replace(L3, "\n ", "\n", [{return,list},global,unicode]).
format_type(Prefix, Name, Type, Last, #opts{pretty_printer = erl_pp}=Opts) ->
try
- L = t_utype(Type),
- O = pp_type(Name, Type),
- {R, ".\n"} = etypef(L, O),
+ L = t_utype(Type, Opts),
+ O = pp_type(Name, Type, Opts),
+ {R, ".\n"} = etypef(L, O, Opts),
[{pre, Prefix ++ [" = "] ++ R ++ Last}]
catch _:_ ->
%% Example: "t() = record(a)."
format_type(Prefix, Name, Type, Last, Opts#opts{pretty_printer =''})
end;
-format_type(Prefix, _Name, Type, Last, _Opts) ->
- [{tt, Prefix ++ [" = "] ++ t_utype(Type) ++ Last}].
+format_type(Prefix, _Name, Type, Last, Opts) ->
+ [{tt, Prefix ++ [" = "] ++ t_utype(Type, Opts) ++ Last}].
-pp_type(Prefix, Type) ->
- Atom = list_to_atom(lists:duplicate(iolist_size(Prefix), $a)),
+pp_type(Prefix, Type, Opts) ->
+ Atom = list_to_atom(lists:duplicate(string_length(Prefix), $a)),
Attr = {attribute,0,type,{Atom,ot_utype(Type),[]}},
- L1 = erl_pp:attribute(erl_parse:new_anno(Attr)),
+ L1 = erl_pp:attribute(erl_parse:new_anno(Attr),
+ [{encoding, Opts#opts.encoding}]),
{L2,N} = case lists:dropwhile(fun(C) -> C =/= $: end, lists:flatten(L1)) of
":: " ++ L3 -> {L3,9}; % compensation for extra "()" and ":"
"::\n" ++ L3 -> {"\n"++L3,6}
end,
Ss = lists:duplicate(N, $\s),
- re:replace(L2, "\n"++Ss, "\n", [{return,list},global]).
+ re:replace(L2, "\n"++Ss, "\n", [{return,list},global,unicode]).
-etypef(L, O0) ->
- {R, O} = etypef(L, [], O0, []),
+etypef(L, O0, Opts) ->
+ {R, O} = etypef(L, [], O0, [], Opts),
{lists:reverse(R), O}.
-etypef([C | L], St, [C | O], R) ->
- etypef(L, St, O, [[C] | R]);
-etypef(" "++L, St, O, R) ->
- etypef(L, St, O, R);
-etypef("", [Cs | St], O, R) ->
- etypef(Cs, St, O, R);
-etypef("", [], O, R) ->
+etypef([C | L], St, [C | O], R, Opts) ->
+ etypef(L, St, O, [[C] | R], Opts);
+etypef(" "++L, St, O, R, Opts) ->
+ etypef(L, St, O, R, Opts);
+etypef("", [Cs | St], O, R, Opts) ->
+ etypef(Cs, St, O, R, Opts);
+etypef("", [], O, R, _Opts) ->
{R, O};
-etypef(L, St, " "++O, R) ->
- etypef(L, St, O, [" " | R]);
-etypef(L, St, "\n"++O, R) ->
+etypef(L, St, " "++O, R, Opts) ->
+ etypef(L, St, O, [" " | R], Opts);
+etypef(L, St, "\n"++O, R, Opts) ->
Ss = lists:takewhile(fun(C) -> C =:= $\s end, O),
- etypef(L, St, lists:nthtail(length(Ss), O), ["\n"++Ss | R]);
-etypef([{a, HRef, S0} | L], St, O0, R) ->
- {S, O} = etypef(S0, app_fix(O0)),
- etypef(L, St, O, [{a, HRef, S} | R]);
-etypef("="++L, St, "::"++O, R) ->
+ etypef(L, St, lists:nthtail(length(Ss), O), ["\n"++Ss | R], Opts);
+etypef([{a, HRef, S0} | L], St, O0, R, Opts) ->
+ {S, O} = etypef(S0, app_fix(O0, Opts), Opts),
+ etypef(L, St, O, [{a, HRef, S} | R], Opts);
+etypef("="++L, St, "::"++O, R, Opts) ->
%% EDoc uses "=" for record field types; Erlang types use "::".
%% Maybe there should be an option for this, possibly affecting
%% other similar discrepancies.
- etypef(L, St, O, ["=" | R]);
-etypef([Cs | L], St, O, R) ->
- etypef(Cs, [L | St], O, R).
+ etypef(L, St, O, ["=" | R], Opts);
+etypef([Cs | L], St, O, R, Opts) ->
+ etypef(Cs, [L | St], O, R, Opts).
-app_fix(L) ->
+app_fix(L, Opts) ->
try
- {"//" ++ R1,L2} = app_fix(L, 1),
+ {"//" ++ R1,L2} = app_fix1(L, 1),
[App, Mod] = string:tokens(R1, "/"),
- "//" ++ atom(App) ++ "/" ++ atom(Mod) ++ L2
+ "//" ++ atom(App, Opts) ++ "/" ++ atom(Mod, Opts) ++ L2
catch _:_ -> L
end.
-app_fix(L, I) -> % a bit slow
+app_fix1(L, I) -> % a bit slow
{L1, L2} = lists:split(I, L),
case erl_scan:tokens([], L1 ++ ". ", 1) of
{done, {ok,[{atom,_,Atom}|_],_}, _} -> {atom_to_list(Atom), L2};
- _ -> app_fix(L, I+1)
+ _ -> app_fix1(L, I+1)
end.
fulldesc(Es) ->
@@ -707,7 +714,7 @@ deprecated(Es, S) ->
?NL]
end.
-behaviours(Es, Name) ->
+behaviours(Es, Name, Opts) ->
CBs = get_content(callbacks, Es),
OCBs = get_content(optional_callbacks, Es),
(case get_elem(behaviour, Es) of
@@ -721,17 +728,18 @@ behaviours(Es, Name) ->
if CBs =:= [], OCBs =:= [] ->
[];
true ->
+ CBFun = fun(E) -> callback(E, Opts) end,
Req = if CBs =:= [] ->
[];
true ->
[br, " Required callback functions: "]
- ++ seq(fun callback/1, CBs, ["."])
+ ++ seq(CBFun, CBs, ["."])
end,
Opt = if OCBs =:= [] ->
[];
true ->
[br, " Optional callback functions: "]
- ++ seq(fun callback/1, OCBs, ["."])
+ ++ seq(CBFun, OCBs, ["."])
end,
[{p, ([{b, ["This module defines the ", {tt, [Name]},
" behaviour."]}]
@@ -742,10 +750,10 @@ behaviours(Es, Name) ->
behaviour(E=#xmlElement{content = Es}) ->
see(E, [{tt, Es}]).
-callback(E=#xmlElement{}) ->
+callback(E=#xmlElement{}, Opts) ->
Name = get_attrval(name, E),
Arity = get_attrval(arity, E),
- [{tt, [Name, "/", Arity]}].
+ [{tt, [atom(Name, Opts), "/", Arity]}].
authors(Es) ->
case get_elem(author, Es) of
@@ -755,9 +763,26 @@ authors(Es) ->
?NL]
end.
-atom(String) ->
+atom(String, #opts{encoding = latin1}) ->
+ io_lib:write_atom_as_latin1(list_to_atom(String));
+atom(String, #opts{encoding = utf8}) ->
io_lib:write_atom(list_to_atom(String)).
+-dialyzer({nowarn_function, string_length/1}).
+string_length(Data) ->
+ try iolist_size(Data)
+ catch
+ _:_ ->
+ M = string,
+ F = length,
+ As = [Data],
+ try apply(M, F, As)
+ catch
+ _:_ ->
+ 20
+ end
+ end.
+
%% <!ATTLIST author
%% name CDATA #REQUIRED
%% email CDATA #IMPLIED
@@ -803,70 +828,73 @@ todos(Es) ->
?NL]
end.
-t_name([E]) ->
+t_name([E], Opts) ->
N = get_attrval(name, E),
case get_attrval(module, E) of
- "" -> atom(N);
+ "" -> atom(N, Opts);
M ->
- S = atom(M) ++ ":" ++ atom(N),
+ S = atom(M, Opts) ++ ":" ++ atom(N, Opts),
case get_attrval(app, E) of
"" -> S;
- A -> "//" ++ atom(A) ++ "/" ++ S
+ A -> "//" ++ atom(A, Opts) ++ "/" ++ S
end
end.
-t_utype([E]) ->
- t_utype_elem(E).
+t_utype([E], Opts) ->
+ t_utype_elem(E, Opts).
+
+t_utype_elem_fun(Opts) ->
+ fun(E) -> t_utype_elem(E, Opts) end.
-t_utype_elem(E=#xmlElement{content = Es}) ->
+t_utype_elem(E=#xmlElement{content = Es}, Opts) ->
case get_attrval(name, E) of
- "" -> t_type(Es);
+ "" -> t_type(Es, Opts);
Name ->
- T = t_type(Es),
+ T = t_type(Es, Opts),
case T of
[Name] -> T; % avoid generating "Foo::Foo"
T -> [Name] ++ ["::"] ++ T
end
end.
-t_type([E=#xmlElement{name = typevar}]) ->
+t_type([E=#xmlElement{name = typevar}], _Opts) ->
t_var(E);
-t_type([E=#xmlElement{name = atom}]) ->
- t_atom(E);
-t_type([E=#xmlElement{name = integer}]) ->
+t_type([E=#xmlElement{name = atom}], Opts) ->
+ t_atom(E, Opts);
+t_type([E=#xmlElement{name = integer}], _Opts) ->
t_integer(E);
-t_type([E=#xmlElement{name = range}]) ->
+t_type([E=#xmlElement{name = range}], _Opts) ->
t_range(E);
-t_type([E=#xmlElement{name = binary}]) ->
+t_type([E=#xmlElement{name = binary}], _Opts) ->
t_binary(E);
-t_type([E=#xmlElement{name = float}]) ->
+t_type([E=#xmlElement{name = float}], _Opts) ->
t_float(E);
-t_type([#xmlElement{name = nil}]) ->
+t_type([#xmlElement{name = nil}], _Opts) ->
t_nil();
-t_type([#xmlElement{name = paren, content = Es}]) ->
- t_paren(Es);
-t_type([#xmlElement{name = list, content = Es}]) ->
- t_list(Es);
-t_type([#xmlElement{name = nonempty_list, content = Es}]) ->
- t_nonempty_list(Es);
-t_type([#xmlElement{name = map, content = Es}]) ->
- t_map(Es);
-t_type([#xmlElement{name = tuple, content = Es}]) ->
- t_tuple(Es);
-t_type([#xmlElement{name = 'fun', content = Es}]) ->
- ["fun("] ++ t_fun(Es) ++ [")"];
-t_type([E = #xmlElement{name = record, content = Es}]) ->
- t_record(E, Es);
-t_type([E = #xmlElement{name = abstype, content = Es}]) ->
- t_abstype(E, Es);
-t_type([#xmlElement{name = union, content = Es}]) ->
- t_union(Es).
+t_type([#xmlElement{name = paren, content = Es}], Opts) ->
+ t_paren(Es, Opts);
+t_type([#xmlElement{name = list, content = Es}], Opts) ->
+ t_list(Es, Opts);
+t_type([#xmlElement{name = nonempty_list, content = Es}], Opts) ->
+ t_nonempty_list(Es, Opts);
+t_type([#xmlElement{name = map, content = Es}], Opts) ->
+ t_map(Es, Opts);
+t_type([#xmlElement{name = tuple, content = Es}], Opts) ->
+ t_tuple(Es, Opts);
+t_type([#xmlElement{name = 'fun', content = Es}], Opts) ->
+ ["fun("] ++ t_fun(Es, Opts) ++ [")"];
+t_type([E = #xmlElement{name = record, content = Es}], Opts) ->
+ t_record(E, Es, Opts);
+t_type([E = #xmlElement{name = abstype, content = Es}], Opts) ->
+ t_abstype(E, Es, Opts);
+t_type([#xmlElement{name = union, content = Es}], Opts) ->
+ t_union(Es, Opts).
t_var(E) ->
[get_attrval(name, E)].
-t_atom(E) ->
- [get_attrval(value, E)].
+t_atom(E, Opts) ->
+ [atom(get_attrval(value, E), Opts)].
t_integer(E) ->
[get_attrval(value, E)].
@@ -883,62 +911,64 @@ t_float(E) ->
t_nil() ->
["[]"].
-t_paren(Es) ->
- ["("] ++ t_utype(get_elem(type, Es)) ++ [")"].
+t_paren(Es, Opts) ->
+ ["("] ++ t_utype(get_elem(type, Es), Opts) ++ [")"].
-t_list(Es) ->
- ["["] ++ t_utype(get_elem(type, Es)) ++ ["]"].
+t_list(Es, Opts) ->
+ ["["] ++ t_utype(get_elem(type, Es), Opts) ++ ["]"].
-t_nonempty_list(Es) ->
- ["["] ++ t_utype(get_elem(type, Es)) ++ [", ...]"].
+t_nonempty_list(Es, Opts) ->
+ ["["] ++ t_utype(get_elem(type, Es), Opts) ++ [", ...]"].
-t_tuple(Es) ->
- ["{"] ++ seq(fun t_utype_elem/1, Es, ["}"]).
+t_tuple(Es, Opts) ->
+ ["{"] ++ seq(t_utype_elem_fun(Opts), Es, ["}"]).
-t_fun(Es) ->
- ["("] ++ seq(fun t_utype_elem/1, get_content(argtypes, Es),
- [") -> "] ++ t_utype(get_elem(type, Es))).
+t_fun(Es, Opts) ->
+ ["("] ++ seq(t_utype_elem_fun(Opts), get_content(argtypes, Es),
+ [") -> "] ++ t_utype(get_elem(type, Es), Opts)).
-t_map(Es) ->
+t_map(Es, Opts) ->
Fs = get_elem(map_field, Es),
- ["#{"] ++ seq(fun t_map_field/1, Fs, ["}"]).
+ ["#{"] ++ seq(fun(E) -> t_map_field(E, Opts) end, Fs, ["}"]).
-t_map_field(#xmlElement{content = [K,V]}=E) ->
- KElem = t_utype_elem(K),
- VElem = t_utype_elem(V),
+t_map_field(#xmlElement{content = [K,V]}=E, Opts) ->
+ KElem = t_utype_elem(K, Opts),
+ VElem = t_utype_elem(V, Opts),
AS = case get_attrval(assoc_type, E) of
"assoc" -> " => ";
"exact" -> " := "
end,
KElem ++ [AS] ++ VElem.
-t_record(E, Es) ->
- Name = ["#"] ++ t_type(get_elem(atom, Es)),
+t_record(E, Es, Opts) ->
+ Name = ["#"] ++ t_type(get_elem(atom, Es), Opts),
case get_elem(field, Es) of
[] ->
see(E, [Name, "{}"]);
Fs ->
- see(E, Name) ++ ["{"] ++ seq(fun t_field/1, Fs, ["}"])
+ see(E, Name) ++ ["{"] ++ seq(fun(F) -> t_field(F, Opts) end,
+ Fs, ["}"])
end.
-t_field(#xmlElement{content = Es}) ->
- t_type(get_elem(atom, Es)) ++ [" = "] ++ t_utype(get_elem(type, Es)).
+t_field(#xmlElement{content = Es}, Opts) ->
+ (t_type(get_elem(atom, Es), Opts) ++ [" = "] ++
+ t_utype(get_elem(type, Es), Opts)).
-t_abstype(E, Es) ->
- Name = t_name(get_elem(erlangName, Es)),
+t_abstype(E, Es, Opts) ->
+ Name = t_name(get_elem(erlangName, Es), Opts),
case get_elem(type, Es) of
[] ->
see(E, [Name, "()"]);
Ts ->
- see(E, [Name]) ++ ["("] ++ seq(fun t_utype_elem/1, Ts, [")"])
+ see(E, [Name]) ++ ["("] ++ seq(t_utype_elem_fun(Opts), Ts, [")"])
end.
-t_abstype(Es) ->
- ([t_name(get_elem(erlangName, Es)), "("]
- ++ seq(fun t_utype_elem/1, get_elem(type, Es), [")"])).
+t_abstype(Es, Opts) ->
+ ([t_name(get_elem(erlangName, Es), Opts), "("]
+ ++ seq(t_utype_elem_fun(Opts), get_elem(type, Es), [")"])).
-t_union(Es) ->
- seq(fun t_utype_elem/1, Es, " | ", []).
+t_union(Es, Opts) ->
+ seq(t_utype_elem_fun(Opts), Es, " | ", []).
seq(F, Es) ->
seq(F, Es, []).
@@ -993,8 +1023,8 @@ local_label(R) ->
xhtml(Title, CSS, Body, Encoding) ->
EncString = case Encoding of
- "latin1" -> "ISO-8859-1";
- _ -> "UTF-8"
+ latin1 -> "ISO-8859-1";
+ utf8 -> "UTF-8"
end,
[{html, [?NL,
{head, [?NL,
@@ -1013,11 +1043,11 @@ xhtml(Title, CSS, Body, Encoding) ->
%% ---------------------------------------------------------------------
type(E) ->
- type(E, []).
+ Opts = init_opts(E, []),
+ type(E, [], Opts).
-type(E, Ds) ->
- Opts = [],
- xmerl:export_simple_content(t_utype_elem(E) ++ local_defs(Ds, Opts),
+type(E, Ds, Opts) ->
+ xmerl:export_simple_content(t_utype_elem(E, Opts) ++ local_defs(Ds, Opts),
?HTML_EXPORT).
overview(E=#xmlElement{name = overview, content = Es}, Options) ->
@@ -1039,8 +1069,8 @@ overview(E=#xmlElement{name = overview, content = Es}, Options) ->
++ FullDesc
++ [?NL, hr]
++ navigation("bottom")
- ++ timestamp()),
- Encoding = get_attrval(encoding, E),
+ ++ footer()),
+ Encoding = Opts#opts.encoding,
XML = xhtml(Title, stylesheet(Opts), Body, Encoding),
xmerl:export_simple(XML, ?HTML_EXPORT, []).
@@ -1098,8 +1128,8 @@ ot_var(E) ->
{var,0,list_to_atom(get_attrval(name, E))}.
ot_atom(E) ->
- {ok, [{atom,A,Name}], _} = erl_scan:string(get_attrval(value, E), 0),
- {atom,erl_anno:line(A),Name}.
+ Name = list_to_atom(get_attrval(value, E)),
+ {atom,erl_anno:new(0),Name}.
ot_integer(E) ->
{integer,0,list_to_integer(get_attrval(value, E))}.
diff --git a/lib/edoc/src/edoc_report.erl b/lib/edoc/src/edoc_report.erl
index ed778c8112..76557ef483 100644
--- a/lib/edoc/src/edoc_report.erl
+++ b/lib/edoc/src/edoc_report.erl
@@ -94,7 +94,7 @@ where({File, footer}) ->
where({File, header}) ->
io_lib:fwrite("~ts, in header file: ", [File]);
where({File, {F, A}}) ->
- io_lib:fwrite("~ts, function ~s/~w: ", [File, F, A]);
+ io_lib:fwrite("~ts, function ~ts/~w: ", [File, F, A]);
where([]) ->
io_lib:fwrite("~s: ", [?APPLICATION]);
where(File) when is_list(File) ->
diff --git a/lib/edoc/src/edoc_scanner.erl b/lib/edoc/src/edoc_scanner.erl
index f1d5e1d4b9..35d00c6c0e 100644
--- a/lib/edoc/src/edoc_scanner.erl
+++ b/lib/edoc/src/edoc_scanner.erl
@@ -86,6 +86,8 @@ scan1([C|Cs], Toks, Pos) when C >= 0, C =< $ -> % Skip blanks
scan1(Cs, Toks, Pos);
scan1([C|Cs], Toks, Pos) when C >= $a, C =< $z -> % Unquoted atom
scan_atom(C, Cs, Toks, Pos);
+scan1([C|Cs], Toks, Pos) when C >= $\337, C =< $\377, C /= $\367 ->
+ scan_atom(C, Cs, Toks, Pos);
scan1([C|Cs], Toks, Pos) when C >= $0, C =< $9 -> % Numbers
scan_number(C, Cs, Toks, Pos);
scan1([$-,C| Cs], Toks, Pos) when C >= $0, C =< $9 -> % Signed numbers
@@ -96,6 +98,8 @@ scan1([C|Cs], Toks, Pos) when C >= $A, C =< $Z -> % Variables
scan_variable(C, Cs, Toks, Pos);
scan1([$_|Cs], Toks, Pos) -> % Variables
scan_variable($_, Cs, Toks, Pos);
+scan1([C|Cs], Toks, Pos) when C >= $\300, C =< $\336, C /= $\327 ->
+ scan_variable(C, Cs, Toks, Pos);
scan1([$$|Cs], Toks, Pos) -> % Character constant
case scan_char_const(Cs, Toks, Pos) of
{ok, Result} ->
@@ -261,6 +265,15 @@ scan_char([], _Pos) ->
%% The following conforms to Standard Erlang escape sequences.
+-define(HEX(C), C >= $0 andalso C =< $9 orelse
+ C >= $A andalso C =< $F orelse
+ C >= $a andalso C =< $f).
+
+-define(UNICODE(C),
+ (C >= 0 andalso C < 16#D800 orelse
+ C > 16#DFFF andalso C < 16#FFFE orelse
+ C > 16#FFFF andalso C =< 16#10FFFF)).
+
scan_escape([O1, O2, O3 | Cs], Pos) when % \<1-3> octal digits
O1 >= $0, O1 =< $3, O2 >= $0, O2 =< $7, O3 >= $0, O3 =< $7 ->
Val = (O1*8 + O2)*8 + O3 - 73*$0,
@@ -272,6 +285,11 @@ scan_escape([O1, O2 | Cs], Pos) when
scan_escape([O1 | Cs], Pos) when
O1 >= $0, O1 =< $7 ->
{O1 - $0,Cs,Pos};
+scan_escape([$x, ${ | Cs], Pos) ->
+ scan_hex(Cs, Pos, []);
+scan_escape([$x, H1, H2 | Cs], Pos) when ?HEX(H1), ?HEX(H2) ->
+ Val = (H1*16 + H2) - 17*$0,
+ {Val,Cs,Pos};
scan_escape([$^, C | Cs], Pos) -> % \^X -> CTL-X
if C >= $\100, C =< $\137 ->
{C - $\100,Cs,Pos};
@@ -285,6 +303,18 @@ scan_escape([C | Cs], Pos) ->
scan_escape([], _Pos) ->
{error, truncated_char}.
+scan_hex([C | Cs], Pos, HCs) when ?HEX(C) ->
+ scan_hex(Cs, Pos, [C | HCs]);
+scan_hex([$} | Cs], Pos, HCs) ->
+ case catch erlang:list_to_integer(lists:reverse(HCs), 16) of
+ Val when ?UNICODE(Val) ->
+ {Val,Cs,Pos};
+ _ ->
+ {error, undefined_escape_sequence}
+ end;
+scan_hex(_Cs, _Pos, _HCs) ->
+ {error, undefined_escape_sequence}.
+
%% Note that we return $\000 for undefined escapes.
escape_char($b) -> $\010; % \b = BS
escape_char($d) -> $\177; % \d = DEL
diff --git a/lib/edoc/src/edoc_specs.erl b/lib/edoc/src/edoc_specs.erl
index c15dfd328f..fb04bfce0e 100644
--- a/lib/edoc/src/edoc_specs.erl
+++ b/lib/edoc/src/edoc_specs.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -274,12 +274,19 @@ parms([A | As], [D | Ds]) ->
param(#t_paren{type = Type}, Default) ->
param(Type, Default);
-param(#t_record{name = #t_atom{val = Name}}, _Default) ->
- list_to_atom(capitalize(atom_to_list(Name)));
+param(#t_record{name = #t_atom{val = Name}}=T, Default) ->
+ AtomList = atom_to_list(Name),
+ case AtomList =:= lists:flatten(io_lib:write_atom(Name)) of
+ true ->
+ list_to_atom(capitalize(AtomList));
+ false ->
+ arg_name(?t_ann(T), Default)
+ end;
param(T, Default) ->
arg_name(?t_ann(T), Default).
capitalize([C | Cs]) when C >= $a, C =< $z -> [C - 32 | Cs];
+capitalize([C | Cs]) when C >= $\340, C =< $\376, C /= $\367 -> [C - 32 | Cs];
capitalize(Cs) -> Cs.
%% Like edoc_types:arg_name/1
diff --git a/lib/edoc/test/edoc_SUITE.erl b/lib/edoc/test/edoc_SUITE.erl
index 00d7550bed..29ca9d1203 100644
--- a/lib/edoc/test/edoc_SUITE.erl
+++ b/lib/edoc/test/edoc_SUITE.erl
@@ -23,12 +23,13 @@
init_per_group/2,end_per_group/2]).
%% Test cases
--export([app/1,appup/1,build_std/1,build_map_module/1,otp_12008/1, build_app/1]).
+-export([app/1,appup/1,build_std/1,build_map_module/1,otp_12008/1,
+ build_app/1, otp_14285/1]).
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [app,appup,build_std,build_map_module,otp_12008, build_app].
+ [app,appup,build_std,build_map_module,otp_12008, build_app, otp_14285].
groups() ->
[].
@@ -69,7 +70,7 @@ build_std(Config) when is_list(Config) ->
{def, {vsn,"TEST"}},
{dir, PrivDir}]),
- ok = edoc:application(xmerl, [{dir, PrivDir}]),
+ ok = edoc:application(xmerl, [{preprocess,true},{dir, PrivDir}]),
ok.
build_map_module(Config) when is_list(Config) ->
@@ -113,3 +114,18 @@ build_app(Config) ->
true = filelib:is_regular(filename:join(OutDir, "a.html")),
true = filelib:is_regular(filename:join(OutDir, "b.html")),
ok.
+
+otp_14285(Config) ->
+ DataDir = ?config(data_dir, Config),
+ PrivDir = ?config(priv_dir, Config),
+ Un1 = filename:join(DataDir, "un_atom1.erl"),
+ Un2 = filename:join(DataDir, "un_atom2.erl"),
+ %% epp_dodger
+ Opts1 = [{dir, PrivDir}],
+ ok = edoc:files([Un1], Opts1),
+ ok = edoc:files([Un2], Opts1),
+ %% epp
+ Opts2 = [{preprocess, true}, {dir, PrivDir}],
+ ok = edoc:files([Un1], Opts2),
+ ok = edoc:files([Un2], Opts2),
+ ok.
diff --git a/lib/edoc/test/edoc_SUITE_data/un_atom1.erl b/lib/edoc/test/edoc_SUITE_data/un_atom1.erl
new file mode 100644
index 0000000000..20ca50d5d2
--- /dev/null
+++ b/lib/edoc/test/edoc_SUITE_data/un_atom1.erl
@@ -0,0 +1,41 @@
+%% coding:latin-1
+
+-module(un_atom1).
+
+-export(['\x{aaa}memory'/0, 'func-\x{400}'/1, func/1, �func/1]).
+
+-record('rec-\x{400}', {'field-\x{400}'}).
+
+-type cs() :: $\x{a}
+ | $\x{aa}
+ | $\x{aaa}
+ | $\xaa.
+
+-callback 'callback-\x{400}'() -> 'apa'.
+
+-type 'type-\x{400}'() :: 'atom-\x{400}'
+ | cs()
+ | #'rec-\x{400}'{'field-\x{400}' :: 'type-\x{400}'()}.
+
+-spec '\x{aaa}memory'() -> 'type-\x{400}'().
+
+'\x{aaa}memory'() ->
+ apa:foo().
+
+%% @deprecated Please use {@link m:f/1}.
+-spec 'func-\x{400}'(#'rec-\x{400}'{}) -> #'rec-\x{400}'{}.
+
+'func-\x{400}'(_T) ->
+ foo:bar(#'rec-\x{400}'{}).
+
+-record(rec, {}).
+
+-spec func(#rec{}) -> #rec{}.
+
+func(#rec{}) -> #rec{}.
+
+-record(�rec, {}).
+
+-spec �func(#�rec{}) -> #�rec{}.
+
+�func(#�rec{}) -> #�rec{}.
diff --git a/lib/edoc/test/edoc_SUITE_data/un_atom2.erl b/lib/edoc/test/edoc_SUITE_data/un_atom2.erl
new file mode 100644
index 0000000000..66c83e30e0
--- /dev/null
+++ b/lib/edoc/test/edoc_SUITE_data/un_atom2.erl
@@ -0,0 +1,40 @@
+%% coding:utf-8
+-module(un_atom2).
+
+-export(['\x{aaa}memory'/0, 'func-\x{400}'/1, func/1, äfunc/1]).
+
+-record('rec-\x{400}', {'field-\x{400}'}).
+
+-type cs() :: $\x{a}
+ | $\x{aa}
+ | $\x{aaa}
+ | $\xaa.
+
+-callback 'callback-\x{400}'() -> 'apa'.
+
+-type 'type-\x{400}'() :: 'atom-\x{400}'
+ | cs()
+ | #'rec-\x{400}'{'field-\x{400}' :: 'type-\x{400}'()}.
+
+-spec '\x{aaa}memory'() -> 'type-\x{400}'().
+
+'\x{aaa}memory'() ->
+ apa:foo().
+
+%% @deprecated Please use {@link m:f/1}.
+-spec 'func-\x{400}'(#'rec-\x{400}'{}) -> #'rec-\x{400}'{}.
+
+'func-\x{400}'(_T) ->
+ foo:bar(#'rec-\x{400}'{}).
+
+-record(rec, {}).
+
+-spec func(#rec{}) -> #rec{}.
+
+func(#rec{}) -> #rec{}.
+
+-record(ärec, {}).
+
+-spec äfunc(#ärec{}) -> #ärec{}.
+
+äfunc(#ärec{}) -> #ärec{}.
diff --git a/lib/erl_interface/doc/src/ei.xml b/lib/erl_interface/doc/src/ei.xml
index ddfb4d88a8..c3c776296c 100644
--- a/lib/erl_interface/doc/src/ei.xml
+++ b/lib/erl_interface/doc/src/ei.xml
@@ -421,22 +421,16 @@ typedef enum {
<name><ret>int</ret><nametext>ei_x_encode_atom_len_as(ei_x_buff* x, const char *p, int len, erlang_char_encoding from_enc, erlang_char_encoding to_enc)</nametext></name>
<fsummary>Encode an atom.</fsummary>
<desc>
- <p>Encodes an atom in the binary format with character encoding
- <seealso marker="#erlang_char_encoding"><c>to_enc</c></seealso>
- (Latin-1 or UTF-8). Parameter <c>p</c> is the name of the atom with
+ <p>Encodes an atom in the binary format. Parameter <c>p</c> is the name of the atom with
character encoding
<seealso marker="#erlang_char_encoding"><c>from_enc</c></seealso>
(ASCII, Latin-1, or UTF-8). The name must either be <c>NULL</c>-terminated or
- a function variant with a <c>len</c> parameter must be used.
- If <c>to_enc</c> is set to the bitwise OR'd combination
- <c>(ERLANG_LATIN1|ERLANG_UTF8)</c>, UTF-8 encoding is only used if the
- atom string cannot be represented in Latin-1 encoding.</p>
- <p>The encoding fails if <c>p</c> is an invalid string in encoding
- <c>from_enc</c>, if the string is too long, or if it cannot be
- represented with character encoding <c>to_enc</c>.</p>
- <p>These functions were introduced in Erlang/OTP R16 as part of a first
- step to support UTF-8 atoms. Atoms encoded with <c>ERLANG_UTF8</c>
- cannot be decoded by earlier releases than R16.</p>
+ a function variant with a <c>len</c> parameter must be used.</p>
+ <p>The encoding fails if <c>p</c> is not a valid string in encoding
+ <c>from_enc</c>.</p>
+
+ <p>Argument <c>to_enc</c> is ignored. As from Erlang/OTP 20 the encoding is always
+ done in UTF-8 which is readable by nodes as old as Erlang/OTP R16.</p>
</desc>
</func>
diff --git a/lib/erl_interface/doc/src/notes.xml b/lib/erl_interface/doc/src/notes.xml
index 69ba3cddb8..b5d8def655 100644
--- a/lib/erl_interface/doc/src/notes.xml
+++ b/lib/erl_interface/doc/src/notes.xml
@@ -31,6 +31,21 @@
</header>
<p>This document describes the changes made to the Erl_interface application.</p>
+<section><title>Erl_Interface 3.9.3</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Minor documentation update</p>
+ <p>
+ Own Id: OTP-14233 Aux Id: PR-1343 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Erl_Interface 3.9.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index c193fd804a..27b919c093 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -497,7 +497,8 @@ int ei_connect_init(ei_cnode* ec, const char* this_node_name,
}
#endif /* _REENTRANT */
- if (gethostname(thishostname, EI_MAXHOSTNAMELEN) == -1) {
+ /* gethostname requires len to be max(hostname) + 1 */
+ if (gethostname(thishostname, EI_MAXHOSTNAMELEN+1) == -1) {
#ifdef __WIN32__
EI_TRACE_ERR1("ei_connect_init","Failed to get host name: %d",
WSAGetLastError());
@@ -613,7 +614,8 @@ int ei_connect_tmo(ei_cnode* ec, char *nodename, unsigned ms)
hp = ei_gethostbyname_r(hostname,&host,buffer,1024,&ei_h_errno);
if (hp == NULL) {
char thishostname[EI_MAXHOSTNAMELEN+1];
- if (gethostname(thishostname,EI_MAXHOSTNAMELEN) < 0) {
+ /* gethostname requies len to be max(hostname) + 1*/
+ if (gethostname(thishostname,EI_MAXHOSTNAMELEN+1) < 0) {
EI_TRACE_ERR0("ei_connect_tmo",
"Failed to get name of this host");
erl_errno = EHOSTUNREACH;
@@ -636,7 +638,8 @@ int ei_connect_tmo(ei_cnode* ec, char *nodename, unsigned ms)
#else /* __WIN32__ */
if ((hp = ei_gethostbyname(hostname)) == NULL) {
char thishostname[EI_MAXHOSTNAMELEN+1];
- if (gethostname(thishostname,EI_MAXHOSTNAMELEN) < 0) {
+ /* gethostname requires len to be max(hostname) + 1 */
+ if (gethostname(thishostname,EI_MAXHOSTNAMELEN+1) < 0) {
EI_TRACE_ERR1("ei_connect_tmo",
"Failed to get name of this host: %d",
WSAGetLastError());
diff --git a/lib/erl_interface/src/encode/encode_atom.c b/lib/erl_interface/src/encode/encode_atom.c
index c1817628e5..1fd7811a0e 100644
--- a/lib/erl_interface/src/encode/encode_atom.c
+++ b/lib/erl_interface/src/encode/encode_atom.c
@@ -26,7 +26,6 @@
static int verify_ascii_atom(const char* src, int slen);
static int verify_utf8_atom(const char* src, int slen);
-static int is_latin1_as_utf8(const char *p, int len);
int ei_encode_atom(char *buf, int *index, const char *p)
{
@@ -34,7 +33,7 @@ int ei_encode_atom(char *buf, int *index, const char *p)
if (len >= MAXATOMLEN)
len = MAXATOMLEN - 1;
- return ei_encode_atom_len_as(buf, index, p, len, ERLANG_LATIN1, ERLANG_LATIN1);
+ return ei_encode_atom_len_as(buf, index, p, len, ERLANG_LATIN1, 0);
}
int ei_encode_atom_len(char *buf, int *index, const char *p, int len)
@@ -42,7 +41,7 @@ int ei_encode_atom_len(char *buf, int *index, const char *p, int len)
/* This function is documented to truncate at MAXATOMLEN (256) */
if (len >= MAXATOMLEN)
len = MAXATOMLEN - 1;
- return ei_encode_atom_len_as(buf, index, p, len, ERLANG_LATIN1, ERLANG_LATIN1);
+ return ei_encode_atom_len_as(buf, index, p, len, ERLANG_LATIN1, 0);
}
int ei_encode_atom_as(char *buf, int *index, const char *p,
@@ -64,46 +63,11 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
return -1;
}
- if (to_enc == (ERLANG_LATIN1 | ERLANG_UTF8)) {
- if (from_enc == ERLANG_UTF8) {
- to_enc = is_latin1_as_utf8(p, len) ? ERLANG_LATIN1 : ERLANG_UTF8;
- }
- else {
- to_enc = from_enc;
- }
- }
- switch(to_enc) {
- case ERLANG_LATIN1:
- if (buf) {
- put8(s,ERL_ATOM_EXT);
- switch (from_enc) {
- case ERLANG_UTF8:
- len = utf8_to_latin1(s+2, p, len, MAXATOMLEN-1, NULL);
- if (len < 0) return -1;
- break;
- case ERLANG_ASCII:
- if (verify_ascii_atom(p, len) < 0) return -1;
- memcpy(s+2, p, len);
- break;
- case ERLANG_LATIN1:
- memcpy(s+2, p, len);
- break;
- default:
- return -1;
- }
- put16be(s,len);
- }
- else {
- s += 3;
- if (from_enc == ERLANG_UTF8) {
- len = utf8_to_latin1(NULL, p, len, MAXATOMLEN-1, NULL);
- if (len < 0) return -1;
- } else if (from_enc == ERLANG_ASCII)
- if (verify_ascii_atom(p, len) < 0) return -1;
- }
- break;
-
- case ERLANG_UTF8:
+ /*
+ * Since OTP 20 we totally ignore 'to_enc'
+ * and alway encode as UTF8.
+ */
+ {
offs = 1 + 1;
switch (from_enc) {
case ERLANG_LATIN1:
@@ -133,10 +97,6 @@ int ei_encode_atom_len_as(char *buf, int *index, const char *p, int len,
}
}
else s+= offs;
- break;
-
- default:
- return -1;
}
s += len;
@@ -197,13 +157,3 @@ static int verify_utf8_atom(const char* src, int slen)
return 0;
}
-/* Only latin1 code points in utf8 string?
- */
-static int is_latin1_as_utf8(const char *p, int len)
-{
- int i;
- for (i=0; i<len; i++) {
- if ((unsigned char)p[i] > 0xC3) return 0;
- }
- return 1;
-}
diff --git a/lib/erl_interface/src/encode/encode_boolean.c b/lib/erl_interface/src/encode/encode_boolean.c
index 61e7e5e6e7..053029af05 100644
--- a/lib/erl_interface/src/encode/encode_boolean.c
+++ b/lib/erl_interface/src/encode/encode_boolean.c
@@ -32,12 +32,12 @@ int ei_encode_boolean(char *buf, int *index, int p)
val = p ? "true" : "false";
len = strlen(val);
- if (!buf) s += 3;
+ if (!buf) s += 2;
else {
- put8(s,ERL_ATOM_EXT);
- put16be(s,len);
+ put8(s, ERL_SMALL_ATOM_UTF8_EXT);
+ put8(s, len);
- memmove(s,val,len); /* unterminated string */
+ memcpy(s,val,len); /* unterminated string */
}
s += len;
diff --git a/lib/erl_interface/src/legacy/erl_eterm.c b/lib/erl_interface/src/legacy/erl_eterm.c
index e4b3b49c7d..5153d0f2e7 100644
--- a/lib/erl_interface/src/legacy/erl_eterm.c
+++ b/lib/erl_interface/src/legacy/erl_eterm.c
@@ -188,14 +188,20 @@ char* erl_atom_ptr_latin1(Erl_Atom_data* a)
char* erl_atom_ptr_utf8(Erl_Atom_data* a)
{
if (a->utf8 == NULL) {
- int dlen = a->lenL * 2; /* over estimation */
- a->utf8 = malloc(dlen + 1);
- a->lenU = latin1_to_utf8(a->utf8, a->latin1, a->lenL, dlen, NULL);
- a->utf8[a->lenU] = '\0';
+ erlang_char_encoding enc;
+ a->lenU = latin1_to_utf8(NULL, a->latin1, a->lenL, a->lenL*2, &enc);
+ if (enc == ERLANG_ASCII) {
+ a->utf8 = a->latin1;
+ }
+ else {
+ a->utf8 = malloc(a->lenU + 1);
+ latin1_to_utf8(a->utf8, a->latin1, a->lenL, a->lenU, NULL);
+ a->utf8[a->lenU] = '\0';
+ }
}
return a->utf8;
-
}
+
int erl_atom_size_latin1(Erl_Atom_data* a)
{
if (a->latin1 == NULL) {
diff --git a/lib/erl_interface/src/legacy/erl_marshal.c b/lib/erl_interface/src/legacy/erl_marshal.c
index 527ae0ef8f..b7a8455313 100644
--- a/lib/erl_interface/src/legacy/erl_marshal.c
+++ b/lib/erl_interface/src/legacy/erl_marshal.c
@@ -175,10 +175,9 @@ static void encode_atom(Erl_Atom_data* a, unsigned char **ext)
int ix = 0;
if (a->latin1) {
ei_encode_atom_len_as((char*)*ext, &ix, a->latin1, a->lenL,
- ERLANG_LATIN1, ERLANG_LATIN1);
+ ERLANG_LATIN1, ERLANG_UTF8);
}
- else if (ei_encode_atom_len_as((char*)*ext, &ix, a->utf8, a->lenU,
- ERLANG_UTF8, ERLANG_LATIN1) < 0) {
+ else {
ei_encode_atom_len_as((char*)*ext, &ix, a->utf8, a->lenU,
ERLANG_UTF8, ERLANG_UTF8);
}
@@ -542,12 +541,8 @@ int erl_term_len(ETERM *ep)
static int atom_len_helper(Erl_Atom_data* a)
{
- if (erl_atom_ptr_latin1(a)) {
- return 1 + 2 + a->lenL; /* ERL_ATOM_EXT */
- }
- else {
- return 1 + 1 + (a->lenU > 255) + a->lenU;
- }
+ (void) erl_atom_ptr_utf8(a);
+ return 1 + 1 + (a->lenU > 255) + a->lenU;
}
static int erl_term_len_helper(ETERM *ep, int dist)
diff --git a/lib/erl_interface/src/prog/erl_call.c b/lib/erl_interface/src/prog/erl_call.c
index d233ed26a2..0b09d412db 100644
--- a/lib/erl_interface/src/prog/erl_call.c
+++ b/lib/erl_interface/src/prog/erl_call.c
@@ -325,7 +325,8 @@ int erl_call(int argc, char **argv)
initWinSock();
#endif
- if (gethostname(h_hostname, EI_MAXHOSTNAMELEN) < 0) {
+ /* gethostname requires len to be max(hostname) + 1 */
+ if (gethostname(h_hostname, EI_MAXHOSTNAMELEN+1) < 0) {
fprintf(stderr,"erl_call: failed to get host name: %d\n", errno);
exit(1);
}
diff --git a/lib/erl_interface/test/ei_decode_SUITE.erl b/lib/erl_interface/test/ei_decode_SUITE.erl
index 10e90685c8..8612450692 100644
--- a/lib/erl_interface/test/ei_decode_SUITE.erl
+++ b/lib/erl_interface/test/ei_decode_SUITE.erl
@@ -179,7 +179,8 @@ test_ei_decode_misc(Config) when is_list(Config) ->
send_term_as_binary(P,foo),
send_term_as_binary(P,''),
- send_term_as_binary(P,'ÅÄÖåäö'),
+ %%send_term_as_binary(P,'ÅÄÖåäö'),
+ send_latin1_atom_as_binary(P, "ÅÄÖåäö"),
send_term_as_binary(P,"foo"),
send_term_as_binary(P,""),
@@ -200,18 +201,19 @@ test_ei_decode_misc(Config) when is_list(Config) ->
test_ei_decode_utf8_atom(Config) ->
P = runner:start(?test_ei_decode_utf8_atom),
- send_utf8_atom_as_binary(P,"å"),
- send_utf8_atom_as_binary(P,"ä"),
- send_term_as_binary(P,'ö'),
- send_term_as_binary(P,'õ'),
+ send_latin1_atom_as_binary(P,"å"),
+ send_latin1_atom_as_binary(P,"ä"),
+ send_latin1_atom_as_binary(P,"ö"),
+ send_latin1_atom_as_binary(P,"õ"),
send_utf8_atom_as_binary(P,[1758]),
send_utf8_atom_as_binary(P,[1758,1758]),
send_utf8_atom_as_binary(P,[1758,1758,1758]),
send_utf8_atom_as_binary(P,[1758,1758,1758,1758]),
- send_utf8_atom_as_binary(P,"a"),
- send_utf8_atom_as_binary(P,"b"),
+ send_latin1_atom_as_binary(P,"a"),
+ send_latin1_atom_as_binary(P,"b"),
+
send_term_as_binary(P,'c'),
send_term_as_binary(P,'d'),
@@ -230,6 +232,9 @@ send_raw(Port, Bin) when is_port(Port) ->
send_utf8_atom_as_binary(Port, String) ->
Port ! {self(), {command, term_to_binary(uc_atup(String))}}.
+send_latin1_atom_as_binary(Port, String) ->
+ Port ! {self(), {command, encode_latin1_atom(String)}}.
+
send_integers(P) ->
send_term_as_binary(P,0), % SMALL_INTEGER_EXT smallest
send_term_as_binary(P,255), % SMALL_INTEGER_EXT largest
@@ -304,6 +309,12 @@ send_integers2(P) ->
send_term_as_binary(P, []), % illegal type
ok.
+encode_latin1_atom(String) ->
+ Len = length(String),
+ %% Use ATOM_EXT (not SMALL_*) to simulate old term_to_binary
+ TagLen = [$d, Len bsr 8, Len band 16#ff],
+ list_to_binary([131, TagLen, String]).
+
uc_atup(ATxt) ->
string_to_atom(ATxt).
diff --git a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
index cfe9083065..649dc9a677 100644
--- a/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
+++ b/lib/erl_interface/test/ei_decode_SUITE_data/ei_decode_test.c
@@ -102,7 +102,7 @@ int ei_decode_my_string(const char *buf, int *index, char *to,
} \
\
if (size1 != SIZE) { \
- fail("size of encoded data is incorrect"); \
+ fail1("size of encoded data (%d) is incorrect", size1); \
return; \
} \
} \
@@ -614,11 +614,11 @@ TESTCASE(test_ei_decode_misc)
EI_DECODE_2(decode_double, 9, double, -1.0);
EI_DECODE_2(decode_double, 9, double, 1.0);
- EI_DECODE_2(decode_boolean, 8, int, 0);
- EI_DECODE_2(decode_boolean, 7, int, 1);
+ EI_DECODE_2(decode_boolean, 7, int, 0);
+ EI_DECODE_2(decode_boolean, 6, int, 1);
- EI_DECODE_STRING(decode_my_atom, 6, "foo");
- EI_DECODE_STRING(decode_my_atom, 3, "");
+ EI_DECODE_STRING(decode_my_atom, 5, "foo");
+ EI_DECODE_STRING(decode_my_atom, 2, "");
EI_DECODE_STRING(decode_my_atom, 9, "������");
EI_DECODE_STRING(decode_my_string, 6, "foo");
@@ -665,10 +665,10 @@ TESTCASE(test_ei_decode_utf8_atom)
P99({ERLANG_ANY,ERLANG_LATIN1,ERLANG_ASCII}));
EI_DECODE_STRING_4(decode_my_atom_as, 4, "b",
P99({ERLANG_UTF8,ERLANG_LATIN1,ERLANG_ASCII}));
- EI_DECODE_STRING_4(decode_my_atom_as, 4, "c",
- P99({ERLANG_LATIN1,ERLANG_LATIN1,ERLANG_ASCII}));
- EI_DECODE_STRING_4(decode_my_atom_as, 4, "d",
- P99({ERLANG_ASCII,ERLANG_LATIN1,ERLANG_ASCII}));
+ EI_DECODE_STRING_4(decode_my_atom_as, 3, "c",
+ P99({ERLANG_LATIN1,ERLANG_UTF8,ERLANG_ASCII}));
+ EI_DECODE_STRING_4(decode_my_atom_as, 3, "d",
+ P99({ERLANG_ASCII,ERLANG_UTF8,ERLANG_ASCII}));
report(1);
}
diff --git a/lib/erl_interface/test/ei_decode_encode_SUITE.erl b/lib/erl_interface/test/ei_decode_encode_SUITE.erl
index 570a91e2da..108a1f5142 100644
--- a/lib/erl_interface/test/ei_decode_encode_SUITE.erl
+++ b/lib/erl_interface/test/ei_decode_encode_SUITE.erl
@@ -170,7 +170,6 @@ get_binary(P) ->
-define(VERSION_MAGIC, 131).
--define(ATOM_EXT, 100).
-define(REFERENCE_EXT, 101).
-define(PORT_EXT, 102).
-define(PID_EXT, 103).
diff --git a/lib/erl_interface/test/ei_encode_SUITE.erl b/lib/erl_interface/test/ei_encode_SUITE.erl
index ac6ec9cf4e..43484a1319 100644
--- a/lib/erl_interface/test/ei_encode_SUITE.erl
+++ b/lib/erl_interface/test/ei_encode_SUITE.erl
@@ -184,17 +184,17 @@ test_ei_encode_misc(Config) when is_list(Config) ->
{<<70,_:8/binary>>,Fp1} = get_buf_and_term(P),
true = match_float(Fp1, 1.0),
- {<<100,0,5,"false">>,false} = get_buf_and_term(P),
- {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
- {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
- {<<100,0,4,"true">> ,true} = get_buf_and_term(P),
-
- {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
- {<<100,0,3,"foo">>,foo} = get_buf_and_term(P),
- {<<100,0,0,"">>,''} = get_buf_and_term(P),
- {<<100,0,0,"">>,''} = get_buf_and_term(P),
- {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
- {<<100,0,6,"ÅÄÖåäö">>,'ÅÄÖåäö'} = get_buf_and_term(P),
+ {<<$w,5,"false">>,false} = get_buf_and_term(P),
+ {<<$w,4,"true">> ,true} = get_buf_and_term(P),
+ {<<$w,4,"true">> ,true} = get_buf_and_term(P),
+ {<<$w,4,"true">> ,true} = get_buf_and_term(P),
+
+ {<<$w,3,"foo">>,foo} = get_buf_and_term(P),
+ {<<$w,3,"foo">>,foo} = get_buf_and_term(P),
+ {<<$w,0,"">>,''} = get_buf_and_term(P),
+ {<<$w,0,"">>,''} = get_buf_and_term(P),
+ {<<$w,12,"ÅÄÖåäö"/utf8>>,'ÅÄÖåäö'} = get_buf_and_term(P),
+ {<<$w,12,"ÅÄÖåäö"/utf8>>,'ÅÄÖåäö'} = get_buf_and_term(P),
{<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
{<<107,0,3,"foo">>,"foo"} = get_buf_and_term(P),
@@ -239,12 +239,12 @@ test_ei_encode_utf8_atom(Config) ->
P = runner:start(?test_ei_encode_utf8_atom),
{<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
- {<<100,0,1,197>>,'Å'} = get_buf_and_term(P),
- {<<100,0,1,197>>,'Å'} = get_buf_and_term(P),
+ {<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
+ {<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
{<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
{<<119,1,$A>>,'A'} = get_buf_and_term(P),
- {<<100,0,1,$A>>,'A'} = get_buf_and_term(P),
+ {<<119,1,$A>>,'A'} = get_buf_and_term(P),
runner:recv_eot(P),
ok.
@@ -254,13 +254,13 @@ test_ei_encode_utf8_atom_len(Config) ->
P = runner:start(?test_ei_encode_utf8_atom_len),
{<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
- {<<100,0,2,197,196>>,'ÅÄ'} = get_buf_and_term(P),
- {<<100,0,1,197>>,'Å'} = get_buf_and_term(P),
+ {<<119,4,195,133,195,132>>,'ÅÄ'} = get_buf_and_term(P),
+ {<<119,2,195,133>>,'Å'} = get_buf_and_term(P),
{<<119,4,195,133,195,132>>,'ÅÄ'} = get_buf_and_term(P),
{<<119,1,$A>>,'A'} = get_buf_and_term(P),
- {<<100,0,2,$A,$B>>,'AB'} = get_buf_and_term(P),
- {<<100,0,255,_:(255*8)>>,_} = get_buf_and_term(P),
+ {<<119,2,$A,$B>>,'AB'} = get_buf_and_term(P),
+ {<<119,255,_:(255*8)>>,_} = get_buf_and_term(P),
runner:recv_eot(P),
ok.
diff --git a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
index 36cf086ed2..afac5485e8 100644
--- a/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
+++ b/lib/erl_interface/test/erl_ext_SUITE_data/ext_test.c
@@ -407,7 +407,7 @@ test_compare_ext(char *test_desc,
}
-#define ATOM_EXT (100)
+#define SMALL_ATOM_UTF8_EXT (119)
#define REFERENCE_EXT (101)
#define PORT_EXT (102)
#define PID_EXT (103)
@@ -429,13 +429,13 @@ write_atom(unsigned char *buf, char *atom)
len = 0;
while(atom[len]) {
- buf[len + 3] = atom[len];
+ buf[len + 2] = atom[len];
len++;
}
- buf[0] = ATOM_EXT;
- PUT_UINT16(&buf[1], len);
+ buf[0] = SMALL_ATOM_UTF8_EXT;
+ buf[1] = len;
- return buf + 3 + len;
+ return buf + 2 + len;
}
static unsigned char *
diff --git a/lib/erl_interface/vsn.mk b/lib/erl_interface/vsn.mk
index c7981ed3a5..563694a0c1 100644
--- a/lib/erl_interface/vsn.mk
+++ b/lib/erl_interface/vsn.mk
@@ -1,2 +1,2 @@
-EI_VSN = 3.9.2
+EI_VSN = 3.9.3
ERL_INTERFACE_VSN = $(EI_VSN)
diff --git a/lib/eunit/doc/overview.edoc b/lib/eunit/doc/overview.edoc
index 3a46e991cb..dc9f858812 100644
--- a/lib/eunit/doc/overview.edoc
+++ b/lib/eunit/doc/overview.edoc
@@ -578,7 +578,7 @@ results for equality, if testing is enabled. If the values are not
equal, an informative exception will be generated; see the `assert'
macro for further details.
-`assertEqual' is more suitable than than `assertMatch' when the
+`assertEqual' is more suitable than `assertMatch' when the
left-hand side is a computed value rather than a simple pattern, and
gives more details than `?assert(Expect =:= Expr)'.
@@ -994,7 +994,7 @@ specified node. `local' means that the current process will handle both
setup/teardown and running the tests - the drawback is that if a test
times out so that the process is killed, the <em>cleanup will not be
performed</em>; hence, avoid this for persistent fixtures such as file
-operations. In general, 'local' should only be used when:
+operations. In general, `local' should only be used when:
<ul>
<li>the setup/teardown needs to be executed by the process that will
run the tests;</li>
diff --git a/lib/eunit/src/eunit.erl b/lib/eunit/src/eunit.erl
index 2c832a7f7a..1ace85ffde 100644
--- a/lib/eunit/src/eunit.erl
+++ b/lib/eunit/src/eunit.erl
@@ -256,7 +256,7 @@ all_options(Opts) ->
false -> Opts;
S ->
{ok, Ts, _} = erl_scan:string(S),
- {ok, V} = erl_parse:parse_term(Ts ++ [{dot,1}]),
+ {ok, V} = erl_parse:parse_term(Ts ++ [{dot,erl_anno:new(1)}]),
if is_list(V) -> Opts ++ V;
true -> Opts ++ [V]
end
diff --git a/lib/eunit/src/eunit_surefire.erl b/lib/eunit/src/eunit_surefire.erl
index 6b306c51d3..2b9f82b075 100644
--- a/lib/eunit/src/eunit_surefire.erl
+++ b/lib/eunit/src/eunit_surefire.erl
@@ -424,6 +424,7 @@ escape_suitename(String) ->
escape_suitename([], Acc) -> lists:reverse(Acc);
escape_suitename([$ | Tail], Acc) -> escape_suitename(Tail, [$_ | Acc]);
escape_suitename([$' | Tail], Acc) -> escape_suitename(Tail, Acc);
+escape_suitename([$" | Tail], Acc) -> escape_suitename(Tail, Acc);
escape_suitename([$/ | Tail], Acc) -> escape_suitename(Tail, [$: | Acc]);
escape_suitename([$\\ | Tail], Acc) -> escape_suitename(Tail, [$: | Acc]);
escape_suitename([Char | Tail], Acc) when Char < $! -> escape_suitename(Tail, Acc);
diff --git a/lib/hipe/amd64/Makefile b/lib/hipe/amd64/Makefile
index 617f6749ac..d0da8cdff6 100644
--- a/lib/hipe/amd64/Makefile
+++ b/lib/hipe/amd64/Makefile
@@ -128,6 +128,7 @@ $(EBIN)/hipe_amd64_ra_postconditions.beam: ../main/hipe.hrl ../x86/hipe_x86.hrl
$(EBIN)/hipe_amd64_ra_sse2_postconditions.beam: ../main/hipe.hrl
$(EBIN)/hipe_amd64_registers.beam: ../rtl/hipe_literals.hrl
$(EBIN)/hipe_amd64_spill_restore.beam: ../main/hipe.hrl ../x86/hipe_x86.hrl ../flow/cfg.hrl ../x86/hipe_x86_spill_restore.erl
+$(EBIN)/hipe_amd64_subst.beam: ../x86/hipe_x86_subst.erl
$(EBIN)/hipe_amd64_x87.beam: ../x86/hipe_x86_x87.erl
$(EBIN)/hipe_amd64_sse2.beam: ../main/hipe.hrl ../x86/hipe_x86.hrl
$(EBIN)/hipe_rtl_to_amd64.beam: ../x86/hipe_rtl_to_x86.erl ../rtl/hipe_rtl.hrl
diff --git a/lib/hipe/amd64/hipe_amd64_encode.erl b/lib/hipe/amd64/hipe_amd64_encode.erl
index f8cc0c7d83..bda2824ffc 100644
--- a/lib/hipe/amd64/hipe_amd64_encode.erl
+++ b/lib/hipe/amd64/hipe_amd64_encode.erl
@@ -1316,6 +1316,7 @@ dotest1(OS) ->
RM64 = {rm64,rm_reg(?EDX)},
RM32 = {rm32,rm_reg(?EDX)},
RM16 = {rm16,rm_reg(?EDX)},
+ RM16REX = {rm16,rm_reg(?R13)},
RM8 = {rm8,rm_reg(?EDX)},
RM8REX = {rm8,rm_reg(?SIL)},
Rel32 = {rel32,Word32},
@@ -1479,6 +1480,7 @@ dotest1(OS) ->
t(OS,'test',{RM8,Imm8}),
t(OS,'test',{RM8REX,Imm8}),
t(OS,'test',{RM16,Imm16}),
+ t(OS,'test',{RM16REX,Imm16}),
t(OS,'test',{RM32,Imm32}),
t(OS,'test',{RM64,Imm32}),
t(OS,'test',{RM32,Reg32}),
diff --git a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
index 8a3ea92156..891c874a15 100644
--- a/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
+++ b/lib/hipe/amd64/hipe_amd64_ra_sse2_postconditions.erl
@@ -53,6 +53,8 @@ do_insn(I, TempMap, Strategy) -> % Insn -> {Insn list, DidSpill}
do_fp_unop(I, TempMap, Strategy);
#fp_binop{} ->
do_fp_binop(I, TempMap, Strategy);
+ #pseudo_spill_fmove{} ->
+ do_pseudo_spill_fmove(I, TempMap, Strategy);
_ ->
%% All non sse2 ops
{[I], false}
@@ -95,8 +97,13 @@ do_fmove(I, TempMap, Strategy) ->
of
true ->
Tmp = spill_temp(double, Strategy),
- {[#fmove{src=Src, dst=Tmp},I#fmove{src=Tmp,dst=Dst}],
- true};
+ %% pseudo_spill_fmove allows spill slot move coalescing, but must not
+ %% contain memory operands (except for spilled temps)
+ Is = case is_float_temp(Src) andalso is_float_temp(Dst) of
+ true -> [#pseudo_spill_fmove{src=Src, temp=Tmp, dst=Dst}];
+ false -> [#fmove{src=Src, dst=Tmp},I#fmove{src=Tmp,dst=Dst}]
+ end,
+ {Is, true};
false ->
{[I], false}
end.
@@ -104,6 +111,12 @@ do_fmove(I, TempMap, Strategy) ->
is_float_temp(#x86_temp{type=Type}) -> Type =:= double;
is_float_temp(#x86_mem{}) -> false.
+%%% Fix an pseudo_spill_fmove op.
+do_pseudo_spill_fmove(I = #pseudo_spill_fmove{temp=Temp}, TempMap, _Strategy) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = is_mem_opnd(Temp, TempMap),
+ {[I], false}. % nothing to do
+
%%% Check if an operand denotes a memory cell (mem or pseudo).
is_mem_opnd(Opnd, TempMap) ->
diff --git a/lib/hipe/amd64/hipe_amd64_registers.erl b/lib/hipe/amd64/hipe_amd64_registers.erl
index a4cb71a106..a5cecef5a1 100644
--- a/lib/hipe/amd64/hipe_amd64_registers.erl
+++ b/lib/hipe/amd64/hipe_amd64_registers.erl
@@ -207,19 +207,14 @@ allocatable_x87() ->
nr_args() -> ?AMD64_NR_ARG_REGS.
-arg(N) ->
- if N < ?AMD64_NR_ARG_REGS ->
- case N of
- 0 -> ?ARG0;
- 1 -> ?ARG1;
- 2 -> ?ARG2;
- 3 -> ?ARG3;
- 4 -> ?ARG4;
- 5 -> ?ARG5;
- _ -> exit({?MODULE, arg, N})
- end;
- true ->
- exit({?MODULE, arg, N})
+arg(N) when N < ?AMD64_NR_ARG_REGS ->
+ case N of
+ 0 -> ?ARG0;
+ 1 -> ?ARG1;
+ 2 -> ?ARG2;
+ 3 -> ?ARG3;
+ 4 -> ?ARG4;
+ 5 -> ?ARG5
end.
is_arg(R) ->
@@ -240,11 +235,7 @@ args(Arity) when is_integer(Arity), Arity >= 0 ->
args(I, Rest) when I < 0 -> Rest;
args(I, Rest) -> args(I-1, [arg(I) | Rest]).
-ret(N) ->
- case N of
- 0 -> ?RAX;
- _ -> exit({?MODULE, ret, N})
- end.
+ret(0) -> ?RAX.
%% Note: the fact that (allocatable() UNION allocatable_x87() UNION
%% allocatable_sse2()) is a subset of call_clobbered() is hard-coded in
diff --git a/lib/hipe/arm/hipe_arm.erl b/lib/hipe/arm/hipe_arm.erl
index e34a00f561..3b090b501a 100644
--- a/lib/hipe/arm/hipe_arm.erl
+++ b/lib/hipe/arm/hipe_arm.erl
@@ -79,6 +79,9 @@
pseudo_move_dst/1,
pseudo_move_src/1,
+ mk_pseudo_spill_move/3,
+ is_pseudo_spill_move/1,
+
mk_pseudo_switch/3,
mk_pseudo_tailcall/4,
@@ -250,6 +253,10 @@ is_pseudo_move(I) -> case I of #pseudo_move{} -> true; _ -> false end.
pseudo_move_dst(#pseudo_move{dst=Dst}) -> Dst.
pseudo_move_src(#pseudo_move{src=Src}) -> Src.
+mk_pseudo_spill_move(Dst, Temp, Src) ->
+ #pseudo_spill_move{dst=Dst, temp=Temp, src=Src}.
+is_pseudo_spill_move(I) -> is_record(I, pseudo_spill_move).
+
mk_pseudo_switch(JTab, Index, Labels) ->
#pseudo_switch{jtab=JTab, index=Index, labels=Labels}.
diff --git a/lib/hipe/arm/hipe_arm.hrl b/lib/hipe/arm/hipe_arm.hrl
index 67bc07634e..be06b1ebd7 100644
--- a/lib/hipe/arm/hipe_arm.hrl
+++ b/lib/hipe/arm/hipe_arm.hrl
@@ -101,6 +101,7 @@
-record(pseudo_call_prepare, {nrstkargs}).
-record(pseudo_li, {dst, imm, label}). % pre-generated label for use by the assembler
-record(pseudo_move, {dst, src}).
+-record(pseudo_spill_move, {dst, temp, src}).
-record(pseudo_switch, {jtab, index, labels}).
-record(pseudo_tailcall, {funv, arity, stkargs, linkage}).
-record(pseudo_tailcall_prepare, {}).
diff --git a/lib/hipe/arm/hipe_arm_assemble.erl b/lib/hipe/arm/hipe_arm_assemble.erl
index 713c148742..9aa730afa9 100644
--- a/lib/hipe/arm/hipe_arm_assemble.erl
+++ b/lib/hipe/arm/hipe_arm_assemble.erl
@@ -31,7 +31,7 @@ assemble(CompiledCode, Closures, Exports, Options) ->
|| {MFA, Defun} <- CompiledCode],
%%
{ConstAlign,ConstSize,ConstMap,RefsFromConsts} =
- hipe_pack_constants:pack_constants(Code, 4),
+ hipe_pack_constants:pack_constants(Code),
%%
{CodeSize,CodeBinary,AccRefs,LabelMap,ExportMap} =
encode(translate(Code, ConstMap), Options),
diff --git a/lib/hipe/arm/hipe_arm_cfg.erl b/lib/hipe/arm/hipe_arm_cfg.erl
index ea6da67317..0bc3df30b9 100644
--- a/lib/hipe/arm/hipe_arm_cfg.erl
+++ b/lib/hipe/arm/hipe_arm_cfg.erl
@@ -24,6 +24,7 @@
-export([params/1, reverse_postorder/1]).
-export([arity/1]). % for linear scan
%%-export([redirect_jmp/3]).
+-export([branch_preds/1]).
%%% these tell cfg.inc what to define (ugly as hell)
-define(BREADTH_ORDER,true). % for linear scan
@@ -75,6 +76,26 @@ branch_successors(Branch) ->
#pseudo_tailcall{} -> []
end.
+branch_preds(Branch) ->
+ case Branch of
+ #pseudo_bc{true_label=TrueLab,false_label=FalseLab,pred=Pred} ->
+ [{FalseLab, 1.0-Pred}, {TrueLab, Pred}];
+ #pseudo_call{contlab=ContLab, sdesc=#arm_sdesc{exnlab=[]}} ->
+ %% A function can still cause an exception, even if we won't catch it
+ [{ContLab, 1.0-hipe_bb_weights:call_exn_pred()}];
+ #pseudo_call{contlab=ContLab, sdesc=#arm_sdesc{exnlab=ExnLab}} ->
+ CallExnPred = hipe_bb_weights:call_exn_pred(),
+ [{ContLab, 1.0-CallExnPred}, {ExnLab, CallExnPred}];
+ #pseudo_switch{labels=Labels} ->
+ Prob = 1.0/length(Labels),
+ [{L, Prob} || L <- Labels];
+ _ ->
+ case branch_successors(Branch) of
+ [] -> [];
+ [Single] -> [{Single, 1.0}]
+ end
+ end.
+
-ifdef(REMOVE_TRIVIAL_BBS_NEEDED).
fails_to(_Instr) -> [].
-endif.
diff --git a/lib/hipe/arm/hipe_arm_defuse.erl b/lib/hipe/arm/hipe_arm_defuse.erl
index 0e62070c6c..652299a514 100644
--- a/lib/hipe/arm/hipe_arm_defuse.erl
+++ b/lib/hipe/arm/hipe_arm_defuse.erl
@@ -40,6 +40,7 @@ insn_def_gpr(I) ->
#pseudo_call{} -> call_clobbered_gpr();
#pseudo_li{dst=Dst} -> [Dst];
#pseudo_move{dst=Dst} -> [Dst];
+ #pseudo_spill_move{dst=Dst, temp=Temp} -> [Dst, Temp];
#pseudo_tailcall_prepare{} -> tailcall_clobbered_gpr();
#smull{dstlo=DstLo,dsthi=DstHi,src1=Src1} ->
%% ARM requires DstLo, DstHi, and Src1 to be distinct.
@@ -83,6 +84,7 @@ insn_use_gpr(I) ->
#pseudo_call{funv=FunV,sdesc=#arm_sdesc{arity=Arity}} ->
funv_use(FunV, arity_use_gpr(Arity));
#pseudo_move{src=Src} -> [Src];
+ #pseudo_spill_move{src=Src} -> [Src];
#pseudo_switch{jtab=JTabR,index=IndexR} -> addtemp(JTabR, [IndexR]);
#pseudo_tailcall{funv=FunV,arity=Arity,stkargs=StkArgs} ->
addargs(StkArgs, addtemps(tailcall_clobbered_gpr(), funv_use(FunV, arity_use_gpr(Arity))));
diff --git a/lib/hipe/arm/hipe_arm_frame.erl b/lib/hipe/arm/hipe_arm_frame.erl
index e323907e31..a1004fb609 100644
--- a/lib/hipe/arm/hipe_arm_frame.erl
+++ b/lib/hipe/arm/hipe_arm_frame.erl
@@ -69,6 +69,8 @@ do_insn(I, LiveOut, Context, FPoff) ->
do_pseudo_call_prepare(I, FPoff);
#pseudo_move{} ->
{do_pseudo_move(I, Context, FPoff), FPoff};
+ #pseudo_spill_move{} ->
+ {do_pseudo_spill_move(I, Context, FPoff), FPoff};
#pseudo_tailcall{} ->
{do_pseudo_tailcall(I, Context), context_framesize(Context)};
_ ->
@@ -100,6 +102,26 @@ pseudo_offset(Temp, FPoff, Context) ->
FPoff + context_offset(Context, Temp).
%%%
+%%% Moves from one spill slot to another
+%%%
+
+do_pseudo_spill_move(I, Context, FPoff) ->
+ #pseudo_spill_move{dst=Dst, temp=Temp, src=Src} = I,
+ case temp_is_pseudo(Src) andalso temp_is_pseudo(Dst) of
+ false -> % Register allocator changed its mind, turn back to move
+ do_pseudo_move(hipe_arm:mk_pseudo_move(Dst, Src), Context, FPoff);
+ true ->
+ SrcOffset = pseudo_offset(Src, FPoff, Context),
+ DstOffset = pseudo_offset(Dst, FPoff, Context),
+ case SrcOffset =:= DstOffset of
+ true -> []; % omit move-to-self
+ false ->
+ mk_load('ldr', Temp, SrcOffset, mk_sp(),
+ mk_store('str', Temp, DstOffset, mk_sp(), []))
+ end
+ end.
+
+%%%
%%% Return - deallocate frame and emit 'ret $N' insn.
%%%
diff --git a/lib/hipe/arm/hipe_arm_ra_finalise.erl b/lib/hipe/arm/hipe_arm_ra_finalise.erl
index 9bfe0a9a83..80cd470708 100644
--- a/lib/hipe/arm/hipe_arm_ra_finalise.erl
+++ b/lib/hipe/arm/hipe_arm_ra_finalise.erl
@@ -25,11 +25,17 @@ ra_bb(BB, Map) ->
hipe_bb:code_update(BB, ra_code(hipe_bb:code(BB), Map, [])).
ra_code([I|Insns], Map, Accum) ->
- ra_code(Insns, Map, [ra_insn(I, Map) | Accum]);
+ ra_code(Insns, Map, ra_insn(I, Map, Accum));
ra_code([], _Map, Accum) ->
lists:reverse(Accum).
-ra_insn(I, Map) ->
+ra_insn(I, Map, Accum) ->
+ case I of
+ #pseudo_move{} -> ra_pseudo_move(I, Map, Accum);
+ _ -> [ra_insn_1(I, Map) | Accum]
+ end.
+
+ra_insn_1(I, Map) ->
case I of
#alu{} -> ra_alu(I, Map);
#cmp{} -> ra_cmp(I, Map);
@@ -38,7 +44,7 @@ ra_insn(I, Map) ->
#move{} -> ra_move(I, Map);
#pseudo_call{} -> ra_pseudo_call(I, Map);
#pseudo_li{} -> ra_pseudo_li(I, Map);
- #pseudo_move{} -> ra_pseudo_move(I, Map);
+ #pseudo_spill_move{} -> ra_pseudo_spill_move(I, Map);
#pseudo_switch{} -> ra_pseudo_switch(I, Map);
#pseudo_tailcall{} -> ra_pseudo_tailcall(I, Map);
#smull{} -> ra_smull(I, Map);
@@ -80,10 +86,19 @@ ra_pseudo_li(I=#pseudo_li{dst=Dst}, Map) ->
NewDst = ra_temp(Dst, Map),
I#pseudo_li{dst=NewDst}.
-ra_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, Map) ->
+ra_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, Map, Accum) ->
+ NewDst = ra_temp(Dst, Map),
+ NewSrc = ra_temp(Src, Map),
+ case NewSrc#arm_temp.reg =:= NewDst#arm_temp.reg of
+ true -> Accum;
+ false -> [I#pseudo_move{dst=NewDst,src=NewSrc} | Accum]
+ end.
+
+ra_pseudo_spill_move(I=#pseudo_spill_move{dst=Dst,temp=Temp,src=Src}, Map) ->
NewDst = ra_temp(Dst, Map),
+ NewTemp = ra_temp(Temp, Map),
NewSrc = ra_temp(Src, Map),
- I#pseudo_move{dst=NewDst,src=NewSrc}.
+ I#pseudo_spill_move{dst=NewDst, temp=NewTemp, src=NewSrc}.
ra_pseudo_switch(I=#pseudo_switch{jtab=JTab,index=Index}, Map) ->
NewJTab = ra_temp(JTab, Map),
diff --git a/lib/hipe/arm/hipe_arm_ra_postconditions.erl b/lib/hipe/arm/hipe_arm_ra_postconditions.erl
index 8d1ee1cb94..23c305511f 100644
--- a/lib/hipe/arm/hipe_arm_ra_postconditions.erl
+++ b/lib/hipe/arm/hipe_arm_ra_postconditions.erl
@@ -56,6 +56,7 @@ do_insn(I, TempMap, Strategy) ->
#pseudo_call{} -> do_pseudo_call(I, TempMap, Strategy);
#pseudo_li{} -> do_pseudo_li(I, TempMap, Strategy);
#pseudo_move{} -> do_pseudo_move(I, TempMap, Strategy);
+ #pseudo_spill_move{} -> do_pseudo_spill_move(I, TempMap, Strategy);
#pseudo_switch{} -> do_pseudo_switch(I, TempMap, Strategy);
#pseudo_tailcall{} -> do_pseudo_tailcall(I, TempMap, Strategy);
#smull{} -> do_smull(I, TempMap, Strategy);
@@ -108,18 +109,25 @@ do_pseudo_li(I=#pseudo_li{dst=Dst}, TempMap, Strategy) ->
do_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, TempMap, Strategy) ->
%% Either Dst or Src (but not both) may be a pseudo temp.
- %% pseudo_move and pseudo_tailcall are special cases: in
- %% all other instructions, all temps must be non-pseudos
- %% after register allocation.
- case temp_is_spilled(Dst, TempMap) of
- true -> % Src must not be a pseudo
- {FixSrc,NewSrc,DidSpill} = fix_src1(Src, TempMap, Strategy),
- NewI = I#pseudo_move{src=NewSrc},
- {FixSrc ++ [NewI], DidSpill};
+ %% pseudo_move, pseudo_spill_move, and pseudo_tailcall
+ %% are special cases: in all other instructions, all
+ %% temps must be non-pseudos after register allocation.
+ case temp_is_spilled(Dst, TempMap)
+ andalso temp_is_spilled(Dst, TempMap)
+ of
+ true -> % Turn into pseudo_spill_move
+ Temp = clone(Src, temp1(Strategy)),
+ NewI = #pseudo_spill_move{dst=Dst, temp=Temp, src=Src},
+ {[NewI], true};
_ ->
{[I], false}
end.
+do_pseudo_spill_move(I = #pseudo_spill_move{temp=Temp}, TempMap, _Strategy) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = temp_is_spilled(Temp, TempMap),
+ {[I], false}. % nothing to do
+
do_pseudo_switch(I=#pseudo_switch{jtab=JTab,index=Index}, TempMap, Strategy) ->
{FixJTab,NewJTab,DidSpill1} = fix_src1(JTab, TempMap, Strategy),
{FixIndex,NewIndex,DidSpill2} = fix_src2(Index, TempMap, Strategy),
diff --git a/lib/hipe/arm/hipe_arm_subst.erl b/lib/hipe/arm/hipe_arm_subst.erl
index 7510c197bd..4ff245f414 100644
--- a/lib/hipe/arm/hipe_arm_subst.erl
+++ b/lib/hipe/arm/hipe_arm_subst.erl
@@ -13,7 +13,7 @@
%% limitations under the License.
-module(hipe_arm_subst).
--export([insn_temps/2]).
+-export([insn_temps/2, insn_lbls/2]).
-include("hipe_arm.hrl").
%% These should be moved to hipe_arm and exported
@@ -31,6 +31,7 @@
-type am3() :: #am3{}.
-type arg() :: temp() | integer().
-type funv() :: #arm_mfa{} | #arm_prim{} | temp().
+-type label() :: non_neg_integer().
-type insn() :: tuple(). % for now
-type subst_fun() :: fun((temp()) -> temp()).
@@ -58,6 +59,8 @@ insn_temps(T, I) ->
#pseudo_call{funv=F} -> I#pseudo_call{funv=funv_temps(T, F)};
#pseudo_call_prepare{} -> I;
#pseudo_li{dst=D} -> I#pseudo_li{dst=T(D)};
+ #pseudo_spill_move{dst=D,temp=U,src=S} ->
+ I#pseudo_spill_move{dst=T(D),temp=T(U),src=T(S)};
#pseudo_switch{jtab=J=#arm_temp{},index=Ix=#arm_temp{}} ->
I#pseudo_switch{jtab=T(J),index=T(Ix)};
#pseudo_tailcall{funv=F,stkargs=Stk} ->
@@ -103,3 +106,22 @@ funv_temps(SubstTemp, T=#arm_temp{}) -> SubstTemp(T).
-spec arg_temps(subst_fun(), arg()) -> arg().
arg_temps(_SubstTemp, Imm) when is_integer(Imm) -> Imm;
arg_temps(SubstTemp, T=#arm_temp{}) -> SubstTemp(T).
+
+-type lbl_subst_fun() :: fun((label()) -> label()).
+
+%% @doc Maps over the branch targets in an instruction
+-spec insn_lbls(lbl_subst_fun(), insn()) -> insn().
+insn_lbls(SubstLbl, I) ->
+ case I of
+ #b_label{label=Label} ->
+ I#b_label{label=SubstLbl(Label)};
+ #pseudo_bc{true_label=T, false_label=F} ->
+ I#pseudo_bc{true_label=SubstLbl(T), false_label=SubstLbl(F)};
+ #pseudo_call{sdesc=Sdesc, contlab=Contlab} ->
+ I#pseudo_call{sdesc=sdesc_lbls(SubstLbl, Sdesc),
+ contlab=SubstLbl(Contlab)}
+ end.
+
+sdesc_lbls(_SubstLbl, Sdesc=#arm_sdesc{exnlab=[]}) -> Sdesc;
+sdesc_lbls(SubstLbl, Sdesc=#arm_sdesc{exnlab=Exnlab}) ->
+ Sdesc#arm_sdesc{exnlab=SubstLbl(Exnlab)}.
diff --git a/lib/hipe/cerl/erl_bif_types.erl b/lib/hipe/cerl/erl_bif_types.erl
index 8c96e60229..9321750d44 100644
--- a/lib/hipe/cerl/erl_bif_types.erl
+++ b/lib/hipe/cerl/erl_bif_types.erl
@@ -2029,17 +2029,14 @@ arith_rem(Min1, Max1, Min2, Max2) ->
Min1_geq_zero = infinity_geq(Min1, 0),
Max1_leq_zero = infinity_geq(0, Max1),
Max_range2 = infinity_max([infinity_abs(Min2), infinity_abs(Max2)]),
- Max_range2_leq_zero = infinity_geq(0, Max_range2),
- New_min =
+ New_min =
if Min1_geq_zero -> 0;
Max_range2 =:= 0 -> 0;
- Max_range2_leq_zero -> infinity_add(Max_range2, 1);
true -> infinity_add(infinity_inv(Max_range2), 1)
end,
New_max =
if Max1_leq_zero -> 0;
Max_range2 =:= 0 -> 0;
- Max_range2_leq_zero -> infinity_add(infinity_inv(Max_range2), -1);
true -> infinity_add(Max_range2, -1)
end,
{New_min, New_max}.
diff --git a/lib/hipe/cerl/erl_types.erl b/lib/hipe/cerl/erl_types.erl
index 9d46d4ac81..ea8cc1677d 100644
--- a/lib/hipe/cerl/erl_types.erl
+++ b/lib/hipe/cerl/erl_types.erl
@@ -518,7 +518,8 @@ list_contains_opaque(List, Opaques) ->
lists:any(fun(E) -> t_contains_opaque(E, Opaques) end, List).
%% t_find_opaque_mismatch/2 of two types should only be used if their
-%% t_inf is t_none() due to some opaque type violation.
+%% t_inf is t_none() due to some opaque type violation. However,
+%% 'error' is returned if a structure mismatch is found.
%%
%% The first argument of the function is the pattern and its second
%% argument the type we are matching against the pattern.
@@ -527,22 +528,30 @@ list_contains_opaque(List, Opaques) ->
'error' | {'ok', erl_type(), erl_type()}.
t_find_opaque_mismatch(T1, T2, Opaques) ->
- t_find_opaque_mismatch(T1, T2, T2, Opaques).
+ catch t_find_opaque_mismatch(T1, T2, T2, Opaques).
t_find_opaque_mismatch(?any, _Type, _TopType, _Opaques) -> error;
-t_find_opaque_mismatch(?none, _Type, _TopType, _Opaques) -> error;
+t_find_opaque_mismatch(?none, _Type, _TopType, _Opaques) -> throw(error);
t_find_opaque_mismatch(?list(T1, Tl1, _), ?list(T2, Tl2, _), TopType, Opaques) ->
t_find_opaque_mismatch_ordlists([T1, Tl1], [T2, Tl2], TopType, Opaques);
t_find_opaque_mismatch(T1, ?opaque(_) = T2, TopType, Opaques) ->
case is_opaque_type(T2, Opaques) of
- false -> {ok, TopType, T2};
+ false ->
+ case t_is_opaque(T1) andalso compatible_opaque_types(T1, T2) =/= [] of
+ true -> error;
+ false -> {ok, TopType, T2}
+ end;
true ->
t_find_opaque_mismatch(T1, t_opaque_structure(T2), TopType, Opaques)
end;
t_find_opaque_mismatch(?opaque(_) = T1, T2, TopType, Opaques) ->
%% The generated message is somewhat misleading:
case is_opaque_type(T1, Opaques) of
- false -> {ok, TopType, T1};
+ false ->
+ case t_is_opaque(T2) andalso compatible_opaque_types(T1, T2) =/= [] of
+ true -> error;
+ false -> {ok, TopType, T1}
+ end;
true ->
t_find_opaque_mismatch(t_opaque_structure(T1), T2, TopType, Opaques)
end;
@@ -558,7 +567,11 @@ t_find_opaque_mismatch(?tuple(_, _, _) = T1, ?tuple_set(_) = T2,
t_find_opaque_mismatch_lists(Tuples1, Tuples2, TopType, Opaques);
t_find_opaque_mismatch(T1, ?union(U2), TopType, Opaques) ->
t_find_opaque_mismatch_lists([T1], U2, TopType, Opaques);
-t_find_opaque_mismatch(_T1, _T2, _TopType, _Opaques) -> error.
+t_find_opaque_mismatch(T1, T2, _TopType, Opaques) ->
+ case t_is_none(t_inf(T1, T2, Opaques)) of
+ false -> error;
+ true -> throw(error)
+ end.
t_find_opaque_mismatch_ordlists(L1, L2, TopType, Opaques) ->
List = lists:zipwith(fun(T1, T2) ->
@@ -567,10 +580,11 @@ t_find_opaque_mismatch_ordlists(L1, L2, TopType, Opaques) ->
t_find_opaque_mismatch_list(List).
t_find_opaque_mismatch_lists(L1, L2, _TopType, Opaques) ->
- List = [t_find_opaque_mismatch(T1, T2, T2, Opaques) || T1 <- L1, T2 <- L2],
+ List = [catch t_find_opaque_mismatch(T1, T2, T2, Opaques) ||
+ T1 <- L1, T2 <- L2],
t_find_opaque_mismatch_list(List).
-t_find_opaque_mismatch_list([]) -> error;
+t_find_opaque_mismatch_list([]) -> throw(error);
t_find_opaque_mismatch_list([H|T]) ->
case H of
{ok, _T1, _T2} -> H;
@@ -3047,6 +3061,9 @@ inf_opaque_types(IsOpaque1, T1, IsOpaque2, T2, Opaques) ->
end
end.
+compatible_opaque_types(?opaque(Es1), ?opaque(Es2)) ->
+ [{O1, O2} || O1 <- Es1, O2 <- Es2, is_compat_opaque_names(O1, O2)].
+
is_compat_opaque_names(Opaque1, Opaque2) ->
#opaque{mod = Mod1, name = Name1, args = Args1} = Opaque1,
#opaque{mod = Mod2, name = Name2, args = Args2} = Opaque2,
diff --git a/lib/hipe/doc/src/notes.xml b/lib/hipe/doc/src/notes.xml
index 314fd55ba3..58ca0b2138 100644
--- a/lib/hipe/doc/src/notes.xml
+++ b/lib/hipe/doc/src/notes.xml
@@ -31,6 +31,26 @@
</header>
<p>This document describes the changes made to HiPE.</p>
+<section><title>Hipe 3.15.4</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p> Fix a bug concerning parameterized opaque types. </p>
+ <p>
+ Own Id: OTP-14130</p>
+ </item>
+ <item>
+ <p>
+ Fixed xml issues in old release notes</p>
+ <p>
+ Own Id: OTP-14269</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Hipe 3.15.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
@@ -130,12 +150,12 @@
</item>
<item>
<p>
- Various fixes and improvements to the HiPE LLVM backend.
+ Various fixes and improvements to the HiPE LLVM backend.</p>
<list> <item>Add support for LLVM 3.7 and 3.8 in the
HiPE/LLVM x86_64 backend</item> <item>Reinstate support
for the LLVM backend on x86 (works OK for LLVM 3.5 to 3.7
-- LLVM 3.8 has a bug that prevents it from generating
- correct native code on x86)</item> </list></p>
+ correct native code on x86)</item> </list>
<p>
Own Id: OTP-13626</p>
</item>
@@ -191,7 +211,7 @@
<item>
<p>
Fix various binary construction inconsistencies for hipe
- compiled code. <list> <item>Passing bad field sizes to
+ compiled code.</p> <list> <item>Passing bad field sizes to
binary constructions would throw <c>badarith</c> rather
than <c>badarg</c>. Worse, in guards, when the unit size
of the field was 1, the exception would leak rather than
@@ -211,7 +231,7 @@
missing check for unit size match when inserting a
binary. For example, a faulty expression like
<c>&lt;&lt;&lt;&lt;1:7&gt;&gt;/binary&gt;&gt;</c> would
- succeed.</item> </list></p>
+ succeed.</item> </list>
<p>
Own Id: OTP-13272</p>
</item>
diff --git a/lib/hipe/flow/ebb.inc b/lib/hipe/flow/ebb.inc
index 58213e44d5..e4b7fd0efb 100644
--- a/lib/hipe/flow/ebb.inc
+++ b/lib/hipe/flow/ebb.inc
@@ -40,12 +40,14 @@
%% | {ebb_leaf, SuccesorLabel}
%%--------------------------------------------------------------------
-%% XXX: Cheating big time! no recursive types
--type ebb() :: {ebb_node, icode_lbl(), _}
- | {ebb_leaf, icode_lbl()}.
+-type ebb() :: ebb_node()
+ | ebb_leaf().
-record(ebb_node, {label :: icode_lbl(), successors :: [ebb()]}).
+-type ebb_node() :: #ebb_node{}.
+
-record(ebb_leaf, {successor :: icode_lbl()}).
+-type ebb_leaf() :: #ebb_leaf{}.
%%--------------------------------------------------------------------
%% Returns a list of extended basic blocks.
@@ -193,7 +195,7 @@ add_succ([Lbl|Lbls], Visited, Node, MkFun, EBBs, CFG) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
--spec mk_node(icode_lbl(), [ebb()]) -> #ebb_node{}.
+-spec mk_node(icode_lbl(), [ebb()]) -> ebb_node().
mk_node(Label, Successors) -> #ebb_node{label=Label, successors=Successors}.
-spec node_label(#ebb_node{}) -> icode_lbl().
@@ -202,11 +204,11 @@ node_label(#ebb_node{label=Label}) -> Label.
-spec node_successors(#ebb_node{}) -> [ebb()].
node_successors(#ebb_node{successors=Successors}) -> Successors.
--spec mk_leaf(icode_lbl()) -> #ebb_leaf{}.
+-spec mk_leaf(icode_lbl()) -> ebb_leaf().
mk_leaf(NextEbb) -> #ebb_leaf{successor=NextEbb}.
%% leaf_next(Leaf) -> Leaf#ebb_leaf.successor.
--spec type(#ebb_node{}) -> 'node' ; (#ebb_leaf{}) -> 'leaf'.
+-spec type(ebb_node()) -> 'node' ; (ebb_leaf()) -> 'leaf'.
type(#ebb_node{}) -> node;
type(#ebb_leaf{}) -> leaf.
diff --git a/lib/hipe/icode/hipe_beam_to_icode.erl b/lib/hipe/icode/hipe_beam_to_icode.erl
index 100bc0b0e2..2abecf7f18 100644
--- a/lib/hipe/icode/hipe_beam_to_icode.erl
+++ b/lib/hipe/icode/hipe_beam_to_icode.erl
@@ -148,7 +148,8 @@ trans_mfa_code(M,F,A, FunBeamCode, ClosureInfo) ->
{Code3,_Env3} = mk_debug_calltrace(MFA, Env1, Code2),
{Code3,_Env3} = {Code2,Env1}),
%% For stack optimization
- Leafness = leafness(Code3),
+ IsClosure = get_closure_info(MFA, ClosureInfo) =/= not_a_closure,
+ Leafness = leafness(Code3, IsClosure),
IsLeaf = is_leaf_code(Leafness),
Code4 =
[FunLbl |
@@ -156,7 +157,6 @@ trans_mfa_code(M,F,A, FunBeamCode, ClosureInfo) ->
false -> Code3;
true -> [mk_redtest()|Code3]
end],
- IsClosure = get_closure_info(MFA, ClosureInfo) =/= not_a_closure,
Code5 = hipe_icode:mk_icode(MFA, FunArgs, IsClosure, IsLeaf,
remove_dead_code(Code4),
hipe_gensym:var_range(icode),
@@ -173,12 +173,12 @@ trans_mfa_code(M,F,A, FunBeamCode, ClosureInfo) ->
mk_redtest() -> hipe_icode:mk_primop([], redtest, []).
-leafness(Is) -> % -> true, selfrec, or false
- leafness(Is, true).
+leafness(Is, IsClosure) -> % -> true, selfrec, closure, or false
+ leafness(Is, IsClosure, true).
-leafness([], Leafness) ->
+leafness([], _IsClosure, Leafness) ->
Leafness;
-leafness([I|Is], Leafness) ->
+leafness([I|Is], IsClosure, Leafness) ->
case I of
#icode_comment{} ->
%% BEAM self-tailcalls become gotos, but they leave
@@ -191,7 +191,7 @@ leafness([I|Is], Leafness) ->
'self_tail_recursive' -> selfrec; % call_only to selfrec
_ -> Leafness
end,
- leafness(Is, NewLeafness);
+ leafness(Is, IsClosure, NewLeafness);
#icode_call{} ->
case hipe_icode:call_type(I) of
'primop' ->
@@ -199,12 +199,12 @@ leafness([I|Is], Leafness) ->
call_fun -> false; % Calls closure
enter_fun -> false; % Calls closure
#apply_N{} -> false;
- _ -> leafness(Is, Leafness) % Other primop calls are ok
+ _ -> leafness(Is, IsClosure, Leafness) % Other primop calls are ok
end;
T when T =:= 'local' orelse T =:= 'remote' ->
{M,F,A} = hipe_icode:call_fun(I),
case erlang:is_builtin(M, F, A) of
- true -> leafness(Is, Leafness);
+ true -> leafness(Is, IsClosure, Leafness);
false -> false
end
end;
@@ -223,11 +223,12 @@ leafness([I|Is], Leafness) ->
T when T =:= 'local' orelse T =:= 'remote' ->
{M,F,A} = hipe_icode:enter_fun(I),
case erlang:is_builtin(M, F, A) of
- true -> leafness(Is, Leafness);
+ true -> leafness(Is, IsClosure, Leafness);
+ _ when IsClosure -> leafness(Is, IsClosure, closure);
_ -> false
end
end;
- _ -> leafness(Is, Leafness)
+ _ -> leafness(Is, IsClosure, Leafness)
end.
%% XXX: this old stuff is passed around but essentially unused
@@ -235,12 +236,20 @@ is_leaf_code(Leafness) ->
case Leafness of
true -> true;
selfrec -> true;
+ closure -> false;
false -> false
end.
needs_redtest(Leafness) ->
case Leafness of
true -> false;
+ %% A "leaf" closure may contain tailcalls to non-closures in addition to
+ %% what other leaves may contain. Omitting the redtest is useful to generate
+ %% shorter code for closures generated by (fun F/A), and is safe since
+ %% control flow cannot return to a "leaf" closure again without a reduction
+ %% being consumed. This is true since no function that can call a closure
+ %% will ever have its redtest omitted.
+ closure -> false;
selfrec -> true;
false -> true
end.
@@ -504,6 +513,19 @@ trans_fun([{test,test_arity,{f,Lbl},[Reg,N]}|Instructions], Env) ->
I = hipe_icode:mk_type([trans_arg(Reg)],{tuple,N},
hipe_icode:label_name(True),map_label(Lbl)),
[I,True | trans_fun(Instructions,Env)];
+%%--- test_is_tagged_tuple ---
+trans_fun([{test,is_tagged_tuple,{f,Lbl},[Reg,N,Atom]}|Instructions], Env) ->
+ TrueArity = mk_label(new),
+ IArity = hipe_icode:mk_type([trans_arg(Reg)],{tuple,N},
+ hipe_icode:label_name(TrueArity),map_label(Lbl)),
+ Var = hipe_icode:mk_new_var(),
+ IGet = hipe_icode:mk_primop([Var],
+ #unsafe_element{index=1},
+ [trans_arg(Reg)]),
+ TrueAtom = mk_label(new),
+ IEQ = hipe_icode:mk_type([Var], Atom, hipe_icode:label_name(TrueAtom),
+ map_label(Lbl)),
+ [IArity,TrueArity,IGet,IEQ,TrueAtom | trans_fun(Instructions,Env)];
%%--- is_map ---
trans_fun([{test,is_map,{f,Lbl},[Arg]}|Instructions], Env) ->
{Code,Env1} = trans_type_test(map,Lbl,Arg,Env),
diff --git a/lib/hipe/icode/hipe_icode_range.erl b/lib/hipe/icode/hipe_icode_range.erl
index b884132327..287b1c80fe 100644
--- a/lib/hipe/icode/hipe_icode_range.erl
+++ b/lib/hipe/icode/hipe_icode_range.erl
@@ -392,14 +392,17 @@ widen(#range{range=Old}, #range{range=New}, T = #range{range=Wide}) ->
-spec analyse_call(#icode_call{}, call_fun()) -> #icode_call{}.
analyse_call(Call, LookupFun) ->
+ Args = hipe_icode:args(Call),
+ Fun = hipe_icode:call_fun(Call),
+ Type = hipe_icode:call_type(Call),
+ %% This call has side-effects (it might call LookupFun which sends messages to
+ %% hipe_icode_coordinator to update the argument ranges of Fun), and must thus
+ %% not be moved into the case statement.
+ DstRanges = analyse_call_or_enter_fun(Fun, Args, Type, LookupFun),
case hipe_icode:call_dstlist(Call) of
[] ->
Call;
Dsts ->
- Args = hipe_icode:args(Call),
- Fun = hipe_icode:call_fun(Call),
- Type = hipe_icode:call_type(Call),
- DstRanges = analyse_call_or_enter_fun(Fun, Args, Type, LookupFun),
NewDefs = [update_info(Var, R) || {Var,R} <- lists:zip(Dsts, DstRanges)],
hipe_icode:subst_defines(lists:zip(Dsts, NewDefs), Call)
end.
@@ -1306,16 +1309,15 @@ range_rem(Range1, Range2) ->
Min1_geq_zero = inf_geq(Min1, 0),
Max1_leq_zero = inf_geq(0, Max1),
Max_range2 = inf_max([inf_abs(Min2), inf_abs(Max2)]),
- Max_range2_leq_zero = inf_geq(0, Max_range2),
New_min =
if Min1_geq_zero -> 0;
- Max_range2_leq_zero -> Max_range2;
- true -> inf_inv(Max_range2)
+ Max_range2 =:= 0 -> 0;
+ true -> inf_add(inf_inv(Max_range2), 1)
end,
New_max =
if Max1_leq_zero -> 0;
- Max_range2_leq_zero -> inf_inv(Max_range2);
- true -> Max_range2
+ Max_range2 =:= 0 -> 0;
+ true -> inf_add(Max_range2, -1)
end,
range_init({New_min, New_max}, false).
diff --git a/lib/hipe/icode/hipe_icode_type.erl b/lib/hipe/icode/hipe_icode_type.erl
index 815d1e57a8..aafaeb5a0a 100644
--- a/lib/hipe/icode/hipe_icode_type.erl
+++ b/lib/hipe/icode/hipe_icode_type.erl
@@ -1410,9 +1410,10 @@ transform_element2(I) ->
NewIndex =
case test_type(integer, IndexType) of
true ->
- case t_number_vals(IndexType) of
- unknown -> unknown;
- [_|_] = Vals -> {number, Vals}
+ case {number_min(IndexType), number_max(IndexType)} of
+ {Lb0, Ub0} when is_integer(Lb0), is_integer(Ub0) ->
+ {number, Lb0, Ub0};
+ {_, _} -> unknown
end;
_ -> unknown
end,
@@ -1427,19 +1428,19 @@ transform_element2(I) ->
_ -> unknown
end,
case {NewIndex, MinSize} of
- {{number, [_|_] = Ns}, {tuple, A}} when is_integer(A) ->
- case lists:all(fun(X) -> 0 < X andalso X =< A end, Ns) of
+ {{number, Lb, Ub}, {tuple, A}} when is_integer(A) ->
+ case 0 < Lb andalso Ub =< A of
true ->
- case Ns of
- [Idx] ->
+ case {Lb, Ub} of
+ {Idx, Idx} ->
[_, Tuple] = hipe_icode:args(I),
update_call_or_enter(I, #unsafe_element{index = Idx}, [Tuple]);
- [_|_] ->
+ {_, _} ->
NewFun = {element, [MinSize, valid]},
update_call_or_enter(I, NewFun)
end;
false ->
- case lists:all(fun(X) -> hipe_tagscheme:is_fixnum(X) end, Ns) of
+ case lists:all(fun(X) -> hipe_tagscheme:is_fixnum(X) end, [Lb, Ub]) of
true ->
NewFun = {element, [MinSize, fixnums]},
update_call_or_enter(I, NewFun);
@@ -1454,7 +1455,7 @@ transform_element2(I) ->
NewFun = {element, [MinSize, fixnums]},
update_call_or_enter(I, NewFun);
false ->
- NewFun = {element, [MinSize, NewIndex]},
+ NewFun = {element, [MinSize, NewIndex]},
update_call_or_enter(I, NewFun)
end
end.
diff --git a/lib/hipe/llvm/Makefile b/lib/hipe/llvm/Makefile
index 88016a7d8b..e8d9a0e8bb 100644
--- a/lib/hipe/llvm/Makefile
+++ b/lib/hipe/llvm/Makefile
@@ -73,8 +73,7 @@ include ../native.mk
ERL_COMPILE_FLAGS += -Werror +inline +warn_export_vars #+warn_missing_spec
# if in 32 bit backend define BIT32 symbol
-ARCH = $(shell echo $(TARGET) | sed 's/^\(x86_64\)-.*/64bit/')
-ifneq ($(ARCH), 64bit)
+ifneq ($(BITS64),yes)
ERL_COMPILE_FLAGS += -DBIT32
endif
diff --git a/lib/hipe/llvm/hipe_llvm_main.erl b/lib/hipe/llvm/hipe_llvm_main.erl
index 0957dd4df2..4eec0c752b 100644
--- a/lib/hipe/llvm/hipe_llvm_main.erl
+++ b/lib/hipe/llvm/hipe_llvm_main.erl
@@ -108,8 +108,10 @@ llvm_llc(Dir, Filename, Ver, Options) ->
OptLevel = trans_optlev_flag(llc, Options),
VerFlags = llc_ver_flags(Ver),
Align = find_stack_alignment(),
+ Target = llc_target_opt(),
LlcFlags = [OptLevel, "-code-model=medium", "-stack-alignment=" ++ Align
, "-tailcallopt", "-filetype=asm" %FIXME
+ , Target
| VerFlags],
Command = "llc " ++ fix_opts(LlcFlags) ++ " " ++ Source,
%% io:format("LLC: ~s~n", [Command]),
@@ -123,7 +125,8 @@ llvm_llc(Dir, Filename, Ver, Options) ->
compile(Dir, Fun_Name, Compiler) ->
Source = Dir ++ Fun_Name ++ ".s",
Dest = Dir ++ Fun_Name ++ ".o",
- Command = Compiler ++ " -c " ++ Source ++ " -o " ++ Dest,
+ Target = compiler_target_opt(),
+ Command = Compiler ++ " " ++ Target ++ " -c " ++ Source ++ " -o " ++ Dest,
%% io:format("~s: ~s~n", [Compiler, Command]),
case os:cmd(Command) of
"" -> ok;
@@ -137,6 +140,18 @@ find_stack_alignment() ->
_ -> exit({?MODULE, find_stack_alignment, "Unimplemented architecture"})
end.
+llc_target_opt() ->
+ case get(hipe_target_arch) of
+ x86 -> "-march=x86";
+ amd64 -> "-march=x86-64"
+ end.
+
+compiler_target_opt() ->
+ case get(hipe_target_arch) of
+ x86 -> "-m32";
+ amd64 -> "-m64"
+ end.
+
%% @doc Join options.
fix_opts(Opts) ->
string:join(Opts, " ").
diff --git a/lib/hipe/llvm/hipe_llvm_merge.erl b/lib/hipe/llvm/hipe_llvm_merge.erl
index 6e891ac3b0..58d862fbb2 100644
--- a/lib/hipe/llvm/hipe_llvm_merge.erl
+++ b/lib/hipe/llvm/hipe_llvm_merge.erl
@@ -13,7 +13,7 @@ finalize(CompiledCode, Closures, Exports) ->
Code = [{MFA, [], ConstTab}
|| {MFA, _, _ , ConstTab, _, _} <- CompiledCode1],
{ConstAlign, ConstSize, ConstMap, RefsFromConsts} =
- hipe_pack_constants:pack_constants(Code, ?ARCH_REGISTERS:alignment()),
+ hipe_pack_constants:pack_constants(Code),
%% Compute total code size separately as a sanity check for alignment
CodeSize = compute_code_size(CompiledCode1, 0),
%% io:format("Code Size (pre-computed): ~w~n", [CodeSize]),
diff --git a/lib/hipe/llvm/hipe_rtl_to_llvm.erl b/lib/hipe/llvm/hipe_rtl_to_llvm.erl
index 208d86841f..79e1bfd381 100644
--- a/lib/hipe/llvm/hipe_rtl_to_llvm.erl
+++ b/lib/hipe/llvm/hipe_rtl_to_llvm.erl
@@ -1364,7 +1364,7 @@ create_function_definition(Fun, Params, Code, LocalVars) ->
EntryBlock =
lists:flatten([EntryLabel, ExceptionSync, I2, LocalVars, StoredParams, I3]),
Final_Code = EntryBlock ++ Code,
- FunctionOptions = [nounwind, noredzone, list_to_atom("gc \"erlang\"")],
+ FunctionOptions = [nounwind, noredzone, 'gc "erlang"'],
WordTy = hipe_llvm:mk_int(?BITS_IN_WORD),
FunRetTy = hipe_llvm:mk_struct(lists:duplicate(?NR_PINNED_REGS + 1, WordTy)),
hipe_llvm:mk_fun_def([], [], "cc 11", [], FunRetTy, FunctionName, Args,
diff --git a/lib/hipe/main/hipe.app.src b/lib/hipe/main/hipe.app.src
index af2c02006d..de0b255c01 100644
--- a/lib/hipe/main/hipe.app.src
+++ b/lib/hipe/main/hipe.app.src
@@ -76,6 +76,7 @@
hipe_arm_specific,
hipe_arm_subst,
hipe_bb,
+ hipe_bb_weights,
hipe_beam_to_icode,
hipe_coalescing_regalloc,
hipe_consttab,
@@ -83,6 +84,7 @@
hipe_digraph,
hipe_dominators,
hipe_dot,
+ hipe_dsets,
hipe_gen_cfg,
hipe_gensym,
hipe_graph_coloring_regalloc,
@@ -146,9 +148,11 @@
hipe_ppc_specific_fp,
hipe_ppc_subst,
hipe_profile,
+ hipe_range_split,
hipe_reg_worklists,
hipe_regalloc_loop,
hipe_regalloc_prepass,
+ hipe_restore_reuse,
hipe_rtl,
hipe_rtl_arch,
hipe_rtl_arith_32,
diff --git a/lib/hipe/main/hipe.erl b/lib/hipe/main/hipe.erl
index fff397b060..19b4e8bfe2 100644
--- a/lib/hipe/main/hipe.erl
+++ b/lib/hipe/main/hipe.erl
@@ -1230,6 +1230,18 @@ option_text(regalloc) ->
" optimistic - another variant of a coalescing allocator";
option_text(remove_comments) ->
"Strip comments from intermediate code";
+option_text(ra_range_split) ->
+ "Split live ranges of temporaries live over call instructions\n"
+ "before performing register allocation.\n"
+ "Heuristically tries to move stack accesses to the cold path of function.\n"
+ "This range splitter is more sophisticated than 'ra_restore_reuse', but has\n"
+ "a significantly larger impact on compile time.\n"
+ "Should only be used with move coalescing register allocators.";
+option_text(ra_restore_reuse) ->
+ "Split live ranges of temporaries such that straight-line\n"
+ "code will not need to contain multiple restores from the same stack\n"
+ "location.\n"
+ "Should only be used with move coalescing register allocators.";
option_text(rtl_ssa) ->
"Perform SSA conversion on the RTL level -- default starting at O2";
option_text(rtl_ssa_const_prop) ->
@@ -1371,6 +1383,12 @@ opt_keys() ->
pp_rtl_linear,
ra_partitioned,
ra_prespill,
+ ra_range_split,
+ ra_restore_reuse,
+ range_split_min_gain,
+ range_split_mode1_fudge,
+ range_split_weight_power,
+ range_split_weights,
regalloc,
remove_comments,
rtl_ssa,
@@ -1409,7 +1427,8 @@ o1_opts(TargetArch) ->
icode_ssa_const_prop, icode_ssa_copy_prop, icode_inline_bifs,
rtl_ssa, rtl_ssa_const_prop, rtl_ssapre,
spillmin_color, use_indexing, remove_comments,
- binary_opt, {regalloc,coalescing} | o0_opts(TargetArch)],
+ binary_opt, {regalloc,coalescing}, ra_restore_reuse
+ | o0_opts(TargetArch)],
case TargetArch of
ultrasparc ->
Common;
@@ -1429,7 +1448,8 @@ o1_opts(TargetArch) ->
o2_opts(TargetArch) ->
Common = [icode_type, icode_call_elim, % icode_ssa_struct_reuse,
- rtl_lcm | (o1_opts(TargetArch) -- [rtl_ssapre])],
+ ra_range_split, range_split_weights, % XXX: Having defaults here is ugly
+ rtl_lcm | (o1_opts(TargetArch) -- [rtl_ssapre, ra_restore_reuse])],
case TargetArch of
T when T =:= amd64 orelse T =:= ppc64 -> % 64-bit targets
[icode_range | Common];
@@ -1477,6 +1497,9 @@ opt_negations() ->
{no_pp_rtl_ssapre, pp_rtl_ssapre},
{no_ra_partitioned, ra_partitioned},
{no_ra_prespill, ra_prespill},
+ {no_ra_range_split, ra_range_split},
+ {no_ra_restore_reuse, ra_restore_reuse},
+ {no_range_split_weights, range_split_weights},
{no_remove_comments, remove_comments},
{no_rtl_ssa, rtl_ssa},
{no_rtl_ssa_const_prop, rtl_ssa_const_prop},
diff --git a/lib/hipe/misc/hipe_consttab.erl b/lib/hipe/misc/hipe_consttab.erl
index 64e3d3ccaa..741bdb2094 100644
--- a/lib/hipe/misc/hipe_consttab.erl
+++ b/lib/hipe/misc/hipe_consttab.erl
@@ -63,9 +63,7 @@
%% A hipe_consttab is a tuple {Data, ReferedLabels, NextConstLabel}
%% @type hipe_constlbl().
%% An abstract datatype for referring to data.
-%% @type element_type() = byte | word | ctab_array()
-%% @type ctab_array() = {ctab_array, Type::element_type(),
-%% NoElements::pos_integer()}
+%% @type element_type() = byte | word
%% @type block() = [integer() | label_ref()]
%% @type label_ref() = {label, Label::code_label()}
%% @type code_label() = hipe_sparc:label_name() | hipe_x86:label_name()
@@ -110,8 +108,7 @@
-type label_ref() :: {'label', code_label()}.
-type block() :: [hipe_constlbl() | label_ref()].
--type ctab_array() :: {'ctab_array', 'byte' | 'word', pos_integer()}.
--type element_type() :: 'byte' | 'word' | ctab_array().
+-type element_type() :: 'byte' | 'word'.
-type sort_order() :: term(). % XXX: FIXME
@@ -187,7 +184,7 @@ insert_block({ConstTab, RefToLabels, NextLabel}, ElementType, InitList) ->
ReferredLabels = get_labels(InitList, []),
NewRefTo = ReferredLabels ++ RefToLabels,
{NewTa, Id} = insert_const({ConstTab, NewRefTo, NextLabel},
- block, word_size(), false,
+ block, size_of(ElementType), false,
{ElementType,InitList}),
{insert_backrefs(NewTa, Id, ReferredLabels), Id}.
@@ -256,13 +253,9 @@ get_labels([], Acc) ->
%% @spec size_of(element_type()) -> pos_integer()
%% @doc Returns the size in bytes of an element_type.
-%% The is_atom/1 guard in the clause handling arrays
-%% constraints the argument to 'byte' | 'word'
-spec size_of(element_type()) -> pos_integer().
size_of(byte) -> 1;
-size_of(word) -> word_size();
-size_of({ctab_array,S,N}) when is_atom(S), is_integer(N), N > 0 ->
- N * size_of(S).
+size_of(word) -> word_size().
%% @spec decompose({element_type(), block()}) -> [byte()]
%% @doc Turns a block into a list of bytes.
diff --git a/lib/hipe/misc/hipe_pack_constants.erl b/lib/hipe/misc/hipe_pack_constants.erl
index 9dd18bce0f..6736d1f503 100644
--- a/lib/hipe/misc/hipe_pack_constants.erl
+++ b/lib/hipe/misc/hipe_pack_constants.erl
@@ -13,7 +13,7 @@
%% limitations under the License.
-module(hipe_pack_constants).
--export([pack_constants/2, slim_refs/1, slim_constmap/1,
+-export([pack_constants/1, slim_refs/1, slim_constmap/1,
find_const/2, mk_data_relocs/2, slim_sorted_exportmap/3]).
-include("hipe_consttab.hrl").
@@ -37,8 +37,8 @@
-record(pcm_entry, {mfa :: mfa(),
label :: hipe_constlbl(),
- const_num :: const_num(),
- start :: addr(),
+ const_num :: const_num(),
+ start :: addr(),
type :: 0 | 1 | 2,
raw_data :: raw_data()}).
-type pcm_entry() :: #pcm_entry{}.
@@ -53,11 +53,11 @@
%%-----------------------------------------------------------------------------
--spec pack_constants([{mfa(),[_],hipe_consttab()}], ct_alignment()) ->
+-spec pack_constants([{mfa(),[_],hipe_consttab()}]) ->
{ct_alignment(), non_neg_integer(), packed_const_map(), mfa_refs_map()}.
-pack_constants(Data, Align) ->
- pack_constants(Data, 0, Align, 0, [], []).
+pack_constants(Data) ->
+ pack_constants(Data, 0, 1, 0, [], []). % 1 = byte alignment
pack_constants([{MFA,_,ConstTab}|Rest], Size, Align, ConstNo, Acc, Refs) ->
Labels = hipe_consttab:labels(ConstTab),
diff --git a/lib/hipe/opt/Makefile b/lib/hipe/opt/Makefile
index 684d6f45b4..5a729d04ae 100644
--- a/lib/hipe/opt/Makefile
+++ b/lib/hipe/opt/Makefile
@@ -43,7 +43,8 @@ RELSYSDIR = $(RELEASE_PATH)/lib/hipe-$(VSN)
# ----------------------------------------------------
# Target Specs
# ----------------------------------------------------
-MODULES = hipe_spillmin hipe_spillmin_color hipe_spillmin_scan
+MODULES = hipe_spillmin hipe_spillmin_color hipe_spillmin_scan \
+ hipe_bb_weights
HRL_FILES=
ERL_FILES= $(MODULES:%=%.erl)
diff --git a/lib/hipe/opt/hipe_bb_weights.erl b/lib/hipe/opt/hipe_bb_weights.erl
new file mode 100644
index 0000000000..8ef113b94c
--- /dev/null
+++ b/lib/hipe/opt/hipe_bb_weights.erl
@@ -0,0 +1,449 @@
+%% -*- erlang-indent-level: 2 -*-
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%@doc
+%% BASIC BLOCK WEIGHTING
+%%
+%% Computes basic block weights by using branch probabilities as weights in a
+%% linear equation system, that is then solved using Gauss-Jordan Elimination.
+%%
+%% The equation system representation is intentionally sparse, since most blocks
+%% have at most two successors.
+-module(hipe_bb_weights).
+-export([compute/3, compute_fast/3, weight/2, call_exn_pred/0]).
+-export_type([bb_weights/0]).
+
+-compile(inline).
+
+%%-define(DO_ASSERT,1).
+%%-define(DEBUG,1).
+-include("../main/hipe.hrl").
+
+%% If the equation system is large, it might take too long to solve it exactly.
+%% Thus, if there are more than ?HEUR_MAX_SOLVE labels, we use the iterative
+%% approximation.
+-define(HEUR_MAX_SOLVE, 10000).
+
+-opaque bb_weights() :: #{label() => float()}.
+
+-type cfg() :: any().
+-type target_module() :: module().
+-type target_context() :: any().
+-type target() :: {target_module(), target_context()}.
+
+-type label() :: integer().
+-type var() :: label().
+-type assignment() :: {var(), float()}.
+-type eq_assoc() :: [{var(), key()}].
+-type solution() :: [assignment()].
+
+%% Constant. Predicted probability of a call resulting in an exception.
+-spec call_exn_pred() -> float().
+call_exn_pred() -> 0.01.
+
+-spec compute(cfg(), target_module(), target_context()) -> bb_weights().
+compute(CFG, TgtMod, TgtCtx) ->
+ Target = {TgtMod, TgtCtx},
+ Labels = labels(CFG, Target),
+ if length(Labels) > ?HEUR_MAX_SOLVE ->
+ ?debug_msg("~w: Too many labels (~w), approximating.~n",
+ [?MODULE, length(Labels)]),
+ compute_fast(CFG, TgtMod, TgtCtx);
+ true ->
+ {EqSys, EqAssoc} = build_eq_system(CFG, Labels, Target),
+ case solve(EqSys, EqAssoc) of
+ {ok, Solution} ->
+ maps:from_list(Solution)
+ end
+ end.
+
+-spec build_eq_system(cfg(), [label()], target()) -> {eq_system(), eq_assoc()}.
+build_eq_system(CFG, Labels, Target) ->
+ StartLb = hipe_gen_cfg:start_label(CFG),
+ EQS0 = eqs_new(),
+ {EQS1, Assoc} = build_eq_system(Labels, CFG, Target, [], EQS0),
+ {StartLb, StartKey} = lists:keyfind(StartLb, 1, Assoc),
+ StartRow0 = eqs_get(StartKey, EQS1),
+ StartRow = row_set_const(-1.0, StartRow0), % -1.0 since StartLb coef is -1.0
+ EQS = eqs_put(StartKey, StartRow, EQS1),
+ {EQS, Assoc}.
+
+build_eq_system([], _CFG, _Target, Map, EQS) -> {EQS, lists:reverse(Map)};
+build_eq_system([L|Ls], CFG, Target, Map, EQS0) ->
+ PredProb = pred_prob(L, CFG, Target),
+ {Key, EQS} = eqs_insert(row_new([{L, -1.0}|PredProb], 0.0), EQS0),
+ build_eq_system(Ls, CFG, Target, [{L, Key}|Map], EQS).
+
+pred_prob(L, CFG, Target) ->
+ [begin
+ BB = bb(CFG, Pred, Target),
+ Ps = branch_preds(hipe_bb:last(BB), Target),
+ ?ASSERT(length(lists:ukeysort(1, Ps))
+ =:= length(hipe_gen_cfg:succ(CFG, Pred))),
+ case lists:keyfind(L, 1, Ps) of
+ {L, Prob} when is_float(Prob) -> {Pred, Prob}
+ end
+ end || Pred <- hipe_gen_cfg:pred(CFG, L)].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-spec triangelise(eq_system(), eq_assoc()) -> {eq_system(), eq_assoc()}.
+triangelise(EQS, VKs) ->
+ triangelise_1(mk_triix(EQS, VKs), []).
+
+triangelise_1(TIX0, Acc) ->
+ case triix_is_empty(TIX0) of
+ true -> {triix_eqs(TIX0), lists:reverse(Acc)};
+ false ->
+ {V,Key,TIX1} = triix_pop_smallest(TIX0),
+ Row0 = triix_get(Key, TIX1),
+ case row_get(V, Row0) of
+ Coef when Coef > -0.0001, Coef < 0.0001 ->
+ throw(error);
+ _ ->
+ Row = row_normalise(V, Row0),
+ TIX2 = triix_put(Key, Row, TIX1),
+ TIX = eliminate_triix(V, Key, Row, TIX2),
+ triangelise_1(TIX, [{V,Key}|Acc])
+ end
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Triangelisation maintains its own index, outside of eqs. This index is
+%% essentially a BST (used as a heap) of all equations by size, with {Key,Var}
+%% as the values and only containing a subset of all the keys in the whole
+%% equation system. The key operation is triix_pop_smallest/1, which pops a
+%% {Key,Var} from the heap corresponding to one of the smallest equations. This
+%% is critical in order to prevent the equations from growing during
+%% triangelisation, which would make the algorithm O(n^2) in the common case.
+-type tri_eq_system() :: {eq_system(),
+ gb_trees:tree(non_neg_integer(),
+ gb_trees:tree(key(), var()))}.
+
+triix_eqs({EQS, _}) -> EQS.
+triix_get(Key, {EQS, _}) -> eqs_get(Key, EQS).
+triix_is_empty({_, Tree}) -> gb_trees:is_empty(Tree).
+triix_lookup(V, {EQS, _}) -> eqs_lookup(V, EQS).
+
+mk_triix(EQS, VKs) ->
+ {EQS,
+ lists:foldl(fun({V,Key}, Tree) ->
+ Size = row_size(eqs_get(Key, EQS)),
+ sitree_insert(Size, Key, V, Tree)
+ end, gb_trees:empty(), VKs)}.
+
+sitree_insert(Size, Key, V, SiTree) ->
+ SubTree1 =
+ case gb_trees:lookup(Size, SiTree) of
+ none -> gb_trees:empty();
+ {value, SubTree0} -> SubTree0
+ end,
+ SubTree = gb_trees:insert(Key, V, SubTree1),
+ gb_trees:enter(Size, SubTree, SiTree).
+
+sitree_update_subtree(Size, SubTree, SiTree) ->
+ case gb_trees:is_empty(SubTree) of
+ true -> gb_trees:delete(Size, SiTree);
+ false -> gb_trees:update(Size, SubTree, SiTree)
+ end.
+
+triix_put(Key, Row, {EQS, Tree0}) ->
+ OldSize = row_size(eqs_get(Key, EQS)),
+ case row_size(Row) of
+ OldSize -> {eqs_put(Key, Row, EQS), Tree0};
+ Size ->
+ Tree =
+ case gb_trees:lookup(OldSize, Tree0) of
+ none -> Tree0;
+ {value, SubTree0} ->
+ case gb_trees:lookup(Key, SubTree0) of
+ none -> Tree0;
+ {value, V} ->
+ SubTree = gb_trees:delete(Key, SubTree0),
+ Tree1 = sitree_update_subtree(OldSize, SubTree, Tree0),
+ sitree_insert(Size, Key, V, Tree1)
+ end
+ end,
+ {eqs_put(Key, Row, EQS), Tree}
+ end.
+
+triix_pop_smallest({EQS, Tree}) ->
+ {Size, SubTree0} = gb_trees:smallest(Tree),
+ {Key, V, SubTree} = gb_trees:take_smallest(SubTree0),
+ {V, Key, {EQS, sitree_update_subtree(Size, SubTree, Tree)}}.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+row_normalise(Var, Row) ->
+ %% Normalise v's coef to 1.0
+ %% row_set_coef ensures the coef is exactly 1.0 (no rounding errors)
+ row_set_coef(Var, 1.0, row_scale(Row, 1.0/row_get(Var, Row))).
+
+%% Precondition: Row must be normalised; i.e. Vars coef must be 1.0 (mod
+%% rounding errors)
+-spec eliminate(var(), key(), row(), eq_system()) -> eq_system().
+eliminate(Var, Key, Row, TIX0) ->
+ eliminate_abstr(Var, Key, Row, TIX0,
+ fun eqs_get/2, fun eqs_lookup/2, fun eqs_put/3).
+
+-spec eliminate_triix(var(), key(), row(), tri_eq_system()) -> tri_eq_system().
+eliminate_triix(Var, Key, Row, TIX0) ->
+ eliminate_abstr(Var, Key, Row, TIX0,
+ fun triix_get/2, fun triix_lookup/2, fun triix_put/3).
+
+%% The same function implemented for two data types, eqs and triix.
+-compile({inline, eliminate_abstr/7}).
+-spec eliminate_abstr(var(), key(), row(), ADT, fun((key(), ADT) -> row()),
+ fun((var(), ADT) -> [key()]),
+ fun((key(), row(), ADT) -> ADT)) -> ADT.
+eliminate_abstr(Var, Key, Row, ADT0, GetFun, LookupFun, PutFun) ->
+ ?ASSERT(1.0 =:= row_get(Var, Row)),
+ ADT =
+ lists:foldl(fun(RK, ADT1) when RK =:= Key -> ADT1;
+ (RK, ADT1) ->
+ R = GetFun(RK, ADT1),
+ PutFun(RK, row_addmul(R, Row, -row_get(Var, R)), ADT1)
+ end, ADT0, LookupFun(Var, ADT0)),
+ [Key] = LookupFun(Var, ADT),
+ ADT.
+
+-spec solve(eq_system(), eq_assoc()) -> error | {ok, solution()}.
+solve(EQS0, EqAssoc0) ->
+ try triangelise(EQS0, EqAssoc0)
+ of {EQS1, EqAssoc} ->
+ {ok, solve_1(EqAssoc, maps:from_list(EqAssoc), EQS1, [])}
+ catch error -> error
+ end.
+
+solve_1([], _VarEqs, _EQS, Acc) -> Acc;
+solve_1([{V,K}|Ps], VarEqs, EQS0, Acc0) ->
+ Row0 = eqs_get(K, EQS0),
+ VarsToKill = [Var || {Var, _} <- row_coefs(Row0), Var =/= V],
+ Row1 = kill_vars(VarsToKill, VarEqs, EQS0, Row0),
+ [{V,_}] = row_coefs(Row1), % assertion
+ Row = row_normalise(V, Row1),
+ [{V,1.0}] = row_coefs(Row), % assertion
+ EQS = eliminate(V, K, Row, EQS0),
+ [K] = eqs_lookup(V, EQS),
+ solve_1(Ps, VarEqs, eqs_remove(K, EQS), [{V, row_const(Row)}|Acc0]).
+
+kill_vars([], _VarEqs, _EQS, Row) -> Row;
+kill_vars([V|Vs], VarEqs, EQS, Row0) ->
+ VRow0 = eqs_get(maps:get(V, VarEqs), EQS),
+ VRow = row_normalise(V, VRow0),
+ ?ASSERT(1.0 =:= row_get(V, VRow)),
+ Row = row_addmul(Row0, VRow, -row_get(V, Row0)),
+ ?ASSERT(0.0 =:= row_get(V, Row)), % V has been killed
+ kill_vars(Vs, VarEqs, EQS, Row).
+
+-spec weight(label(), bb_weights()) -> float().
+weight(Lbl, Weights) ->
+ maps:get(Lbl, Weights).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Row datatype
+%% Invariant: No 0.0 coefficiets!
+-spec row_empty() -> row().
+row_empty() -> {orddict:new(), 0.0}.
+
+-spec row_new([{var(), float()}], float()) -> row().
+row_new(Coefs, Const) when is_float(Const) ->
+ row_ensure_invar({row_squash_multiples(lists:keysort(1, Coefs)), Const}).
+
+row_squash_multiples([{K, C1},{K, C2}|Ps]) ->
+ row_squash_multiples([{K,C1+C2}|Ps]);
+row_squash_multiples([P|Ps]) -> [P|row_squash_multiples(Ps)];
+row_squash_multiples([]) -> [].
+
+row_ensure_invar({Coef, Const}) ->
+ {orddict:filter(fun(_, 0.0) -> false; (_, F) when is_float(F) -> true end,
+ Coef), Const}.
+
+row_const({_, Const}) -> Const.
+row_coefs({Coefs, _}) -> orddict:to_list(Coefs).
+row_size({Coefs, _}) -> orddict:size(Coefs).
+
+row_get(Var, {Coefs, _}) ->
+ case lists:keyfind(Var, 1, Coefs) of
+ false -> 0.0;
+ {_, Coef} -> Coef
+ end.
+
+row_set_coef(Var, 0.0, {Coefs, Const}) ->
+ {orddict:erase(Var, Coefs), Const};
+row_set_coef(Var, Coef, {Coefs, Const}) ->
+ {orddict:store(Var, Coef, Coefs), Const}.
+
+row_set_const(Const, {Coefs, _}) -> {Coefs, Const}.
+
+%% Lhs + Rhs*Factor
+-spec row_addmul(row(), row(), float()) -> row().
+row_addmul({LhsCoefs, LhsConst}, {RhsCoefs, RhsConst}, Factor)
+ when is_float(Factor) ->
+ Coefs = row_addmul_coefs(LhsCoefs, RhsCoefs, Factor),
+ Const = LhsConst + RhsConst * Factor,
+ {Coefs, Const}.
+
+row_addmul_coefs(Ls, [], Factor) when is_float(Factor) -> Ls;
+row_addmul_coefs([], Rs, Factor) when is_float(Factor) ->
+ row_scale_coefs(Rs, Factor);
+row_addmul_coefs([L={LV, _}|Ls], Rs=[{RV,_}|_], Factor)
+ when LV < RV, is_float(Factor) ->
+ [L|row_addmul_coefs(Ls, Rs, Factor)];
+row_addmul_coefs(Ls=[{LV, _}|_], [{RV, RC}|Rs], Factor)
+ when LV > RV, is_float(RC), is_float(Factor) ->
+ [{RV, RC*Factor}|row_addmul_coefs(Ls, Rs, Factor)];
+row_addmul_coefs([{V, LC}|Ls], [{V, RC}|Rs], Factor)
+ when is_float(LC), is_float(RC), is_float(Factor) ->
+ case LC + RC * Factor of
+ 0.0 -> row_addmul_coefs(Ls, Rs, Factor);
+ C -> [{V,C}|row_addmul_coefs(Ls, Rs, Factor)]
+ end.
+
+row_scale(_, 0.0) -> row_empty();
+row_scale({RowCoefs, RowConst}, Factor) when is_float(Factor) ->
+ {row_scale_coefs(RowCoefs, Factor), RowConst * Factor}.
+
+row_scale_coefs([{V,C}|Cs], Factor) when is_float(Factor), is_float(C) ->
+ [{V,C*Factor}|row_scale_coefs(Cs, Factor)];
+row_scale_coefs([], Factor) when is_float(Factor) ->
+ [].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Equation system ADT
+%%
+%% Stores a linear equation system, allowing for efficient updates and efficient
+%% queries for all equations mentioning a variable.
+%%
+%% It is sort of like a "database" table of {Primary, Terms, Const} indexed both
+%% on Primary as well as the vars (map keys) in Terms.
+-type row() :: {Terms :: orddict:orddict(var(), float()),
+ Const :: float()}.
+-type key() :: non_neg_integer().
+-type rev_index() :: #{var() => ordsets:ordset(key())}.
+-record(eq_system, {
+ rows = #{} :: #{key() => row()},
+ revidx = revidx_empty() :: rev_index(),
+ next_key = 0 :: key()
+ }).
+-type eq_system() :: #eq_system{}.
+
+eqs_new() -> #eq_system{}.
+
+-spec eqs_insert(row(), eq_system()) -> {key(), eq_system()}.
+eqs_insert(Row, EQS=#eq_system{next_key=NextKey0}) ->
+ Key = NextKey0,
+ NextKey = NextKey0 + 1,
+ {Key, eqs_insert(Key, Row, EQS#eq_system{next_key=NextKey})}.
+
+eqs_insert(Key, Row, EQS=#eq_system{rows=Rows, revidx=RevIdx0}) ->
+ RevIdx = revidx_add(Key, Row, RevIdx0),
+ EQS#eq_system{rows=Rows#{Key => Row}, revidx=RevIdx}.
+
+eqs_put(Key, Row, EQS0) ->
+ eqs_insert(Key, Row, eqs_remove(Key, EQS0)).
+
+eqs_remove(Key, EQS=#eq_system{rows=Rows, revidx=RevIdx0}) ->
+ OldRow = maps:get(Key, Rows),
+ RevIdx = revidx_remove(Key, OldRow, RevIdx0),
+ EQS#eq_system{rows = maps:remove(Key, Rows), revidx=RevIdx}.
+
+-spec eqs_get(key(), eq_system()) -> row().
+eqs_get(Key, #eq_system{rows=Rows}) -> maps:get(Key, Rows).
+
+%% Keys of all equations containing a nonzero coefficient for Var
+-spec eqs_lookup(var(), eq_system()) -> ordsets:ordset(key()).
+eqs_lookup(Var, #eq_system{revidx=RevIdx}) -> maps:get(Var, RevIdx).
+
+%% eqs_rows(#eq_system{rows=Rows}) -> maps:to_list(Rows).
+
+%% eqs_print(EQS) ->
+%% lists:foreach(fun({_, Row}) ->
+%% row_print(Row)
+%% end, lists:sort(eqs_rows(EQS))).
+
+%% row_print(Row) ->
+%% CoefStrs = [io_lib:format("~wl~w", [Coef, Var])
+%% || {Var, Coef} <- row_coefs(Row)],
+%% CoefStr = lists:join(" + ", CoefStrs),
+%% io:format("~w = ~s~n", [row_const(Row), CoefStr]).
+
+revidx_empty() -> #{}.
+
+-spec revidx_add(key(), row(), rev_index()) -> rev_index().
+revidx_add(Key, Row, RevIdx0) ->
+ orddict:fold(fun(Var, _Coef, RevIdx1) ->
+ ?ASSERT(_Coef /= 0.0),
+ RevIdx1#{Var => ordsets:add_element(
+ Key, maps:get(Var, RevIdx1, ordsets:new()))}
+ end, RevIdx0, row_coefs(Row)).
+
+-spec revidx_remove(key(), row(), rev_index()) -> rev_index().
+revidx_remove(Key, {Coefs, _}, RevIdx0) ->
+ orddict:fold(fun(Var, _Coef, RevIdx1) ->
+ case RevIdx1 of
+ #{Var := Keys0} ->
+ case ordsets:del_element(Key, Keys0) of
+ [] -> maps:remove(Var, RevIdx1);
+ Keys -> RevIdx1#{Var := Keys}
+ end
+ end
+ end, RevIdx0, Coefs).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(FAST_ITERATIONS, 5).
+
+%% @doc Computes a rough approximation of BB weights. The approximation is
+%% particularly poor (converges slowly) for recursive functions and loops.
+-spec compute_fast(cfg(), target_module(), target_context()) -> bb_weights().
+compute_fast(CFG, TgtMod, TgtCtx) ->
+ Target = {TgtMod, TgtCtx},
+ StartLb = hipe_gen_cfg:start_label(CFG),
+ RPO = reverse_postorder(CFG, Target),
+ PredProbs = [{L, pred_prob(L, CFG, Target)} || L <- RPO, L =/= StartLb],
+ Probs0 = (maps:from_list([{L, 0.0} || L <- RPO]))#{StartLb := 1.0},
+ fast_iterate(?FAST_ITERATIONS, PredProbs, Probs0).
+
+fast_iterate(0, _Pred, Probs) -> Probs;
+fast_iterate(Iters, Pred, Probs0) ->
+ fast_iterate(Iters-1, Pred,
+ fast_one(Pred, Probs0)).
+
+fast_one([{L, Pred}|Ls], Probs0) ->
+ Weight = fast_sum(Pred, Probs0, 0.0),
+ Probs = Probs0#{L => Weight},
+ fast_one(Ls, Probs);
+fast_one([], Probs) ->
+ Probs.
+
+fast_sum([{P,EWt}|Pred], Probs, Acc) when is_float(EWt), is_float(Acc) ->
+ case Probs of
+ #{P := PWt} when is_float(PWt) ->
+ fast_sum(Pred, Probs, Acc + PWt * EWt)
+ end;
+fast_sum([], _Probs, Acc) when is_float(Acc) ->
+ Acc.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Target module interface functions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(TGT_IFACE_0(N), N( {M,C}) -> M:N( C)).
+-define(TGT_IFACE_1(N), N(A1, {M,C}) -> M:N(A1, C)).
+-define(TGT_IFACE_2(N), N(A1,A2, {M,C}) -> M:N(A1,A2, C)).
+-define(TGT_IFACE_3(N), N(A1,A2,A3,{M,C}) -> M:N(A1,A2,A3,C)).
+
+?TGT_IFACE_2(bb).
+?TGT_IFACE_1(branch_preds).
+?TGT_IFACE_1(labels).
+?TGT_IFACE_1(reverse_postorder).
diff --git a/lib/hipe/opt/hipe_spillmin_color.erl b/lib/hipe/opt/hipe_spillmin_color.erl
index 41f1972df7..f87d9a5b61 100644
--- a/lib/hipe/opt/hipe_spillmin_color.erl
+++ b/lib/hipe/opt/hipe_spillmin_color.erl
@@ -166,9 +166,13 @@ remap_temp_map0(Cols, [_Y|Ys], SpillIndex) ->
%%
build_ig(CFG, Live, Target, TempMap) ->
- try build_ig0(CFG, Live, Target, TempMap)
- catch error:Rsn -> exit({regalloc, build_ig, Rsn})
- end.
+ TempMapping = map_spilled_temporaries(TempMap),
+ TempMappingTable = setup_ets(TempMapping),
+ NumSpilled = length(TempMapping),
+ IG = build_ig_bbs(labels(CFG, Target), CFG, Live, empty_ig(NumSpilled),
+ Target, TempMap, TempMappingTable),
+ ets:delete(TempMappingTable),
+ {normalize_ig(IG), NumSpilled}.
%% Creates an ETS table consisting of the keys given in List, with the values
%% being an integer which is the position of the key in List.
@@ -183,15 +187,6 @@ setup_ets0([X|Xs], Table, N) ->
ets:insert(Table, {X, N}),
setup_ets0(Xs, Table, N+1).
-build_ig0(CFG, Live, Target, TempMap) ->
- TempMapping = map_spilled_temporaries(TempMap),
- TempMappingTable = setup_ets(TempMapping),
- NumSpilled = length(TempMapping),
- IG = build_ig_bbs(labels(CFG, Target), CFG, Live, empty_ig(NumSpilled),
- Target, TempMap, TempMappingTable),
- ets:delete(TempMappingTable),
- {normalize_ig(IG), NumSpilled}.
-
build_ig_bbs([], _CFG, _Live, IG, _Target, _TempMap, _TempMapping) ->
IG;
build_ig_bbs([L|Ls], CFG, Live, IG, Target, TempMap, TempMapping) ->
@@ -212,16 +207,26 @@ build_ig_bb([X|Xs], LiveOut, IG, Target, TempMap, TempMapping) ->
build_ig_bb(Xs, LiveOut, IG, Target, TempMap, TempMapping),
build_ig_instr(X, Live, NewIG, Target, TempMap, TempMapping).
-build_ig_instr(X, Live, IG, Target, TempMap, TempMapping) ->
+build_ig_instr(X, Live0, IG0, Target, TempMap, TempMapping) ->
{Def, Use} = def_use(X, Target, TempMap),
- ?report3("Live ~w\n~w : Def: ~w Use ~w\n",[Live, X, Def,Use]),
+ ?report3("Live ~w\n~w : Def: ~w Use ~w\n",[Live0, X, Def,Use]),
DefListMapped = list_map(Def, TempMapping, []),
UseListMapped = list_map(Use, TempMapping, []),
DefSetMapped = ordsets:from_list(DefListMapped),
UseSetMapped = ordsets:from_list(UseListMapped),
- NewIG = interference_arcs(DefListMapped, ordsets:to_list(Live), IG),
- NewLive = ordsets:union(UseSetMapped, ordsets:subtract(Live, DefSetMapped)),
- {NewLive, NewIG}.
+ {Live1, IG1} =
+ analyze_move(X, Live0, IG0, Target, DefSetMapped, UseSetMapped),
+ IG = interference_arcs(DefListMapped, ordsets:to_list(Live1), IG1),
+ Live = ordsets:union(UseSetMapped, ordsets:subtract(Live1, DefSetMapped)),
+ {Live, IG}.
+
+analyze_move(X, Live0, IG0, Target, DefSetMapped, UseSetMapped) ->
+ case {is_spill_move(X, Target), DefSetMapped, UseSetMapped} of
+ {true, [Dst], [Src]} ->
+ {ordsets:del_element(Src, Live0), add_move(Src, Dst, IG0)};
+ {_, _, _} ->
+ {Live0, IG0}
+ end.
%% Given a list of Keys and an ets-table returns a list of the elements
%% in Mapping corresponding to the Keys and appends Acc to this list.
@@ -271,15 +276,6 @@ i_arcs(X, [Y|Ys], IG) ->
%% throw an exception (the caller should retry with more stack slots)
color(IG, StackSlots, NumNodes, Target) ->
- try
- color_0(IG, StackSlots, NumNodes, Target)
- catch
- error:Rsn ->
- ?error_msg("Coloring failed with ~p~n", [Rsn]),
- ?EXIT(Rsn)
- end.
-
-color_0(IG, StackSlots, NumNodes, Target) ->
?report("simplification of IG~n", []),
K = ordsets:size(StackSlots),
Nodes = list_ig(IG),
@@ -382,7 +378,8 @@ select_colors([{X,colorable}|Xs], IG, Cols, PhysRegs) ->
select_color(X, IG, Cols, PhysRegs) ->
UsedColors = get_colors(neighbors(X, IG), Cols),
- Reg = select_unused_color(UsedColors, PhysRegs),
+ Preferences = get_colors(move_connected(X, IG), Cols),
+ Reg = select_unused_color(UsedColors, Preferences, PhysRegs),
{Reg, set_color(X, Reg, Cols)}.
%%%%%%%%%%%%%%%%%%%%
@@ -396,10 +393,14 @@ get_colors([X|Xs], Cols) ->
[R|get_colors(Xs, Cols)]
end.
-select_unused_color(UsedColors, PhysRegs) ->
+select_unused_color(UsedColors, Preferences, PhysRegs) ->
Summary = ordsets:from_list(UsedColors),
- AvailRegs = ordsets:to_list(ordsets:subtract(PhysRegs, Summary)),
- hd(AvailRegs).
+ case ordsets:subtract(ordsets:from_list(Preferences), Summary) of
+ [PreferredColor|_] -> PreferredColor;
+ _ ->
+ AvailRegs = ordsets:to_list(ordsets:subtract(PhysRegs, Summary)),
+ hd(AvailRegs)
+ end.
push_colored(X, Stk) ->
[{X, colorable} | Stk].
@@ -456,7 +457,11 @@ init_stackslots(NumSlots, Acc) ->
%%
%% Note: later on, we may wish to add 'move-related' support.
--record(ig_info, {neighbors = [] :: [_], degree = 0 :: non_neg_integer()}).
+-record(ig_info, {
+ neighbors = [] :: [_],
+ degree = 0 :: non_neg_integer(),
+ move_connected = [] :: [_]
+ }).
empty_ig(NumNodes) ->
hipe_vectors:new(NumNodes, #ig_info{}).
@@ -467,16 +472,29 @@ degree(Info) ->
neighbors(Info) ->
Info#ig_info.neighbors.
+move_connected(Info) ->
+ Info#ig_info.move_connected.
+
add_edge(X, X, IG) -> IG;
add_edge(X, Y, IG) ->
add_arc(X, Y, add_arc(Y, X, IG)).
+add_move(X, X, IG) -> IG;
+add_move(X, Y, IG) ->
+ add_move_arc(X, Y, add_move_arc(Y, X, IG)).
+
add_arc(X, Y, IG) ->
Info = hipe_vectors:get(IG, X),
Old = neighbors(Info),
New = Info#ig_info{neighbors = [Y|Old]},
hipe_vectors:set(IG,X,New).
+add_move_arc(X, Y, IG) ->
+ Info = hipe_vectors:get(IG, X),
+ Old = move_connected(Info),
+ New = Info#ig_info{move_connected = [Y|Old]},
+ hipe_vectors:set(IG,X,New).
+
normalize_ig(IG) ->
Size = hipe_vectors:size(IG),
normalize_ig(Size-1, IG).
@@ -486,7 +504,8 @@ normalize_ig(-1, IG) ->
normalize_ig(I, IG) ->
Info = hipe_vectors:get(IG, I),
N = ordsets:from_list(neighbors(Info)),
- NewInfo = Info#ig_info{neighbors = N, degree = length(N)},
+ M = ordsets:subtract(ordsets:from_list(move_connected(Info)), N),
+ NewInfo = Info#ig_info{neighbors = N, degree = length(N), move_connected = M},
NewIG = hipe_vectors:set(IG, I, NewInfo),
normalize_ig(I-1, NewIG).
@@ -494,6 +513,10 @@ neighbors(X, IG) ->
Info = hipe_vectors:get(IG, X),
Info#ig_info.neighbors.
+move_connected(X, IG) ->
+ Info = hipe_vectors:get(IG, X),
+ Info#ig_info.move_connected.
+
decrement_degree(X, IG) ->
Info = hipe_vectors:get(IG, X),
Degree = degree(Info),
@@ -555,3 +578,6 @@ def_use(X, Target={TgtMod,TgtCtx}, TempMap) ->
reg_names(Regs, {TgtMod,TgtCtx}) ->
[TgtMod:reg_nr(X,TgtCtx) || X <- Regs].
+
+is_spill_move(Instr, {TgtMod,TgtCtx}) ->
+ TgtMod:is_spill_move(Instr, TgtCtx).
diff --git a/lib/hipe/ppc/hipe_ppc.erl b/lib/hipe/ppc/hipe_ppc.erl
index df9f193fa3..63ecd0a0b8 100644
--- a/lib/hipe/ppc/hipe_ppc.erl
+++ b/lib/hipe/ppc/hipe_ppc.erl
@@ -98,6 +98,9 @@
pseudo_move_dst/1,
pseudo_move_src/1,
+ mk_pseudo_spill_move/3,
+ is_pseudo_spill_move/1,
+
mk_pseudo_tailcall/4,
pseudo_tailcall_func/1,
pseudo_tailcall_stkargs/1,
@@ -131,6 +134,9 @@
pseudo_fmove_dst/1,
pseudo_fmove_src/1,
+ mk_pseudo_spill_fmove/3,
+ is_pseudo_spill_fmove/1,
+
mk_defun/8,
defun_mfa/1,
defun_formals/1,
@@ -412,6 +418,10 @@ is_pseudo_move(I) -> case I of #pseudo_move{} -> true; _ -> false end.
pseudo_move_dst(#pseudo_move{dst=Dst}) -> Dst.
pseudo_move_src(#pseudo_move{src=Src}) -> Src.
+mk_pseudo_spill_move(Dst, Temp, Src) ->
+ #pseudo_spill_move{dst=Dst, temp=Temp, src=Src}.
+is_pseudo_spill_move(I) -> is_record(I, pseudo_spill_move).
+
mk_pseudo_tailcall(FunC, Arity, StkArgs, Linkage) ->
#pseudo_tailcall{func=FunC, arity=Arity, stkargs=StkArgs, linkage=Linkage}.
pseudo_tailcall_func(#pseudo_tailcall{func=FunC}) -> FunC.
@@ -495,6 +505,10 @@ is_pseudo_fmove(I) -> case I of #pseudo_fmove{} -> true; _ -> false end.
pseudo_fmove_dst(#pseudo_fmove{dst=Dst}) -> Dst.
pseudo_fmove_src(#pseudo_fmove{src=Src}) -> Src.
+mk_pseudo_spill_fmove(Dst, Temp, Src) ->
+ #pseudo_spill_fmove{dst=Dst, temp=Temp, src=Src}.
+is_pseudo_spill_fmove(I) -> is_record(I, pseudo_spill_fmove).
+
mk_defun(MFA, Formals, IsClosure, IsLeaf, Code, Data, VarRange, LabelRange) ->
#defun{mfa=MFA, formals=Formals, code=Code, data=Data,
isclosure=IsClosure, isleaf=IsLeaf,
diff --git a/lib/hipe/ppc/hipe_ppc.hrl b/lib/hipe/ppc/hipe_ppc.hrl
index a96692c52e..3eef8be487 100644
--- a/lib/hipe/ppc/hipe_ppc.hrl
+++ b/lib/hipe/ppc/hipe_ppc.hrl
@@ -87,6 +87,7 @@
-record(pseudo_call_prepare, {nrstkargs}).
-record(pseudo_li, {dst, imm}).
-record(pseudo_move, {dst, src}).
+-record(pseudo_spill_move, {dst, temp, src}).
-record(pseudo_tailcall, {func, arity, stkargs, linkage}).
-record(pseudo_tailcall_prepare, {}).
-record(store, {stop, src, disp, base}). % non-indexed, non-update form
@@ -99,6 +100,7 @@
-record(fp_binary, {fp_binop, dst, src1, src2}).
-record(fp_unary, {fp_unop, dst, src}).
-record(pseudo_fmove, {dst, src}).
+-record(pseudo_spill_fmove, {dst, temp, src}).
%%% Function definitions.
diff --git a/lib/hipe/ppc/hipe_ppc_assemble.erl b/lib/hipe/ppc/hipe_ppc_assemble.erl
index 66817837df..b0f57e5582 100644
--- a/lib/hipe/ppc/hipe_ppc_assemble.erl
+++ b/lib/hipe/ppc/hipe_ppc_assemble.erl
@@ -32,7 +32,7 @@ assemble(CompiledCode, Closures, Exports, Options) ->
|| {MFA, Defun} <- CompiledCode],
%%
{ConstAlign,ConstSize,ConstMap,RefsFromConsts} =
- hipe_pack_constants:pack_constants(Code, hipe_rtl_arch:word_size()),
+ hipe_pack_constants:pack_constants(Code),
%%
{CodeSize,CodeBinary,AccRefs,LabelMap,ExportMap} =
encode(translate(Code, ConstMap), Options),
diff --git a/lib/hipe/ppc/hipe_ppc_cfg.erl b/lib/hipe/ppc/hipe_ppc_cfg.erl
index f17c0ac503..d44d38f38d 100644
--- a/lib/hipe/ppc/hipe_ppc_cfg.erl
+++ b/lib/hipe/ppc/hipe_ppc_cfg.erl
@@ -21,8 +21,8 @@
bb/2, bb_add/3]).
-export([postorder/1]).
-export([linearise/1, params/1, reverse_postorder/1]).
--export([arity/1]).
-%%%-export([redirect_jmp/3, arity/1]).
+-export([redirect_jmp/3, arity/1]).
+-export([branch_preds/1]).
%%% these tell cfg.inc what to define (ugly as hell)
-define(BREADTH_ORDER,true).
@@ -75,11 +75,30 @@ branch_successors(Branch) ->
#pseudo_tailcall{} -> []
end.
+branch_preds(Branch) ->
+ case Branch of
+ #bctr{labels=Labels} ->
+ Prob = 1.0/length(Labels),
+ [{L, Prob} || L <- Labels];
+ #pseudo_bc{true_label=TrueLab,false_label=FalseLab,pred=Pred} ->
+ [{FalseLab, 1.0-Pred}, {TrueLab, Pred}];
+ #pseudo_call{contlab=ContLab, sdesc=#ppc_sdesc{exnlab=[]}} ->
+ %% A function can still cause an exception, even if we won't catch it
+ [{ContLab, 1.0-hipe_bb_weights:call_exn_pred()}];
+ #pseudo_call{contlab=ContLab, sdesc=#ppc_sdesc{exnlab=ExnLab}} ->
+ CallExnPred = hipe_bb_weights:call_exn_pred(),
+ [{ContLab, 1.0-CallExnPred}, {ExnLab, CallExnPred}];
+ _ ->
+ case branch_successors(Branch) of
+ [] -> [];
+ [Single] -> [{Single, 1.0}]
+ end
+ end.
+
-ifdef(REMOVE_TRIVIAL_BBS_NEEDED).
fails_to(_Instr) -> [].
-endif.
--ifdef(notdef).
redirect_jmp(I, Old, New) ->
case I of
#b_label{label=Label} ->
@@ -93,10 +112,16 @@ redirect_jmp(I, Old, New) ->
if Old =:= FalseLab -> I1#pseudo_bc{false_label=New};
true -> I1
end;
- %% handle pseudo_call too?
- _ -> I
+ #pseudo_call{sdesc=SDesc0, contlab=ContLab0} ->
+ SDesc = case SDesc0 of
+ #ppc_sdesc{exnlab=Old} -> SDesc0#ppc_sdesc{exnlab=New};
+ #ppc_sdesc{exnlab=_} -> SDesc0
+ end,
+ ContLab = if Old =:= ContLab0 -> New;
+ true -> ContLab0
+ end,
+ I#pseudo_call{sdesc=SDesc, contlab=ContLab}
end.
--endif.
mk_goto(Label) ->
hipe_ppc:mk_b_label(Label).
diff --git a/lib/hipe/ppc/hipe_ppc_defuse.erl b/lib/hipe/ppc/hipe_ppc_defuse.erl
index 9a99611493..d8a864f7d5 100644
--- a/lib/hipe/ppc/hipe_ppc_defuse.erl
+++ b/lib/hipe/ppc/hipe_ppc_defuse.erl
@@ -41,6 +41,7 @@ insn_def_gpr(I) ->
#pseudo_call{} -> call_clobbered_gpr();
#pseudo_li{dst=Dst} -> [Dst];
#pseudo_move{dst=Dst} -> [Dst];
+ #pseudo_spill_move{dst=Dst,temp=Temp} -> [Dst, Temp];
#pseudo_tailcall_prepare{} -> tailcall_clobbered_gpr();
#unary{dst=Dst} -> [Dst];
_ -> []
@@ -71,6 +72,7 @@ insn_use_gpr(I) ->
#mtspr{src=Src} -> [Src];
#pseudo_call{sdesc=#ppc_sdesc{arity=Arity}} -> arity_use_gpr(Arity);
#pseudo_move{src=Src} -> [Src];
+ #pseudo_spill_move{src=Src} -> [Src];
#pseudo_tailcall{arity=Arity,stkargs=StkArgs} ->
addsrcs(StkArgs, addtemps(tailcall_clobbered_gpr(), arity_use_gpr(Arity)));
#store{src=Src,base=Base} -> addtemp(Src, [Base]);
@@ -110,6 +112,7 @@ insn_def_fpr(I) ->
#fp_binary{dst=Dst} -> [Dst];
#fp_unary{dst=Dst} -> [Dst];
#pseudo_fmove{dst=Dst} -> [Dst];
+ #pseudo_spill_fmove{dst=Dst,temp=Temp} -> [Dst, Temp];
_ -> []
end.
@@ -126,6 +129,7 @@ insn_use_fpr(I) ->
#fp_binary{src1=Src1,src2=Src2} -> addtemp(Src1, [Src2]);
#fp_unary{src=Src} -> [Src];
#pseudo_fmove{src=Src} -> [Src];
+ #pseudo_spill_fmove{src=Src} -> [Src];
_ -> []
end.
diff --git a/lib/hipe/ppc/hipe_ppc_frame.erl b/lib/hipe/ppc/hipe_ppc_frame.erl
index a91cb18cc2..b88b75a5bd 100644
--- a/lib/hipe/ppc/hipe_ppc_frame.erl
+++ b/lib/hipe/ppc/hipe_ppc_frame.erl
@@ -66,10 +66,14 @@ do_insn(I, LiveOut, Context, FPoff) ->
do_pseudo_call_prepare(I, FPoff);
#pseudo_move{} ->
{do_pseudo_move(I, Context, FPoff), FPoff};
+ #pseudo_spill_move{} ->
+ {do_pseudo_spill_move(I, Context, FPoff), FPoff};
#pseudo_tailcall{} ->
{do_pseudo_tailcall(I, Context), context_framesize(Context)};
#pseudo_fmove{} ->
{do_pseudo_fmove(I, Context, FPoff), FPoff};
+ #pseudo_spill_fmove{} ->
+ {do_pseudo_spill_fmove(I, Context, FPoff), FPoff};
_ ->
{[I], FPoff}
end.
@@ -98,6 +102,22 @@ do_pseudo_move(I, Context, FPoff) ->
end
end.
+do_pseudo_spill_move(I, Context, FPoff) ->
+ #pseudo_spill_move{dst=Dst,temp=Temp,src=Src} = I,
+ case temp_is_pseudo(Src) andalso temp_is_pseudo(Dst) of
+ false -> % Register allocator changed its mind, turn back to move
+ do_pseudo_move(hipe_ppc:mk_pseudo_move(Dst, Src), Context, FPoff);
+ true ->
+ SrcOffset = pseudo_offset(Src, FPoff, Context),
+ DstOffset = pseudo_offset(Dst, FPoff, Context),
+ case SrcOffset =:= DstOffset of
+ true -> []; % omit move-to-self
+ false ->
+ mk_load(hipe_ppc:ldop_word(), Temp, SrcOffset, mk_sp(),
+ mk_store(hipe_ppc:stop_word(), Temp, DstOffset, mk_sp(), []))
+ end
+ end.
+
do_pseudo_fmove(I, Context, FPoff) ->
Dst = hipe_ppc:pseudo_fmove_dst(I),
Src = hipe_ppc:pseudo_fmove_src(I),
@@ -115,6 +135,22 @@ do_pseudo_fmove(I, Context, FPoff) ->
end
end.
+do_pseudo_spill_fmove(I, Context, FPoff) ->
+ #pseudo_spill_fmove{dst=Dst,temp=Temp,src=Src} = I,
+ case temp_is_pseudo(Src) andalso temp_is_pseudo(Dst) of
+ false -> % Register allocator changed its mind, turn back to move
+ do_pseudo_fmove(hipe_ppc:mk_pseudo_fmove(Dst, Src), Context, FPoff);
+ true ->
+ SrcOffset = pseudo_offset(Src, FPoff, Context),
+ DstOffset = pseudo_offset(Dst, FPoff, Context),
+ case SrcOffset =:= DstOffset of
+ true -> []; % omit move-to-self
+ false ->
+ hipe_ppc:mk_fload(Temp, SrcOffset, mk_sp(), 0)
+ ++ hipe_ppc:mk_fstore(Temp, DstOffset, mk_sp(), 0)
+ end
+ end.
+
pseudo_offset(Temp, FPoff, Context) ->
FPoff + context_offset(Context, Temp).
diff --git a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
index 74ef7475eb..bca504d754 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_finalise.erl
@@ -41,6 +41,7 @@ ra_insn(I, Map, FPMap) ->
#mtspr{} -> ra_mtspr(I, Map);
#pseudo_li{} -> ra_pseudo_li(I, Map);
#pseudo_move{} -> ra_pseudo_move(I, Map);
+ #pseudo_spill_move{} -> ra_pseudo_spill_move(I, Map);
#pseudo_tailcall{} -> ra_pseudo_tailcall(I, Map);
#store{} -> ra_store(I, Map);
#storex{} -> ra_storex(I, Map);
@@ -52,6 +53,7 @@ ra_insn(I, Map, FPMap) ->
#fp_binary{} -> ra_fp_binary(I, FPMap);
#fp_unary{} -> ra_fp_unary(I, FPMap);
#pseudo_fmove{} -> ra_pseudo_fmove(I, FPMap);
+ #pseudo_spill_fmove{} -> ra_pseudo_spill_fmove(I, FPMap);
_ -> I
end.
@@ -98,6 +100,12 @@ ra_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, Map) ->
NewSrc = ra_temp(Src, Map),
I#pseudo_move{dst=NewDst,src=NewSrc}.
+ra_pseudo_spill_move(I=#pseudo_spill_move{dst=Dst,temp=Temp,src=Src}, Map) ->
+ NewDst = ra_temp(Dst, Map),
+ NewTemp = ra_temp(Temp, Map),
+ NewSrc = ra_temp(Src, Map),
+ I#pseudo_spill_move{dst=NewDst,temp=NewTemp,src=NewSrc}.
+
ra_pseudo_tailcall(I=#pseudo_tailcall{stkargs=StkArgs}, Map) ->
NewStkArgs = ra_args(StkArgs, Map),
I#pseudo_tailcall{stkargs=NewStkArgs}.
@@ -156,6 +164,13 @@ ra_pseudo_fmove(I=#pseudo_fmove{dst=Dst,src=Src}, FPMap) ->
NewSrc = ra_temp_fp(Src, FPMap),
I#pseudo_fmove{dst=NewDst,src=NewSrc}.
+ra_pseudo_spill_fmove(I=#pseudo_spill_fmove{dst=Dst,temp=Temp,src=Src},
+ FPMap) ->
+ NewDst = ra_temp_fp(Dst, FPMap),
+ NewTemp = ra_temp_fp(Temp, FPMap),
+ NewSrc = ra_temp_fp(Src, FPMap),
+ I#pseudo_spill_fmove{dst=NewDst,temp=NewTemp,src=NewSrc}.
+
ra_args([Arg|Args], Map) ->
[ra_temp_or_imm(Arg, Map) | ra_args(Args, Map)];
ra_args([], _) ->
diff --git a/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl b/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
index 95aa294fe5..0a97129666 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_postconditions.erl
@@ -57,6 +57,7 @@ do_insn(I, TempMap, Strategy) ->
#mtspr{} -> do_mtspr(I, TempMap, Strategy);
#pseudo_li{} -> do_pseudo_li(I, TempMap, Strategy);
#pseudo_move{} -> do_pseudo_move(I, TempMap, Strategy);
+ #pseudo_spill_move{} -> do_pseudo_spill_move(I, TempMap, Strategy);
#store{} -> do_store(I, TempMap, Strategy);
#storex{} -> do_storex(I, TempMap, Strategy);
#unary{} -> do_unary(I, TempMap, Strategy);
@@ -117,18 +118,25 @@ do_pseudo_li(I=#pseudo_li{dst=Dst}, TempMap, Strategy) ->
do_pseudo_move(I=#pseudo_move{dst=Dst,src=Src}, TempMap, Strategy) ->
%% Either Dst or Src (but not both) may be a pseudo temp.
- %% pseudo_move and pseudo_tailcall are special cases: in
- %% all other instructions, all temps must be non-pseudos
- %% after register allocation.
- case temp_is_spilled(Dst, TempMap) of
- true -> % Src must not be a pseudo
- {FixSrc,NewSrc,DidSpill} = fix_src1(Src, TempMap, Strategy),
- NewI = I#pseudo_move{src=NewSrc},
- {FixSrc ++ [NewI], DidSpill};
+ %% pseudo_move, pseudo_spill_move, and pseudo_tailcall are
+ %% special cases: in all other instructions, all temps
+ %% must be non-pseudos after register allocation.
+ case temp_is_spilled(Src, TempMap)
+ andalso temp_is_spilled(Dst, TempMap)
+ of
+ true -> % Turn into pseudo_spill_move
+ Temp = clone(Src, temp1(Strategy)),
+ NewI = #pseudo_spill_move{dst=Dst,temp=Temp,src=Src},
+ {[NewI], true};
_ ->
{[I], false}
end.
+do_pseudo_spill_move(I=#pseudo_spill_move{temp=Temp}, TempMap, _Strategy) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = temp_is_spilled(Temp, TempMap),
+ {[I], false}.
+
do_store(I=#store{src=Src,base=Base}, TempMap, Strategy) ->
{FixSrc,NewSrc,DidSpill1} = fix_src1(Src, TempMap, Strategy),
{FixBase,NewBase,DidSpill2} = fix_src2(Base, TempMap, Strategy),
diff --git a/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl b/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
index 5ec5f29577..7342053620 100644
--- a/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
+++ b/lib/hipe/ppc/hipe_ppc_ra_postconditions_fp.erl
@@ -42,6 +42,7 @@ do_insn(I, TempMap) ->
#fp_binary{} -> do_fp_binary(I, TempMap);
#fp_unary{} -> do_fp_unary(I, TempMap);
#pseudo_fmove{} -> do_pseudo_fmove(I, TempMap);
+ #pseudo_spill_fmove{} -> do_pseudo_spill_fmove(I, TempMap);
_ -> {[I], false}
end.
@@ -81,15 +82,22 @@ do_fp_unary(I=#fp_unary{dst=Dst,src=Src}, TempMap) ->
{FixSrc ++ [NewI | FixDst], DidSpill1 or DidSpill2}.
do_pseudo_fmove(I=#pseudo_fmove{dst=Dst,src=Src}, TempMap) ->
- case temp_is_spilled(Dst, TempMap) of
- true ->
- {FixSrc,NewSrc,DidSpill} = fix_src(Src, TempMap),
- NewI = I#pseudo_fmove{src=NewSrc},
- {FixSrc ++ [NewI], DidSpill};
+ case temp_is_spilled(Src, TempMap)
+ andalso temp_is_spilled(Dst, TempMap)
+ of
+ true -> % Turn into pseudo_spill_fmove
+ Temp = clone(Src),
+ NewI = #pseudo_spill_fmove{dst=Dst,temp=Temp,src=Src},
+ {[NewI], true};
_ ->
{[I], false}
end.
+do_pseudo_spill_fmove(I=#pseudo_spill_fmove{temp=Temp}, TempMap) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = temp_is_spilled(Temp, TempMap),
+ {[I], false}.
+
%%% Fix Dst and Src operands.
fix_src(Src, TempMap) ->
diff --git a/lib/hipe/ppc/hipe_ppc_subst.erl b/lib/hipe/ppc/hipe_ppc_subst.erl
index 1cd18b5c01..e282b22774 100644
--- a/lib/hipe/ppc/hipe_ppc_subst.erl
+++ b/lib/hipe/ppc/hipe_ppc_subst.erl
@@ -48,6 +48,8 @@ insn_temps(T, I) ->
#pseudo_call_prepare{} -> I;
#pseudo_li{dst=D} -> I#pseudo_li{dst=T(D)};
#pseudo_move{dst=D,src=S} -> I#pseudo_move{dst=T(D),src=T(S)};
+ #pseudo_spill_move{dst=D,temp=U,src=S} ->
+ I#pseudo_spill_move{dst=T(D),temp=T(U),src=T(S)};
#pseudo_tailcall{func=F,stkargs=Stk} when not is_record(F, ppc_temp) ->
I#pseudo_tailcall{stkargs=lists:map(A,Stk)};
#pseudo_tailcall_prepare{} -> I;
@@ -62,7 +64,9 @@ insn_temps(T, I) ->
#fp_binary{dst=D,src1=L,src2=R} ->
I#fp_binary{dst=T(D),src1=T(L),src2=T(R)};
#fp_unary{dst=D,src=S} -> I#fp_unary{dst=T(D),src=T(S)};
- #pseudo_fmove{dst=D,src=S} -> I#pseudo_fmove{dst=T(D),src=T(S)}
+ #pseudo_fmove{dst=D,src=S} -> I#pseudo_fmove{dst=T(D),src=T(S)};
+ #pseudo_spill_fmove{dst=D,temp=U,src=S} ->
+ I#pseudo_spill_fmove{dst=T(D),temp=T(U),src=T(S)}
end.
-spec oper_temps(subst_fun(), oper()) -> oper().
diff --git a/lib/hipe/regalloc/Makefile b/lib/hipe/regalloc/Makefile
index 209f230a9b..81a92e5d35 100644
--- a/lib/hipe/regalloc/Makefile
+++ b/lib/hipe/regalloc/Makefile
@@ -50,8 +50,10 @@ MODULES = hipe_ig hipe_ig_moves hipe_moves \
hipe_optimistic_regalloc \
hipe_coalescing_regalloc \
hipe_graph_coloring_regalloc \
+ hipe_range_split \
hipe_regalloc_loop \
hipe_regalloc_prepass \
+ hipe_restore_reuse \
hipe_ls_regalloc \
hipe_ppc_specific hipe_ppc_specific_fp \
hipe_sparc_specific hipe_sparc_specific_fp \
diff --git a/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl b/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
index 9c94539bc6..d592ba391c 100644
--- a/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
+++ b/lib/hipe/regalloc/hipe_amd64_specific_sse2.erl
@@ -30,6 +30,7 @@
def_use/2,
is_arg/2, %% used by hipe_ls_regalloc
is_move/2,
+ is_spill_move/2,
is_fixed/2, %% used by hipe_graph_coloring_regalloc
is_global/2,
is_precoloured/2,
@@ -50,12 +51,19 @@
-export([check_and_rewrite/3,
check_and_rewrite/4]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights
+-export([branch_preds/2]).
+
%%----------------------------------------------------------------------------
-include("../flow/cfg.hrl").
@@ -126,8 +134,8 @@ temp0(_) ->
all_precoloured(Ctx) ->
allocatable(Ctx).
-is_precoloured(Reg, Ctx) ->
- lists:member(Reg,all_precoloured(Ctx)).
+is_precoloured(Reg, _) ->
+ hipe_amd64_registers:is_precoloured_sse2(Reg).
physical_name(Reg, _) ->
Reg.
@@ -152,6 +160,9 @@ bb(CFG, L, _) ->
update_bb(CFG,L,BB,_) ->
hipe_x86_cfg:bb_add(CFG,L,BB).
+branch_preds(Instr,_) ->
+ hipe_x86_cfg:branch_preds(Instr).
+
%% AMD64 stuff
def_use(Instruction, _) ->
@@ -184,10 +195,34 @@ is_move(Instruction, _) ->
andalso hipe_x86:is_temp(Dst) andalso hipe_x86:temp_is_allocatable(Dst);
false -> false
end.
+
+is_spill_move(Instruction,_) ->
+ hipe_x86:is_pseudo_spill_fmove(Instruction).
reg_nr(Reg, _) ->
hipe_x86:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_x86:mk_fmove(Src, Dst).
+
+mk_goto(Label, _) ->
+ hipe_x86:mk_jmp_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ Ref = make_ref(),
+ put(Ref, false),
+ I = hipe_x86_subst:insn_lbls(
+ fun(Tgt) ->
+ if Tgt =:= ToOld -> put(Ref, true), ToNew;
+ is_integer(Tgt) -> Tgt
+ end
+ end, Jmp),
+ true = erase(Ref), % Assert that something was rewritten
+ I.
+
+new_label(_) ->
+ hipe_gensym:get_next_label(x86).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(x86).
diff --git a/lib/hipe/regalloc/hipe_arm_specific.erl b/lib/hipe/regalloc/hipe_arm_specific.erl
index cef22e5af9..7ebc6aa336 100644
--- a/lib/hipe/regalloc/hipe_arm_specific.erl
+++ b/lib/hipe/regalloc/hipe_arm_specific.erl
@@ -24,6 +24,7 @@
,reg_nr/2
,def_use/2
,is_move/2
+ ,is_spill_move/2
,is_precoloured/2
,var_range/2
,allocatable/1
@@ -46,12 +47,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights, hipe_range_split
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, no_context) ->
hipe_arm_ra_postconditions:check_and_rewrite(CFG, Coloring, 'normal').
@@ -115,6 +123,9 @@ bb(CFG,L,_) ->
update_bb(CFG,L,BB,_) ->
hipe_arm_cfg:bb_add(CFG,L,BB).
+branch_preds(Branch,_) ->
+ hipe_arm_cfg:branch_preds(Branch).
+
%% ARM stuff
def_use(Instruction, Ctx) ->
@@ -144,9 +155,33 @@ is_move(Instruction, _) ->
false -> false
end.
+is_spill_move(Instruction, _) ->
+ hipe_arm:is_pseudo_spill_move(Instruction).
+
reg_nr(Reg, _) ->
hipe_arm:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_arm:mk_pseudo_move(Dst, Src).
+
+mk_goto(Label, _) ->
+ hipe_arm:mk_b_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ Ref = make_ref(),
+ put(Ref, false),
+ I = hipe_arm_subst:insn_lbls(
+ fun(Tgt) ->
+ if Tgt =:= ToOld -> put(Ref, true), ToNew;
+ is_integer(Tgt) -> Tgt
+ end
+ end, Jmp),
+ true = erase(Ref), % Assert that something was rewritten
+ I.
+
+new_label(_) ->
+ hipe_gensym:get_next_label(arm).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(arm).
diff --git a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
index e8ccbec9f1..b8f0a1974c 100644
--- a/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_coalescing_regalloc.erl
@@ -914,7 +914,7 @@ findCheapest([Node|Nodes], IG, Cost, Cheapest, SpillLimit) ->
%% limit are extremely expensive.
getCost(Node, IG, SpillLimit) ->
- case Node > SpillLimit of
+ case Node >= SpillLimit of
true -> inf;
false -> hipe_ig:node_spill_cost(Node, IG)
end.
diff --git a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
index 07aa812f4a..f82d3a2cbc 100644
--- a/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_graph_coloring_regalloc.erl
@@ -209,8 +209,8 @@ color(IG, Spill, PhysRegs, SpillIx, SpillLimit, NumNodes, Target,
%% Any nodes above the spillimit must be colored first...
MustNotSpill =
- if NumNodes > SpillLimit+1 ->
- sort_on_degree(lists:seq(SpillLimit+1,NumNodes-1) -- Low,IG);
+ if NumNodes > SpillLimit ->
+ sort_on_degree(lists:seq(SpillLimit,NumNodes-1) -- Low,IG);
true -> []
end,
@@ -401,7 +401,7 @@ spill_costs([{N,Info}|Ns], IG, Vis, Spill, SpillLimit, Target) ->
true ->
spill_costs(Ns, IG, Vis, Spill, SpillLimit, Target);
false ->
- if N > SpillLimit ->
+ if N >= SpillLimit ->
spill_costs(Ns, IG, Vis, Spill, SpillLimit, Target);
true ->
[{spill_cost_of(N,Spill)/Deg,N} |
diff --git a/lib/hipe/regalloc/hipe_optimistic_regalloc.erl b/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
index b96920cbcf..a019c46b90 100644
--- a/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
+++ b/lib/hipe/regalloc/hipe_optimistic_regalloc.erl
@@ -1933,7 +1933,7 @@ findCheapest([Node|Nodes], IG, Cost, Cheapest, SpillLimit) ->
%% limit are extremely expensive.
getCost(Node, IG, SpillLimit) ->
- case Node > SpillLimit of
+ case Node >= SpillLimit of
true -> inf;
false ->
SpillCost = hipe_ig:node_spill_cost(Node, IG),
diff --git a/lib/hipe/regalloc/hipe_ppc_specific.erl b/lib/hipe/regalloc/hipe_ppc_specific.erl
index a6450b4d96..81bb551bd2 100644
--- a/lib/hipe/regalloc/hipe_ppc_specific.erl
+++ b/lib/hipe/regalloc/hipe_ppc_specific.erl
@@ -24,6 +24,7 @@
,reg_nr/2
,def_use/2
,is_move/2
+ ,is_spill_move/2
,is_precoloured/2
,var_range/2
,allocatable/1
@@ -46,12 +47,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, _) ->
hipe_ppc_ra_postconditions:check_and_rewrite(CFG, Coloring, 'normal').
@@ -115,6 +123,9 @@ bb(CFG,L,_) ->
update_bb(CFG,L,BB,_) ->
hipe_ppc_cfg:bb_add(CFG,L,BB).
+branch_preds(Instr,_) ->
+ hipe_ppc_cfg:branch_preds(Instr).
+
%% PowerPC stuff
def_use(Instruction, Ctx) ->
@@ -144,9 +155,24 @@ is_move(Instruction, _) ->
false -> false
end.
+is_spill_move(Instruction, _) ->
+ hipe_ppc:is_pseudo_spill_move(Instruction).
+
reg_nr(Reg, _) ->
hipe_ppc:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_ppc:mk_pseudo_move(Dst, Src).
+
+mk_goto(Label, _) ->
+ hipe_ppc:mk_b_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ hipe_ppc_cfg:redirect_jmp(Jmp, ToOld, ToNew).
+
+new_label(_) ->
+ hipe_gensym:get_next_label(ppc).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(ppc).
diff --git a/lib/hipe/regalloc/hipe_ppc_specific_fp.erl b/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
index 23cb6c0318..dcfdf6592c 100644
--- a/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
+++ b/lib/hipe/regalloc/hipe_ppc_specific_fp.erl
@@ -24,6 +24,7 @@
,reg_nr/2
,def_use/2
,is_move/2
+ ,is_spill_move/2
,is_precoloured/2
,var_range/2
,allocatable/1
@@ -46,12 +47,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, _) ->
hipe_ppc_ra_postconditions_fp:check_and_rewrite(CFG, Coloring).
@@ -108,6 +116,9 @@ bb(CFG, L, _) ->
update_bb(CFG,L,BB,_) ->
hipe_ppc_cfg:bb_add(CFG,L,BB).
+branch_preds(Instr,_) ->
+ hipe_ppc_cfg:branch_preds(Instr).
+
%% PowerPC stuff
def_use(I, Ctx) ->
@@ -125,9 +136,24 @@ defines_all_alloc(I, _) ->
is_move(I, _) ->
hipe_ppc:is_pseudo_fmove(I).
+is_spill_move(I, _) ->
+ hipe_ppc:is_pseudo_spill_fmove(I).
+
reg_nr(Reg, _) ->
hipe_ppc:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_ppc:mk_pseudo_fmove(Dst, Src).
+
+mk_goto(Label, _) ->
+ hipe_ppc:mk_b_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ hipe_ppc_cfg:redirect_jmp(Jmp, ToOld, ToNew).
+
+new_label(_) ->
+ hipe_gensym:get_next_label(ppc).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(ppc).
diff --git a/lib/hipe/regalloc/hipe_range_split.erl b/lib/hipe/regalloc/hipe_range_split.erl
new file mode 100644
index 0000000000..39b086d9f7
--- /dev/null
+++ b/lib/hipe/regalloc/hipe_range_split.erl
@@ -0,0 +1,1187 @@
+%% -*- erlang-indent-level: 2 -*-
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%@doc
+%% TEMPORARY LIVE RANGE SPLITTING PASS
+%%
+%% Live range splitting is useful to allow a register allocator to allocate a
+%% temporary to register for a part of its lifetime, even if it cannot be for
+%% the entirety. This improves register allocation quality, at the cost of
+%% making the allocation problem more time and memory intensive to solve.
+%%
+%% Optimal allocation can be achieved if all temporaries are split at every
+%% program point (between all instructions), but this makes register allocation
+%% infeasably slow in practice. Instead, this module uses heuristics to choose
+%% which temporaries should have their live ranges split, and at which points.
+%%
+%% The range splitter only considers temps which are live during a call
+%% instruction, since they're known to be spilled. The control-flow graph is
+%% partitioned at call instructions and splitting decisions are made separately
+%% for each partition. The register copy of a temp (if any) gets a separate name
+%% in each partition.
+%%
+%% There are three different ways the range splitter may choose to split a
+%% temporary in a program partition:
+%%
+%% * Mode1: Spill the temp before calls, and restore it after them
+%% * Mode2: Spill the temp after definitions, restore it after calls
+%% * Mode3: Spill the temp after definitions, restore it before uses
+%%
+%% To pick which of these should be used for each temp×partiton pair, the range
+%% splitter uses a cost function. The cost is simply the sum of the cost of all
+%% expected stack accesses, and the cost for an individual stack access is based
+%% on the probability weight of the basic block that it resides in. This biases
+%% the range splitter so that it attempts moving stack accesses from a functions
+%% hot path to the cold path.
+%%
+%% The heuristic has a couple of tuning knobs, adjusting its preference for
+%% different spilling modes, aggressiveness, and how much influence the basic
+%% block probability weights have.
+%%
+%% Edge case not handled: Call instructions directly defining a pseudo. In that
+%% case, if that pseudo has been selected for mode2 spills, no spill is inserted
+%% after the call.
+-module(hipe_range_split).
+
+-export([split/5]).
+
+-compile(inline).
+
+%% -define(DO_ASSERT, 1).
+%% -define(DEBUG, 1).
+-include("../main/hipe.hrl").
+
+%% Heuristic tuning constants
+-define(DEFAULT_MIN_GAIN, 1.1). % option: range_split_min_gain
+-define(DEFAULT_MODE1_FUDGE, 1.1). % option: range_split_mode1_fudge
+-define(DEFAULT_WEIGHT_POWER, 2). % option: range_split_weight_power
+-define(WEIGHT_CONST_FUN(Power), math:log(Power)/math:log(100)).
+-define(WEIGHT_FUN(Wt, Const), math:pow(Wt, Const)).
+-define(HEUR_MAX_TEMPS, 20000).
+
+-type target_cfg() :: any().
+-type target_instr() :: any().
+-type target_temp() :: any().
+-type liveness() :: any().
+-type target_module() :: module().
+-type target_context() :: any().
+-type target() :: {target_module(), target_context()}.
+-type liveset() :: ordsets:ordset(temp()).
+-type temp() :: non_neg_integer().
+-type label() :: non_neg_integer().
+
+-spec split(target_cfg(), liveness(), target_module(), target_context(),
+ comp_options())
+ -> target_cfg().
+split(TCFG0, Liveness, TargetMod, TargetContext, Options) ->
+ Target = {TargetMod, TargetContext},
+ NoTemps = number_of_temporaries(TCFG0, Target),
+ if NoTemps > ?HEUR_MAX_TEMPS ->
+ ?debug_msg("~w: Too many temps (~w), falling back on restore_reuse.~n",
+ [?MODULE, NoTemps]),
+ hipe_restore_reuse:split(TCFG0, Liveness, TargetMod, TargetContext);
+ true ->
+ Wts = compute_weights(TCFG0, TargetMod, TargetContext, Options),
+ {CFG0, Temps} = convert(TCFG0, Target),
+ Avail = avail_analyse(TCFG0, Liveness, Target),
+ Defs = def_analyse(CFG0, TCFG0),
+ RDefs = rdef_analyse(CFG0),
+ PLive = plive_analyse(CFG0),
+ {CFG, DUCounts, Costs, DSets0} =
+ scan(CFG0, Liveness, PLive, Wts, Defs, RDefs, Avail, Target),
+ {DSets, _} = hipe_dsets:to_map(DSets0),
+ Renames = decide(DUCounts, Costs, Target, Options),
+ rewrite(CFG, TCFG0, Target, Liveness, PLive, Defs, Avail, DSets, Renames,
+ Temps)
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Internal program representation
+%%
+%% Second pass: Convert cfg to internal representation
+
+-record(cfg, {
+ rpo_labels :: [label()],
+ bbs :: #{label() => bb()}
+ }).
+-type cfg() :: #cfg{}.
+
+cfg_bb(L, #cfg{bbs=BBS}) -> maps:get(L, BBS).
+
+cfg_postorder(#cfg{rpo_labels=RPO}) -> lists:reverse(RPO).
+
+-record(bb, {
+ code :: [code_elem()],
+ %% If the last instruction of code defines all allocatable registers
+ has_call :: boolean(),
+ succ :: [label()]
+ }).
+-type bb() :: #bb{}.
+-type code_elem() :: instr() | mode2_spills() | mode3_restores().
+
+bb_code(#bb{code=Code}) -> Code.
+bb_has_call(#bb{has_call=HasCall}) -> HasCall.
+bb_succ(#bb{succ=Succ}) -> Succ.
+
+bb_butlast(#bb{code=Code}) ->
+ bb_butlast_1(Code).
+
+bb_butlast_1([_Last]) -> [];
+bb_butlast_1([I|Is]) -> [I|bb_butlast_1(Is)].
+
+bb_last(#bb{code=Code}) -> lists:last(Code).
+
+-record(instr, {
+ i :: target_instr(),
+ def :: ordsets:ordset(temp()),
+ use :: ordsets:ordset(temp())
+ }).
+-type instr() :: #instr{}.
+
+-record(mode2_spills, {
+ temps :: ordsets:ordset(temp())
+ }).
+-type mode2_spills() :: #mode2_spills{}.
+
+-record(mode3_restores, {
+ temps :: ordsets:ordset(temp())
+ }).
+-type mode3_restores() :: #mode3_restores{}.
+
+-spec convert(target_cfg(), target()) -> {cfg(), temps()}.
+convert(CFG, Target) ->
+ RPO = reverse_postorder(CFG, Target),
+ {BBsList, Temps} = convert_bbs(RPO, CFG, Target, #{}, []),
+ {#cfg{rpo_labels = RPO,
+ bbs = maps:from_list(BBsList)},
+ Temps}.
+
+convert_bbs([], _CFG, _Target, Temps, Acc) -> {Acc, Temps};
+convert_bbs([L|Ls], CFG, Target, Temps0, Acc) ->
+ Succs = hipe_gen_cfg:succ(CFG, L),
+ TBB = bb(CFG, L, Target),
+ TCode = hipe_bb:code(TBB),
+ {Code, Last, Temps} = convert_code(TCode, Target, Temps0, []),
+ HasCall = defines_all_alloc(Last#instr.i, Target),
+ BB = #bb{code = Code,
+ has_call = HasCall,
+ succ = Succs},
+ convert_bbs(Ls, CFG, Target, Temps, [{L,BB}|Acc]).
+
+convert_code([], _Target, Temps, [Last|_]=Acc) ->
+ {lists:reverse(Acc), Last, Temps};
+convert_code([TI|TIs], Target, Temps0, Acc) ->
+ {TDef, TUse} = def_use(TI, Target),
+ I = #instr{i = TI,
+ def = ordsets:from_list(reg_names(TDef, Target)),
+ use = ordsets:from_list(reg_names(TUse, Target))},
+ Temps = add_temps(TUse, Target, add_temps(TDef, Target, Temps0)),
+ convert_code(TIs, Target, Temps, [I|Acc]).
+
+-type temps() :: #{temp() => target_temp()}.
+add_temps([], _Target, Temps) -> Temps;
+add_temps([T|Ts], Target, Temps) ->
+ add_temps(Ts, Target, Temps#{reg_nr(T, Target) => T}).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Fourth pass: P({DEF}) lattice fwd dataflow (for eliding stores at SPILL
+%% splits)
+-type defsi() :: #{label() => defseti() | {call, defseti(), defseti()}}.
+-type defs() :: #{label() => defsetf()}.
+
+-spec def_analyse(cfg(), target_cfg()) -> defs().
+def_analyse(CFG = #cfg{rpo_labels = RPO}, TCFG) ->
+ Defs0 = def_init(CFG),
+ def_dataf(RPO, TCFG, Defs0).
+
+-spec def_init(cfg()) -> defsi().
+def_init(#cfg{bbs = BBs}) ->
+ maps:from_list(
+ [begin
+ {L, case HasCall of
+ false -> def_init_scan(bb_code(BB), defseti_new());
+ true ->
+ {call, def_init_scan(bb_butlast(BB), defseti_new()),
+ defseti_from_ordset((bb_last(BB))#instr.def)}
+ end}
+ end || {L, BB = #bb{has_call=HasCall}} <- maps:to_list(BBs)]).
+
+def_init_scan([], Defset) -> Defset;
+def_init_scan([#instr{def=Def}|Is], Defset0) ->
+ Defset = defseti_add_ordset(Def, Defset0),
+ def_init_scan(Is, Defset).
+
+-spec def_dataf([label()], target_cfg(), defsi()) -> defs().
+def_dataf(Labels, TCFG, Defs0) ->
+ case def_dataf_once(Labels, TCFG, Defs0, 0) of
+ {Defs, 0} ->
+ def_finalise(Defs);
+ {Defs, _Changed} ->
+ def_dataf(Labels, TCFG, Defs)
+ end.
+
+-spec def_finalise(defsi()) -> defs().
+def_finalise(Defs) ->
+ maps:from_list([{K, defseti_finalise(BL)}
+ || {K, {call, BL, _}} <- maps:to_list(Defs)]).
+
+-spec def_dataf_once([label()], target_cfg(), defsi(), non_neg_integer())
+ -> {defsi(), non_neg_integer()}.
+def_dataf_once([], _TCFG, Defs, Changed) -> {Defs, Changed};
+def_dataf_once([L|Ls], TCFG, Defs0, Changed0) ->
+ AddPreds =
+ fun(Defset1) ->
+ lists:foldl(fun(P, Defset2) ->
+ defseti_union(defout(P, Defs0), Defset2)
+ end, Defset1, hipe_gen_cfg:pred(TCFG, L))
+ end,
+ Defset =
+ case Defset0 = maps:get(L, Defs0) of
+ {call, Butlast, Defout} -> {call, AddPreds(Butlast), Defout};
+ _ -> AddPreds(Defset0)
+ end,
+ Changed = case Defset =:= Defset0 of
+ true -> Changed0;
+ false -> Changed0+1
+ end,
+ def_dataf_once(Ls, TCFG, Defs0#{L := Defset}, Changed).
+
+-spec defout(label(), defsi()) -> defseti().
+defout(L, Defs) ->
+ case maps:get(L, Defs) of
+ {call, _DefButLast, Defout} -> Defout;
+ Defout -> Defout
+ end.
+
+-spec defbutlast(label(), defs()) -> defsetf().
+defbutlast(L, Defs) -> maps:get(L, Defs).
+
+-spec defseti_new() -> defseti().
+-spec defseti_union(defseti(), defseti()) -> defseti().
+-spec defseti_add_ordset(ordset:ordset(temp()), defseti()) -> defseti().
+-spec defseti_from_ordset(ordset:ordset(temp())) -> defseti().
+-spec defseti_finalise(defseti()) -> defsetf().
+-spec defsetf_member(temp(), defsetf()) -> boolean().
+-spec defsetf_intersect_ordset(ordsets:ordset(temp()), defsetf())
+ -> ordsets:ordset(temp()).
+
+-type defseti() :: bitord().
+defseti_new() -> bitord_new().
+defseti_union(A, B) -> bitord_union(A, B).
+defseti_add_ordset(OS, D) -> defseti_union(defseti_from_ordset(OS), D).
+defseti_from_ordset(OS) -> bitord_from_ordset(OS).
+defseti_finalise(D) -> bitarr_from_bitord(D).
+
+-type defsetf() :: bitarr().
+defsetf_member(E, D) -> bitarr_get(E, D).
+
+defsetf_intersect_ordset([], _D) -> [];
+defsetf_intersect_ordset([E|Es], D) ->
+ case bitarr_get(E, D) of
+ true -> [E|defsetf_intersect_ordset(Es,D)];
+ false -> defsetf_intersect_ordset(Es,D)
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Fifth pass: P({DEF}) lattice reverse dataflow (for eliding stores at defines
+%% in mode2)
+-type rdefsi() :: #{label() =>
+ {call, rdefseti(), [label()]}
+ | {nocall, rdefseti(), rdefseti(), [label()]}}.
+-type rdefs() :: #{label() => {final, rdefsetf(), [label()]}}.
+
+-spec rdef_analyse(cfg()) -> rdefs().
+rdef_analyse(CFG = #cfg{rpo_labels=RPO}) ->
+ Defs0 = rdef_init(CFG),
+ PO = rdef_postorder(RPO, CFG, []),
+ rdef_dataf(PO, Defs0).
+
+%% Filter out 'call' labels, since they don't change
+-spec rdef_postorder([label()], cfg(), [label()]) -> [label()].
+rdef_postorder([], _CFG, Acc) -> Acc;
+rdef_postorder([L|Ls], CFG, Acc) ->
+ case bb_has_call(cfg_bb(L, CFG)) of
+ true -> rdef_postorder(Ls, CFG, Acc);
+ false -> rdef_postorder(Ls, CFG, [L|Acc])
+ end.
+
+-spec rdef_init(cfg()) -> rdefsi().
+rdef_init(#cfg{bbs = BBs}) ->
+ maps:from_list(
+ [{L, case HasCall of
+ true ->
+ Defin = rdef_init_scan(bb_butlast(BB), rdefseti_empty()),
+ {call, Defin, Succs};
+ false ->
+ Gen = rdef_init_scan(bb_code(BB), rdefseti_empty()),
+ {nocall, Gen, rdefseti_top(), Succs}
+ end}
+ || {L, BB = #bb{has_call=HasCall, succ=Succs}} <- maps:to_list(BBs)]).
+
+-spec rdef_init_scan([instr()], rdefseti()) -> rdefseti().
+rdef_init_scan([], Defset) -> Defset;
+rdef_init_scan([#instr{def=Def}|Is], Defset0) ->
+ Defset = rdefseti_add_ordset(Def, Defset0),
+ rdef_init_scan(Is, Defset).
+
+-spec rdef_dataf([label()], rdefsi()) -> rdefs().
+rdef_dataf(Labels, Defs0) ->
+ case rdef_dataf_once(Labels, Defs0, 0) of
+ {Defs, 0} ->
+ rdef_finalise(Defs);
+ {Defs, _Changed} ->
+ rdef_dataf(Labels, Defs)
+ end.
+
+-spec rdef_finalise(rdefsi()) -> rdefs().
+rdef_finalise(Defs) ->
+ maps:map(fun(L, V) ->
+ Succs = rsuccs_val(V),
+ Defout0 = rdefout_intersect(L, Defs, rdefseti_top()),
+ {final, rdefset_finalise(Defout0), Succs}
+ end, Defs).
+
+-spec rdef_dataf_once([label()], rdefsi(), non_neg_integer())
+ -> {rdefsi(), non_neg_integer()}.
+rdef_dataf_once([], Defs, Changed) -> {Defs, Changed};
+rdef_dataf_once([L|Ls], Defs0, Changed0) ->
+ #{L := {nocall, Gen, Defin0, Succs}} = Defs0,
+ Defin = rdefseti_union(Gen, rdefout_intersect(L, Defs0, Defin0)),
+ Defset = {nocall, Gen, Defin, Succs},
+ Changed = case Defin =:= Defin0 of
+ true -> Changed0;
+ false -> Changed0+1
+ end,
+ rdef_dataf_once(Ls, Defs0#{L := Defset}, Changed).
+
+-spec rdefin(label(), rdefsi()) -> rdefseti().
+rdefin(L, Defs) -> rdefin_val(maps:get(L, Defs)).
+rdefin_val({nocall, _Gen, Defin, _Succs}) -> Defin;
+rdefin_val({call, Defin, _Succs}) -> Defin.
+
+-spec rsuccs(label(), rdefsi()) -> [label()].
+rsuccs(L, Defs) -> rsuccs_val(maps:get(L, Defs)).
+rsuccs_val({nocall, _Gen, _Defin, Succs}) -> Succs;
+rsuccs_val({call, _Defin, Succs}) -> Succs.
+
+-spec rdefout(label(), rdefs()) -> rdefsetf().
+rdefout(L, Defs) ->
+ #{L := {final, Defout, _Succs}} = Defs,
+ Defout.
+
+-spec rdefout_intersect(label(), rdefsi(), rdefseti()) -> rdefseti().
+rdefout_intersect(L, Defs, Init) ->
+ lists:foldl(fun(S, Acc) ->
+ rdefseti_intersect(rdefin(S, Defs), Acc)
+ end, Init, rsuccs(L, Defs)).
+
+-type rdefseti() :: bitord() | top.
+rdefseti_top() -> top.
+rdefseti_empty() -> bitord_new().
+-spec rdefseti_from_ordset(ordsets:ordset(temp())) -> rdefseti().
+rdefseti_from_ordset(OS) -> bitord_from_ordset(OS).
+
+-spec rdefseti_add_ordset(ordsets:ordset(temp()), rdefseti()) -> rdefseti().
+rdefseti_add_ordset(_, top) -> top; % Should never happen in rdef_dataf
+rdefseti_add_ordset(OS, D) -> rdefseti_union(rdefseti_from_ordset(OS), D).
+
+-spec rdefseti_union(rdefseti(), rdefseti()) -> rdefseti().
+rdefseti_union(top, _) -> top;
+rdefseti_union(_, top) -> top;
+rdefseti_union(A, B) -> bitord_union(A, B).
+
+-spec rdefseti_intersect(rdefseti(), rdefseti()) -> rdefseti().
+rdefseti_intersect(top, D) -> D;
+rdefseti_intersect(D, top) -> D;
+rdefseti_intersect(A, B) -> bitord_intersect(A, B).
+
+-type rdefsetf() :: {arr, bitarr()} | top.
+-spec rdefset_finalise(rdefseti()) -> rdefsetf().
+rdefset_finalise(top) -> top;
+rdefset_finalise(Ord) -> {arr, bitarr_from_bitord(Ord)}.
+
+%% rdefsetf_top() -> top.
+rdefsetf_empty() -> {arr, bitarr_new()}.
+
+-spec rdefsetf_add_ordset(ordset:ordset(temp()), rdefsetf()) -> rdefsetf().
+rdefsetf_add_ordset(_, top) -> top;
+rdefsetf_add_ordset(OS, {arr, Arr}) ->
+ {arr, lists:foldl(fun bitarr_set/2, Arr, OS)}.
+
+-spec rdef_step(instr(), rdefsetf()) -> rdefsetf().
+rdef_step(#instr{def=Def}, Defset) ->
+ %% ?ASSERT(not defines_all_alloc(I, Target)),
+ rdefsetf_add_ordset(Def, Defset).
+
+-spec ordset_subtract_rdefsetf(ordsets:ordset(temp()), rdefsetf())
+ -> ordsets:ordset(temp()).
+ordset_subtract_rdefsetf(_, top) -> [];
+ordset_subtract_rdefsetf(OS, {arr, Arr}) ->
+ %% Lazy implementation; could do better if OS can grow
+ lists:filter(fun(E) -> not bitarr_get(E, Arr) end, OS).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Integer sets represented as bit sets
+%%
+%% Two representations; bitord() and bitarr()
+-define(LIMB_IX_BITS, 11).
+-define(LIMB_BITS, (1 bsl ?LIMB_IX_BITS)).
+-define(LIMB_IX(Index), (Index bsr ?LIMB_IX_BITS)).
+-define(BIT_IX(Index), (Index band (?LIMB_BITS - 1))).
+-define(BIT_MASK(Index), (1 bsl ?BIT_IX(Index))).
+
+%% bitord(): fast at union/2 and can be compared for equality with '=:='
+-type bitord() :: orddict:orddict(non_neg_integer(), 0..((1 bsl ?LIMB_BITS)-1)).
+
+-spec bitord_new() -> bitord().
+bitord_new() -> [].
+
+-spec bitord_union(bitord(), bitord()) -> bitord().
+bitord_union(Lhs, Rhs) ->
+ orddict:merge(fun(_, L, R) -> L bor R end, Lhs, Rhs).
+
+-spec bitord_intersect(bitord(), bitord()) -> bitord().
+bitord_intersect([], _) -> [];
+bitord_intersect(_, []) -> [];
+bitord_intersect([{K, L}|Ls], [{K, R}|Rs]) ->
+ [{K, L band R} | bitord_intersect(Ls, Rs)];
+bitord_intersect([{LK, _}|Ls], [{RK, _}|_]=Rs) when LK < RK ->
+ bitord_intersect(Ls, Rs);
+bitord_intersect([{LK, _}|_]=Ls, [{RK, _}|Rs]) when LK > RK ->
+ bitord_intersect(Ls, Rs).
+
+-spec bitord_from_ordset(ordsets:ordset(non_neg_integer())) -> bitord().
+bitord_from_ordset([]) -> [];
+bitord_from_ordset([B|Bs]) ->
+ bitord_from_ordset_1(Bs, ?LIMB_IX(B), ?BIT_MASK(B)).
+
+bitord_from_ordset_1([B|Bs], Key, Val) when Key =:= ?LIMB_IX(B) ->
+ bitord_from_ordset_1(Bs, Key, Val bor ?BIT_MASK(B));
+bitord_from_ordset_1([B|Bs], Key, Val) ->
+ [{Key,Val} | bitord_from_ordset_1(Bs, ?LIMB_IX(B), ?BIT_MASK(B))];
+bitord_from_ordset_1([], Key, Val) -> [{Key, Val}].
+
+%% bitarr(): fast (enough) at get/2
+-type bitarr() :: array:array(0..((1 bsl ?LIMB_BITS)-1)).
+
+-spec bitarr_new() -> bitarr().
+bitarr_new() -> array:new({default, 0}).
+
+-spec bitarr_get(non_neg_integer(), bitarr()) -> boolean().
+bitarr_get(Index, Array) ->
+ Limb = array:get(?LIMB_IX(Index), Array),
+ 0 =/= (Limb band ?BIT_MASK(Index)).
+
+-spec bitarr_set(non_neg_integer(), bitarr()) -> bitarr().
+bitarr_set(Index, Array) ->
+ Limb0 = array:get(?LIMB_IX(Index), Array),
+ Limb = Limb0 bor ?BIT_MASK(Index),
+ array:set(?LIMB_IX(Index), Limb, Array).
+
+-spec bitarr_from_bitord(bitord()) -> bitarr().
+bitarr_from_bitord(Ord) ->
+ array:from_orddict(Ord, 0).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Sixth pass: Partition-local liveness analysis
+%%
+%% As temps are not spilled when exiting a partition in mode2, only
+%% partition-local uses need to be considered when deciding which temps need
+%% restoring at partition entry.
+
+-type plive() :: #{label() =>
+ {call, liveset(), [label()]}
+ | {nocall, {liveset(), liveset()}, liveset(), [label()]}}.
+
+-spec plive_analyse(cfg()) -> plive().
+plive_analyse(CFG) ->
+ Defs0 = plive_init(CFG),
+ PO = cfg_postorder(CFG),
+ plive_dataf(PO, Defs0).
+
+-spec plive_init(cfg()) -> plive().
+plive_init(#cfg{bbs = BBs}) ->
+ maps:from_list(
+ [begin
+ {L, case HasCall of
+ true ->
+ {Gen, _} = plive_init_scan(bb_code(BB)),
+ {call, Gen, Succs};
+ false ->
+ GenKill = plive_init_scan(bb_code(BB)),
+ {nocall, GenKill, liveset_empty(), Succs}
+ end}
+ end || {L, BB = #bb{has_call=HasCall, succ=Succs}} <- maps:to_list(BBs)]).
+
+-spec plive_init_scan([instr()]) -> {liveset(), liveset()}.
+plive_init_scan([]) -> {liveset_empty(), liveset_empty()};
+plive_init_scan([#instr{def=InstrKill, use=InstrGen}|Is]) ->
+ {Gen0, Kill0} = plive_init_scan(Is),
+ Gen1 = liveset_subtract(Gen0, InstrKill),
+ Gen = liveset_union(Gen1, InstrGen),
+ Kill1 = liveset_union(Kill0, InstrKill),
+ Kill = liveset_subtract(Kill1, InstrGen),
+ {Gen, Kill}.
+
+-spec plive_dataf([label()], plive()) -> plive().
+plive_dataf(Labels, PLive0) ->
+ case plive_dataf_once(Labels, PLive0, 0) of
+ {PLive, 0} -> PLive;
+ {PLive, _Changed} ->
+ plive_dataf(Labels, PLive)
+ end.
+
+-spec plive_dataf_once([label()], plive(), non_neg_integer()) ->
+ {plive(), non_neg_integer()}.
+plive_dataf_once([], PLive, Changed) -> {PLive, Changed};
+plive_dataf_once([L|Ls], PLive0, Changed0) ->
+ Liveset =
+ case Liveset0 = maps:get(L, PLive0) of
+ {call, Livein, Succs} ->
+ {call, Livein, Succs};
+ {nocall, {Gen, Kill} = GenKill, _OldLivein, Succs} ->
+ Liveout = pliveout(L, PLive0),
+ Livein = liveset_union(Gen, liveset_subtract(Liveout, Kill)),
+ {nocall, GenKill, Livein, Succs}
+ end,
+ Changed = case Liveset =:= Liveset0 of
+ true -> Changed0;
+ false -> Changed0+1
+ end,
+ plive_dataf_once(Ls, PLive0#{L := Liveset}, Changed).
+
+-spec pliveout(label(), plive()) -> liveset().
+pliveout(L, PLive) ->
+ liveset_union([plivein(S, PLive) || S <- psuccs(L, PLive)]).
+
+-spec psuccs(label(), plive()) -> [label()].
+psuccs(L, PLive) -> psuccs_val(maps:get(L, PLive)).
+psuccs_val({call, _Livein, Succs}) -> Succs;
+psuccs_val({nocall, _GenKill, _Livein, Succs}) -> Succs.
+
+-spec plivein(label(), plive()) -> liveset().
+plivein(L, PLive) -> plivein_val(maps:get(L, PLive)).
+plivein_val({call, Livein, _Succs}) -> Livein;
+plivein_val({nocall, _GenKill, Livein, _Succs}) -> Livein.
+
+liveset_empty() -> ordsets:new().
+liveset_subtract(A, B) -> ordsets:subtract(A, B).
+liveset_union(A, B) -> ordsets:union(A, B).
+liveset_union(LivesetList) -> ordsets:union(LivesetList).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Third pass: Compute dataflow analyses required for placing mode3
+%% spills/restores.
+%% Reuse analysis implementation in hipe_restore_reuse.
+%% XXX: hipe_restore_reuse has it's own "rdef"; we would like to reuse that one
+%% too.
+-type avail() :: hipe_restore_reuse:avail().
+
+-spec avail_analyse(target_cfg(), liveness(), target()) -> avail().
+avail_analyse(CFG, Liveness, Target) ->
+ hipe_restore_reuse:analyse(CFG, Liveness, Target).
+
+-spec mode3_split_in_block(label(), avail()) -> ordsets:ordset(temp()).
+mode3_split_in_block(L, Avail) ->
+ hipe_restore_reuse:split_in_block(L, Avail).
+
+-spec mode3_block_renameset(label(), avail()) -> ordsets:ordset(temp()).
+mode3_block_renameset(L, Avail) ->
+ hipe_restore_reuse:renamed_in_block(L, Avail).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Seventh pass
+%%
+%% Compute program space partitioning, collect information required by the
+%% heuristic.
+-type part_key() :: label().
+-type part_dsets() :: hipe_dsets:dsets(part_key()).
+-type part_dsets_map() :: #{part_key() => part_key()}.
+-type ducounts() :: #{part_key() => ducount()}.
+
+-spec scan(cfg(), liveness(), plive(), weights(), defs(), rdefs(), avail(),
+ target()) -> {cfg(), ducounts(), costs(), part_dsets()}.
+scan(CFG0, Liveness, PLive, Weights, Defs, RDefs, Avail, Target) ->
+ #cfg{rpo_labels = Labels, bbs = BBs0} = CFG0,
+ CFG = CFG0#cfg{bbs=#{}}, % kill reference
+ DSets0 = hipe_dsets:new(Labels),
+ Costs0 = costs_new(),
+ {BBs, DUCounts0, Costs1, DSets1} =
+ scan_bbs(maps:to_list(BBs0), Liveness, PLive, Weights, Defs, RDefs, Avail,
+ Target, #{}, Costs0, DSets0, []),
+ {RLList, DSets2} = hipe_dsets:to_rllist(DSets1),
+ {Costs, DSets} = costs_map_roots(DSets2, Costs1),
+ DUCounts = collect_ducounts(RLList, DUCounts0, #{}),
+ {CFG#cfg{bbs=maps:from_list(BBs)}, DUCounts, Costs, DSets}.
+
+-spec collect_ducounts([{label(), [label()]}], ducounts(), ducounts())
+ -> ducounts().
+collect_ducounts([], _, Acc) -> Acc;
+collect_ducounts([{R,Ls}|RLs], DUCounts, Acc) ->
+ DUCount = lists:foldl(
+ fun(Key, FAcc) ->
+ ducount_merge(maps:get(Key, DUCounts, ducount_new()), FAcc)
+ end, ducount_new(), Ls),
+ collect_ducounts(RLs, DUCounts, Acc#{R => DUCount}).
+
+-spec scan_bbs([{label(), bb()}], liveness(), plive(), weights(), defs(),
+ rdefs(), avail(), target(), ducounts(), costs(), part_dsets(),
+ [{label(), bb()}])
+ -> {[{label(), bb()}], ducounts(), costs(), part_dsets()}.
+scan_bbs([], _Liveness, _PLive, _Weights, _Defs, _RDefs, _Avail, _Target,
+ DUCounts, Costs, DSets, Acc) ->
+ {Acc, DUCounts, Costs, DSets};
+scan_bbs([{L,BB}|BBs], Liveness, PLive, Weights, Defs, RDefs, Avail, Target,
+ DUCounts0, Costs0, DSets0, Acc) ->
+ Wt = weight(L, Weights),
+ {DSets, Costs5, EntryCode, ExitCode, RDefout, Liveout} =
+ case bb_has_call(BB) of
+ false ->
+ DSets1 = lists:foldl(fun(S, DS) -> hipe_dsets:union(L, S, DS) end,
+ DSets0, bb_succ(BB)),
+ {DSets1, Costs0, bb_code(BB), [], rdefout(L, RDefs),
+ liveout(Liveness, L, Target)};
+ true ->
+ LastI = #instr{def=LastDef} = bb_last(BB),
+ LiveBefore = ordsets:subtract(liveout(Liveness, L, Target), LastDef),
+ %% We can omit the spill of a temp that has not been defined since the
+ %% last time it was spilled
+ SpillSet = defsetf_intersect_ordset(LiveBefore, defbutlast(L, Defs)),
+ Costs1 = costs_insert(exit, L, Wt, SpillSet, Costs0),
+ Costs4 = lists:foldl(fun({S, BranchWt}, Costs2) ->
+ SLivein = livein(Liveness, S, Target),
+ SPLivein = plivein(S, PLive),
+ SWt = weight_scaled(L, BranchWt, Weights),
+ Costs3 = costs_insert(entry1, S, SWt, SLivein, Costs2),
+ costs_insert(entry2, S, SWt, SPLivein, Costs3)
+ end, Costs1, branch_preds(LastI#instr.i, Target)),
+ {DSets0, Costs4, bb_butlast(BB), [LastI], rdefsetf_empty(), LiveBefore}
+ end,
+ Mode3Splits = mode3_split_in_block(L, Avail),
+ {RevEntryCode, Restored} = scan_bb_fwd(EntryCode, Mode3Splits, [], []),
+ {Code, DUCount, Mode2Spills} =
+ scan_bb(RevEntryCode, Wt, RDefout, Liveout, ducount_new(), [], ExitCode),
+ DUCounts = DUCounts0#{L => DUCount},
+ M2SpillSet = ordsets:from_list(Mode2Spills),
+ Costs6 = costs_insert(spill, L, Wt, M2SpillSet, Costs5),
+ Mode3Renames = mode3_block_renameset(L, Avail),
+ Costs7 = costs_insert(restore, L, Wt, ordsets:intersection(M2SpillSet, Mode3Renames), Costs6),
+ Costs8 = costs_insert(restore, L, Wt, ordsets:from_list(Restored), Costs7),
+ Costs = add_unsplit_mode3_costs(DUCount, Mode3Renames, L, Costs8),
+ scan_bbs(BBs, Liveness, PLive, Weights, Defs, RDefs, Avail, Target, DUCounts,
+ Costs, DSets, [{L,BB#bb{code=Code}}|Acc]).
+
+-spec add_unsplit_mode3_costs(ducount(), ordsets:ordset(temp()), label(), costs())
+ -> costs().
+add_unsplit_mode3_costs(DUCount, Mode3Renames, L, Costs) ->
+ Unsplit = orddict_without_ordset(Mode3Renames,
+ orddict:from_list(ducount_to_list(DUCount))),
+ add_unsplit_mode3_costs_1(Unsplit, L, Costs).
+
+-spec add_unsplit_mode3_costs_1([{temp(),float()}], label(), costs())
+ -> costs().
+add_unsplit_mode3_costs_1([], _L, Costs) -> Costs;
+add_unsplit_mode3_costs_1([{T,C}|Cs], L, Costs) ->
+ add_unsplit_mode3_costs_1(Cs, L, costs_insert(restore, L, C, [T], Costs)).
+
+%% @doc Returns a new orddict without keys in Set and their associated values.
+-spec orddict_without_ordset(ordsets:ordset(K), orddict:orddict(K, V))
+ -> orddict:orddict(K, V).
+orddict_without_ordset([S|Ss], [{K,_}|_]=Dict) when S < K ->
+ orddict_without_ordset(Ss, Dict);
+orddict_without_ordset([S|_]=Set, [D={K,_}|Ds]) when S > K ->
+ [D|orddict_without_ordset(Set, Ds)];
+orddict_without_ordset([_S|Ss], [{_K,_}|Ds]) -> % _S == _K
+ orddict_without_ordset(Ss, Ds);
+orddict_without_ordset(_, []) -> [];
+orddict_without_ordset([], Dict) -> Dict.
+
+%% Scans the code forward, collecting and inserting mode3 restores
+-spec scan_bb_fwd([instr()], ordsets:ordset(temp()), ordsets:ordset(temp()),
+ [code_elem()])
+ -> {[code_elem()], ordsets:ordset(temp())}.
+scan_bb_fwd([], [], Restored, Acc) -> {Acc, Restored};
+scan_bb_fwd([I|Is], SplitHere0, Restored0, Acc0) ->
+ #instr{def=Def, use=Use} = I,
+ {ToRestore, SplitHere1} =
+ lists:partition(fun(R) -> lists:member(R, Use) end, SplitHere0),
+ SplitHere = lists:filter(fun(R) -> not lists:member(R, Def) end, SplitHere1),
+ Acc =
+ case ToRestore of
+ [] -> [I | Acc0];
+ _ -> [I, #mode3_restores{temps=ToRestore} | Acc0]
+ end,
+ scan_bb_fwd(Is, SplitHere, ToRestore ++ Restored0, Acc).
+
+%% Scans the code backwards, collecting def/use counts and mode2 spills
+-spec scan_bb([code_elem()], float(), rdefsetf(), liveset(), ducount(),
+ [temp()], [code_elem()])
+ -> {[code_elem()], ducount(), [temp()]}.
+scan_bb([], _Wt, _RDefout, _Liveout, DUCount, Spills, Acc) ->
+ {Acc, DUCount, Spills};
+scan_bb([I=#mode3_restores{}|Is], Wt, RDefout, Liveout, DUCount, Spills, Acc) ->
+ scan_bb(Is, Wt, RDefout, Liveout, DUCount, Spills, [I|Acc]);
+scan_bb([I|Is], Wt, RDefout, Liveout, DUCount0, Spills0, Acc0) ->
+ #instr{def=Def,use=Use} = I,
+ DUCount = ducount_add(Use, Wt, ducount_add(Def, Wt, DUCount0)),
+ Livein = liveness_step(I, Liveout),
+ RDefin = rdef_step(I, RDefout),
+ %% The temps that would be spilled after I in mode 2
+ NewSpills = ordset_subtract_rdefsetf(
+ ordsets:intersection(Def, Liveout),
+ RDefout),
+ ?ASSERT(NewSpills =:= (NewSpills -- Spills0)),
+ Spills = NewSpills ++ Spills0,
+ Acc1 = case NewSpills of
+ [] -> Acc0;
+ _ -> [#mode2_spills{temps=NewSpills}|Acc0]
+ end,
+ scan_bb(Is, Wt, RDefin, Livein, DUCount, Spills, [I|Acc1]).
+
+-spec liveness_step(instr(), liveset()) -> liveset().
+liveness_step(#instr{def=Def, use=Use}, Liveout) ->
+ ordsets:union(Use, ordsets:subtract(Liveout, Def)).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% First pass: compute basic-block weighting
+
+-type weights() :: no_bb_weights
+ | {hipe_bb_weights:bb_weights(), float()}.
+
+-spec weight(label(), weights()) -> float().
+weight(L, Weights) -> weight_scaled(L, 1.0, Weights).
+
+-spec compute_weights(target_cfg(), target_module(), target_context(),
+ comp_options()) -> weights().
+compute_weights(CFG, TargetMod, TargetContext, Options) ->
+ case proplists:get_bool(range_split_weights, Options) of
+ false -> no_bb_weights;
+ true ->
+ {hipe_bb_weights:compute(CFG, TargetMod, TargetContext),
+ ?WEIGHT_CONST_FUN(proplists:get_value(range_split_weight_power,
+ Options, ?DEFAULT_WEIGHT_POWER))}
+ end.
+
+-spec weight_scaled(label(), float(), weights()) -> float().
+weight_scaled(_L, _Scale, no_bb_weights) -> 1.0;
+weight_scaled(L, Scale, {Weights, Const}) ->
+ Wt0 = hipe_bb_weights:weight(L, Weights) * Scale,
+ Wt = erlang:min(erlang:max(Wt0, 0.0000000000000000001), 10000.0),
+ ?WEIGHT_FUN(Wt, Const).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Heuristic splitting decision.
+%%
+%% Decide which temps to split, in which parts, and pick new names for them.
+-type spill_mode() :: mode1 % Spill temps at partition exits
+ | mode2 % Spill temps at definitions
+ | mode3.% Spill temps at definitions, restore temps at uses
+-type ren() :: #{temp() => {spill_mode(), temp()}}.
+-type renames() :: #{label() => ren()}.
+
+-record(heur_par, {
+ mode1_fudge :: float(),
+ min_gain :: float()
+ }).
+-type heur_par() :: #heur_par{}.
+
+-spec decide(ducounts(), costs(), target(), comp_options()) -> renames().
+decide(DUCounts, Costs, Target, Options) ->
+ Par = #heur_par{
+ mode1_fudge = proplists:get_value(range_split_mode1_fudge, Options,
+ ?DEFAULT_MODE1_FUDGE),
+ min_gain = proplists:get_value(range_split_min_gain, Options,
+ ?DEFAULT_MIN_GAIN)},
+ decide_parts(maps:to_list(DUCounts), Costs, Target, Par, #{}).
+
+-spec decide_parts([{part_key(), ducount()}], costs(), target(),
+ heur_par(), renames())
+ -> renames().
+decide_parts([], _Costs, _Target, _Par, Acc) -> Acc;
+decide_parts([{Part,DUCount}|Ps], Costs, Target, Par, Acc) ->
+ Spills = decide_temps(ducount_to_list(DUCount), Part, Costs, Target, Par,
+ #{}),
+ decide_parts(Ps, Costs, Target, Par, Acc#{Part => Spills}).
+
+-spec decide_temps([{temp(), float()}], part_key(), costs(), target(),
+ heur_par(), ren())
+ -> ren().
+decide_temps([], _Part, _Costs, _Target, _Par, Acc) -> Acc;
+decide_temps([{Temp, SpillGain}|Ts], Part, Costs, Target, Par, Acc0) ->
+ SpillCost1 = costs_query(Temp, entry1, Part, Costs)
+ + costs_query(Temp, exit, Part, Costs),
+ SpillCost2 = costs_query(Temp, entry2, Part, Costs)
+ + costs_query(Temp, spill, Part, Costs),
+ SpillCost3 = costs_query(Temp, restore, Part, Costs),
+ Acc =
+ %% SpillCost1 =:= 0.0 usually means the temp is local to the partition;
+ %% hence no need to split it
+ case (SpillCost1 =/= 0.0) %% maps:is_key(Temp, S)
+ andalso (not is_precoloured(Temp, Target))
+ andalso ((Par#heur_par.min_gain*SpillCost1 < SpillGain)
+ orelse (Par#heur_par.min_gain*SpillCost2 < SpillGain)
+ orelse (Par#heur_par.min_gain*SpillCost3 < SpillGain))
+ of
+ false -> Acc0;
+ true ->
+ Mode =
+ if Par#heur_par.mode1_fudge*SpillCost1 < SpillCost2,
+ Par#heur_par.mode1_fudge*SpillCost1 < SpillCost3 ->
+ mode1;
+ SpillCost2 < SpillCost3 ->
+ mode2;
+ true ->
+ mode3
+ end,
+ Acc0#{Temp => {Mode, new_reg_nr(Target)}}
+ end,
+ decide_temps(Ts, Part, Costs, Target, Par, Acc).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Eighth pass: Rewrite program performing range splitting.
+
+-spec rewrite(cfg(), target_cfg(), target(), liveness(), plive(), defs(),
+ avail(), part_dsets_map(), renames(), temps())
+ -> target_cfg().
+rewrite(#cfg{bbs=BBs}, TCFG, Target, Liveness, PLive, Defs, Avail, DSets,
+ Renames, Temps) ->
+ rewrite_bbs(maps:to_list(BBs), Target, Liveness, PLive, Defs, Avail, DSets,
+ Renames, Temps, TCFG).
+
+-spec rewrite_bbs([{label(), bb()}], target(), liveness(), plive(), defs(),
+ avail(), part_dsets_map(), renames(), temps(), target_cfg())
+ -> target_cfg().
+rewrite_bbs([], _Target, _Liveness, _PLive, _Defs, _Avail, _DSets, _Renames,
+ _Temps, TCFG) ->
+ TCFG;
+rewrite_bbs([{L,BB}|BBs], Target, Liveness, PLive, Defs, Avail, DSets, Renames,
+ Temps, TCFG0) ->
+ Code0Rev = lists:reverse(bb_code(BB)),
+ EntryRen = maps:get(maps:get(L,DSets), Renames),
+ M3Ren = mode3_block_renameset(L, Avail),
+ SubstFun = rewrite_subst_fun(Target, EntryRen, M3Ren),
+ Fun = fun(I) -> subst_temps(SubstFun, I, Target) end,
+ {Code, TCFG} =
+ case bb_has_call(BB) of
+ false ->
+ Code1 = rewrite_instrs(Code0Rev, Fun, EntryRen, M3Ren, Temps, Target,
+ []),
+ {Code1, TCFG0};
+ true ->
+ CallI0 = hd(Code0Rev),
+ Succ = bb_succ(BB),
+ {CallTI, TCFG1} = inject_restores(Succ, Target, Liveness, PLive, DSets,
+ Renames, Temps, CallI0#instr.i, TCFG0),
+ Liveout1 = liveness_step(CallI0, liveout(Liveness, L, Target)),
+ Defout = defbutlast(L, Defs),
+ SpillMap = mk_spillmap(EntryRen, Liveout1, Defout, Temps, Target),
+ Code1 = rewrite_instrs(tl(Code0Rev), Fun, EntryRen, M3Ren, Temps,
+ Target, []),
+ Code2 = lift_spills(lists:reverse(Code1), Target, SpillMap, [CallTI]),
+ {Code2, TCFG1}
+ end,
+ TBB = hipe_bb:code_update(bb(TCFG, L, Target), Code),
+ rewrite_bbs(BBs, Target, Liveness, PLive, Defs, Avail, DSets, Renames, Temps,
+ update_bb(TCFG, L, TBB, Target)).
+
+-spec rewrite_instrs([code_elem()], rewrite_fun(), ren(),
+ ordsets:ordset(temp()), temps(), target(),
+ [target_instr()])
+ -> [target_instr()].
+rewrite_instrs([], _Fun, _Ren, _M3Ren, _Temps, _Target, Acc) -> Acc;
+rewrite_instrs([I|Is], Fun, Ren, M3Ren, Temps, Target, Acc0) ->
+ Acc =
+ case I of
+ #instr{i=TI} -> [Fun(TI)|Acc0];
+ #mode2_spills{temps=Mode2Spills} ->
+ add_mode2_spills(Mode2Spills, Target, Ren, M3Ren, Temps, Acc0);
+ #mode3_restores{temps=Mode3Restores} ->
+ add_mode3_restores(Mode3Restores, Target, Ren, Temps, Acc0)
+ end,
+ rewrite_instrs(Is, Fun, Ren, M3Ren, Temps, Target, Acc).
+
+-spec add_mode2_spills(ordsets:ordset(temp()), target(), ren(),
+ ordsets:ordset(temp()), temps(), [target_instr()])
+ -> [target_instr()].
+add_mode2_spills([], _Target, _Ren, _M3Ren, _Temps, Acc) -> Acc;
+add_mode2_spills([R|Rs], Target, Ren, M3Ren, Temps, Acc0) ->
+ Acc =
+ case Ren of
+ #{R := {Mode, NewName}} when Mode =:= mode2; Mode =:= mode3 ->
+ case Mode =/= mode3 orelse lists:member(R, M3Ren) of
+ false -> Acc0;
+ true ->
+ #{R := T} = Temps,
+ SpillInstr = mk_move(update_reg_nr(NewName, T, Target), T, Target),
+ [SpillInstr|Acc0]
+ end;
+ #{} ->
+ Acc0
+ end,
+ add_mode2_spills(Rs, Target, Ren, M3Ren, Temps, Acc).
+
+-spec add_mode3_restores(ordsets:ordset(temp()), target(), ren(), temps(),
+ [target_instr()])
+ -> [target_instr()].
+add_mode3_restores([], _Target, _Ren, _Temps, Acc) -> Acc;
+add_mode3_restores([R|Rs], Target, Ren, Temps, Acc) ->
+ case Ren of
+ #{R := {mode3, NewName}} ->
+ #{R := T} = Temps,
+ RestoreInstr = mk_move(T, update_reg_nr(NewName, T, Target), Target),
+ add_mode3_restores(Rs, Target, Ren, Temps, [RestoreInstr|Acc]);
+ #{} ->
+ add_mode3_restores(Rs, Target, Ren, Temps, Acc)
+ end.
+
+-type rewrite_fun() :: fun((target_instr()) -> target_instr()).
+-type subst_fun() :: fun((target_temp()) -> target_temp()).
+-spec rewrite_subst_fun(target(), ren(), ordsets:ordset(temp())) -> subst_fun().
+rewrite_subst_fun(Target, Ren, M3Ren) ->
+ fun(Temp) ->
+ Reg = reg_nr(Temp, Target),
+ case Ren of
+ #{Reg := {Mode, NewName}} ->
+ case Mode =/= mode3 orelse lists:member(Reg, M3Ren) of
+ false -> Temp;
+ true -> update_reg_nr(NewName, Temp, Target)
+ end;
+ #{} -> Temp
+ end
+ end.
+
+-type spillmap() :: [{temp(), target_instr()}].
+-spec mk_spillmap(ren(), liveset(), defsetf(), temps(), target())
+ -> spillmap().
+mk_spillmap(Ren, Livein, Defout, Temps, Target) ->
+ [begin
+ Temp = maps:get(Reg, Temps),
+ {NewName, mk_move(update_reg_nr(NewName, Temp, Target), Temp, Target)}
+ end || {Reg, {mode1, NewName}} <- maps:to_list(Ren),
+ lists:member(Reg, Livein), defsetf_member(Reg, Defout)].
+
+-spec mk_restores(ren(), liveset(), liveset(), temps(), target())
+ -> [target_instr()].
+mk_restores(Ren, Livein, PLivein, Temps, Target) ->
+ [begin
+ Temp = maps:get(Reg, Temps),
+ mk_move(Temp, update_reg_nr(NewName, Temp, Target), Target)
+ end || {Reg, {Mode, NewName}} <- maps:to_list(Ren),
+ ( (Mode =:= mode1 andalso lists:member(Reg, Livein ))
+ orelse (Mode =:= mode2 andalso lists:member(Reg, PLivein)))].
+
+-spec inject_restores([label()], target(), liveness(), plive(),
+ part_dsets_map(), renames(), temps(), target_instr(),
+ target_cfg())
+ -> {target_instr(), target_cfg()}.
+inject_restores([], _Target, _Liveness, _PLive, _DSets, _Renames, _Temps, CFTI,
+ TCFG) ->
+ {CFTI, TCFG};
+inject_restores([L|Ls], Target, Liveness, PLive, DSets, Renames, Temps, CFTI0,
+ TCFG0) ->
+ Ren = maps:get(maps:get(L,DSets), Renames),
+ Livein = livein(Liveness, L, Target),
+ PLivein = plivein(L, PLive),
+ {CFTI, TCFG} =
+ case mk_restores(Ren, Livein, PLivein, Temps, Target) of
+ [] -> {CFTI0, TCFG0}; % optimisation
+ Restores ->
+ RestBBLbl = new_label(Target),
+ Code = Restores ++ [mk_goto(L, Target)],
+ CFTI1 = redirect_jmp(CFTI0, L, RestBBLbl, Target),
+ TCFG1 = update_bb(TCFG0, RestBBLbl, hipe_bb:mk_bb(Code), Target),
+ {CFTI1, TCFG1}
+ end,
+ inject_restores(Ls, Target, Liveness, PLive, DSets, Renames, Temps, CFTI,
+ TCFG).
+
+%% Heuristic. Move spills up until we meet the edge of the BB or a definition of
+%% that temp.
+-spec lift_spills([target_instr()], target(), spillmap(), [target_instr()])
+ -> [target_instr()].
+lift_spills([], _Target, SpillMap, Acc) ->
+ [SpillI || {_, SpillI} <- SpillMap] ++ Acc;
+lift_spills([I|Is], Target, SpillMap0, Acc) ->
+ Def = reg_defines(I, Target),
+ {Spills0, SpillMap} =
+ lists:partition(fun({Reg,_}) -> lists:member(Reg, Def) end, SpillMap0),
+ Spills = [SpillI || {_, SpillI} <- Spills0],
+ lift_spills(Is, Target, SpillMap, [I|Spills ++ Acc]).
+
+reg_defines(I, Target) ->
+ reg_names(defines(I,Target), Target).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Costs ADT
+%%
+%% Keeps track of cumulative cost of spilling temps in particular partitions
+%% using particular spill modes.
+-type cost_map() :: #{[part_key()|temp()] => float()}.
+-type cost_key() :: entry1 | entry2 | exit | spill | restore.
+-record(costs, {entry1 = #{} :: cost_map()
+ ,entry2 = #{} :: cost_map()
+ ,exit = #{} :: cost_map()
+ ,spill = #{} :: cost_map()
+ ,restore = #{} :: cost_map()
+ }).
+-type costs() :: #costs{}.
+
+-spec costs_new() -> costs().
+costs_new() -> #costs{}.
+
+-spec costs_insert(cost_key(), part_key(), float(), liveset(), costs())
+ -> costs().
+costs_insert(entry1, A, Weight, Liveset, Costs=#costs{entry1=Entry1}) ->
+ Costs#costs{entry1=costs_insert_1(A, Weight, Liveset, Entry1)};
+costs_insert(entry2, A, Weight, Liveset, Costs=#costs{entry2=Entry2}) ->
+ Costs#costs{entry2=costs_insert_1(A, Weight, Liveset, Entry2)};
+costs_insert(exit, A, Weight, Liveset, Costs=#costs{exit=Exit}) ->
+ Costs#costs{exit=costs_insert_1(A, Weight, Liveset, Exit)};
+costs_insert(spill, A, Weight, Liveset, Costs=#costs{spill=Spill}) ->
+ Costs#costs{spill=costs_insert_1(A, Weight, Liveset, Spill)};
+costs_insert(restore, A, Weight, Liveset, Costs=#costs{restore=Restore}) ->
+ Costs#costs{restore=costs_insert_1(A, Weight, Liveset, Restore)}.
+
+costs_insert_1(A, Weight, Liveset, CostMap0) when is_float(Weight) ->
+ lists:foldl(fun(Live, CostMap1) ->
+ map_update_counter([A|Live], Weight, CostMap1)
+ end, CostMap0, Liveset).
+
+-spec costs_map_roots(part_dsets(), costs()) -> {costs(), part_dsets()}.
+costs_map_roots(DSets0, Costs) ->
+ {Entry1, DSets1} = costs_map_roots_1(DSets0, Costs#costs.entry1),
+ {Entry2, DSets2} = costs_map_roots_1(DSets1, Costs#costs.entry2),
+ {Exit, DSets3} = costs_map_roots_1(DSets2, Costs#costs.exit),
+ {Spill, DSets4} = costs_map_roots_1(DSets3, Costs#costs.spill),
+ {Restore, DSets} = costs_map_roots_1(DSets4, Costs#costs.restore),
+ {#costs{entry1=Entry1,entry2=Entry2,exit=Exit,spill=Spill,restore=Restore},
+ DSets}.
+
+costs_map_roots_1(DSets0, CostMap) ->
+ {NewEs, DSets} = lists:mapfoldl(fun({[A|T], Wt}, DSets1) ->
+ {AR, DSets2} = hipe_dsets:find(A, DSets1),
+ {{[AR|T], Wt}, DSets2}
+ end, DSets0, maps:to_list(CostMap)),
+ {maps_from_list_merge(NewEs, fun erlang:'+'/2, #{}), DSets}.
+
+maps_from_list_merge([], _MF, Acc) -> Acc;
+maps_from_list_merge([{K,V}|Ps], MF, Acc) ->
+ maps_from_list_merge(Ps, MF, case Acc of
+ #{K := OV} -> Acc#{K := MF(V, OV)};
+ #{} -> Acc#{K => V}
+ end).
+
+-spec costs_query(temp(), cost_key(), part_key(), costs()) -> float().
+costs_query(Temp, entry1, Part, #costs{entry1=Entry1}) ->
+ costs_query_1(Temp, Part, Entry1);
+costs_query(Temp, entry2, Part, #costs{entry2=Entry2}) ->
+ costs_query_1(Temp, Part, Entry2);
+costs_query(Temp, exit, Part, #costs{exit=Exit}) ->
+ costs_query_1(Temp, Part, Exit);
+costs_query(Temp, spill, Part, #costs{spill=Spill}) ->
+ costs_query_1(Temp, Part, Spill);
+costs_query(Temp, restore, Part, #costs{restore=Restore}) ->
+ costs_query_1(Temp, Part, Restore).
+
+costs_query_1(Temp, Part, CostMap) ->
+ Key = [Part|Temp],
+ case CostMap of
+ #{Key := Wt} -> Wt;
+ #{} -> 0.0
+ end.
+
+-spec map_update_counter(Key, number(), #{Key => number(), OK => OV})
+ -> #{Key := number(), OK => OV}.
+map_update_counter(Key, Incr, Map) ->
+ case Map of
+ #{Key := Orig} -> Map#{Key := Orig + Incr};
+ #{} -> Map#{Key => Incr}
+ end.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Def and use counting ADT
+-type ducount() :: #{temp() => float()}.
+
+-spec ducount_new() -> ducount().
+ducount_new() -> #{}.
+
+-spec ducount_add([temp()], float(), ducount()) -> ducount().
+ducount_add([], _Weight, DUCount) -> DUCount;
+ducount_add([T|Ts], Weight, DUCount0) ->
+ DUCount =
+ case DUCount0 of
+ #{T := Count} -> DUCount0#{T := Count + Weight};
+ #{} -> DUCount0#{T => Weight}
+ end,
+ ducount_add(Ts, Weight, DUCount).
+
+ducount_to_list(DUCount) -> maps:to_list(DUCount).
+
+-spec ducount_merge(ducount(), ducount()) -> ducount().
+ducount_merge(DCA, DCB) when map_size(DCA) < map_size(DCB) ->
+ ducount_merge_1(ducount_to_list(DCA), DCB);
+ducount_merge(DCA, DCB) when map_size(DCA) >= map_size(DCB) ->
+ ducount_merge_1(ducount_to_list(DCB), DCA).
+
+ducount_merge_1([], DUCount) -> DUCount;
+ducount_merge_1([{T,AC}|Ts], DUCount0) ->
+ DUCount =
+ case DUCount0 of
+ #{T := BC} -> DUCount0#{T := AC + BC};
+ #{} -> DUCount0#{T => AC}
+ end,
+ ducount_merge_1(Ts, DUCount).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Target module interface functions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(TGT_IFACE_0(N), N( {M,C}) -> M:N( C)).
+-define(TGT_IFACE_1(N), N(A1, {M,C}) -> M:N(A1, C)).
+-define(TGT_IFACE_2(N), N(A1,A2, {M,C}) -> M:N(A1,A2, C)).
+-define(TGT_IFACE_3(N), N(A1,A2,A3,{M,C}) -> M:N(A1,A2,A3,C)).
+
+?TGT_IFACE_2(bb).
+?TGT_IFACE_1(def_use).
+?TGT_IFACE_1(defines).
+?TGT_IFACE_1(defines_all_alloc).
+?TGT_IFACE_1(is_precoloured).
+?TGT_IFACE_1(mk_goto).
+?TGT_IFACE_2(mk_move).
+?TGT_IFACE_0(new_label).
+?TGT_IFACE_0(new_reg_nr).
+?TGT_IFACE_1(number_of_temporaries).
+?TGT_IFACE_3(redirect_jmp).
+?TGT_IFACE_1(reg_nr).
+?TGT_IFACE_1(reverse_postorder).
+?TGT_IFACE_2(subst_temps).
+?TGT_IFACE_3(update_bb).
+?TGT_IFACE_2(update_reg_nr).
+
+branch_preds(Instr, {TgtMod,TgtCtx}) ->
+ merge_sorted_preds(lists:keysort(1, TgtMod:branch_preds(Instr, TgtCtx))).
+
+livein(Liveness, L, Target={TgtMod,TgtCtx}) ->
+ ordsets:from_list(reg_names(TgtMod:livein(Liveness, L, TgtCtx), Target)).
+
+liveout(Liveness, L, Target={TgtMod,TgtCtx}) ->
+ ordsets:from_list(reg_names(TgtMod:liveout(Liveness, L, TgtCtx), Target)).
+
+merge_sorted_preds([]) -> [];
+merge_sorted_preds([{L, P1}, {L, P2}|LPs]) ->
+ merge_sorted_preds([{L, P1+P2}|LPs]);
+merge_sorted_preds([LP|LPs]) -> [LP|merge_sorted_preds(LPs)].
+
+reg_names(Regs, {TgtMod,TgtCtx}) ->
+ [TgtMod:reg_nr(X,TgtCtx) || X <- Regs].
diff --git a/lib/hipe/regalloc/hipe_regalloc_loop.erl b/lib/hipe/regalloc/hipe_regalloc_loop.erl
index 5bbb0ba7c1..29ef3adcc2 100644
--- a/lib/hipe/regalloc/hipe_regalloc_loop.erl
+++ b/lib/hipe/regalloc/hipe_regalloc_loop.erl
@@ -32,9 +32,11 @@ ra_fp(CFG, Liveness, Options, RegAllocMod, TargetMod, TargetCtx) ->
ra_common(CFG0, Liveness0, SpillIndex, Options, RegAllocMod, TargetMod,
TargetCtx) ->
?inc_counter(ra_calls_counter, 1),
- SpillLimit0 = TargetMod:number_of_temporaries(CFG0, TargetCtx),
+ {CFG1, Liveness1} =
+ do_range_split(CFG0, Liveness0, TargetMod, TargetCtx, Options),
+ SpillLimit0 = TargetMod:number_of_temporaries(CFG1, TargetCtx),
{Coloring, _, CFG, Liveness} =
- call_allocator_initial(CFG0, Liveness0, SpillLimit0, SpillIndex, Options,
+ call_allocator_initial(CFG1, Liveness1, SpillLimit0, SpillIndex, Options,
RegAllocMod, TargetMod, TargetCtx),
%% The first iteration, the hipe_regalloc_prepass may create new temps, these
%% should not end up above SpillLimit.
@@ -96,3 +98,20 @@ call_allocator(CFG, Liveness, SpillLimit, SpillIndex, Options, RegAllocMod,
RegAllocMod:regalloc(CFG, Liveness, SpillIndex, SpillLimit, TargetMod,
TargetCtx, Options)
end.
+
+do_range_split(CFG0, Liveness0, TgtMod, TgtCtx, Options) ->
+ {CFG2, Liveness1} =
+ case proplists:get_bool(ra_restore_reuse, Options) of
+ true ->
+ CFG1 = hipe_restore_reuse:split(CFG0, Liveness0, TgtMod, TgtCtx),
+ {CFG1, TgtMod:analyze(CFG1, TgtCtx)};
+ false ->
+ {CFG0, Liveness0}
+ end,
+ case proplists:get_bool(ra_range_split, Options) of
+ true ->
+ CFG3 = hipe_range_split:split(CFG2, Liveness1, TgtMod, TgtCtx, Options),
+ {CFG3, TgtMod:analyze(CFG3, TgtCtx)};
+ false ->
+ {CFG2, Liveness1}
+ end.
diff --git a/lib/hipe/regalloc/hipe_regalloc_prepass.erl b/lib/hipe/regalloc/hipe_regalloc_prepass.erl
index e212420ad2..5024840237 100644
--- a/lib/hipe/regalloc/hipe_regalloc_prepass.erl
+++ b/lib/hipe/regalloc/hipe_regalloc_prepass.erl
@@ -483,8 +483,8 @@ merge_pointless_splits_1([], _ScanBBs, DSets, Acc) -> {Acc, DSets};
merge_pointless_splits_1([P={_,{single,_}}|Ps], ScanBBs, DSets, Acc) ->
merge_pointless_splits_1(Ps, ScanBBs, DSets, [P|Acc]);
merge_pointless_splits_1([P0={L,{split,_,_}}|Ps], ScanBBs, DSets0, Acc) ->
- {EntryRoot, DSets1} = dsets_find({entry,L}, DSets0),
- {ExitRoot, DSets} = dsets_find({exit,L}, DSets1),
+ {EntryRoot, DSets1} = hipe_dsets:find({entry,L}, DSets0),
+ {ExitRoot, DSets} = hipe_dsets:find({exit,L}, DSets1),
case EntryRoot =:= ExitRoot of
false -> merge_pointless_splits_1(Ps, ScanBBs, DSets, [P0|Acc]);
true ->
@@ -501,7 +501,7 @@ merge_pointless_splits_1([P0={L,{split,_,_}}|Ps], ScanBBs, DSets0, Acc) ->
-spec merge_small_parts(bb_dsets()) -> {bb_dsets_rllist(), bb_dsets()}.
merge_small_parts(DSets0) ->
- {RLList, DSets1} = dsets_to_rllist(DSets0),
+ {RLList, DSets1} = hipe_dsets:to_rllist(DSets0),
RLLList = [{R, length(Elems), Elems} || {R, Elems} <- RLList],
merge_small_parts_1(RLLList, DSets1, []).
@@ -518,8 +518,8 @@ merge_small_parts_1([Fst,{R, L, Es}|Ps], DSets, Acc)
merge_small_parts_1([Fst|Ps], DSets, [{R,Es}|Acc]);
merge_small_parts_1([{R1,L1,Es1},{R2,L2,Es2}|Ps], DSets0, Acc) ->
?ASSERT(L1 < ?TUNE_TOO_FEW_BBS andalso L2 < ?TUNE_TOO_FEW_BBS),
- DSets1 = dsets_union(R1, R2, DSets0),
- {R, DSets} = dsets_find(R1, DSets1),
+ DSets1 = hipe_dsets:union(R1, R2, DSets0),
+ {R, DSets} = hipe_dsets:find(R1, DSets1),
merge_small_parts_1([{R,L2+L1,Es2++Es1}|Ps], DSets, Acc).
%% @doc Partition an ordering over BBs into subsequences for the dsets that
@@ -531,8 +531,8 @@ part_order(Lbs, DSets) -> part_order(Lbs, DSets, #{}).
part_order([], DSets, Acc) -> {Acc, DSets};
part_order([L|Ls], DSets0, Acc0) ->
- {EntryRoot, DSets1} = dsets_find({entry,L}, DSets0),
- {ExitRoot, DSets2} = dsets_find({exit,L}, DSets1),
+ {EntryRoot, DSets1} = hipe_dsets:find({entry,L}, DSets0),
+ {ExitRoot, DSets2} = hipe_dsets:find({exit,L}, DSets1),
Acc1 = map_append(EntryRoot, L, Acc0),
%% Only include the label once if both entry and exit is in same partition
Acc2 = case EntryRoot =:= ExitRoot of
@@ -558,73 +558,26 @@ map_append(Key, Elem, Map) ->
%% split point, and one from the end to the last split point.
-type bb_dset_key() :: {entry | exit, label()}.
--type bb_dsets() :: dsets(bb_dset_key()).
+-type bb_dsets() :: hipe_dsets:dsets(bb_dset_key()).
-type bb_dsets_rllist() :: [{bb_dset_key(), [bb_dset_key()]}].
-spec initial_dsets(target_cfg(), module(), target_context()) -> bb_dsets().
initial_dsets(CFG, TgtMod, TgtCtx) ->
Labels = TgtMod:labels(CFG, TgtCtx),
- DSets0 = dsets_new(lists:append([[{entry,L},{exit,L}] || L <- Labels])),
+ DSets0 = hipe_dsets:new(lists:append([[{entry,L},{exit,L}] || L <- Labels])),
Edges = lists:append([[{L, S} || S <- hipe_gen_cfg:succ(CFG, L)]
|| L <- Labels]),
- lists:foldl(fun({X, Y}, DS) -> dsets_union({exit,X}, {entry,Y}, DS) end,
+ lists:foldl(fun({X, Y}, DS) -> hipe_dsets:union({exit,X}, {entry,Y}, DS) end,
DSets0, Edges).
-spec join_whole_blocks(part_bb_list(), bb_dsets()) -> bb_dsets().
join_whole_blocks(PartBBList, DSets0) ->
- lists:foldl(fun({L, {single, _}}, DS) -> dsets_union({entry,L}, {exit,L}, DS);
+ lists:foldl(fun({L, {single, _}}, DS) ->
+ hipe_dsets:union({entry,L}, {exit,L}, DS);
({_, {split, _, _}}, DS) -> DS
end, DSets0, PartBBList).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% The disjoint set forests data structure, for elements of arbitrary types.
-%% Note that the find operation mutates the set.
-%%
-%% We could do this more efficiently if we restricted the elements to integers,
-%% and used the (mutable) hipe arrays. For arbitrary terms ETS could be used,
-%% for a persistent interface (which isn't that nice when even accessors return
-%% modified copies), the array module could be used.
--type dsets(X) :: #{X => {node, X} | {root, non_neg_integer()}}.
-
--spec dsets_new([E]) -> dsets(E).
-dsets_new(Elems) -> maps:from_list([{E,{root,0}} || E <- Elems]).
-
--spec dsets_find(E, dsets(E)) -> {E, dsets(E)}.
-dsets_find(E, DS0) ->
- case DS0 of
- #{E := {root,_}} -> {E, DS0};
- #{E := {node,N}} ->
- case dsets_find(N, DS0) of
- {N, _}=T -> T;
- {R, DS1} -> {R, DS1#{E := {node,R}}}
- end
- ;_ -> error(badarg, [E, DS0])
- end.
-
--spec dsets_union(E, E, dsets(E)) -> dsets(E).
-dsets_union(X, Y, DS0) ->
- {XRoot, DS1} = dsets_find(X, DS0),
- case dsets_find(Y, DS1) of
- {XRoot, DS2} -> DS2;
- {YRoot, DS2} ->
- #{XRoot := {root,XRR}, YRoot := {root,YRR}} = DS2,
- if XRR < YRR -> DS2#{XRoot := {node,YRoot}};
- XRR > YRR -> DS2#{YRoot := {node,XRoot}};
- true -> DS2#{YRoot := {node,XRoot}, XRoot := {root,XRR+1}}
- end
- end.
-
--spec dsets_to_rllist(dsets(E)) -> {[{Root::E, Elems::[E]}], dsets(E)}.
-dsets_to_rllist(DS0) ->
- {Lists, DS} = dsets_to_rllist(maps:keys(DS0), #{}, DS0),
- {maps:to_list(Lists), DS}.
-
-dsets_to_rllist([], Acc, DS) -> {Acc, DS};
-dsets_to_rllist([E|Es], Acc, DS0) ->
- {ERoot, DS} = dsets_find(E, DS0),
- dsets_to_rllist(Es, map_append(ERoot, E, Acc), DS).
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Third pass
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Collect all referenced temps in each partition.
diff --git a/lib/hipe/regalloc/hipe_restore_reuse.erl b/lib/hipe/regalloc/hipe_restore_reuse.erl
new file mode 100644
index 0000000000..2158bd185e
--- /dev/null
+++ b/lib/hipe/regalloc/hipe_restore_reuse.erl
@@ -0,0 +1,516 @@
+%% -*- erlang-indent-level: 2 -*-
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%@doc
+%% RESTORE REUSE LIVE RANGE SPLITTING PASS
+%%
+%% This is a simple live range splitter that tries to avoid sequences where a
+%% temporary is accessed on stack multiple times by keeping a copy of that temp
+%% around in a register.
+%%
+%% At any point where a temporary that is expected to be spilled (see uses of
+%% spills_add_list/2) is defined or used, this pass considers that temporary
+%% "available".
+%%
+%% Limitations:
+%% * If a live range part starts with several different restores, this module
+%% will introduce a new temp number for each of them, and later be forced to
+%% generate phi blocks. It would be more efficient to introduce just a
+%% single temp number. That would also remove the need for the phi blocks.
+%% * If a live range part ends in a definition, that definition should just
+%% define the base temp rather than the substitution, since some CISC
+%% targets might be able to inline the memory access in the instruction.
+-module(hipe_restore_reuse).
+
+-export([split/4]).
+
+%% Exports for hipe_range_split, which uses restore_reuse as one possible spill
+%% "mode"
+-export([analyse/3
+ ,renamed_in_block/2
+ ,split_in_block/2
+ ]).
+-export_type([avail/0]).
+
+-compile(inline).
+
+%% -define(DO_ASSERT, 1).
+-include("../main/hipe.hrl").
+
+-type target_cfg() :: any().
+-type liveness() :: any().
+-type target_module() :: module().
+-type target_context() :: any().
+-type target() :: {target_module(), target_context()}.
+-type label() :: non_neg_integer().
+-type reg() :: non_neg_integer().
+-type instr() :: any().
+-type temp() :: any().
+
+-spec split(target_cfg(), liveness(), target_module(), target_context())
+ -> target_cfg().
+split(CFG, Liveness, TargetMod, TargetContext) ->
+ Target = {TargetMod, TargetContext},
+ Avail = analyse(CFG, Liveness, Target),
+ rewrite(CFG, Target, Avail).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-opaque avail() :: #{label() => avail_bb()}.
+
+-record(avail_bb, {
+ %% Blocks where HasCall is true are considered to have too high
+ %% register pressure to support a register copy of a temp
+ has_call :: boolean(),
+ %% AvailOut: Temps that can be split (are available)
+ out :: availset(),
+ %% Gen: AvailOut generated locally
+ gen :: availset(),
+ %% WantIn: Temps that are split
+ want :: regset(),
+ %% Self: Temps with avail-want pairs locally
+ self :: regset(),
+ %% DefIn: Temps shadowed by later def in same live range part
+ defin :: regset(),
+ pred :: [label()],
+ succ :: [label()]
+ }).
+-type avail_bb() :: #avail_bb{}.
+
+avail_get(L, Avail) -> maps:get(L, Avail).
+avail_set(L, Val, Avail) -> maps:put(L, Val, Avail).
+avail_has_call(L, Avail) -> (avail_get(L, Avail))#avail_bb.has_call.
+avail_out(L, Avail) -> (avail_get(L, Avail))#avail_bb.out.
+avail_self(L, Avail) -> (avail_get(L, Avail))#avail_bb.self.
+avail_pred(L, Avail) -> (avail_get(L, Avail))#avail_bb.pred.
+avail_succ(L, Avail) -> (avail_get(L, Avail))#avail_bb.succ.
+
+avail_in(L, Avail) ->
+ case avail_pred(L, Avail) of
+ [] -> availset_empty(); % entry
+ Pred ->
+ lists:foldl(fun(P, ASet) ->
+ availset_intersect(avail_out(P, Avail), ASet)
+ end, availset_top(), Pred)
+ end.
+
+want_in(L, Avail) -> (avail_get(L, Avail))#avail_bb.want.
+want_out(L, Avail) ->
+ lists:foldl(fun(S, Set) ->
+ ordsets:union(want_in(S, Avail), Set)
+ end, ordsets:new(), avail_succ(L, Avail)).
+
+def_in(L, Avail) -> (avail_get(L, Avail))#avail_bb.defin.
+def_out(L, Avail) ->
+ case avail_succ(L, Avail) of
+ [] -> ordsets:new(); % entry
+ Succ ->
+ ordsets:intersection([def_in(S, Avail) || S <- Succ])
+ end.
+
+-type regset() :: ordsets:ordset(reg()).
+-type availset() :: top | regset().
+availset_empty() -> [].
+availset_top() -> top.
+availset_intersect(top, B) -> B;
+availset_intersect(A, top) -> A;
+availset_intersect(A, B) -> ordsets:intersection(A, B).
+availset_union(top, _) -> top;
+availset_union(_, top) -> top;
+availset_union(A, B) -> ordsets:union(A, B).
+ordset_intersect_availset(OS, top) -> OS;
+ordset_intersect_availset(OS, AS) -> ordsets:intersection(OS, AS).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Analysis pass
+%%
+%% The analysis pass collects the set of temps we're interested in splitting
+%% (Spills), and computes three dataflow analyses for this subset of temps.
+%%
+%% Avail, which is the set of temps which are available in register from a
+%% previous (potential) spill or restore without going through a HasCall
+%% block.
+%% Want, which is a liveness analysis for the subset of temps used by an
+%% instruction that are also in Avail at that point. In other words, Want is
+%% the set of temps that are split (has a register copy) at a particular
+%% point.
+%% Def, which are the temps that are already going to be spilled later, and so
+%% need not be spilled when they're defined.
+%%
+%% Lastly, it computes the set Self for each block, which is the temps that have
+%% avail-want pairs in the same block, and so should be split in that block even
+%% if they're not in WantIn for the block.
+
+-spec analyse(target_cfg(), liveness(), target()) -> avail().
+analyse(CFG, Liveness, Target) ->
+ Avail0 = analyse_init(CFG, Liveness, Target),
+ RPO = reverse_postorder(CFG, Target),
+ AvailLs = [L || L <- RPO, not avail_has_call(L, Avail0)],
+ Avail1 = avail_dataf(AvailLs, Avail0),
+ Avail2 = analyse_filter_want(maps:keys(Avail1), Avail1),
+ PO = lists:reverse(RPO),
+ want_dataf(PO, Avail2).
+
+-spec analyse_init(target_cfg(), liveness(), target()) -> avail().
+analyse_init(CFG, Liveness, Target) ->
+ analyse_init(labels(CFG, Target), CFG, Liveness, Target, #{}, []).
+
+-spec analyse_init([label()], target_cfg(), liveness(), target(), spillset(),
+ [{label(), avail_bb()}])
+ -> avail().
+analyse_init([], _CFG, _Liveness, Target, Spills0, Acc) ->
+ %% Precoloured temps can't be spilled
+ Spills = spills_filter(fun(R) -> not is_precoloured(R, Target) end, Spills0),
+ analyse_init_1(Acc, Spills, []);
+analyse_init([L|Ls], CFG, Liveness, Target, Spills0, Acc) ->
+ {DefIn, Gen, Self, Want, HasCall0} =
+ analyse_scan(hipe_bb:code(bb(CFG, L, Target)), Target,
+ ordsets:new(), ordsets:new(), ordsets:new(),
+ ordsets:new()),
+ {Spills, Out, HasCall} =
+ case HasCall0 of
+ false -> {Spills0, availset_top(), false};
+ {true, CallDefs} ->
+ Spill = ordsets:subtract(liveout(Liveness, L, Target), CallDefs),
+ {spills_add_list(Spill, Spills0), Gen, true}
+ end,
+ Pred = hipe_gen_cfg:pred(CFG, L),
+ Succ = hipe_gen_cfg:succ(CFG, L),
+ Val = #avail_bb{gen=Gen, want=Want, self=Self, out=Out, has_call=HasCall,
+ pred=Pred, succ=Succ, defin=DefIn},
+ analyse_init(Ls, CFG, Liveness, Target, Spills, [{L, Val} | Acc]).
+
+-spec analyse_init_1([{label(), avail_bb()}], spillset(),
+ [{label(), avail_bb()}])
+ -> avail().
+analyse_init_1([], _Spills, Acc) -> maps:from_list(Acc);
+analyse_init_1([{L, Val0}|Vs], Spills, Acc) ->
+ #avail_bb{out=Out,gen=Gen,want=Want,self=Self} = Val0,
+ Val = Val0#avail_bb{
+ out = spills_filter_availset(Out, Spills),
+ gen = spills_filter_availset(Gen, Spills),
+ want = spills_filter_availset(Want, Spills),
+ self = spills_filter_availset(Self, Spills)},
+ analyse_init_1(Vs, Spills, [{L, Val} | Acc]).
+
+-type spillset() :: #{reg() => []}.
+-spec spills_add_list([reg()], spillset()) -> spillset().
+spills_add_list([], Spills) -> Spills;
+spills_add_list([R|Rs], Spills) -> spills_add_list(Rs, Spills#{R => []}).
+
+-spec spills_filter_availset(availset(), spillset()) -> availset().
+spills_filter_availset([E|Es], Spills) ->
+ case Spills of
+ #{E := _} -> [E|spills_filter_availset(Es, Spills)];
+ #{} -> spills_filter_availset(Es, Spills)
+ end;
+spills_filter_availset([], _) -> [];
+spills_filter_availset(top, _) -> top.
+
+spills_filter(Fun, Spills) -> maps:filter(fun(K, _) -> Fun(K) end, Spills).
+
+-spec analyse_scan([instr()], target(), Defset, Gen, Self, Want)
+ -> {Defset, Gen, Self, Want, HasCall} when
+ HasCall :: false | {true, regset()},
+ Defset :: regset(),
+ Gen :: availset(),
+ Self :: regset(),
+ Want :: regset().
+analyse_scan([], _Target, Defs, Gen, Self, Want) ->
+ {Defs, Gen, Self, Want, false};
+analyse_scan([I|Is], Target, Defs0, Gen0, Self0, Want0) ->
+ {DefL, UseL} = reg_def_use(I, Target),
+ Use = ordsets:from_list(UseL),
+ Def = ordsets:from_list(DefL),
+ Self = ordsets:union(ordsets:intersection(Use, Gen0), Self0),
+ Want = ordsets:union(ordsets:subtract(Use, Defs0), Want0),
+ Defs = ordsets:union(Def, Defs0),
+ case defines_all_alloc(I, Target) of
+ true ->
+ [] = Is, %assertion
+ {Defs, ordsets:new(), Self, Want, {true, Def}};
+ false ->
+ Gen = ordsets:union(ordsets:union(Def, Use), Gen0),
+ analyse_scan(Is, Target, Defs, Gen, Self, Want)
+ end.
+
+-spec avail_dataf([label()], avail()) -> avail().
+avail_dataf(RPO, Avail0) ->
+ case avail_dataf_once(RPO, Avail0, 0) of
+ {Avail, 0} -> Avail;
+ {Avail, _Changed} ->
+ avail_dataf(RPO, Avail)
+ end.
+
+-spec avail_dataf_once([label()], avail(), non_neg_integer())
+ -> {avail(), non_neg_integer()}.
+avail_dataf_once([], Avail, Changed) -> {Avail, Changed};
+avail_dataf_once([L|Ls], Avail0, Changed0) ->
+ ABB = #avail_bb{out=OldOut, gen=Gen} = avail_get(L, Avail0),
+ In = avail_in(L, Avail0),
+ {Changed, Avail} =
+ case availset_union(In, Gen) of
+ OldOut -> {Changed0, Avail0};
+ Out -> {Changed0+1, avail_set(L, ABB#avail_bb{out=Out}, Avail0)}
+ end,
+ avail_dataf_once(Ls, Avail, Changed).
+
+-spec analyse_filter_want([label()], avail()) -> avail().
+analyse_filter_want([], Avail) -> Avail;
+analyse_filter_want([L|Ls], Avail0) ->
+ ABB = #avail_bb{want=Want0, defin=DefIn0} = avail_get(L, Avail0),
+ In = avail_in(L, Avail0),
+ Want = ordset_intersect_availset(Want0, In),
+ DefIn = ordset_intersect_availset(DefIn0, In),
+ Avail = avail_set(L, ABB#avail_bb{want=Want, defin=DefIn}, Avail0),
+ analyse_filter_want(Ls, Avail).
+
+-spec want_dataf([label()], avail()) -> avail().
+want_dataf(PO, Avail0) ->
+ case want_dataf_once(PO, Avail0, 0) of
+ {Avail, 0} -> Avail;
+ {Avail, _Changed} ->
+ want_dataf(PO, Avail)
+ end.
+
+-spec want_dataf_once([label()], avail(), non_neg_integer())
+ -> {avail(), non_neg_integer()}.
+want_dataf_once([], Avail, Changed) -> {Avail, Changed};
+want_dataf_once([L|Ls], Avail0, Changed0) ->
+ ABB0 = #avail_bb{want=OldIn,defin=OldDef} = avail_get(L, Avail0),
+ AvailIn = avail_in(L, Avail0),
+ Out = want_out(L, Avail0),
+ DefOut = def_out(L, Avail0),
+ {Changed, Avail} =
+ case {ordsets:union(ordset_intersect_availset(Out, AvailIn), OldIn),
+ ordsets:union(ordset_intersect_availset(DefOut, AvailIn), OldDef)}
+ of
+ {OldIn, OldDef} -> {Changed0, Avail0};
+ {In, DefIn} ->
+ ABB = ABB0#avail_bb{want=In,defin=DefIn},
+ {Changed0+1, avail_set(L, ABB, Avail0)}
+ end,
+ want_dataf_once(Ls, Avail, Changed).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Rewrite pass
+-type subst_dict() :: orddict:orddict(reg(), reg()).
+-type input() :: #{label() => subst_dict()}.
+
+-spec rewrite(target_cfg(), target(), avail()) -> target_cfg().
+rewrite(CFG, Target, Avail) ->
+ RPO = reverse_postorder(CFG, Target),
+ rewrite(RPO, Target, Avail, #{}, CFG).
+
+-spec rewrite([label()], target(), avail(), input(), target_cfg())
+ -> target_cfg().
+rewrite([], _Target, _Avail, _Input, CFG) -> CFG;
+rewrite([L|Ls], Target, Avail, Input0, CFG0) ->
+ SplitHere = split_in_block(L, Avail),
+ {Input1, LInput} =
+ case Input0 of
+ #{L := LInput0} -> {Input0, LInput0};
+ #{} -> {Input0#{L => []}, []} % entry block
+ end,
+ ?ASSERT([] =:= [X || X <- SplitHere, orddict:is_key(X, LInput)]),
+ ?ASSERT(want_in(L, Avail) =:= orddict:fetch_keys(LInput)),
+ {CFG1, LOutput} =
+ case {SplitHere, LInput} of
+ {[], []} -> % optimisation (rewrite will do nothing, so skip it)
+ {CFG0, LInput};
+ _ ->
+ Code0 = hipe_bb:code(BB=bb(CFG0, L, Target)),
+ DefOut = def_out(L, Avail),
+ {Code, LOutput0, _DefIn} =
+ rewrite_instrs(Code0, Target, LInput, DefOut, SplitHere),
+ {update_bb(CFG0, L, hipe_bb:code_update(BB, Code), Target), LOutput0}
+ end,
+ {Input, CFG} = rewrite_succs(avail_succ(L, Avail), Target, L, LOutput, Avail,
+ Input1, CFG1),
+ rewrite(Ls, Target, Avail, Input, CFG).
+
+-spec renamed_in_block(label(), avail()) -> ordsets:ordset(reg()).
+renamed_in_block(L, Avail) ->
+ ordsets:union([avail_self(L, Avail), want_in(L, Avail),
+ want_out(L, Avail)]).
+
+-spec split_in_block(label(), avail()) -> ordsets:ordset(reg()).
+split_in_block(L, Avail) ->
+ ordsets:subtract(ordsets:union(avail_self(L, Avail), want_out(L, Avail)),
+ want_in(L, Avail)).
+
+-spec rewrite_instrs([instr()], target(), subst_dict(), regset(), [reg()])
+ -> {[instr()], subst_dict(), regset()}.
+rewrite_instrs([], _Target, Output, DefOut, []) ->
+ {[], Output, DefOut};
+rewrite_instrs([I|Is], Target, Input0, BBDefOut, SplitHere0) ->
+ {TDef, TUse} = def_use(I, Target),
+ {Def, Use} = {reg_names(TDef, Target), reg_names(TUse, Target)},
+ %% Restores are generated in forward order by picking temps from SplitHere as
+ %% they're used or defined. After the last instruction, all temps have been
+ %% picked.
+ {ISplits, SplitHere} =
+ lists:partition(fun(R) ->
+ lists:member(R, Def) orelse lists:member(R, Use)
+ end, SplitHere0),
+ {Input, Restores} =
+ case ISplits of
+ [] -> {Input0, []};
+ _ ->
+ make_splits(ISplits, Target, TDef, TUse, Input0, [])
+ end,
+ %% Here's the recursive call
+ {Acc0, Output, DefOut} =
+ rewrite_instrs(Is, Target, Input, BBDefOut, SplitHere),
+ %% From here we're processing instructions in reverse order, because to avoid
+ %% redundant spills we need to walk the 'def' dataflow, which is in reverse.
+ SubstFun = fun(Temp) ->
+ case orddict:find(reg_nr(Temp, Target), Input) of
+ {ok, NewTemp} -> NewTemp;
+ error -> Temp
+ end
+ end,
+ Acc1 = insert_spills(TDef, Target, Input, DefOut, Acc0),
+ Acc = Restores ++ [subst_temps(SubstFun, I, Target) | Acc1],
+ DefIn = ordsets:union(DefOut, ordsets:from_list(Def)),
+ {Acc, Output, DefIn}.
+
+-spec make_splits([reg()], target(), [temp()], [temp()], subst_dict(),
+ [instr()])
+ -> {subst_dict(), [instr()]}.
+make_splits([], _Target, _TDef, _TUse, Input, Acc) ->
+ {Input, Acc};
+make_splits([S|Ss], Target, TDef, TUse, Input0, Acc0) ->
+ SubstReg = new_reg_nr(Target),
+ {Acc, Subst} =
+ case find_reg_temp(S, TUse, Target) of
+ error ->
+ {ok, Temp} = find_reg_temp(S, TDef, Target),
+ {Acc0, update_reg_nr(SubstReg, Temp, Target)};
+ {ok, Temp} ->
+ Subst0 = update_reg_nr(SubstReg, Temp, Target),
+ Acc1 = [mk_move(Temp, Subst0, Target) | Acc0],
+ {Acc1, Subst0}
+ end,
+ Input = orddict:store(S, Subst, Input0),
+ make_splits(Ss, Target, TDef, TUse, Input, Acc).
+
+-spec find_reg_temp(reg(), [temp()], target()) -> error | {ok, temp()}.
+find_reg_temp(_Reg, [], _Target) -> error;
+find_reg_temp(Reg, [T|Ts], Target) ->
+ case reg_nr(T, Target) of
+ Reg -> {ok, T};
+ _ -> find_reg_temp(Reg, Ts, Target)
+ end.
+
+-spec insert_spills([temp()], target(), subst_dict(), regset(), [instr()])
+ -> [instr()].
+insert_spills([], _Target, _Input, _DefOut, Acc) -> Acc;
+insert_spills([T|Ts], Target, Input, DefOut, Acc0) ->
+ R = reg_nr(T, Target),
+ Acc =
+ case orddict:find(R, Input) of
+ error -> Acc0;
+ {ok, Subst} ->
+ case lists:member(R, DefOut) of
+ true -> Acc0;
+ false -> [mk_move(Subst, T, Target) | Acc0]
+ end
+ end,
+ insert_spills(Ts, Target, Input, DefOut, Acc).
+
+-spec rewrite_succs([label()], target(), label(), subst_dict(), avail(),
+ input(), target_cfg()) -> {input(), target_cfg()}.
+rewrite_succs([], _Target, _P, _POutput, _Avail, Input, CFG) -> {Input, CFG};
+rewrite_succs([L|Ls], Target, P, POutput, Avail, Input0, CFG0) ->
+ NewLInput = orddict_with_ordset(want_in(L, Avail), POutput),
+ {Input, CFG} =
+ case Input0 of
+ #{L := LInput} ->
+ CFG2 =
+ case required_phi_moves(LInput, NewLInput) of
+ [] -> CFG0;
+ ReqMovs ->
+ PhiLb = new_label(Target),
+ Code = [mk_move(S,D,Target) || {S,D} <- ReqMovs]
+ ++ [mk_goto(L, Target)],
+ PhiBB = hipe_bb:mk_bb(Code),
+ CFG1 = update_bb(CFG0, PhiLb, PhiBB, Target),
+ bb_redirect_jmp(L, PhiLb, P, CFG1, Target)
+ end,
+ {Input0, CFG2};
+ #{} ->
+ {Input0#{L => NewLInput}, CFG0}
+ end,
+ rewrite_succs(Ls, Target, P, POutput, Avail, Input, CFG).
+
+-spec bb_redirect_jmp(label(), label(), label(), target_cfg(), target())
+ -> target_cfg().
+bb_redirect_jmp(From, To, Lb, CFG, Target) ->
+ BB0 = bb(CFG, Lb, Target),
+ Last = redirect_jmp(hipe_bb:last(BB0), From, To, Target),
+ BB = hipe_bb:code_update(BB0, hipe_bb:butlast(BB0) ++ [Last]),
+ update_bb(CFG, Lb, BB, Target).
+
+-spec required_phi_moves(subst_dict(), subst_dict()) -> [{reg(), reg()}].
+required_phi_moves([], []) -> [];
+required_phi_moves([P|Is], [P|Os]) -> required_phi_moves(Is, Os);
+required_phi_moves([{K, In}|Is], [{K, Out}|Os]) ->
+ [{Out, In}|required_phi_moves(Is, Os)].
+
+%% @doc Returns a new orddict with the keys in Set and their associated values.
+-spec orddict_with_ordset(ordsets:ordset(K), orddict:orddict(K, V))
+ -> orddict:orddict(K, V).
+orddict_with_ordset([S|Ss], [{K, _}|_]=Dict) when S < K ->
+ orddict_with_ordset(Ss, Dict);
+orddict_with_ordset([S|_]=Set, [{K, _}|Ds]) when S > K ->
+ orddict_with_ordset(Set, Ds);
+orddict_with_ordset([_S|Ss], [{_K, _}=P|Ds]) -> % _S == _K
+ [P|orddict_with_ordset(Ss, Ds)];
+orddict_with_ordset([], _) -> [];
+orddict_with_ordset(_, []) -> [].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Target module interface functions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+-define(TGT_IFACE_0(N), N( {M,C}) -> M:N( C)).
+-define(TGT_IFACE_1(N), N(A1, {M,C}) -> M:N(A1, C)).
+-define(TGT_IFACE_2(N), N(A1,A2, {M,C}) -> M:N(A1,A2, C)).
+-define(TGT_IFACE_3(N), N(A1,A2,A3,{M,C}) -> M:N(A1,A2,A3,C)).
+
+?TGT_IFACE_2(bb).
+?TGT_IFACE_1(def_use).
+?TGT_IFACE_1(defines_all_alloc).
+?TGT_IFACE_1(is_precoloured).
+?TGT_IFACE_1(labels).
+?TGT_IFACE_1(mk_goto).
+?TGT_IFACE_2(mk_move).
+?TGT_IFACE_0(new_label).
+?TGT_IFACE_0(new_reg_nr).
+?TGT_IFACE_3(redirect_jmp).
+?TGT_IFACE_1(reg_nr).
+?TGT_IFACE_1(reverse_postorder).
+?TGT_IFACE_2(subst_temps).
+?TGT_IFACE_3(update_bb).
+?TGT_IFACE_2(update_reg_nr).
+
+liveout(Liveness, L, Target={TgtMod,TgtCtx}) ->
+ ordsets:from_list(reg_names(TgtMod:liveout(Liveness, L, TgtCtx), Target)).
+
+reg_names(Regs, {TgtMod,TgtCtx}) ->
+ [TgtMod:reg_nr(X,TgtCtx) || X <- Regs].
+
+reg_def_use(I, Target) ->
+ {TDef, TUse} = def_use(I, Target),
+ {reg_names(TDef, Target), reg_names(TUse, Target)}.
diff --git a/lib/hipe/regalloc/hipe_sparc_specific.erl b/lib/hipe/regalloc/hipe_sparc_specific.erl
index 31fca81316..78b6379eba 100644
--- a/lib/hipe/regalloc/hipe_sparc_specific.erl
+++ b/lib/hipe/regalloc/hipe_sparc_specific.erl
@@ -24,6 +24,7 @@
,reg_nr/2
,def_use/2
,is_move/2
+ ,is_spill_move/2
,is_precoloured/2
,var_range/2
,allocatable/1
@@ -46,12 +47,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights, hipe_range_split
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, no_context) ->
hipe_sparc_ra_postconditions:check_and_rewrite(CFG, Coloring, 'normal').
@@ -115,6 +123,9 @@ bb(CFG,L,_) ->
update_bb(CFG,L,BB,_) ->
hipe_sparc_cfg:bb_add(CFG,L,BB).
+branch_preds(Branch,_) ->
+ hipe_sparc_cfg:branch_preds(Branch).
+
%% SPARC stuff
def_use(Instruction, Ctx) ->
@@ -144,9 +155,24 @@ is_move(Instruction, _) ->
false -> false
end.
+is_spill_move(Instruction, _) ->
+ hipe_sparc:is_pseudo_spill_move(Instruction).
+
reg_nr(Reg, _) ->
hipe_sparc:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_sparc:mk_pseudo_move(Src, Dst).
+
+mk_goto(Label, _) ->
+ hipe_sparc:mk_b_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ hipe_sparc_cfg:redirect_jmp(Jmp, ToOld, ToNew).
+
+new_label(_) ->
+ hipe_gensym:get_next_label(sparc).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(sparc).
diff --git a/lib/hipe/regalloc/hipe_sparc_specific_fp.erl b/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
index 050d65e1a9..485fdc212a 100644
--- a/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
+++ b/lib/hipe/regalloc/hipe_sparc_specific_fp.erl
@@ -24,6 +24,7 @@
,reg_nr/2
,def_use/2
,is_move/2
+ ,is_spill_move/2
,is_precoloured/2
,var_range/2
,allocatable/1
@@ -46,12 +47,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights, hipe_range_split
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, no_context) ->
hipe_sparc_ra_postconditions_fp:check_and_rewrite(CFG, Coloring).
@@ -108,6 +116,9 @@ bb(CFG, L, _) ->
update_bb(CFG,L,BB,_) ->
hipe_sparc_cfg:bb_add(CFG,L,BB).
+branch_preds(Branch,_) ->
+ hipe_sparc_cfg:branch_preds(Branch).
+
%% SPARC stuff
def_use(I, Ctx) ->
@@ -125,9 +136,24 @@ defines_all_alloc(I, _) ->
is_move(I, _) ->
hipe_sparc:is_pseudo_fmove(I).
+is_spill_move(I, _) ->
+ hipe_sparc:is_pseudo_spill_fmove(I).
+
reg_nr(Reg, _) ->
hipe_sparc:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_sparc:mk_pseudo_fmove(Src, Dst).
+
+mk_goto(Label, _) ->
+ hipe_sparc:mk_b_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ hipe_sparc_cfg:redirect_jmp(Jmp, ToOld, ToNew).
+
+new_label(_) ->
+ hipe_gensym:get_next_label(sparc).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(sparc).
diff --git a/lib/hipe/regalloc/hipe_x86_specific.erl b/lib/hipe/regalloc/hipe_x86_specific.erl
index c1c8dbbcd6..dacfb71b00 100644
--- a/lib/hipe/regalloc/hipe_x86_specific.erl
+++ b/lib/hipe/regalloc/hipe_x86_specific.erl
@@ -46,6 +46,7 @@
def_use/2,
is_arg/2, % used by hipe_ls_regalloc
is_move/2,
+ is_spill_move/2,
is_fixed/2, % used by hipe_graph_coloring_regalloc
is_global/2,
is_precoloured/2,
@@ -63,12 +64,19 @@
%% callbacks for hipe_regalloc_loop
-export([check_and_rewrite/3]).
-%% callbacks for hipe_regalloc_prepass
--export([new_reg_nr/1,
+%% callbacks for hipe_regalloc_prepass, hipe_range_split
+-export([mk_move/3,
+ mk_goto/2,
+ redirect_jmp/4,
+ new_label/1,
+ new_reg_nr/1,
update_reg_nr/3,
update_bb/4,
subst_temps/3]).
+%% callbacks for hipe_bb_weights
+-export([branch_preds/2]).
+
check_and_rewrite(CFG, Coloring, _) ->
?HIPE_X86_RA_POSTCONDITIONS:check_and_rewrite(CFG, Coloring, 'normal').
@@ -156,6 +164,9 @@ bb(CFG,L,_) ->
update_bb(CFG,L,BB,_) ->
hipe_x86_cfg:bb_add(CFG,L,BB).
+branch_preds(Instr,_) ->
+ hipe_x86_cfg:branch_preds(Instr).
+
%% X86 stuff
def_use(Instruction,_) ->
@@ -200,9 +211,33 @@ is_move(Instruction,_) ->
false -> false
end.
+is_spill_move(Instruction,_) ->
+ hipe_x86:is_pseudo_spill_move(Instruction).
+
reg_nr(Reg,_) ->
hipe_x86:temp_reg(Reg).
+mk_move(Src, Dst, _) ->
+ hipe_x86:mk_move(Src, Dst).
+
+mk_goto(Label, _) ->
+ hipe_x86:mk_jmp_label(Label).
+
+redirect_jmp(Jmp, ToOld, ToNew, _) when is_integer(ToOld), is_integer(ToNew) ->
+ Ref = make_ref(),
+ put(Ref, false),
+ I = hipe_x86_subst:insn_lbls(
+ fun(Tgt) ->
+ if Tgt =:= ToOld -> put(Ref, true), ToNew;
+ is_integer(Tgt) -> Tgt
+ end
+ end, Jmp),
+ true = erase(Ref), % Assert that something was rewritten
+ I.
+
+new_label(_) ->
+ hipe_gensym:get_next_label(x86).
+
new_reg_nr(_) ->
hipe_gensym:get_next_var(x86).
diff --git a/lib/hipe/regalloc/hipe_x86_specific_x87.erl b/lib/hipe/regalloc/hipe_x86_specific_x87.erl
index 4b4c83f76d..3fe49e1f00 100644
--- a/lib/hipe/regalloc/hipe_x86_specific_x87.erl
+++ b/lib/hipe/regalloc/hipe_x86_specific_x87.erl
@@ -47,6 +47,7 @@
uses/2,
defines/2,
defines_all_alloc/2,
+ is_spill_move/2,
is_global/2,
reg_nr/2,
physical_name/2,
@@ -158,6 +159,9 @@ defines(I, _) ->
defines_all_alloc(I, _) -> hipe_amd64_defuse:insn_defs_all(I).
+is_spill_move(I, _) ->
+ hipe_x86:is_pseudo_spill_fmove(I).
+
temp_is_double(Temp) ->
hipe_x86:temp_type(Temp) =:= 'double'.
diff --git a/lib/hipe/rtl/hipe_icode2rtl.erl b/lib/hipe/rtl/hipe_icode2rtl.erl
index 82970f04ab..6da8a76d34 100644
--- a/lib/hipe/rtl/hipe_icode2rtl.erl
+++ b/lib/hipe/rtl/hipe_icode2rtl.erl
@@ -532,8 +532,12 @@ gen_cond(CondOp, Args, TrueLbl, FalseLbl, Pred) ->
FalseLbl, Pred)];
'=:=' ->
[Arg1, Arg2] = Args,
+ TypeTestLbl = hipe_rtl:mk_new_label(),
[hipe_rtl:mk_branch(Arg1, eq, Arg2, TrueLbl,
- hipe_rtl:label_name(GenLbl), Pred),
+ hipe_rtl:label_name(TypeTestLbl), Pred),
+ TypeTestLbl,
+ hipe_tagscheme:test_either_immed(Arg1, Arg2, FalseLbl,
+ hipe_rtl:label_name(GenLbl)),
GenLbl,
hipe_rtl:mk_call([Tmp], op_exact_eqeq_2, Args,
TestRetName, [], not_remote),
@@ -546,8 +550,12 @@ gen_cond(CondOp, Args, TrueLbl, FalseLbl, Pred) ->
TrueLbl, 1-Pred)];
'=/=' ->
[Arg1, Arg2] = Args,
+ TypeTestLbl = hipe_rtl:mk_new_label(),
[hipe_rtl:mk_branch(Arg1, eq, Arg2, FalseLbl,
- hipe_rtl:label_name(GenLbl), 1-Pred),
+ hipe_rtl:label_name(TypeTestLbl), 1-Pred),
+ TypeTestLbl,
+ hipe_tagscheme:test_either_immed(Arg1, Arg2, TrueLbl,
+ hipe_rtl:label_name(GenLbl)),
GenLbl,
hipe_rtl:mk_call([Tmp], op_exact_eqeq_2, Args,
TestRetName, [], not_remote),
diff --git a/lib/hipe/rtl/hipe_rtl_binary_construct.erl b/lib/hipe/rtl/hipe_rtl_binary_construct.erl
index fd0d1f1223..52ea5db382 100644
--- a/lib/hipe/rtl/hipe_rtl_binary_construct.erl
+++ b/lib/hipe/rtl/hipe_rtl_binary_construct.erl
@@ -137,43 +137,6 @@ gen_rtl(BsOP, Dst, Args, TrueLblName, FalseLblName, SystemLimitLblName, ConstTab
end
end;
- {bs_put_integer, Size, Flags, ConstInfo} ->
- Aligned = aligned(Flags),
- LittleEndian = littleendian(Flags),
- [NewOffset] = get_real(Dst),
- case is_illegal_const(Size) of
- true ->
- [hipe_rtl:mk_goto(FalseLblName)];
- false ->
- case ConstInfo of
- fail ->
- [hipe_rtl:mk_goto(FalseLblName)];
- _ ->
- case Args of
- [Src, Base, Offset] ->
- CCode = static_int_c_code(NewOffset, Src,
- Base, Offset, Size,
- Flags, TrueLblName,
- FalseLblName),
- put_static_int(NewOffset, Src, Base, Offset, Size,
- CCode, Aligned, LittleEndian, TrueLblName);
- [Src, Bits, Base, Offset] ->
- {SizeCode, SizeReg} =
- hipe_rtl_binary:make_size(Size, Bits,
- SystemLimitLblName,
- FalseLblName),
- CCode = int_c_code(NewOffset, Src, Base,
- Offset, SizeReg, Flags,
- TrueLblName, FalseLblName),
- InCode =
- put_dynamic_int(NewOffset, Src, Base, Offset,
- SizeReg, CCode, Aligned,
- LittleEndian, TrueLblName),
- SizeCode ++ InCode
- end
- end
- end;
-
{unsafe_bs_put_integer, 0, _Flags, _ConstInfo} ->
[NewOffset] = get_real(Dst),
case Args of
@@ -186,44 +149,12 @@ gen_rtl(BsOP, Dst, Args, TrueLblName, FalseLblName, SystemLimitLblName, ConstTab
end;
{unsafe_bs_put_integer, Size, Flags, ConstInfo} ->
- case is_illegal_const(Size) of
- true ->
- [hipe_rtl:mk_goto(FalseLblName)];
- false ->
- Aligned = aligned(Flags),
- LittleEndian = littleendian(Flags),
- [NewOffset] = get_real(Dst),
- case ConstInfo of
- fail ->
- [hipe_rtl:mk_goto(FalseLblName)];
- _ ->
- case Args of
- [Src, Base, Offset] ->
- CCode = static_int_c_code(NewOffset, Src,
- Base, Offset, Size,
- Flags, TrueLblName,
- FalseLblName),
- put_unsafe_static_int(NewOffset, Src, Base,
- Offset, Size,
- CCode, Aligned, LittleEndian,
- TrueLblName);
- [Src, Bits, Base, Offset] ->
- {SizeCode, SizeReg} =
- hipe_rtl_binary:make_size(Size, Bits,
- SystemLimitLblName,
- FalseLblName),
- CCode = int_c_code(NewOffset, Src, Base,
- Offset, SizeReg, Flags,
- TrueLblName, FalseLblName),
- InCode =
- put_unsafe_dynamic_int(NewOffset, Src, Base,
- Offset, SizeReg, CCode,
- Aligned, LittleEndian,
- TrueLblName),
- SizeCode ++ InCode
- end
- end
- end;
+ do_bs_put_integer(Dst, Args, Size, Flags, ConstInfo, true,
+ TrueLblName, FalseLblName, SystemLimitLblName);
+
+ {bs_put_integer, Size, Flags, ConstInfo} ->
+ do_bs_put_integer(Dst, Args, Size, Flags, ConstInfo, false,
+ TrueLblName, FalseLblName, SystemLimitLblName);
bs_utf8_size ->
case Dst of
@@ -360,6 +291,40 @@ gen_rtl(BsOP, Dst, Args, TrueLblName, FalseLblName, SystemLimitLblName, ConstTab
{Code, ConstTab}
end.
+%% Common implementation of bs_put_integer and unsafe_bs_put_integer
+do_bs_put_integer(Dst, Args, Size, Flags, ConstInfo, SrcUnsafe,
+ TrueLblName, FalseLblName, SystemLimitLblName) ->
+ case is_illegal_const(Size) of
+ true ->
+ [hipe_rtl:mk_goto(FalseLblName)];
+ false ->
+ Aligned = aligned(Flags),
+ LittleEndian = littleendian(Flags),
+ [NewOffset] = get_real(Dst),
+ case ConstInfo of
+ fail ->
+ [hipe_rtl:mk_goto(FalseLblName)];
+ _ ->
+ case Args of
+ [Src, Base, Offset] ->
+ CCode = static_int_c_code(NewOffset, Src, Base, Offset, Size,
+ Flags, TrueLblName, FalseLblName),
+ put_static_int(NewOffset, Src, Base, Offset, Size, CCode, Aligned,
+ LittleEndian, SrcUnsafe, TrueLblName);
+ [Src, Bits, Base, Offset] ->
+ {SizeCode, SizeReg} =
+ hipe_rtl_binary:make_size(Size, Bits, SystemLimitLblName,
+ FalseLblName),
+ CCode = int_c_code(NewOffset, Src, Base, Offset, SizeReg, Flags,
+ TrueLblName, FalseLblName),
+ InCode = put_dynamic_int(NewOffset, Src, Base, Offset, SizeReg,
+ CCode, Aligned, LittleEndian, SrcUnsafe,
+ TrueLblName),
+ SizeCode ++ InCode
+ end
+ end
+ end.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Code that is used in the append and init writeable functions
@@ -807,28 +772,8 @@ put_float(_NewOffset, _Src, _Base, _Offset, _Size, CCode, _Aligned,
CCode.
put_static_int(NewOffset, Src, Base, Offset, Size, CCode, Aligned,
- LittleEndian, TrueLblName) ->
- {Init, End, UntaggedSrc} = make_init_end(Src, CCode, TrueLblName),
- case {Aligned, LittleEndian} of
- {true, true} ->
- Init ++
- copy_int_little(Base, Offset, NewOffset, Size, UntaggedSrc) ++
- End;
- {true, false} ->
- Init ++
- copy_int_big(Base, Offset, NewOffset, Size, UntaggedSrc) ++
- End;
- {false, true} ->
- CCode;
- {false, false} ->
- Init ++
- copy_offset_int_big(Base, Offset, NewOffset, Size, UntaggedSrc) ++
- End
- end.
-
-put_unsafe_static_int(NewOffset, Src, Base, Offset, Size, CCode, Aligned,
- LittleEndian, TrueLblName) ->
- {Init, End, UntaggedSrc} = make_init_end(Src, TrueLblName),
+ LittleEndian, SrcUnsafe, TrueLblName) ->
+ {Init, End, UntaggedSrc} = make_init_end(Src, CCode, SrcUnsafe, TrueLblName),
case {Aligned, LittleEndian} of
{true, true} ->
Init ++
@@ -847,27 +792,8 @@ put_unsafe_static_int(NewOffset, Src, Base, Offset, Size, CCode, Aligned,
end.
put_dynamic_int(NewOffset, Src, Base, Offset, SizeReg, CCode, Aligned,
- LittleEndian, TrueLblName) ->
- {Init, End, UntaggedSrc} = make_init_end(Src, CCode, TrueLblName),
- case Aligned of
- true ->
- case LittleEndian of
- true ->
- Init ++
- copy_int_little(Base, Offset, NewOffset, SizeReg, UntaggedSrc) ++
- End;
- false ->
- Init ++
- copy_int_big(Base, Offset, NewOffset, SizeReg, UntaggedSrc) ++
- End
- end;
- false ->
- CCode
- end.
-
-put_unsafe_dynamic_int(NewOffset, Src, Base, Offset, SizeReg, CCode, Aligned,
- LittleEndian, TrueLblName) ->
- {Init, End, UntaggedSrc} = make_init_end(Src, TrueLblName),
+ LittleEndian, SrcUnsafe, TrueLblName) ->
+ {Init, End, UntaggedSrc} = make_init_end(Src, CCode, SrcUnsafe, TrueLblName),
case Aligned of
true ->
case LittleEndian of
@@ -884,14 +810,13 @@ put_unsafe_dynamic_int(NewOffset, Src, Base, Offset, SizeReg, CCode, Aligned,
CCode
end.
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% Help functions used by the above
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-make_init_end(Src, CCode, TrueLblName) ->
+make_init_end(Src, CCode, false, TrueLblName) ->
[CLbl, SuccessLbl] = create_lbls(2),
[UntaggedSrc] = create_regs(1),
Init = [hipe_tagscheme:test_fixnum(Src, hipe_rtl:label_name(SuccessLbl),
@@ -899,9 +824,8 @@ make_init_end(Src, CCode, TrueLblName) ->
SuccessLbl,
hipe_tagscheme:untag_fixnum(UntaggedSrc,Src)],
End = [hipe_rtl:mk_goto(TrueLblName), CLbl| CCode],
- {Init, End, UntaggedSrc}.
-
-make_init_end(Src, TrueLblName) ->
+ {Init, End, UntaggedSrc};
+make_init_end(Src, _CCode, true, TrueLblName) ->
[UntaggedSrc] = create_regs(1),
Init = [hipe_tagscheme:untag_fixnum(UntaggedSrc,Src)],
End = [hipe_rtl:mk_goto(TrueLblName)],
diff --git a/lib/hipe/rtl/hipe_tagscheme.erl b/lib/hipe/rtl/hipe_tagscheme.erl
index 35d1e7c8a4..68cbe75e85 100644
--- a/lib/hipe/rtl/hipe_tagscheme.erl
+++ b/lib/hipe/rtl/hipe_tagscheme.erl
@@ -40,6 +40,7 @@
fixnum_gt/5, fixnum_lt/5, fixnum_ge/5, fixnum_le/5, fixnum_val/1,
fixnum_mul/4, fixnum_addsub/5, fixnum_andorxor/4, fixnum_not/2,
fixnum_bsr/3, fixnum_bsl/3]).
+-export([test_either_immed/4]).
-export([unsafe_car/2, unsafe_cdr/2,
unsafe_constant_element/3, unsafe_update_element/3, element/6]).
-export([unsafe_closure_element/3]).
@@ -363,14 +364,17 @@ test_matchstate(X, TrueLab, FalseLab, Pred) ->
mask_and_compare(Tmp, ?TAG_HEADER_MASK, ?TAG_HEADER_BIN_MATCHSTATE,
TrueLab, FalseLab, Pred)].
+test_bitstr_header(HdrTmp, TrueLab, FalseLab, Pred) ->
+ Mask = ?TAG_HEADER_MASK - ?BINARY_XXX_MASK,
+ mask_and_compare(HdrTmp, Mask, ?TAG_HEADER_REFC_BIN, TrueLab, FalseLab, Pred).
+
test_bitstr(X, TrueLab, FalseLab, Pred) ->
Tmp = hipe_rtl:mk_new_reg_gcsafe(),
HalfTrueLab = hipe_rtl:mk_new_label(),
- Mask = ?TAG_HEADER_MASK - ?BINARY_XXX_MASK,
[test_is_boxed(X, hipe_rtl:label_name(HalfTrueLab), FalseLab, Pred),
HalfTrueLab,
get_header(Tmp, X),
- mask_and_compare(Tmp, Mask, ?TAG_HEADER_REFC_BIN, TrueLab, FalseLab, Pred)].
+ test_bitstr_header(Tmp, TrueLab, FalseLab, Pred)].
test_binary(X, TrueLab, FalseLab, Pred) ->
Tmp1 = hipe_rtl:mk_new_reg_gcsafe(),
@@ -378,12 +382,10 @@ test_binary(X, TrueLab, FalseLab, Pred) ->
IsBoxedLab = hipe_rtl:mk_new_label(),
IsBitStrLab = hipe_rtl:mk_new_label(),
IsSubBinLab = hipe_rtl:mk_new_label(),
- Mask = ?TAG_HEADER_MASK - ?BINARY_XXX_MASK,
[test_is_boxed(X, hipe_rtl:label_name(IsBoxedLab), FalseLab, Pred),
IsBoxedLab,
get_header(Tmp1, X),
- mask_and_compare(Tmp1, Mask, ?TAG_HEADER_REFC_BIN,
- hipe_rtl:label_name(IsBitStrLab), FalseLab, Pred),
+ test_bitstr_header(Tmp1, hipe_rtl:label_name(IsBitStrLab), FalseLab, Pred),
IsBitStrLab,
mask_and_compare(Tmp1, ?TAG_HEADER_MASK, ?TAG_HEADER_SUB_BIN,
hipe_rtl:label_name(IsSubBinLab), TrueLab, 0.5),
@@ -453,6 +455,10 @@ test_fixnums_1([Arg1, Arg2|Args], Acc) ->
Tmp = hipe_rtl:mk_new_reg_gcsafe(),
test_fixnums_1([Tmp|Args], [hipe_rtl:mk_alu(Tmp, Arg1, 'and', Arg2)|Acc]).
+test_two_fixnums(Arg, Arg, FalseLab) ->
+ TrueLab = hipe_rtl:mk_new_label(),
+ [test_fixnum(Arg, hipe_rtl:label_name(TrueLab), FalseLab, 0.99),
+ TrueLab];
test_two_fixnums(Arg1, Arg2, FalseLab) ->
TrueLab = hipe_rtl:mk_new_label(),
case hipe_rtl:is_imm(Arg1) orelse hipe_rtl:is_imm(Arg2) of
@@ -567,8 +573,8 @@ fixnum_andorxor(AluOp, Arg1, Arg2, Res) ->
case AluOp of
'xor' ->
Tmp = hipe_rtl:mk_new_reg_gcsafe(),
- [hipe_rtl:mk_alu(Tmp, Arg1, 'xor', Arg2), % clears tag :-(
- hipe_rtl:mk_alu(Res, Tmp, 'or', hipe_rtl:mk_imm(?TAG_IMMED1_SMALL))];
+ [hipe_rtl:mk_alu(Tmp, Arg1, 'sub', hipe_rtl:mk_imm(?TAG_IMMED1_SMALL)),
+ hipe_rtl:mk_alu(Res, Tmp, 'xor', Arg2)];
_ -> hipe_rtl:mk_alu(Res, Arg1, AluOp, Arg2)
end.
@@ -595,6 +601,21 @@ fixnum_bsl(Arg1, Arg2, Res) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Test if either of two values are immediate (primary tag IMMED1, 0x3)
+test_either_immed(Arg1, Arg2, TrueLab, FalseLab) ->
+ %% This test assumes primary tag 0x0 is reserved and immed has tag 0x3
+ 16#0 = ?TAG_PRIMARY_HEADER,
+ 16#3 = ?TAG_PRIMARY_IMMED1,
+ Tmp1 = hipe_rtl:mk_new_reg_gcsafe(),
+ Tmp2 = hipe_rtl:mk_new_reg_gcsafe(),
+ [hipe_rtl:mk_alu(Tmp1, Arg1, 'sub', hipe_rtl:mk_imm(1)),
+ hipe_rtl:mk_alu(Tmp2, Arg2, 'sub', hipe_rtl:mk_imm(1)),
+ hipe_rtl:mk_alu(Tmp2, Tmp2, 'or', Tmp1),
+ hipe_rtl:mk_branch(Tmp2, 'and', hipe_rtl:mk_imm(2), eq,
+ FalseLab, TrueLab, 0.01)].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
unsafe_car(Dst, Arg) ->
hipe_rtl:mk_load(Dst, Arg, hipe_rtl:mk_imm(-(?TAG_PRIMARY_LIST))).
@@ -631,14 +652,13 @@ unsafe_update_element(Tuple, Index, Value) -> % Index is an immediate
element(Dst, Index, Tuple, FailLabName, {tuple, A}, IndexInfo) ->
FixnumOkLab = hipe_rtl:mk_new_label(),
IndexOkLab = hipe_rtl:mk_new_label(),
- Ptr = hipe_rtl:mk_new_reg(), % offset from Tuple
UIndex = hipe_rtl:mk_new_reg_gcsafe(),
Arity = hipe_rtl:mk_imm(A),
- InvIndex = hipe_rtl:mk_new_reg_gcsafe(),
- Offset = hipe_rtl:mk_new_reg_gcsafe(),
case IndexInfo of
valid ->
%% This is no branch, 1 load and 3 alus = 4 instr
+ Offset = hipe_rtl:mk_new_reg_gcsafe(),
+ Ptr = hipe_rtl:mk_new_reg(), % offset from Tuple
[untag_fixnum(UIndex, Index),
hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
hipe_rtl:mk_alu(Offset, UIndex, 'sll',
@@ -647,72 +667,56 @@ element(Dst, Index, Tuple, FailLabName, {tuple, A}, IndexInfo) ->
fixnums ->
%% This is 1 branch, 1 load and 4 alus = 6 instr
[untag_fixnum(UIndex, Index),
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub',hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset, UIndex,
- FailLabName, IndexOkLab)];
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)];
_ ->
%% This is 3 branches, 1 load and 5 alus = 9 instr
[test_fixnum(Index, hipe_rtl:label_name(FixnumOkLab),
FailLabName, 0.99),
FixnumOkLab,
untag_fixnum(UIndex, Index),
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub',hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset, UIndex,
- FailLabName, IndexOkLab)]
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)]
end;
element(Dst, Index, Tuple, FailLabName, tuple, IndexInfo) ->
FixnumOkLab = hipe_rtl:mk_new_label(),
IndexOkLab = hipe_rtl:mk_new_label(),
- Ptr = hipe_rtl:mk_new_reg(), % offset from Tuple
Header = hipe_rtl:mk_new_reg_gcsafe(),
UIndex = hipe_rtl:mk_new_reg_gcsafe(),
Arity = hipe_rtl:mk_new_reg_gcsafe(),
- InvIndex = hipe_rtl:mk_new_reg_gcsafe(),
- Offset = hipe_rtl:mk_new_reg_gcsafe(),
case IndexInfo of
fixnums ->
%% This is 1 branch, 2 loads and 5 alus = 8 instr
- [hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
- hipe_rtl:mk_load(Header, Ptr, hipe_rtl:mk_imm(0)),
+ [get_header(Header, Tuple),
untag_fixnum(UIndex, Index),
hipe_rtl:mk_alu(Arity,Header,'srl',hipe_rtl:mk_imm(?HEADER_ARITY_OFFS))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset, UIndex,
- FailLabName, IndexOkLab)];
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)];
Num when is_integer(Num) ->
%% This is 1 branch, 1 load and 3 alus = 5 instr
- [hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED))|
- gen_element_tail(Dst, Ptr, InvIndex, hipe_rtl:mk_imm(Num),
- Offset, UIndex, FailLabName, IndexOkLab)];
+ gen_element_tail(Dst, Tuple, hipe_rtl:mk_imm(Num), UIndex, FailLabName,
+ IndexOkLab);
_ ->
%% This is 2 branches, 2 loads and 6 alus = 10 instr
[test_fixnum(Index, hipe_rtl:label_name(FixnumOkLab), FailLabName, 0.99),
FixnumOkLab,
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
- hipe_rtl:mk_load(Header, Ptr, hipe_rtl:mk_imm(0)),
+ get_header(Header, Tuple),
untag_fixnum(UIndex, Index),
hipe_rtl:mk_alu(Arity,Header,'srl',hipe_rtl:mk_imm(?HEADER_ARITY_OFFS))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset, UIndex,
- FailLabName, IndexOkLab)]
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)]
end;
element(Dst, Index, Tuple, FailLabName, unknown, IndexInfo) ->
FixnumOkLab = hipe_rtl:mk_new_label(),
BoxedOkLab = hipe_rtl:mk_new_label(),
TupleOkLab = hipe_rtl:mk_new_label(),
IndexOkLab = hipe_rtl:mk_new_label(),
- Ptr = hipe_rtl:mk_new_reg(), % offset from Tuple
Header = hipe_rtl:mk_new_reg_gcsafe(),
UIndex = hipe_rtl:mk_new_reg_gcsafe(),
Arity = hipe_rtl:mk_new_reg_gcsafe(),
- InvIndex = hipe_rtl:mk_new_reg_gcsafe(),
- Offset = hipe_rtl:mk_new_reg_gcsafe(),
case IndexInfo of
fixnums ->
%% This is 3 branches, 2 loads and 5 alus = 10 instr
[test_is_boxed(Tuple, hipe_rtl:label_name(BoxedOkLab),
FailLabName, 0.99),
BoxedOkLab,
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
- hipe_rtl:mk_load(Header, Ptr, hipe_rtl:mk_imm(0)),
+ get_header(Header, Tuple),
hipe_rtl:mk_branch(Header, 'and',
hipe_rtl:mk_imm(?TAG_HEADER_MASK), 'eq',
hipe_rtl:label_name(TupleOkLab), FailLabName, 0.99),
@@ -720,23 +724,21 @@ element(Dst, Index, Tuple, FailLabName, unknown, IndexInfo) ->
untag_fixnum(UIndex, Index),
hipe_rtl:mk_alu(Arity, Header, 'srl',
hipe_rtl:mk_imm(?HEADER_ARITY_OFFS))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset,
- UIndex, FailLabName, IndexOkLab)];
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)];
Num when is_integer(Num) ->
%% This is 3 branches, 2 loads and 4 alus = 9 instr
[test_is_boxed(Tuple, hipe_rtl:label_name(BoxedOkLab),
FailLabName, 0.99),
BoxedOkLab,
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
- hipe_rtl:mk_load(Header, Ptr, hipe_rtl:mk_imm(0)),
+ get_header(Header, Tuple),
hipe_rtl:mk_branch(Header, 'and',
hipe_rtl:mk_imm(?TAG_HEADER_MASK), 'eq',
hipe_rtl:label_name(TupleOkLab), FailLabName, 0.99),
TupleOkLab,
hipe_rtl:mk_alu(Arity, Header, 'srl',
hipe_rtl:mk_imm(?HEADER_ARITY_OFFS))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset,
- hipe_rtl:mk_imm(Num), FailLabName, IndexOkLab)];
+ gen_element_tail(Dst, Tuple, Arity, hipe_rtl:mk_imm(Num), FailLabName,
+ IndexOkLab)];
_ ->
%% This is 4 branches, 2 loads, and 6 alus = 12 instr :(
[test_fixnum(Index, hipe_rtl:label_name(FixnumOkLab),
@@ -745,8 +747,7 @@ element(Dst, Index, Tuple, FailLabName, unknown, IndexInfo) ->
test_is_boxed(Tuple, hipe_rtl:label_name(BoxedOkLab),
FailLabName, 0.99),
BoxedOkLab,
- hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
- hipe_rtl:mk_load(Header, Ptr, hipe_rtl:mk_imm(0)),
+ get_header(Header, Tuple),
hipe_rtl:mk_branch(Header, 'and',
hipe_rtl:mk_imm(?TAG_HEADER_MASK), 'eq',
hipe_rtl:label_name(TupleOkLab), FailLabName, 0.99),
@@ -754,20 +755,21 @@ element(Dst, Index, Tuple, FailLabName, unknown, IndexInfo) ->
untag_fixnum(UIndex, Index),
hipe_rtl:mk_alu(Arity, Header, 'srl',
hipe_rtl:mk_imm(?HEADER_ARITY_OFFS))|
- gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset,
- UIndex, FailLabName, IndexOkLab)]
+ gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab)]
end.
-gen_element_tail(Dst, Ptr, InvIndex, Arity, Offset,
- UIndex, FailLabName, IndexOkLab) ->
+gen_element_tail(Dst, Tuple, Arity, UIndex, FailLabName, IndexOkLab) ->
+ ZeroIndex = hipe_rtl:mk_new_reg_gcsafe(),
+ Offset = hipe_rtl:mk_new_reg_gcsafe(),
+ Ptr = hipe_rtl:mk_new_reg(), % offset from Tuple
%% now check that 1 <= UIndex <= Arity
- %% if UIndex < 1, then (Arity - UIndex) >= Arity
- %% if UIndex > Arity, then (Arity - UIndex) < 0, which is >=u Arity
- %% otherwise, 0 <= (Arity - UIndex) < Arity
- [hipe_rtl:mk_alu(InvIndex, Arity, 'sub', UIndex),
- hipe_rtl:mk_branch(InvIndex, 'geu', Arity, FailLabName,
+ %% by checking the equivalent (except for when Arity>=2^(WordSize-1))
+ %% (UIndex - 1) <u Arity
+ [hipe_rtl:mk_alu(ZeroIndex, UIndex, 'sub', hipe_rtl:mk_imm(1)),
+ hipe_rtl:mk_branch(ZeroIndex, 'geu', Arity, FailLabName,
hipe_rtl:label_name(IndexOkLab), 0.01),
IndexOkLab,
+ hipe_rtl:mk_alu(Ptr, Tuple, 'sub', hipe_rtl:mk_imm(?TAG_PRIMARY_BOXED)),
hipe_rtl:mk_alu(Offset, UIndex, 'sll',
hipe_rtl:mk_imm(hipe_rtl_arch:log2_word_size())),
hipe_rtl:mk_load(Dst, Ptr, Offset)].
diff --git a/lib/hipe/sparc/hipe_sparc.erl b/lib/hipe/sparc/hipe_sparc.erl
index 916857b224..22e0761b69 100644
--- a/lib/hipe/sparc/hipe_sparc.erl
+++ b/lib/hipe/sparc/hipe_sparc.erl
@@ -87,6 +87,9 @@
mk_pseudo_set/2,
+ mk_pseudo_spill_move/3,
+ is_pseudo_spill_move/1,
+
mk_pseudo_tailcall/4,
pseudo_tailcall_funv/1,
pseudo_tailcall_linkage/1,
@@ -117,6 +120,9 @@
pseudo_fmove_src/1,
pseudo_fmove_dst/1,
+ mk_pseudo_spill_fmove/3,
+ is_pseudo_spill_fmove/1,
+
mk_pseudo_fstore/3,
mk_fstore/4,
@@ -269,6 +275,10 @@ mk_pseudo_ret() -> #pseudo_ret{}.
mk_pseudo_set(Imm, Dst) -> #pseudo_set{imm=Imm, dst=Dst}.
+mk_pseudo_spill_move(Src, Temp, Dst) ->
+ #pseudo_spill_move{src=Src, temp=Temp, dst=Dst}.
+is_pseudo_spill_move(I) -> is_record(I, pseudo_spill_move).
+
mk_pseudo_tailcall(FunV, Arity, StkArgs, Linkage) ->
#pseudo_tailcall{funv=FunV, arity=Arity, stkargs=StkArgs, linkage=Linkage}.
pseudo_tailcall_funv(#pseudo_tailcall{funv=FunV}) -> FunV.
@@ -375,6 +385,10 @@ is_pseudo_fmove(I) -> case I of #pseudo_fmove{} -> true; _ -> false end.
pseudo_fmove_src(#pseudo_fmove{src=Src}) -> Src.
pseudo_fmove_dst(#pseudo_fmove{dst=Dst}) -> Dst.
+mk_pseudo_spill_fmove(Src, Temp, Dst) ->
+ #pseudo_spill_fmove{src=Src, temp=Temp, dst=Dst}.
+is_pseudo_spill_fmove(I) -> is_record(I, pseudo_spill_fmove).
+
mk_pseudo_fstore(Src, Base, Disp) ->
#pseudo_fstore{src=Src, base=Base, disp=Disp}.
diff --git a/lib/hipe/sparc/hipe_sparc.hrl b/lib/hipe/sparc/hipe_sparc.hrl
index 4eae6777a9..f60e516e59 100644
--- a/lib/hipe/sparc/hipe_sparc.hrl
+++ b/lib/hipe/sparc/hipe_sparc.hrl
@@ -88,6 +88,8 @@
-record(pseudo_move, {src, dst}).
-record(pseudo_ret, {}).
-record(pseudo_set, {imm, dst}).
+-record(pseudo_spill_fmove, {src, temp, dst}).
+-record(pseudo_spill_move, {src, temp, dst}).
-record(pseudo_tailcall, {funv, arity, stkargs, linkage}).
-record(pseudo_tailcall_prepare, {}).
-record(rdy, {dst}).
diff --git a/lib/hipe/sparc/hipe_sparc_assemble.erl b/lib/hipe/sparc/hipe_sparc_assemble.erl
index 08bd47c4d2..2b82f41d23 100644
--- a/lib/hipe/sparc/hipe_sparc_assemble.erl
+++ b/lib/hipe/sparc/hipe_sparc_assemble.erl
@@ -32,7 +32,7 @@ assemble(CompiledCode, Closures, Exports, Options) ->
|| {MFA, Defun} <- CompiledCode],
%%
{ConstAlign,ConstSize,ConstMap,RefsFromConsts} =
- hipe_pack_constants:pack_constants(Code, 4),
+ hipe_pack_constants:pack_constants(Code),
%%
{CodeSize,CodeBinary,AccRefs,LabelMap,ExportMap} =
encode(translate(Code, ConstMap), Options),
diff --git a/lib/hipe/sparc/hipe_sparc_cfg.erl b/lib/hipe/sparc/hipe_sparc_cfg.erl
index 27374d187b..45c8e887b5 100644
--- a/lib/hipe/sparc/hipe_sparc_cfg.erl
+++ b/lib/hipe/sparc/hipe_sparc_cfg.erl
@@ -23,6 +23,7 @@
-export([linearise/1]).
-export([params/1]).
-export([arity/1]). % for linear scan
+-export([redirect_jmp/3, branch_preds/1]).
-define(SPARC_CFG, true). % needed for cfg.inc
@@ -77,28 +78,53 @@ branch_successors(Branch) ->
#pseudo_tailcall{} -> []
end.
+branch_preds(Branch) ->
+ case Branch of
+ #jmp{labels=Labels} ->
+ Prob = 1.0/length(Labels),
+ [{L, Prob} || L <- Labels];
+ #pseudo_bp{true_label=TrueLab,false_label=FalseLab,pred=Pred} ->
+ [{FalseLab, 1.0-Pred}, {TrueLab, Pred}];
+ #pseudo_call{contlab=ContLab, sdesc=#sparc_sdesc{exnlab=[]}} ->
+ %% A function can still cause an exception, even if we won't catch it
+ [{ContLab, 1.0-hipe_bb_weights:call_exn_pred()}];
+ #pseudo_call{contlab=ContLab, sdesc=#sparc_sdesc{exnlab=ExnLab}} ->
+ CallExnPred = hipe_bb_weights:call_exn_pred(),
+ [{ContLab, 1.0-CallExnPred}, {ExnLab, CallExnPred}];
+ _ ->
+ case branch_successors(Branch) of
+ [] -> [];
+ [Single] -> [{Single, 1.0}]
+ end
+ end.
+
-ifdef(REMOVE_TRIVIAL_BBS_NEEDED).
fails_to(_Instr) -> [].
-endif.
--ifdef(notdef).
redirect_jmp(I, Old, New) ->
case I of
- #b_label{label=Label} ->
- if Old =:= Label -> I#b_label{label=New};
+ #bp{'cond'='a',label=Label} ->
+ if Old =:= Label -> I#bp{label=New};
true -> I
end;
- #pseudo_bc{true_label=TrueLab, false_label=FalseLab} ->
- I1 = if Old =:= TrueLab -> I#pseudo_bc{true_label=New};
+ #pseudo_bp{true_label=TrueLab, false_label=FalseLab} ->
+ I1 = if Old =:= TrueLab -> I#pseudo_bp{true_label=New};
true -> I
end,
- if Old =:= FalseLab -> I1#pseudo_bc{false_label=New};
+ if Old =:= FalseLab -> I1#pseudo_bp{false_label=New};
true -> I1
end;
- %% handle pseudo_call too?
- _ -> I
+ #pseudo_call{contlab=ContLab0, sdesc=SDesc0} ->
+ SDesc = case SDesc0 of
+ #sparc_sdesc{exnlab=Old} -> SDesc0#sparc_sdesc{exnlab=New};
+ #sparc_sdesc{exnlab=_} -> SDesc0
+ end,
+ ContLab = if Old =:= ContLab0 -> New;
+ true -> ContLab0
+ end,
+ I#pseudo_call{sdesc=SDesc, contlab=ContLab}
end.
--endif.
mk_goto(Label) ->
hipe_sparc:mk_b_label(Label).
diff --git a/lib/hipe/sparc/hipe_sparc_defuse.erl b/lib/hipe/sparc/hipe_sparc_defuse.erl
index cb75f82e2b..4d4b11e301 100644
--- a/lib/hipe/sparc/hipe_sparc_defuse.erl
+++ b/lib/hipe/sparc/hipe_sparc_defuse.erl
@@ -39,6 +39,7 @@ insn_def_gpr(I) ->
#pseudo_call{} -> call_clobbered_gpr();
#pseudo_move{dst=Dst} -> [Dst];
#pseudo_set{dst=Dst} -> [Dst];
+ #pseudo_spill_move{temp=Temp, dst=Dst} -> [Temp, Dst];
#pseudo_tailcall_prepare{} -> tailcall_clobbered_gpr();
#rdy{dst=Dst} -> [Dst];
#sethi{dst=Dst} -> [Dst];
@@ -72,6 +73,7 @@ insn_use_gpr(I) ->
funv_use(FunV, arity_use_gpr(Arity));
#pseudo_move{src=Src} -> [Src];
#pseudo_ret{} -> [hipe_sparc:mk_rv()];
+ #pseudo_spill_move{src=Src} -> [Src];
#pseudo_tailcall{funv=FunV,arity=Arity,stkargs=StkArgs} ->
addsrcs(StkArgs, addtemps(tailcall_clobbered_gpr(), funv_use(FunV, arity_use_gpr(Arity))));
#store{src=Src,base=Base,disp=Disp} ->
@@ -112,6 +114,7 @@ insn_def_fpr(I) ->
#fp_unary{dst=Dst} -> [Dst];
#pseudo_fload{dst=Dst} -> [Dst];
#pseudo_fmove{dst=Dst} -> [Dst];
+ #pseudo_spill_fmove{temp=Temp, dst=Dst} -> [Temp, Dst];
_ -> []
end.
@@ -130,6 +133,7 @@ insn_use_fpr(I) ->
#fp_unary{src=Src} -> [Src];
#pseudo_fmove{src=Src} -> [Src];
#pseudo_fstore{src=Src} -> [Src];
+ #pseudo_spill_fmove{src=Src} -> [Src];
_ -> []
end.
diff --git a/lib/hipe/sparc/hipe_sparc_frame.erl b/lib/hipe/sparc/hipe_sparc_frame.erl
index 6f29c3c905..1f2a259ca1 100644
--- a/lib/hipe/sparc/hipe_sparc_frame.erl
+++ b/lib/hipe/sparc/hipe_sparc_frame.erl
@@ -82,6 +82,10 @@ do_insn(I, LiveOut, Context, FPoff) ->
{do_pseudo_tailcall(I, Context), context_framesize(Context)};
#pseudo_fmove{} ->
{do_pseudo_fmove(I, Context, FPoff), FPoff};
+ #pseudo_spill_move{} ->
+ {do_pseudo_spill_move(I, Context, FPoff), FPoff};
+ #pseudo_spill_fmove{} ->
+ {do_pseudo_spill_fmove(I, Context, FPoff), FPoff};
_ ->
{[I], FPoff}
end.
@@ -110,6 +114,22 @@ do_pseudo_move(I, Context, FPoff) ->
end
end.
+do_pseudo_spill_move(I, Context, FPoff) ->
+ #pseudo_spill_move{src=Src,temp=Temp,dst=Dst} = I,
+ case temp_is_pseudo(Src) andalso temp_is_pseudo(Dst) of
+ false -> % Register allocator changed its mind, turn back to move
+ do_pseudo_move(hipe_sparc:mk_pseudo_move(Src, Dst), Context, FPoff);
+ true ->
+ SrcOffset = pseudo_offset(Src, FPoff, Context),
+ DstOffset = pseudo_offset(Dst, FPoff, Context),
+ case SrcOffset =:= DstOffset of
+ true -> []; % omit move-to-self
+ false ->
+ mk_load(hipe_sparc:mk_sp(), SrcOffset, Temp,
+ mk_store(Temp, hipe_sparc:mk_sp(), DstOffset, []))
+ end
+ end.
+
do_pseudo_fmove(I, Context, FPoff) ->
Dst = hipe_sparc:pseudo_fmove_dst(I),
Src = hipe_sparc:pseudo_fmove_src(I),
@@ -127,6 +147,22 @@ do_pseudo_fmove(I, Context, FPoff) ->
end
end.
+do_pseudo_spill_fmove(I, Context, FPoff) ->
+ #pseudo_spill_fmove{src=Src,temp=Temp,dst=Dst} = I,
+ case temp_is_pseudo(Src) andalso temp_is_pseudo(Dst) of
+ false -> % Register allocator changed its mind, turn back to fmove
+ do_pseudo_fmove(hipe_sparc:mk_pseudo_fmove(Src, Dst), Context, FPoff);
+ true ->
+ SrcOffset = pseudo_offset(Src, FPoff, Context),
+ DstOffset = pseudo_offset(Dst, FPoff, Context),
+ case SrcOffset =:= DstOffset of
+ true -> []; % omit move-to-self
+ false ->
+ mk_fload(hipe_sparc:mk_sp(), SrcOffset, Temp)
+ ++ mk_fstore(Temp, hipe_sparc:mk_sp(), DstOffset)
+ end
+ end.
+
pseudo_offset(Temp, FPoff, Context) ->
FPoff + context_offset(Context, Temp).
diff --git a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
index 5fdb73e197..a724821992 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_finalise.erl
@@ -38,6 +38,7 @@ ra_insn(I, Map, FPMap) ->
#pseudo_call{} -> ra_pseudo_call(I, Map);
#pseudo_move{} -> ra_pseudo_move(I, Map);
#pseudo_set{} -> ra_pseudo_set(I, Map);
+ #pseudo_spill_move{} -> ra_pseudo_spill_move(I, Map);
#pseudo_tailcall{} -> ra_pseudo_tailcall(I, Map);
#rdy{} -> ra_rdy(I, Map);
#sethi{} -> ra_sethi(I, Map);
@@ -47,6 +48,7 @@ ra_insn(I, Map, FPMap) ->
#pseudo_fload{} -> ra_pseudo_fload(I, Map, FPMap);
#pseudo_fmove{} -> ra_pseudo_fmove(I, FPMap);
#pseudo_fstore{} -> ra_pseudo_fstore(I, Map, FPMap);
+ #pseudo_spill_fmove{} -> ra_pseudo_spill_fmove(I, FPMap);
_ -> I
end.
@@ -80,6 +82,12 @@ ra_pseudo_set(I=#pseudo_set{dst=Dst}, Map) ->
NewDst = ra_temp(Dst, Map),
I#pseudo_set{dst=NewDst}.
+ra_pseudo_spill_move(I=#pseudo_spill_move{src=Src,temp=Temp,dst=Dst}, Map) ->
+ NewSrc = ra_temp(Src, Map),
+ NewTemp = ra_temp(Temp, Map),
+ NewDst = ra_temp(Dst, Map),
+ I#pseudo_spill_move{src=NewSrc,temp=NewTemp,dst=NewDst}.
+
ra_pseudo_tailcall(I=#pseudo_tailcall{funv=FunV,stkargs=StkArgs}, Map) ->
NewFunV = ra_funv(FunV, Map),
NewStkArgs = ra_args(StkArgs, Map),
@@ -120,6 +128,13 @@ ra_pseudo_fmove(I=#pseudo_fmove{src=Src,dst=Dst}, FPMap) ->
NewDst = ra_temp_fp(Dst, FPMap),
I#pseudo_fmove{src=NewSrc,dst=NewDst}.
+ra_pseudo_spill_fmove(I=#pseudo_spill_fmove{src=Src,temp=Temp,dst=Dst},
+ FPMap) ->
+ NewSrc = ra_temp_fp(Src, FPMap),
+ NewTemp = ra_temp_fp(Temp, FPMap),
+ NewDst = ra_temp_fp(Dst, FPMap),
+ I#pseudo_spill_fmove{src=NewSrc,temp=NewTemp,dst=NewDst}.
+
ra_pseudo_fstore(I=#pseudo_fstore{src=Src,base=Base}, Map, FPMap) ->
NewSrc = ra_temp_fp(Src, FPMap),
NewBase = ra_temp(Base, Map),
diff --git a/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl b/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
index 984c97fbd4..d3ecb43ec6 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_postconditions.erl
@@ -54,6 +54,7 @@ do_insn(I, TempMap, Strategy) ->
#pseudo_call{} -> do_pseudo_call(I, TempMap, Strategy);
#pseudo_move{} -> do_pseudo_move(I, TempMap, Strategy);
#pseudo_set{} -> do_pseudo_set(I, TempMap, Strategy);
+ #pseudo_spill_move{} -> do_pseudo_spill_move(I, TempMap, Strategy);
#pseudo_tailcall{} -> do_pseudo_tailcall(I, TempMap, Strategy);
#rdy{} -> do_rdy(I, TempMap, Strategy);
#sethi{} -> do_sethi(I, TempMap, Strategy);
@@ -92,14 +93,16 @@ do_pseudo_call(I=#pseudo_call{funv=FunV}, TempMap, Strategy) ->
do_pseudo_move(I=#pseudo_move{src=Src,dst=Dst}, TempMap, Strategy) ->
%% Either Dst or Src (but not both) may be a pseudo temp.
- %% pseudo_move is a special case: in [XXX: not pseudo_tailcall]
- %% all other instructions, all temps must be non-pseudos
- %% after register allocation.
- case temp_is_spilled(Dst, TempMap) of
- true -> % Src must not be a pseudo
- {FixSrc,NewSrc,DidSpill} = fix_src1(Src, TempMap, Strategy),
- NewI = I#pseudo_move{src=NewSrc},
- {FixSrc ++ [NewI], DidSpill};
+ %% pseudo_move and pseudo_spill_move [XXX: not pseudo_tailcall]
+ %% are special cases: in all other instructions, all temps must
+ %% be non-pseudos after register allocation.
+ case temp_is_spilled(Src, TempMap)
+ andalso temp_is_spilled(Dst, TempMap)
+ of
+ true -> % Turn into pseudo_spill_move
+ Temp = clone(Src, temp1(Strategy)),
+ NewI = #pseudo_spill_move{src=Src,temp=Temp,dst=Dst},
+ {[NewI], true};
_ ->
{[I], false}
end.
@@ -109,6 +112,11 @@ do_pseudo_set(I=#pseudo_set{dst=Dst}, TempMap, Strategy) ->
NewI = I#pseudo_set{dst=NewDst},
{[NewI | FixDst], DidSpill}.
+do_pseudo_spill_move(I=#pseudo_spill_move{temp=Temp}, TempMap, _Strategy) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = temp_is_spilled(Temp, TempMap),
+ {[I], false}.
+
do_pseudo_tailcall(I=#pseudo_tailcall{funv=FunV}, TempMap, Strategy) ->
{FixFunV,NewFunV,DidSpill} = fix_funv(FunV, TempMap, Strategy),
NewI = I#pseudo_tailcall{funv=NewFunV},
diff --git a/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl b/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
index 751e91425c..5fa3a5fc59 100644
--- a/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
+++ b/lib/hipe/sparc/hipe_sparc_ra_postconditions_fp.erl
@@ -43,6 +43,7 @@ do_insn(I, TempMap) ->
#pseudo_fload{} -> do_pseudo_fload(I, TempMap);
#pseudo_fmove{} -> do_pseudo_fmove(I, TempMap);
#pseudo_fstore{} -> do_pseudo_fstore(I, TempMap);
+ #pseudo_spill_fmove{} -> do_pseudo_spill_fmove(I, TempMap);
_ -> {[I], false}
end.
@@ -67,11 +68,13 @@ do_pseudo_fload(I=#pseudo_fload{dst=Dst}, TempMap) ->
{[NewI | FixDst], DidSpill}.
do_pseudo_fmove(I=#pseudo_fmove{src=Src,dst=Dst}, TempMap) ->
- case temp_is_spilled(Dst, TempMap) of
- true ->
- {FixSrc,NewSrc,DidSpill} = fix_src(Src, TempMap),
- NewI = I#pseudo_fmove{src=NewSrc},
- {FixSrc ++ [NewI], DidSpill};
+ case temp_is_spilled(Src, TempMap)
+ andalso temp_is_spilled(Dst, TempMap)
+ of
+ true -> % Turn into pseudo_spill_fmove
+ Temp = clone(Src),
+ NewI = #pseudo_spill_fmove{src=Src,temp=Temp,dst=Dst},
+ {[NewI], true};
_ ->
{[I], false}
end.
@@ -81,6 +84,11 @@ do_pseudo_fstore(I=#pseudo_fstore{src=Src}, TempMap) ->
NewI = I#pseudo_fstore{src=NewSrc},
{FixSrc ++ [NewI], DidSpill}.
+do_pseudo_spill_fmove(I=#pseudo_spill_fmove{temp=Temp}, TempMap) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = temp_is_spilled(Temp, TempMap),
+ {[I], false}.
+
%%% Fix Dst and Src operands.
fix_src(Src, TempMap) ->
diff --git a/lib/hipe/sparc/hipe_sparc_subst.erl b/lib/hipe/sparc/hipe_sparc_subst.erl
index 1d0671464e..ce3bbb813a 100644
--- a/lib/hipe/sparc/hipe_sparc_subst.erl
+++ b/lib/hipe/sparc/hipe_sparc_subst.erl
@@ -44,6 +44,8 @@ insn_temps(T, I) ->
#pseudo_move{src=S,dst=D} -> I#pseudo_move{src=T(S),dst=T(D)};
#pseudo_ret{} -> I;
#pseudo_set{dst=D}-> I#pseudo_set{dst=T(D)};
+ #pseudo_spill_move{src=S,temp=U,dst=D} ->
+ I#pseudo_spill_move{src=T(S),temp=T(U),dst=T(D)};
#pseudo_tailcall{funv=F,stkargs=Stk} ->
I#pseudo_tailcall{funv=funv_temps(T,F),stkargs=lists:map(Arg,Stk)};
#pseudo_tailcall_prepare{} -> I;
@@ -57,7 +59,9 @@ insn_temps(T, I) ->
I#pseudo_fload{base=T(B),disp=S2(Di),dst=T(Ds)};
#pseudo_fmove{src=S,dst=D} -> I#pseudo_fmove{src=T(S),dst=T(D)};
#pseudo_fstore{src=S,base=B,disp=D} ->
- I#pseudo_fstore{src=T(S),base=T(B),disp=S2(D)}
+ I#pseudo_fstore{src=T(S),base=T(B),disp=S2(D)};
+ #pseudo_spill_fmove{src=S,temp=U,dst=D} ->
+ I#pseudo_spill_fmove{src=T(S),temp=T(U),dst=T(D)}
end.
-spec src2_temps(subst_fun(), src2()) -> src2().
diff --git a/lib/hipe/test/basic_SUITE_data/basic_bugs_hipe.erl b/lib/hipe/test/basic_SUITE_data/basic_bugs_hipe.erl
index caa0e71d0b..430e097b91 100644
--- a/lib/hipe/test/basic_SUITE_data/basic_bugs_hipe.erl
+++ b/lib/hipe/test/basic_SUITE_data/basic_bugs_hipe.erl
@@ -18,6 +18,7 @@ test() ->
ok = test_R12B5_seg_fault(),
ok = test_switch_neg_int(),
ok = test_icode_range_anal(),
+ ok = test_icode_range_call(),
ok.
%%-----------------------------------------------------------------------
@@ -461,3 +462,44 @@ g(X, Z) ->
test -> non_zero_test;
other -> other
end.
+
+%%-----------------------------------------------------------------------
+%% From: Rich Neswold
+%% Date: Oct 5, 2016
+%%
+%% The following was a bug in the HiPE compiler's range analysis. The
+%% function range_client/2 below would would not stop when N reached 0,
+%% but keep recursing into the second clause forever.
+%%
+%% The problem turned out to be in hipe_icode_range:analyse_call/2,
+%% which would note update the argument ranges of the callee if the
+%% result of the call was ignored.
+%% -----------------------------------------------------------------------
+-define(TIMEOUT, 42).
+
+test_icode_range_call() ->
+ Self = self(),
+ Client = spawn_link(fun() -> range_client(Self, 4) end),
+ range_server(4, Client).
+
+range_server(0, _Client) ->
+ receive
+ stopping -> ok;
+ {called_with, 0} -> error(failure)
+ after ?TIMEOUT -> error(timeout)
+ end;
+range_server(N, Client) ->
+ receive
+ {called_with, N} ->
+ Client ! proceed
+ after ?TIMEOUT -> error(timeout)
+ end,
+ range_server(N-1, Client). % tailcall (so the bug does not affect it)
+
+range_client(Server, 0) ->
+ Server ! stopping;
+range_client(Server, N) ->
+ Server ! {called_with, N},
+ receive proceed -> ok end,
+ range_client(Server, N - 1), % non-tailrecursive call with ignored result
+ ok.
diff --git a/lib/hipe/test/basic_SUITE_data/basic_edge_cases.erl b/lib/hipe/test/basic_SUITE_data/basic_edge_cases.erl
new file mode 100644
index 0000000000..9bf5cf52cd
--- /dev/null
+++ b/lib/hipe/test/basic_SUITE_data/basic_edge_cases.erl
@@ -0,0 +1,142 @@
+%%% -*- erlang-indent-level: 2 -*-
+%%%----------------------------------------------------------------------
+%%% Contains
+%%%----------------------------------------------------------------------
+-module(basic_edge_cases).
+
+-export([test/0]).
+
+test() ->
+ ok = test_float_spills(),
+ ok = test_infinite_loops(),
+ ok.
+
+%% Contains more float temps live at a single point than there are float
+%% registers in any backend
+
+test_float_spills() ->
+ {{{2942.0,4670.0,3198.0,4926.0,2206.0,4734.0},
+ {3118.0,2062.0,5174.0,3038.0,3618.0,3014.0},
+ {2542.0,2062.0,4934.0,2590.0,3098.0,3062.0},
+ {2950.0,3666.0,2574.0,5038.0,1866.0,2946.0},
+ {3126.0,3050.0,3054.0,5070.0,2258.0,2714.0},
+ {4734.0,2206.0,4926.0,3198.0,4670.0,2942.0}},
+ 58937.0} =
+ mat66_flip_sum(35.0,86.0,32.0,88.0,33.0,57.0,
+ 22.0,77.0,91.0,80.0,14.0,33.0,
+ 51.0,28.0,87.0,20.0,91.0,11.0,
+ 68.0,83.0,64.0,82.0,10.0,86.0,
+ 74.0,18.0,08.0,52.0,10.0,14.0,
+ 89.0,34.0,64.0,66.0,58.0,55.0,
+ 0.0, 5),
+ ok.
+
+mat66_flip_sum(M11, M12, M13, M14, M15, M16,
+ M21, M22, M23, M24, M25, M26,
+ M31, M32, M33, M34, M35, M36,
+ M41, M42, M43, M44, M45, M46,
+ M51, M52, M53, M54, M55, M56,
+ M61, M62, M63, M64, M65, M66,
+ Acc, Ctr)
+ when is_float(M11), is_float(M12), is_float(M13),
+ is_float(M14), is_float(M15), is_float(M16),
+ is_float(M21), is_float(M22), is_float(M23),
+ is_float(M24), is_float(M25), is_float(M26),
+ is_float(M31), is_float(M32), is_float(M33),
+ is_float(M34), is_float(M35), is_float(M36),
+ is_float(M41), is_float(M42), is_float(M43),
+ is_float(M44), is_float(M45), is_float(M46),
+ is_float(M51), is_float(M52), is_float(M53),
+ is_float(M54), is_float(M55), is_float(M56),
+ is_float(M61), is_float(M62), is_float(M63),
+ is_float(M64), is_float(M65), is_float(M66),
+ is_float(Acc) ->
+ R11 = M66+M11, R12 = M65+M12, R13 = M64+M13,
+ R14 = M63+M14, R15 = M62+M15, R16 = M61+M16,
+ R21 = M56+M21, R22 = M55+M22, R23 = M54+M23,
+ R24 = M53+M24, R25 = M52+M25, R26 = M51+M26,
+ R31 = M46+M31, R32 = M45+M32, R33 = M44+M33,
+ R34 = M43+M34, R35 = M42+M35, R36 = M41+M36,
+ R41 = M26+M41, R42 = M25+M42, R43 = M24+M43,
+ R44 = M23+M44, R45 = M22+M45, R46 = M21+M46,
+ R51 = M36+M51, R52 = M35+M52, R53 = M34+M53,
+ R54 = M33+M54, R55 = M32+M55, R56 = M31+M56,
+ R61 = M16+M61, R62 = M15+M62, R63 = M14+M63,
+ R64 = M13+M64, R65 = M12+M65, R66 = M11+M66,
+ case Ctr of
+ 0 ->
+ {{{R11, R12, R13, R14, R15, R16},
+ {R21, R22, R23, R24, R25, R26},
+ {R31, R32, R33, R34, R35, R36},
+ {R41, R42, R43, R44, R45, R46},
+ {R51, R52, R53, R54, R55, R56},
+ {R61, R62, R63, R64, R65, R66}},
+ Acc};
+ _ ->
+ NewAcc = 0.0 + M11 + M12 + M13 + M14 + M15 + M16 +
+ + M21 + M22 + M23 + M24 + M25 + M26
+ + M31 + M32 + M33 + M34 + M35 + M36
+ + M41 + M42 + M43 + M44 + M45 + M46
+ + M51 + M52 + M53 + M54 + M55 + M56
+ + M61 + M62 + M63 + M64 + M65 + M66
+ + Acc,
+ mat66_flip_sum(R11+1.0, R12+1.0, R13+1.0, R14+1.0, R15+1.0, R16+1.0,
+ R21+1.0, R22+1.0, R23+1.0, R24+1.0, R25+1.0, R26+1.0,
+ R31+1.0, R32+1.0, R33+1.0, R34+1.0, R35+1.0, R36+1.0,
+ R41+1.0, R42+1.0, R43+1.0, R44+1.0, R45+1.0, R46+1.0,
+ R51+1.0, R52+1.0, R53+1.0, R54+1.0, R55+1.0, R56+1.0,
+ R61+1.0, R62+1.0, R63+1.0, R64+1.0, R65+1.0, R66+1.0,
+ NewAcc, Ctr-1)
+ end.
+
+%% Infinite loops must receive reduction tests, and might trip up basic block
+%% weighting, leading to infinite weights and/or divisions by zero.
+
+test_infinite_loops() ->
+ OldTrapExit = process_flag(trap_exit, true),
+ ok = test_infinite_loop(fun infinite_recursion/0),
+ ok = test_infinite_loop(fun infinite_corecursion/0),
+ RecursiveFun = fun RecursiveFun() -> RecursiveFun() end,
+ ok = test_infinite_loop(RecursiveFun),
+ CorecursiveFunA = fun CorecursiveFunA() ->
+ CorecursiveFunA1 = fun () -> CorecursiveFunA() end,
+ CorecursiveFunA1()
+ end,
+ ok = test_infinite_loop(CorecursiveFunA),
+ CorecursiveFunB1 = fun(CorecursiveFunB) -> CorecursiveFunB() end,
+ CorecursiveFunB = fun CorecursiveFunB() ->
+ CorecursiveFunB1(CorecursiveFunB)
+ end,
+ ok = test_infinite_loop(CorecursiveFunB),
+ CorecursiveFunC1 = fun CorecursiveFunC1(Other) ->
+ Other(CorecursiveFunC1)
+ end,
+ CorecursiveFunC = fun CorecursiveFunC(Other) ->
+ Other(CorecursiveFunC)
+ end,
+ ok = test_infinite_loop(fun() -> CorecursiveFunC(CorecursiveFunC1) end),
+ ok = test_infinite_loop(fun() -> CorecursiveFunC(CorecursiveFunC) end),
+ true = process_flag(trap_exit, OldTrapExit),
+ ok.
+
+-define(INFINITE_LOOP_TIMEOUT, 100).
+test_infinite_loop(Fun) ->
+ Tester = spawn_link(Fun),
+ kill_soon(Tester),
+ receive {'EXIT', Tester, awake} ->
+ undefined = process_info(Tester),
+ ok
+ after ?INFINITE_LOOP_TIMEOUT -> error(timeout)
+ end.
+
+infinite_recursion() -> infinite_recursion().
+
+infinite_corecursion() -> infinite_corecursion_1().
+infinite_corecursion_1() -> infinite_corecursion().
+
+kill_soon(Pid) ->
+ _ = spawn_link(fun() ->
+ timer:sleep(1),
+ erlang:exit(Pid, awake)
+ end),
+ ok.
diff --git a/lib/hipe/test/basic_SUITE_data/basic_tuples.erl b/lib/hipe/test/basic_SUITE_data/basic_tuples.erl
index 94c187e364..96e39d565a 100644
--- a/lib/hipe/test/basic_SUITE_data/basic_tuples.erl
+++ b/lib/hipe/test/basic_SUITE_data/basic_tuples.erl
@@ -55,6 +55,8 @@ test_element(T0, T1, T2, N) ->
List = lists:seq(1, N),
Tuple = list_to_tuple(List),
ok = get_elements(List, Tuple, 1),
+ %% element/2 of larger tuple with omitted bounds test
+ true = lists:all(fun(I) -> I * I =:= square(I) end, lists:seq(1, 20)),
%% some cases that throw exceptions
{'EXIT', _} = (catch my_element(0, T2)),
{'EXIT', _} = (catch my_element(3, T2)),
@@ -73,6 +75,18 @@ get_elements([Element|Rest], Tuple, Pos) ->
get_elements([], _Tuple, _Pos) ->
ok.
+squares() ->
+ {1*1, 2*2, 3*3, 4*4, 5*5, 6*6, 7*7, 8*8, 9*9, 10*10,
+ 11*11, 12*12, 13*13, 14*14, 15*15, 16*16, 17*17, 18*18, 19*19, 20*20}.
+
+square(N) when is_integer(N), N >= 1, N =< 20 ->
+ %% The guard tests lets the range analysis conclude N to be an integer in the
+ %% 1..20 range. 20-1=19 is bigger than ?SET_LIMIT in erl_types.erl, and will
+ %% thus be represented by an ?int_range() rather than an ?int_set().
+ %% Because of the range analysis, the bounds test of this element/2 call
+ %% should be omitted.
+ element(N, squares()).
+
%%--------------------------------------------------------------------
%% Tests set_element/3.
diff --git a/lib/hipe/util/Makefile b/lib/hipe/util/Makefile
index 04de7f7823..eeb81ac482 100644
--- a/lib/hipe/util/Makefile
+++ b/lib/hipe/util/Makefile
@@ -48,7 +48,7 @@ HIPE_MODULES = hipe_vectors
else
HIPE_MODULES =
endif
-MODULES = hipe_timing hipe_dot hipe_digraph $(HIPE_MODULES)
+MODULES = hipe_timing hipe_dot hipe_digraph hipe_dsets $(HIPE_MODULES)
HRL_FILES=
ERL_FILES= $(MODULES:%=%.erl)
diff --git a/lib/hipe/util/hipe_dsets.erl b/lib/hipe/util/hipe_dsets.erl
new file mode 100644
index 0000000000..9492cab0ff
--- /dev/null
+++ b/lib/hipe/util/hipe_dsets.erl
@@ -0,0 +1,84 @@
+%% -*- erlang-indent-level: 2 -*-
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%@doc
+%% IMMUTABLE DISJOINT SETS OF ARBITRARY TERMS
+%%
+%% The disjoint set forests data structure, for elements of arbitrary types.
+%% Note that the find operation mutates the set.
+%%
+%% We could do this more efficiently if we restricted the elements to integers,
+%% and used the (mutable) hipe arrays. For arbitrary terms ETS could be used,
+%% for a persistent interface (which isn't that nice when even accessors return
+%% modified copies), the array module could be used.
+-module(hipe_dsets).
+
+-export([new/1, find/2, union/3, to_map/1, to_rllist/1]).
+-export_type([dsets/1]).
+
+-opaque dsets(X) :: #{X => {node, X} | {root, non_neg_integer()}}.
+
+-spec new([E]) -> dsets(E).
+new(Elems) -> maps:from_list([{E,{root,0}} || E <- Elems]).
+
+-spec find(E, dsets(E)) -> {E, dsets(E)}.
+find(E, DS0) ->
+ case DS0 of
+ #{E := {root,_}} -> {E, DS0};
+ #{E := {node,N}} ->
+ case find(N, DS0) of
+ {N, _}=T -> T;
+ {R, DS1} -> {R, DS1#{E := {node,R}}}
+ end;
+ _ -> error(badarg, [E, DS0])
+ end.
+
+-spec union(E, E, dsets(E)) -> dsets(E).
+union(X, Y, DS0) ->
+ {XRoot, DS1} = find(X, DS0),
+ case find(Y, DS1) of
+ {XRoot, DS2} -> DS2;
+ {YRoot, DS2} ->
+ #{XRoot := {root,XRR}, YRoot := {root,YRR}} = DS2,
+ if XRR < YRR -> DS2#{XRoot := {node,YRoot}};
+ XRR > YRR -> DS2#{YRoot := {node,XRoot}};
+ true -> DS2#{YRoot := {node,XRoot}, XRoot := {root,XRR+1}}
+ end
+ end.
+
+-spec to_map(dsets(E)) -> {#{Elem::E => Root::E}, dsets(E)}.
+to_map(DS) ->
+ to_map(maps:keys(DS), DS, #{}).
+
+to_map([], DS, Acc) -> {Acc, DS};
+to_map([K|Ks], DS0, Acc) ->
+ {KR, DS} = find(K, DS0),
+ to_map(Ks, DS, Acc#{K => KR}).
+
+-spec to_rllist(dsets(E)) -> {[{Root::E, Elems::[E]}], dsets(E)}.
+to_rllist(DS0) ->
+ {Lists, DS} = to_rllist(maps:keys(DS0), #{}, DS0),
+ {maps:to_list(Lists), DS}.
+
+to_rllist([], Acc, DS) -> {Acc, DS};
+to_rllist([E|Es], Acc, DS0) ->
+ {ERoot, DS} = find(E, DS0),
+ to_rllist(Es, map_append(ERoot, E, Acc), DS).
+
+map_append(Key, Elem, Map) ->
+ case Map of
+ #{Key := List} -> Map#{Key := [Elem|List]};
+ #{} -> Map#{Key => [Elem]}
+ end.
diff --git a/lib/hipe/util/hipe_vectors.erl b/lib/hipe/util/hipe_vectors.erl
index fc4e4edb24..788dacd11b 100644
--- a/lib/hipe/util/hipe_vectors.erl
+++ b/lib/hipe/util/hipe_vectors.erl
@@ -116,8 +116,7 @@ get(Vec, Ix) ->
%% ---------------------------------------------------------------------
-ifdef(USE_ARRAYS).
-%%-opaque vector(E) :: array:array(E).
--type vector(E) :: array:array(E). % Work around dialyzer bug
+-opaque vector(E) :: array:array(E).
new(N, V) -> array:new(N, {default, V}).
size(V) -> array:size(V).
diff --git a/lib/hipe/vsn.mk b/lib/hipe/vsn.mk
index cb4174381a..172d976931 100644
--- a/lib/hipe/vsn.mk
+++ b/lib/hipe/vsn.mk
@@ -1 +1 @@
-HIPE_VSN = 3.15.3
+HIPE_VSN = 3.15.4
diff --git a/lib/hipe/x86/hipe_rtl_to_x86.erl b/lib/hipe/x86/hipe_rtl_to_x86.erl
index 29cad6ca51..31e4f6e4ac 100644
--- a/lib/hipe/x86/hipe_rtl_to_x86.erl
+++ b/lib/hipe/x86/hipe_rtl_to_x86.erl
@@ -124,7 +124,6 @@ conv_insn(I, Map, Data) ->
hipe_rtl:call_continuation(I),
hipe_rtl:call_fail(I),
hipe_rtl:call_type(I)),
- %% XXX Fixme: this ++ is probably inefficient.
{FixArgs++I2, Map2, Data};
#comment{} ->
I2 = [hipe_x86:mk_comment(hipe_rtl:comment_text(I))],
diff --git a/lib/hipe/x86/hipe_x86.erl b/lib/hipe/x86/hipe_x86.erl
index cc1c75b04d..f514dd1ded 100644
--- a/lib/hipe/x86/hipe_x86.erl
+++ b/lib/hipe/x86/hipe_x86.erl
@@ -167,6 +167,12 @@
mk_pseudo_spill/1,
+ mk_pseudo_spill_fmove/3,
+ is_pseudo_spill_fmove/1,
+
+ mk_pseudo_spill_move/3,
+ is_pseudo_spill_move/1,
+
mk_pseudo_tailcall/4,
%% is_pseudo_tailcall/1,
pseudo_tailcall_fun/1,
@@ -425,6 +431,14 @@ mk_pseudo_jcc_simple(Cc, TrueLabel, FalseLabel, Pred) ->
mk_pseudo_spill(List) ->
#pseudo_spill{args=List}.
+mk_pseudo_spill_fmove(Src, Temp, Dst) ->
+ #pseudo_spill_fmove{src=Src, temp=Temp, dst=Dst}.
+is_pseudo_spill_fmove(I) -> is_record(I, pseudo_spill_fmove).
+
+mk_pseudo_spill_move(Src, Temp, Dst) ->
+ #pseudo_spill_move{src=Src, temp=Temp, dst=Dst}.
+is_pseudo_spill_move(I) -> is_record(I, pseudo_spill_move).
+
mk_pseudo_tailcall(Fun, Arity, StkArgs, Linkage) ->
check_linkage(Linkage),
#pseudo_tailcall{'fun'=Fun, arity=Arity, stkargs=StkArgs, linkage=Linkage}.
diff --git a/lib/hipe/x86/hipe_x86.hrl b/lib/hipe/x86/hipe_x86.hrl
index 567848bae5..6cd69905b2 100644
--- a/lib/hipe/x86/hipe_x86.hrl
+++ b/lib/hipe/x86/hipe_x86.hrl
@@ -91,6 +91,8 @@
-record(pseudo_call, {'fun', sdesc, contlab, linkage}).
-record(pseudo_jcc, {cc, true_label, false_label, pred}).
-record(pseudo_spill, {args=[]}).
+-record(pseudo_spill_move, {src, temp, dst}).
+-record(pseudo_spill_fmove, {src, temp, dst}).
-record(pseudo_tailcall, {'fun', arity, stkargs, linkage}).
-record(pseudo_tailcall_prepare, {}).
-record(push, {src}).
diff --git a/lib/hipe/x86/hipe_x86_assemble.erl b/lib/hipe/x86/hipe_x86_assemble.erl
index ef9c32ef41..50919bdf4e 100644
--- a/lib/hipe/x86/hipe_x86_assemble.erl
+++ b/lib/hipe/x86/hipe_x86_assemble.erl
@@ -63,7 +63,7 @@ assemble(CompiledCode, Closures, Exports, Options) ->
|| {MFA, Defun} <- CompiledCode],
%%
{ConstAlign,ConstSize,ConstMap,RefsFromConsts} =
- hipe_pack_constants:pack_constants(Code, ?HIPE_X86_REGISTERS:alignment()),
+ hipe_pack_constants:pack_constants(Code),
%%
{CodeSize,CodeBinary,AccRefs,LabelMap,ExportMap} =
encode(translate(Code, ConstMap, Options), Options),
@@ -148,6 +148,8 @@ insn_size(I) ->
translate_insn(I, Context, Options) ->
case I of
+ #alu{aluop='xor', src=#x86_temp{reg=Reg}=Src, dst=#x86_temp{reg=Reg}=Dst} ->
+ [{'xor', {temp_to_reg32(Dst), temp_to_rm32(Src)}, I}];
#alu{} ->
Arg = resolve_alu_args(hipe_x86:alu_src(I), hipe_x86:alu_dst(I), Context),
[{hipe_x86:alu_op(I), Arg, I}];
@@ -228,11 +230,11 @@ translate_insn(I, Context, Options) ->
#move64{} ->
translate_move64(I, Context);
#movsx{} ->
- Arg = resolve_movx_args(hipe_x86:movsx_src(I), hipe_x86:movsx_dst(I)),
- [{movsx, Arg, I}];
+ Src = resolve_movx_src(hipe_x86:movsx_src(I)),
+ [{movsx, {temp_to_regArch(hipe_x86:movsx_dst(I)), Src}, I}];
#movzx{} ->
- Arg = resolve_movx_args(hipe_x86:movzx_src(I), hipe_x86:movzx_dst(I)),
- [{movzx, Arg, I}];
+ Src = resolve_movx_src(hipe_x86:movzx_src(I)),
+ [{movzx, {temp_to_reg32(hipe_x86:movzx_dst(I)), Src}, I}];
%% pseudo_call: eliminated before assembly
%% pseudo_jcc: eliminated before assembly
%% pseudo_tailcall: eliminated before assembly
@@ -845,16 +847,15 @@ translate_move64(I, _Context) -> exit({?MODULE, I}).
-endif.
%%% mov{s,z}x
-resolve_movx_args(Src=#x86_mem{type=Type}, Dst=#x86_temp{}) ->
- {temp_to_regArch(Dst),
- case Type of
- byte ->
- mem_to_rm8(Src);
- int16 ->
- mem_to_rm16(Src);
- int32 ->
- mem_to_rm32(Src)
- end}.
+resolve_movx_src(Src=#x86_mem{type=Type}) ->
+ case Type of
+ byte ->
+ mem_to_rm8(Src);
+ int16 ->
+ mem_to_rm16(Src);
+ int32 ->
+ mem_to_rm32(Src)
+ end.
%%% alu/cmp (_not_ test)
resolve_alu_args(Src, Dst, Context) ->
diff --git a/lib/hipe/x86/hipe_x86_cfg.erl b/lib/hipe/x86/hipe_x86_cfg.erl
index a4544e1086..0a3c0fc9d6 100644
--- a/lib/hipe/x86/hipe_x86_cfg.erl
+++ b/lib/hipe/x86/hipe_x86_cfg.erl
@@ -19,7 +19,7 @@
succ/2, pred/2,
bb/2, bb_add/3, map_bbs/2, fold_bbs/3]).
-export([postorder/1, reverse_postorder/1]).
--export([linearise/1, params/1, arity/1, redirect_jmp/3]).
+-export([linearise/1, params/1, arity/1, redirect_jmp/3, branch_preds/1]).
%%% these tell cfg.inc what to define (ugly as hell)
-define(PRED_NEEDED,true).
@@ -72,6 +72,26 @@ branch_successors(Branch) ->
#ret{} -> []
end.
+branch_preds(Branch) ->
+ case Branch of
+ #jmp_switch{labels=Labels} ->
+ Prob = 1.0/length(Labels),
+ [{L, Prob} || L <- Labels];
+ #pseudo_call{contlab=ContLab, sdesc=#x86_sdesc{exnlab=[]}} ->
+ %% A function can still cause an exception, even if we won't catch it
+ [{ContLab, 1.0-hipe_bb_weights:call_exn_pred()}];
+ #pseudo_call{contlab=ContLab, sdesc=#x86_sdesc{exnlab=ExnLab}} ->
+ CallExnPred = hipe_bb_weights:call_exn_pred(),
+ [{ContLab, 1.0-CallExnPred}, {ExnLab, CallExnPred}];
+ #pseudo_jcc{true_label=TrueLab,false_label=FalseLab,pred=Pred} ->
+ [{FalseLab, 1.0-Pred}, {TrueLab, Pred}];
+ _ ->
+ case branch_successors(Branch) of
+ [] -> [];
+ [Single] -> [{Single, 1.0}]
+ end
+ end.
+
-ifdef(REMOVE_TRIVIAL_BBS_NEEDED).
fails_to(_Instr) -> [].
-endif.
diff --git a/lib/hipe/x86/hipe_x86_defuse.erl b/lib/hipe/x86/hipe_x86_defuse.erl
index 5d7fadf8e5..2731836dc1 100644
--- a/lib/hipe/x86/hipe_x86_defuse.erl
+++ b/lib/hipe/x86/hipe_x86_defuse.erl
@@ -51,6 +51,8 @@ insn_def(I) ->
#movzx{dst=Dst} -> dst_def(Dst);
#pseudo_call{} -> call_clobbered();
#pseudo_spill{} -> [];
+ #pseudo_spill_fmove{temp=Temp, dst=Dst} -> [Temp, Dst];
+ #pseudo_spill_move{temp=Temp, dst=Dst} -> [Temp, Dst];
#pseudo_tailcall_prepare{} -> tailcall_clobbered();
#shift{dst=Dst} -> dst_def(Dst);
%% call, cmp, comment, jcc, jmp_fun, jmp_label, jmp_switch, label
@@ -108,6 +110,8 @@ insn_use(I) ->
#pseudo_call{'fun'=Fun,sdesc=#x86_sdesc{arity=Arity}} ->
addtemp(Fun, arity_use(Arity));
#pseudo_spill{args=Args} -> Args;
+ #pseudo_spill_fmove{src=Src} -> [Src];
+ #pseudo_spill_move{src=Src} -> [Src];
#pseudo_tailcall{'fun'=Fun,arity=Arity,stkargs=StkArgs} ->
addtemp(Fun, addtemps(StkArgs, addtemps(tailcall_clobbered(),
arity_use(Arity))));
diff --git a/lib/hipe/x86/hipe_x86_frame.erl b/lib/hipe/x86/hipe_x86_frame.erl
index 3c2b67967a..558321d0c3 100644
--- a/lib/hipe/x86/hipe_x86_frame.erl
+++ b/lib/hipe/x86/hipe_x86_frame.erl
@@ -95,13 +95,17 @@ do_insn(I, LiveOut, Context, FPoff) ->
#imul{} ->
{[do_imul(I, Context, FPoff)], FPoff};
#move{} ->
- {[do_move(I, Context, FPoff)], FPoff};
+ {do_move(I, Context, FPoff), FPoff};
#movsx{} ->
{[do_movsx(I, Context, FPoff)], FPoff};
#movzx{} ->
{[do_movzx(I, Context, FPoff)], FPoff};
#pseudo_call{} ->
do_pseudo_call(I, LiveOut, Context, FPoff);
+ #pseudo_spill_fmove{} ->
+ {do_pseudo_spill_fmove(I, Context, FPoff), FPoff};
+ #pseudo_spill_move{} ->
+ {do_pseudo_spill_move(I, Context, FPoff), FPoff};
#pseudo_tailcall{} ->
{do_pseudo_tailcall(I, Context), context_framesize(Context)};
#push{} ->
@@ -144,22 +148,50 @@ do_fp_binop(I, Context, FPoff) ->
Dst = conv_opnd(Dst0, FPoff, Context),
[I#fp_binop{src=Src,dst=Dst}].
-do_fmove(I, Context, FPoff) ->
- #fmove{src=Src0,dst=Dst0} = I,
+do_fmove(I0, Context, FPoff) ->
+ #fmove{src=Src0,dst=Dst0} = I0,
Src = conv_opnd(Src0, FPoff, Context),
Dst = conv_opnd(Dst0, FPoff, Context),
- I#fmove{src=Src,dst=Dst}.
+ I = I0#fmove{src=Src,dst=Dst},
+ case Src =:= Dst of
+ true -> []; % omit move-to-self
+ false -> [I]
+ end.
+
+do_pseudo_spill_fmove(I0, Context, FPoff) ->
+ #pseudo_spill_fmove{src=Src0,temp=Temp0,dst=Dst0} = I0,
+ Src = conv_opnd(Src0, FPoff, Context),
+ Temp = conv_opnd(Temp0, FPoff, Context),
+ Dst = conv_opnd(Dst0, FPoff, Context),
+ case Src =:= Dst of
+ true -> []; % omit move-to-self
+ false -> [#fmove{src=Src, dst=Temp}, #fmove{src=Temp, dst=Dst}]
+ end.
do_imul(I, Context, FPoff) ->
#imul{src=Src0} = I,
Src = conv_opnd(Src0, FPoff, Context),
I#imul{src=Src}.
-do_move(I, Context, FPoff) ->
- #move{src=Src0,dst=Dst0} = I,
+do_move(I0, Context, FPoff) ->
+ #move{src=Src0,dst=Dst0} = I0,
Src = conv_opnd(Src0, FPoff, Context),
Dst = conv_opnd(Dst0, FPoff, Context),
- I#move{src=Src,dst=Dst}.
+ I = I0#move{src=Src,dst=Dst},
+ case Src =:= Dst of
+ true -> []; % omit move-to-self
+ false -> [I]
+ end.
+
+do_pseudo_spill_move(I0, Context, FPoff) ->
+ #pseudo_spill_move{src=Src0,temp=Temp0,dst=Dst0} = I0,
+ Src = conv_opnd(Src0, FPoff, Context),
+ Temp = conv_opnd(Temp0, FPoff, Context),
+ Dst = conv_opnd(Dst0, FPoff, Context),
+ case Src =:= Dst of
+ true -> []; % omit move-to-self
+ false -> [#move{src=Src, dst=Temp}, #move{src=Temp, dst=Dst}]
+ end.
do_movsx(I, Context, FPoff) ->
#movsx{src=Src0,dst=Dst0} = I,
diff --git a/lib/hipe/x86/hipe_x86_postpass.erl b/lib/hipe/x86/hipe_x86_postpass.erl
index b84e9bed91..925054dd68 100644
--- a/lib/hipe/x86/hipe_x86_postpass.erl
+++ b/lib/hipe/x86/hipe_x86_postpass.erl
@@ -57,9 +57,10 @@ postpass(#defun{code=Code0}=Defun, Options) ->
peephole_optimization(Insns) ->
peep(Insns, [], []).
-%% MoveSelf related peep-opts
+
+%% MoveSelf related peep-opts
%% ------------------------------
-peep([#fmove{src=Src, dst=Src} | Insns], Res,Lst) ->
+peep([#fmove{src=Src, dst=Src} | Insns], Res,Lst) ->
peep(Insns, Res, [moveSelf1|Lst]);
peep([I=#fmove{src=Src, dst=Dst},
#fmove{src=Dst, dst=Src} | Insns], Res,Lst) ->
@@ -159,8 +160,7 @@ peep([#jcc{label=Lab}, I=#label{label=Lab}|Insns], Res, Lst) ->
%% ElimSet0
%% --------
-peep([#move{src=#x86_imm{value=0},dst=Dst}|Insns],Res,Lst)
-when (Dst==#x86_temp{}) ->
+peep([#move{src=#x86_imm{value=0},dst=Dst=#x86_temp{}}|Insns],Res,Lst) ->
peep(Insns, [#alu{aluop='xor', src=Dst, dst=Dst}|Res], [elimSet0|Lst]);
%% ElimMDPow2
diff --git a/lib/hipe/x86/hipe_x86_ra_finalise.erl b/lib/hipe/x86/hipe_x86_ra_finalise.erl
index 4273e3cee8..e8abe78e00 100644
--- a/lib/hipe/x86/hipe_x86_ra_finalise.erl
+++ b/lib/hipe/x86/hipe_x86_ra_finalise.erl
@@ -140,6 +140,16 @@ ra_insn(I, Map, FpMap) ->
I#pseudo_call{'fun'=Fun};
#pseudo_jcc{} ->
I;
+ #pseudo_spill_fmove{src=Src0, temp=Temp0, dst=Dst0} ->
+ Src = ra_opnd(Src0, Map, FpMap),
+ Temp = ra_opnd(Temp0, Map, FpMap),
+ Dst = ra_opnd(Dst0, Map, FpMap),
+ I#pseudo_spill_fmove{src=Src, temp=Temp, dst=Dst};
+ #pseudo_spill_move{src=Src0, temp=Temp0, dst=Dst0} ->
+ Src = ra_opnd(Src0, Map),
+ Temp = ra_opnd(Temp0, Map),
+ Dst = ra_opnd(Dst0, Map),
+ I#pseudo_spill_move{src=Src, temp=Temp, dst=Dst};
#pseudo_tailcall{'fun'=Fun0,stkargs=StkArgs0} ->
Fun = ra_opnd(Fun0, Map),
StkArgs = ra_args(StkArgs0, Map),
diff --git a/lib/hipe/x86/hipe_x86_ra_postconditions.erl b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
index 28ec9c4277..db6391d5c1 100644
--- a/lib/hipe/x86/hipe_x86_ra_postconditions.erl
+++ b/lib/hipe/x86/hipe_x86_ra_postconditions.erl
@@ -74,6 +74,8 @@ do_insn(I, TempMap, Strategy) -> % Insn -> {Insn list, DidSpill}
do_movx(I, TempMap, Strategy);
#fmove{} ->
do_fmove(I, TempMap, Strategy);
+ #pseudo_spill_move{} ->
+ do_pseudo_spill_move(I, TempMap, Strategy);
#shift{} ->
do_shift(I, TempMap, Strategy);
#test{} ->
@@ -190,10 +192,19 @@ do_lea(I, TempMap, Strategy) ->
do_move(I, TempMap, Strategy) ->
#move{src=Src0,dst=Dst0} = I,
- {FixSrc, Src, FixDst, Dst, DidSpill} =
- do_check_byte_move(Src0, Dst0, TempMap, Strategy),
- {FixSrc ++ FixDst ++ [I#move{src=Src,dst=Dst}],
- DidSpill}.
+ case
+ is_record(Src0, x86_temp) andalso is_record(Dst0, x86_temp)
+ andalso is_spilled(Src0, TempMap) andalso is_spilled(Dst0, TempMap)
+ of
+ true ->
+ Tmp = clone(Src0, Strategy),
+ {[hipe_x86:mk_pseudo_spill_move(Src0, Tmp, Dst0)], true};
+ false ->
+ {FixSrc, Src, FixDst, Dst, DidSpill} =
+ do_check_byte_move(Src0, Dst0, TempMap, Strategy),
+ {FixSrc ++ FixDst ++ [I#move{src=Src,dst=Dst}],
+ DidSpill}
+ end.
-ifdef(HIPE_AMD64).
@@ -287,6 +298,13 @@ do_fmove(I, TempMap, Strategy) ->
{FixSrc ++ FixDst ++ [I#fmove{src=Src,dst=Dst}],
DidSpill1 or DidSpill2}.
+%%% Fix an pseudo_spill_move op.
+
+do_pseudo_spill_move(I = #pseudo_spill_move{temp=Temp}, TempMap, _Strategy) ->
+ %% Temp is above the low water mark and must not have been spilled
+ false = is_spilled(Temp, TempMap),
+ {[I], false}. % nothing to do
+
%%% Fix a shift operation.
%%% 1. remove pseudos from any explicit memory operands
%%% 2. if the source is a register or memory position
diff --git a/lib/hipe/x86/hipe_x86_subst.erl b/lib/hipe/x86/hipe_x86_subst.erl
index 7b5fb1352b..7db3b23d92 100644
--- a/lib/hipe/x86/hipe_x86_subst.erl
+++ b/lib/hipe/x86/hipe_x86_subst.erl
@@ -19,7 +19,7 @@
-endif.
-module(?HIPE_X86_SUBST).
--export([insn_temps/2]).
+-export([insn_temps/2, insn_lbls/2]).
-include("../x86/hipe_x86.hrl").
%% These should be moved to hipe_x86 and exported
@@ -28,6 +28,7 @@
-type mfarec() :: #x86_mfa{}.
-type prim() :: #x86_prim{}.
-type funv() :: mfarec() | prim() | temp().
+-type label() :: non_neg_integer().
-type insn() :: tuple(). % for now
-type subst_fun() :: fun((temp()) -> temp()).
@@ -49,14 +50,19 @@ insn_temps(SubstTemp, I) ->
#movzx {src=S, dst=D} -> I#movzx {src=O(S), dst=O(D)};
#shift {src=S, dst=D} -> I#shift {src=O(S), dst=O(D)};
#test {src=S, dst=D} -> I#test {src=O(S), dst=O(D)};
- #fp_unop{arg=A} -> I#fp_unop{arg=O(A)};
- #move64 {dst=D} -> I#move64 {dst=O(D)};
- #push {src=S} -> I#push {src=O(S)};
- #pop {dst=D} -> I#pop {dst=O(D)};
+ #fp_unop{arg=[]} -> I;
+ #fp_unop{arg=A} -> I#fp_unop{arg=O(A)};
+ #move64 {dst=D} -> I#move64 {dst=O(D)};
+ #push {src=S} -> I#push {src=O(S)};
+ #pop {dst=D} -> I#pop {dst=O(D)};
#jmp_switch{temp=T, jtab=J} ->
I#jmp_switch{temp=O(T), jtab=jtab_temps(SubstTemp, J)};
#pseudo_call{'fun'=F} ->
I#pseudo_call{'fun'=funv_temps(SubstTemp, F)};
+ #pseudo_spill_fmove{src=S, temp=T, dst=D} ->
+ I#pseudo_spill_fmove{src=O(S), temp=O(T), dst=O(D)};
+ #pseudo_spill_move{src=S, temp=T, dst=D} ->
+ I#pseudo_spill_move{src=O(S), temp=O(T), dst=O(D)};
#pseudo_tailcall{'fun'=F, stkargs=Stk} ->
I#pseudo_tailcall{'fun'=funv_temps(SubstTemp, F),
stkargs=lists:map(O, Stk)};
@@ -85,3 +91,22 @@ jtab_temps(SubstTemp, T=#x86_temp{}) -> SubstTemp(T).
-else.
jtab_temps(_SubstTemp, DataLbl) when is_integer(DataLbl) -> DataLbl.
-endif.
+
+-type lbl_subst_fun() :: fun((label()) -> label()).
+
+%% @doc Maps over the branch targets in an instruction
+-spec insn_lbls(lbl_subst_fun(), insn()) -> insn().
+insn_lbls(SubstLbl, I) ->
+ case I of
+ #jmp_label{label=Label} ->
+ I#jmp_label{label=SubstLbl(Label)};
+ #pseudo_call{sdesc=Sdesc, contlab=Contlab} ->
+ I#pseudo_call{sdesc=sdesc_lbls(SubstLbl, Sdesc),
+ contlab=SubstLbl(Contlab)};
+ #pseudo_jcc{true_label=T, false_label=F} ->
+ I#pseudo_jcc{true_label=SubstLbl(T), false_label=SubstLbl(F)}
+ end.
+
+sdesc_lbls(_SubstLbl, Sdesc=#x86_sdesc{exnlab=[]}) -> Sdesc;
+sdesc_lbls(SubstLbl, Sdesc=#x86_sdesc{exnlab=Exnlab}) ->
+ Sdesc#x86_sdesc{exnlab=SubstLbl(Exnlab)}.
diff --git a/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
index af189a74f7..b3a18e03d4 100644
--- a/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_SUITE_data/c_client.c
@@ -58,7 +58,7 @@
#include "erl_interface.h"
#include "m_i.h"
-#define HOSTNAMESZ 256
+#define HOSTNAMESZ 255
#define NODENAMESZ 512
#define INBUFSZ 10
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
progname = argv[0];
host[HOSTNAMESZ] = '\0';
- if (gethostname(host, HOSTNAMESZ) < 0) {
+ if (gethostname(host, HOSTNAMESZ + 1) < 0) {
fprintf(stderr, "Can't find own hostname\n");
done(1);
}
diff --git a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
index b7609d63e5..40c7328f03 100644
--- a/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_proto_SUITE_data/c_client.c
@@ -61,7 +61,7 @@
#include "erl_interface.h"
#include "m_i.h"
-#define HOSTNAMESZ 256
+#define HOSTNAMESZ 255
#define NODENAMESZ 512
#define INBUFSZ 10
@@ -298,7 +298,7 @@ int main(int argc, char **argv)
progname = argv[0];
host[HOSTNAMESZ] = '\0';
- if (gethostname(host, HOSTNAMESZ) < 0) {
+ if (gethostname(host, HOSTNAMESZ + 1) < 0) {
fprintf(stderr, "Can't find own hostname\n");
done(1);
}
diff --git a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
index 23dc089555..33cfe71322 100644
--- a/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
+++ b/lib/ic/test/c_client_erl_server_proto_tmo_SUITE_data/c_client.c
@@ -61,7 +61,7 @@
#include "erl_interface.h"
#include "m_i.h"
-#define HOSTNAMESZ 256
+#define HOSTNAMESZ 255
#define NODENAMESZ 512
#define INBUFSZ 10
@@ -298,7 +298,7 @@ int main(int argc, char **argv)
progname = argv[0];
host[HOSTNAMESZ] = '\0';
- if (gethostname(host, HOSTNAMESZ) < 0) {
+ if (gethostname(host, HOSTNAMESZ + 1) < 0) {
fprintf(stderr, "Can't find own hostname\n");
done(1);
}
diff --git a/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c b/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
index 53345d561b..f48480e8dc 100644
--- a/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
+++ b/lib/ic/test/erl_client_c_server_SUITE_data/c_server.c
@@ -81,7 +81,7 @@ static void showtime(MyTimeval *start, MyTimeval *stop);
static void usage(void);
static void done(int r);
-#define HOSTNAMESZ 256
+#define HOSTNAMESZ 255
#define NODENAMESZ 512
#define INBUFSZ 10
#define OUTBUFSZ 0
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
progname = argv[0];
host[HOSTNAMESZ] = '\0';
- if (gethostname(host, HOSTNAMESZ) < 0) {
+ if (gethostname(host, HOSTNAMESZ + 1) < 0) {
fprintf(stderr, "Can't find own hostname\n");
done(1);
}
diff --git a/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c b/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
index a18f0e7ba9..e2ba5bd5b6 100644
--- a/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
+++ b/lib/ic/test/erl_client_c_server_proto_SUITE_data/c_server.c
@@ -81,7 +81,7 @@ static void showtime(MyTimeval *start, MyTimeval *stop);
static void usage(void);
static void done(int r);
-#define HOSTNAMESZ 256
+#define HOSTNAMESZ 255
#define NODENAMESZ 512
#define INBUFSZ 10
#define OUTBUFSZ 0
@@ -122,7 +122,7 @@ int main(int argc, char **argv)
progname = argv[0];
host[HOSTNAMESZ] = '\0';
- if (gethostname(host, HOSTNAMESZ) < 0) {
+ if (gethostname(host, HOSTNAMESZ + 1) < 0) {
fprintf(stderr, "Can't find own hostname\n");
done(1);
}
diff --git a/lib/inets/doc/src/notes.xml b/lib/inets/doc/src/notes.xml
index 1d8432ee35..2aa48cd50a 100644
--- a/lib/inets/doc/src/notes.xml
+++ b/lib/inets/doc/src/notes.xml
@@ -33,7 +33,61 @@
<file>notes.xml</file>
</header>
- <section><title>Inets 6.3.5</title>
+ <section><title>Inets 6.3.7</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed a bug in ftp that made further operations after a
+ recv_chunk operation impossible.</p>
+ <p>
+ Own Id: OTP-14242</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Inets 6.3.6</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Chunk size decoding could fail. The symptom was that
+ chunk decoding sometimes failed depending on timing of
+ the received stream. If chunk size was split into two
+ different packets decoding would fail.</p>
+ <p>
+ Own Id: OTP-13571 Aux Id: ERL-116 </p>
+ </item>
+ <item>
+ <p>
+ Prevent httpc user process to hang if httpc_handler
+ process terminates unexpectedly</p>
+ <p>
+ Own Id: OTP-14091</p>
+ </item>
+ <item>
+ <p>
+ Correct Host header, to include port number, when
+ redirecting requests.</p>
+ <p>
+ Own Id: OTP-14097</p>
+ </item>
+ <item>
+ <p>
+ Shutdown gracefully on connection or TLS handshake errors</p>
+ <p>
+ Own Id: OTP-14173 Aux Id: seq13262 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Inets 6.3.5</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl
index 23d6483291..de869e3204 100644
--- a/lib/inets/src/ftp/ftp.erl
+++ b/lib/inets/src/ftp/ftp.erl
@@ -108,7 +108,7 @@
-define(DBG(F,A), 'n/a').
%%-define(DBG(F,A), io:format(F,A)).
-%%-define(DBG(F,A), if is_list(F) -> ct:pal(F,A); is_atom(F)->ct:pal(atom_to_list(F),A) end).
+%%-define(DBG(F,A), ct:pal("~p:~p " ++ if is_list(F) -> F; is_atom(F) -> atom_to_list(F) end, [?MODULE,?LINE|A])).
%%%=========================================================================
%%% API - CLIENT FUNCTIONS
@@ -1482,13 +1482,13 @@ handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket},
activate_ctrl_connection(State),
{noreply, State#state{dsock = undefined, data = <<>>}};
-handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket}, client = From,
+handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket},
caller = recv_chunk} = State)
when {Cls,Trpt}=={tcp_closed,tcp} ; {Cls,Trpt}=={ssl_closed,ssl} ->
- gen_server:reply(From, ok),
- {noreply, State#state{dsock = undefined, client = undefined,
- data = <<>>, caller = undefined,
- chunk = false}};
+ activate_ctrl_connection(State),
+ {noreply, State#state{dsock = undefined, data = <<>>,
+ caller = recv_chunk_closed
+ }};
handle_info({Cls, Socket}, #state{dsock = {Trpt,Socket}, caller = recv_bin,
data = Data} = State)
@@ -1601,13 +1601,13 @@ terminate(normal, State) ->
%% If terminate reason =/= normal the progress reporting process will
%% be killed by the exit signal.
progress_report(stop, State),
- do_termiante({error, econn}, State);
+ do_terminate({error, econn}, State);
terminate(Reason, State) ->
Report = io_lib:format("Ftp connection closed due to: ~p~n", [Reason]),
error_logger:error_report(Report),
- do_termiante({error, eclosed}, State).
+ do_terminate({error, eclosed}, State).
-do_termiante(ErrorMsg, State) ->
+do_terminate(ErrorMsg, State) ->
close_data_connection(State),
close_ctrl_connection(State),
case State#state.client of
@@ -2046,6 +2046,16 @@ handle_ctrl_result({pos_prel, _}, #state{client = From,
end;
%%--------------------------------------------------------------------------
+%% File handling - chunk_transfer complete
+handle_ctrl_result({pos_compl, _}, #state{client = From,
+ caller = recv_chunk_closed}
+ = State0) ->
+ gen_server:reply(From, ok),
+ {noreply, State0#state{caller = undefined,
+ chunk = false,
+ client = undefined}};
+
+%%--------------------------------------------------------------------------
%% File handling - recv_file
handle_ctrl_result({pos_prel, _}, #state{caller = {recv_file, _}} = State0) ->
case accept_data_connection(State0) of
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index bd5f6df39e..418b6247b0 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -524,7 +524,7 @@ handle_request(Method, Url,
Options = request_options(Options0),
Sync = proplists:get_value(sync, Options),
Stream = proplists:get_value(stream, Options),
- Host2 = header_host(Scheme, Host, Port),
+ Host2 = http_request:normalize_host(Scheme, Host, Port),
HeadersRecord = header_record(NewHeaders, Host2, HTTPOptions),
Receiver = proplists:get_value(receiver, Options),
SocketOpts = proplists:get_value(socket_opts, Options),
@@ -1035,14 +1035,6 @@ bad_option(Option, BadValue) ->
throw({error, {bad_option, Option, BadValue}}).
-header_host(https, Host, 443 = _Port) ->
- Host;
-header_host(http, Host, 80 = _Port) ->
- Host;
-header_host(_Scheme, Host, Port) ->
- Host ++ ":" ++ integer_to_list(Port).
-
-
header_record(NewHeaders, Host, #http_options{version = Version}) ->
header_record(NewHeaders, #http_request_h{}, Host, Version).
diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl
index d24705a845..d81afde5fe 100644
--- a/lib/inets/src/http_client/httpc_response.erl
+++ b/lib/inets/src/http_client/httpc_response.erl
@@ -362,8 +362,9 @@ redirect(Response = {StatusLine, Headers, Body}, Request) ->
{ok, error(Request, Reason), Data};
%% Automatic redirection
{ok, {Scheme, _, Host, Port, Path, Query}} ->
+ HostPort = http_request:normalize_host(Scheme, Host, Port),
NewHeaders =
- (Request#request.headers)#http_request_h{host = Host++":"++integer_to_list(Port)},
+ (Request#request.headers)#http_request_h{host = HostPort},
NewRequest =
Request#request{redircount =
Request#request.redircount+1,
diff --git a/lib/inets/src/http_lib/http_request.erl b/lib/inets/src/http_lib/http_request.erl
index c77b616f0d..4c50edb5ef 100644
--- a/lib/inets/src/http_lib/http_request.erl
+++ b/lib/inets/src/http_lib/http_request.erl
@@ -22,7 +22,7 @@
-include("http_internal.hrl").
--export([headers/2, http_headers/1, is_absolut_uri/1, key_value/1]).
+-export([headers/2, http_headers/1, is_absolut_uri/1, key_value/1, normalize_host/3]).
key_value(KeyValueStr) ->
@@ -85,6 +85,22 @@ is_absolut_uri("https://" ++ _) ->
is_absolut_uri(_) ->
false.
+%%-------------------------------------------------------------------------
+%% normalize_host(Scheme, Host, Port) -> string()
+%% Scheme - http | https
+%% Host - string()
+%% Port - integer()
+%%
+%% Description: returns a normalized Host header value, with the port
+%% number omitted for well-known ports
+%%-------------------------------------------------------------------------
+normalize_host(https, Host, 443 = _Port) ->
+ Host;
+normalize_host(http, Host, 80 = _Port) ->
+ Host;
+normalize_host(_Scheme, Host, Port) ->
+ Host ++ ":" ++ integer_to_list(Port).
+
%%%========================================================================
%%% Internal functions
%%%========================================================================
diff --git a/lib/inets/test/ftp_SUITE.erl b/lib/inets/test/ftp_SUITE.erl
index e2dec0c42a..0053ba6edd 100644
--- a/lib/inets/test/ftp_SUITE.erl
+++ b/lib/inets/test/ftp_SUITE.erl
@@ -93,8 +93,10 @@ ftp_tests()->
append_chunk,
recv,
recv_3,
- recv_bin,
+ recv_bin,
+ recv_bin_twice,
recv_chunk,
+ recv_chunk_twice,
type,
quote,
error_elogin,
@@ -191,9 +193,22 @@ end_per_suite(Config) ->
ok.
%%--------------------------------------------------------------------
-init_per_group(_Group, Config) -> Config.
-
-end_per_group(_Group, Config) -> Config.
+init_per_group(Group, Config) when Group == ftps_active,
+ Group == ftps_passive ->
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ Config
+ catch
+ _:_ ->
+ {skip, "Crypto did not start"}
+ end;
+
+init_per_group(_Group, Config) ->
+ Config.
+
+end_per_group(_Group, Config) ->
+ Config.
%%--------------------------------------------------------------------
init_per_testcase(Case, Config0) ->
@@ -533,15 +548,19 @@ append_chunk(Config0) ->
recv() ->
[{doc, "Receive a file using recv/2"}].
recv(Config0) ->
- File = "f_dst.txt",
+ File1 = "f_dst1.txt",
+ File2 = "f_dst2.txt",
SrcDir = "a_dir",
- Contents = <<"ftp_SUITE test ...">>,
- Config = set_state([reset, {mkfile,[SrcDir,File],Contents}], Config0),
+ Contents1 = <<"1 ftp_SUITE test ...">>,
+ Contents2 = <<"2 ftp_SUITE test ...">>,
+ Config = set_state([reset, {mkfile,[SrcDir,File1],Contents1}, {mkfile,[SrcDir,File2],Contents2}], Config0),
Pid = proplists:get_value(ftp, Config),
ok = ftp:cd(Pid, id2ftp(SrcDir,Config)),
ok = ftp:lcd(Pid, id2ftp("",Config)),
- ok = ftp:recv(Pid, File),
- chk_file(File, Contents, Config),
+ ok = ftp:recv(Pid, File1),
+ chk_file(File1, Contents1, Config),
+ ok = ftp:recv(Pid, File2),
+ chk_file(File2, Contents2, Config),
{error,epath} = ftp:recv(Pid, "non_existing_file"),
ok.
@@ -572,6 +591,25 @@ recv_bin(Config0) ->
ok.
%%-------------------------------------------------------------------------
+recv_bin_twice() ->
+ [{doc, "Receive two files as a binaries."}].
+recv_bin_twice(Config0) ->
+ File1 = "f_dst1.txt",
+ File2 = "f_dst2.txt",
+ Contents1 = <<"1 ftp_SUITE test ...">>,
+ Contents2 = <<"2 ftp_SUITE test ...">>,
+ Config = set_state([reset, {mkfile,File1,Contents1}, {mkfile,File2,Contents2}], Config0),
+ ct:log("First transfer",[]),
+ Pid = proplists:get_value(ftp, Config),
+ {ok,Received1} = ftp:recv_bin(Pid, id2ftp(File1,Config)),
+ find_diff(Received1, Contents1),
+ ct:log("Second transfer",[]),
+ {ok,Received2} = ftp:recv_bin(Pid, id2ftp(File2,Config)),
+ find_diff(Received2, Contents2),
+ ct:log("Transfers ready!",[]),
+ {error,epath} = ftp:recv_bin(Pid, id2ftp("non_existing_file",Config)),
+ ok.
+%%-------------------------------------------------------------------------
recv_chunk() ->
[{doc, "Receive a file using chunk-wise."}].
recv_chunk(Config0) ->
@@ -584,6 +622,23 @@ recv_chunk(Config0) ->
{ok, ReceivedContents, _Ncunks} = recv_chunk(Pid, <<>>),
find_diff(ReceivedContents, Contents).
+recv_chunk_twice() ->
+ [{doc, "Receive two files using chunk-wise."}].
+recv_chunk_twice(Config0) ->
+ File1 = "big_file1.txt",
+ File2 = "big_file2.txt",
+ Contents1 = list_to_binary( lists:duplicate(1000, lists:seq(0,255)) ),
+ Contents2 = crypto:strong_rand_bytes(1200),
+ Config = set_state([reset, {mkfile,File1,Contents1}, {mkfile,File2,Contents2}], Config0),
+ Pid = proplists:get_value(ftp, Config),
+ {{error, "ftp:recv_chunk_start/2 not called"},_} = recv_chunk(Pid, <<>>),
+ ok = ftp:recv_chunk_start(Pid, id2ftp(File1,Config)),
+ {ok, ReceivedContents1, _Ncunks1} = recv_chunk(Pid, <<>>),
+ ok = ftp:recv_chunk_start(Pid, id2ftp(File2,Config)),
+ {ok, ReceivedContents2, _Ncunks2} = recv_chunk(Pid, <<>>),
+ find_diff(ReceivedContents1, Contents1),
+ find_diff(ReceivedContents2, Contents2).
+
recv_chunk(Pid, Acc) ->
recv_chunk(Pid, Acc, 0).
diff --git a/lib/inets/test/httpc_SUITE.erl b/lib/inets/test/httpc_SUITE.erl
index 8aea38037d..67aa78aa06 100644
--- a/lib/inets/test/httpc_SUITE.erl
+++ b/lib/inets/test/httpc_SUITE.erl
@@ -163,21 +163,17 @@ init_per_group(misc = Group, Config) ->
ok = httpc:set_options([{ipfamily, Inet}]),
Config;
+
init_per_group(Group, Config0) when Group =:= sim_https; Group =:= https->
- ct:timetrap({seconds, 30}),
- start_apps(Group),
- StartSsl = try ssl:start()
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ ct:timetrap({seconds, 30}),
+ start_apps(Group),
+ do_init_per_group(Group, Config0)
catch
- Error:Reason ->
- {skip, lists:flatten(io_lib:format("Failed to start apps for https Error=~p Reason=~p", [Error, Reason]))}
- end,
- case StartSsl of
- {error, {already_started, _}} ->
- do_init_per_group(Group, Config0);
- ok ->
- do_init_per_group(Group, Config0);
- _ ->
- StartSsl
+ _:_ ->
+ {skip, "Crypto did not start"}
end;
init_per_group(Group, Config0) ->
diff --git a/lib/inets/test/httpd_SUITE.erl b/lib/inets/test/httpd_SUITE.erl
index aae4ce5256..44b1e09cbc 100644
--- a/lib/inets/test/httpd_SUITE.erl
+++ b/lib/inets/test/httpd_SUITE.erl
@@ -197,7 +197,14 @@ init_per_group(Group, Config0) when Group == https_basic;
Group == https_security;
Group == https_reload
->
- init_ssl(Group, Config0);
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ init_ssl(Group, Config0)
+ catch
+ _:_ ->
+ {skip, "Crypto did not start"}
+ end;
init_per_group(Group, Config0) when Group == http_basic;
Group == http_limit;
Group == http_custom;
@@ -232,7 +239,14 @@ init_per_group(https_htaccess = Group, Config) ->
Path = proplists:get_value(doc_root, Config),
catch remove_htaccess(Path),
create_htaccess_data(Path, proplists:get_value(address, Config)),
- init_ssl(Group, Config);
+ catch crypto:stop(),
+ try crypto:start() of
+ ok ->
+ init_ssl(Group, Config)
+ catch
+ _:_ ->
+ {skip, "Crypto did not start"}
+ end;
init_per_group(auth_api, Config) ->
[{auth_prefix, ""} | Config];
init_per_group(auth_api_dets, Config) ->
diff --git a/lib/inets/vsn.mk b/lib/inets/vsn.mk
index 9591ab22ed..411bbfc043 100644
--- a/lib/inets/vsn.mk
+++ b/lib/inets/vsn.mk
@@ -19,6 +19,6 @@
# %CopyrightEnd%
APPLICATION = inets
-INETS_VSN = 6.3.5
+INETS_VSN = 6.3.7
PRE_VSN =
APP_VSN = "$(APPLICATION)-$(INETS_VSN)$(PRE_VSN)"
diff --git a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
index dca2eb7c51..e1718f8380 100644
--- a/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
+++ b/lib/jinterface/java_src/com/ericsson/otp/erlang/OtpOutputStream.java
@@ -403,7 +403,6 @@ public class OtpOutputStream extends ByteArrayOutputStream {
public void write_atom(final String atom) {
String enc_atom;
byte[] bytes;
- boolean isLatin1 = true;
if (atom.codePointCount(0, atom.length()) <= OtpExternal.maxAtomLength) {
enc_atom = atom;
@@ -416,29 +415,15 @@ public class OtpOutputStream extends ByteArrayOutputStream {
OtpExternal.maxAtomLength);
}
- for (int offset = 0; offset < enc_atom.length();) {
- final int cp = enc_atom.codePointAt(offset);
- if ((cp & ~0xFF) != 0) {
- isLatin1 = false;
- break;
- }
- offset += Character.charCount(cp);
- }
try {
- if (isLatin1) {
- bytes = enc_atom.getBytes("ISO-8859-1");
- write1(OtpExternal.atomTag);
- write2BE(bytes.length);
+ bytes = enc_atom.getBytes("UTF-8");
+ final int length = bytes.length;
+ if (length < 256) {
+ write1(OtpExternal.smallAtomUtf8Tag);
+ write1(length);
} else {
- bytes = enc_atom.getBytes("UTF-8");
- final int length = bytes.length;
- if (length < 256) {
- write1(OtpExternal.smallAtomUtf8Tag);
- write1(length);
- } else {
- write1(OtpExternal.atomUtf8Tag);
- write2BE(length);
- }
+ write1(OtpExternal.atomUtf8Tag);
+ write2BE(length);
}
writeN(bytes);
} catch (final java.io.UnsupportedEncodingException e) {
diff --git a/lib/jinterface/test/jinterface_SUITE_data/Maps.java b/lib/jinterface/test/jinterface_SUITE_data/Maps.java
index e8a05245da..a1b6fa73c9 100644
--- a/lib/jinterface/test/jinterface_SUITE_data/Maps.java
+++ b/lib/jinterface/test/jinterface_SUITE_data/Maps.java
@@ -40,19 +40,19 @@ class Maps {
public static void main(final String argv[]) {
runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 0 }, "#{}", 1);
- runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 1, 100, 0, 1, 97, 100,
- 0, 1, 98 }, "#{a => b}", 2);
+ runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 1, 119, 1, 97, 119,
+ 1, 98 }, "#{a => b}", 2);
// make sure keys are sorted here, jinterface doesn't reorder them
runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 2, 97, 2, 106,
- 100, 0, 1, 97, 97, 1 }, "#{2 => [],a => 1}", 3);
+ 119, 1, 97, 97, 1 }, "#{2 => [],a => 1}", 3);
runTest(new byte[] { (byte) 131, 116, 0, 0, 0, 1, 104, 1, 97, 3, 108,
- 0, 0, 0, 1, 100, 0, 1, 114, 106 }, "#{{3} => [r]}", 4);
+ 0, 0, 0, 1, 119, 1, 114, 106 }, "#{{3} => [r]}", 4);
try {
// #{2 => [],a => 1}
final OtpErlangMap map = new OtpErlangMap(new OtpInputStream(
new byte[] { (byte) 131, 116, 0, 0, 0, 2, 97, 2, 106,
- 100, 0, 1, 97, 97, 1 }));
+ 119, 1, 97, 97, 1 }));
if (map.arity() != 2) {
fail(5);
diff --git a/lib/kernel/doc/src/gen_tcp.xml b/lib/kernel/doc/src/gen_tcp.xml
index e97db20062..bef8096aed 100644
--- a/lib/kernel/doc/src/gen_tcp.xml
+++ b/lib/kernel/doc/src/gen_tcp.xml
@@ -140,6 +140,23 @@ do_recv(Sock, Bs) ->
<fsummary>Close a TCP socket.</fsummary>
<desc>
<p>Closes a TCP socket.</p>
+ <p>Note that in most implementations of TCP, doing a <c>close</c> does
+ not guarantee that any data sent is delivered to the recipient before
+ the close is detected at the remote side. If you want to guarantee
+ delivery of the data to the recipient there are two common ways to
+ achieve this.</p>
+ <list type="ordered">
+ <item><p>Use <seealso marker="#shutdown/2">
+ <c>gen_tcp:shutdown(Sock, write)</c></seealso> to signal that
+ no more data is to be sent and wait for the read side of the
+ socket to be closed.</p>
+ </item>
+ <item><p>Use the socket option <seealso marker="inet#packet">
+ <c>{packet, N}</c></seealso> (or something similar) to make
+ it possible for the receiver to close the connection when it
+ knowns it has received all the data.</p>
+ </item>
+ </list>
</desc>
</func>
diff --git a/lib/kernel/doc/src/inet.xml b/lib/kernel/doc/src/inet.xml
index 4c4a5c39cb..947e4d4560 100644
--- a/lib/kernel/doc/src/inet.xml
+++ b/lib/kernel/doc/src/inet.xml
@@ -659,7 +659,8 @@ get_tcpi_sacked(Sock) ->
<tag><c>{buffer, Size}</c></tag>
<item>
<p>The size of the user-level software buffer used by
- the driver. Not to be confused with options <c>sndbuf</c>
+ the driver.
+ Not to be confused with options <c>sndbuf</c>
and <c>recbuf</c>, which correspond to the
Kernel socket buffers. It is recommended
to have <c>val(buffer) &gt;= max(val(sndbuf),val(recbuf))</c> to
@@ -670,6 +671,9 @@ get_tcpi_sacked(Sock) ->
usually become larger, you are encouraged to use
<seealso marker="#getopts/2"><c>getopts/2</c></seealso>
to analyze the behavior of your operating system.</p>
+ <p>Note that this is also the maximum amount of data that can be
+ received from a single recv call. If you are using higher than
+ normal MTU consider setting buffer higher.</p>
</item>
<tag><c>{delay_send, Boolean}</c></tag>
<item>
@@ -893,6 +897,32 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp</code>
<seealso marker="file#native_name_encoding/0"><c>file:native_name_encoding/0</c></seealso>.</p></item>
</list>
</item>
+ <tag><c>{bind_to_device, Ifname :: binary()}</c></tag>
+ <item>
+ <p>Binds a socket to a specific network interface. This option
+ must be used in a function call that creates a socket, that is,
+ <seealso marker="gen_tcp#connect/3"><c>gen_tcp:connect/3,4</c></seealso>,
+ <seealso marker="gen_tcp#listen/2"><c>gen_tcp:listen/2</c></seealso>,
+ <seealso marker="gen_udp#open/1"><c>gen_udp:open/1,2</c></seealso>, or
+ <seealso marker="gen_sctp#open/0"><c>gen_sctp:open/0,1,2</c></seealso>.</p>
+ <p>Unlike <seealso marker="#getifaddrs/0"><c>getifaddrs/0</c></seealso>, Ifname
+ is encoded a binary. In the unlikely case that a system is using
+ non-7-bit-ASCII characters in network device names, special care
+ has to be taken when encoding this argument.</p>
+ <p>This option uses the Linux-specific socket option
+ <c>SO_BINDTODEVICE</c>, such as in Linux kernel 2.0.30 or later,
+ and therefore only exists when the runtime system
+ is compiled for such an operating system.</p>
+ <p>Before Linux 3.8, this socket option could be set, but could not retrieved
+ with <seealso marker="#getopts/2"><c>getopts/2</c></seealso>. Since Linux 3.8,
+ it is readable.</p>
+ <p>The virtual machine also needs elevated privileges, either
+ running as superuser or (for Linux) having capability
+ <c>CAP_NET_RAW</c>.</p>
+ <p>The primary use case for this option is to bind sockets into
+ <url href="http://www.kernel.org/doc/Documentation/networking/vrf.txt">Linux VRF instances</url>.
+ </p>
+ </item>
<tag><c>list</c></tag>
<item>
<p>Received <c>Packet</c> is delivered as a list.</p>
@@ -909,7 +939,7 @@ setcap cap_sys_admin,cap_sys_ptrace,cap_dac_read_search+epi beam.smp</code>
</item>
<tag><c>{packet, PacketType}</c>(TCP/IP sockets)</tag>
<item>
- <p>Defines the type of packets to use for a socket.
+ <p><marker id="packet"/>Defines the type of packets to use for a socket.
Possible values:</p>
<taglist>
<tag><c>raw | 0</c></tag>
diff --git a/lib/kernel/doc/src/notes.xml b/lib/kernel/doc/src/notes.xml
index d80c4f077c..ad349c5aaf 100644
--- a/lib/kernel/doc/src/notes.xml
+++ b/lib/kernel/doc/src/notes.xml
@@ -31,6 +31,45 @@
</header>
<p>This document describes the changes made to the Kernel application.</p>
+<section><title>Kernel 5.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix a race during cleanup of os:cmd that would cause
+ os:cmd to hang indefinitely.</p>
+ <p>
+ Own Id: OTP-14232 Aux Id: seq13275 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>The functions in the '<c>file</c>' module that take a
+ list of paths (e.g. <c>file:path_consult/2</c>) will now
+ continue to search in the path if the path contains
+ something that is not a directory.</p>
+ <p>
+ Own Id: OTP-14191</p>
+ </item>
+ <item>
+ <p>Two OTP processes that are known to receive many
+ messages are 'rex' (used by 'rpc') and 'error_logger'.
+ Those processes will now store unprocessed messages
+ outside the process heap, which will potentially decrease
+ the cost of garbage collections.</p>
+ <p>
+ Own Id: OTP-14192</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Kernel 5.1.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl
index 0e61153613..3b642f5873 100644
--- a/lib/kernel/src/application_controller.erl
+++ b/lib/kernel/src/application_controller.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -1620,7 +1620,7 @@ conv(_) -> [].
make_term(Str) ->
case erl_scan:string(Str) of
{ok, Tokens, _} ->
- case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of
+ case erl_parse:parse_term(Tokens ++ [{dot, erl_anno:new(1)}]) of
{ok, Term} ->
Term;
{error, {_,M,Reason}} ->
diff --git a/lib/kernel/src/dist_util.erl b/lib/kernel/src/dist_util.erl
index 8d2fc4d4b7..d929179715 100644
--- a/lib/kernel/src/dist_util.erl
+++ b/lib/kernel/src/dist_util.erl
@@ -131,7 +131,7 @@ handshake_other_started(#hs_data{request_type=ReqType}=HSData0) ->
other_version=Version,
other_node=Node,
other_started=true},
- check_dflag_xnc(HSData),
+ check_dflags(HSData),
is_allowed(HSData),
?debug({"MD5 connection from ~p (V~p)~n",
[Node, HSData#hs_data.other_version]}),
@@ -168,27 +168,24 @@ is_allowed(#hs_data{other_node = Node,
%% Check that both nodes can handle the same types of extended
%% node containers. If they can not, abort the connection.
%%
-check_dflag_xnc(#hs_data{other_node = Node,
- other_flags = OtherFlags,
- other_started = OtherStarted} = HSData) ->
- XRFlg = ?DFLAG_EXTENDED_REFERENCES,
- XPPFlg = case erlang:system_info(compat_rel) of
- R when R >= 10 ->
- ?DFLAG_EXTENDED_PIDS_PORTS;
- _ ->
- 0
- end,
- ReqXncFlags = XRFlg bor XPPFlg,
- case OtherFlags band ReqXncFlags =:= ReqXncFlags of
- true ->
- ok;
- false ->
- What = case {OtherFlags band XRFlg =:= XRFlg,
- OtherFlags band XPPFlg =:= XPPFlg} of
- {false, false} -> "references, pids and ports";
- {true, false} -> "pids and ports";
- {false, true} -> "references"
- end,
+check_dflags(#hs_data{other_node = Node,
+ other_flags = OtherFlags,
+ other_started = OtherStarted} = HSData) ->
+
+ Mandatory = [{?DFLAG_EXTENDED_REFERENCES, "EXTENDED_REFERENCES"},
+ {?DFLAG_EXTENDED_PIDS_PORTS, "EXTENDED_PIDS_PORTS"},
+ {?DFLAG_UTF8_ATOMS, "UTF8_ATOMS"}],
+ Missing = lists:filtermap(fun({Bit, Str}) ->
+ case Bit band OtherFlags of
+ Bit -> false;
+ 0 -> {true, Str}
+ end
+ end,
+ Mandatory),
+ case Missing of
+ [] ->
+ ok;
+ _ ->
case OtherStarted of
true ->
send_status(HSData, not_allowed),
@@ -199,9 +196,9 @@ check_dflag_xnc(#hs_data{other_node = Node,
How = "aborted"
end,
error_msg("** ~w: Connection attempt ~s node ~w ~s "
- "since it cannot handle extended ~s. "
- "**~n", [node(), Dir, Node, How, What]),
- ?shutdown2(Node, {check_dflag_xnc_failed, What})
+ "since it cannot handle ~p."
+ "**~n", [node(), Dir, Node, How, Missing]),
+ ?shutdown2(Node, {check_dflags_failed, Missing})
end.
@@ -327,7 +324,7 @@ handshake_we_started(#hs_data{request_type=ReqType,
NewHSData = HSData#hs_data{this_flags = ThisFlags,
other_flags = OtherFlags,
other_started = false},
- check_dflag_xnc(NewHSData),
+ check_dflags(NewHSData),
MyChallenge = gen_challenge(),
{MyCookie,HisCookie} = get_cookies(Node),
send_challenge_reply(NewHSData,MyChallenge,
diff --git a/lib/kernel/src/inet.erl b/lib/kernel/src/inet.erl
index f5c13ecdd7..5be790b7d9 100644
--- a/lib/kernel/src/inet.erl
+++ b/lib/kernel/src/inet.erl
@@ -702,7 +702,7 @@ connect_options() ->
header, active, packet, packet_size, buffer, mode, deliver, line_delimiter,
exit_on_close, high_watermark, low_watermark, high_msgq_watermark,
low_msgq_watermark, send_timeout, send_timeout_close, delay_send, raw,
- show_econnreset].
+ show_econnreset, bind_to_device].
connect_options(Opts, Mod) ->
BaseOpts =
@@ -770,7 +770,7 @@ listen_options() ->
header, active, packet, buffer, mode, deliver, backlog, ipv6_v6only,
exit_on_close, high_watermark, low_watermark, high_msgq_watermark,
low_msgq_watermark, send_timeout, send_timeout_close, delay_send,
- packet_size, raw, show_econnreset].
+ packet_size, raw, show_econnreset, bind_to_device].
listen_options(Opts, Mod) ->
BaseOpts =
@@ -850,7 +850,7 @@ udp_options() ->
deliver, ipv6_v6only,
broadcast, dontroute, multicast_if, multicast_ttl, multicast_loop,
add_membership, drop_membership, read_packets,raw,
- high_msgq_watermark, low_msgq_watermark].
+ high_msgq_watermark, low_msgq_watermark, bind_to_device].
udp_options(Opts, Mod) ->
@@ -919,6 +919,7 @@ sctp_options() ->
[ % The following are generic inet options supported for SCTP sockets:
mode, active, buffer, tos, tclass, priority, dontroute, reuseaddr, linger, sndbuf,
recbuf, ipv6_v6only, high_msgq_watermark, low_msgq_watermark,
+ bind_to_device,
% Other options are SCTP-specific (though they may be similar to their
% TCP and UDP counter-parts):
@@ -1055,7 +1056,6 @@ binary2filename(Bin) ->
Bin
end.
-
translate_ip(any, inet) -> {0,0,0,0};
translate_ip(loopback, inet) -> {127,0,0,1};
translate_ip(any, inet6) -> {0,0,0,0,0,0,0,0};
diff --git a/lib/kernel/src/inet_int.hrl b/lib/kernel/src/inet_int.hrl
index 4e8f59a3b9..e6cd48935a 100644
--- a/lib/kernel/src/inet_int.hrl
+++ b/lib/kernel/src/inet_int.hrl
@@ -154,6 +154,7 @@
-define(INET_LOPT_TCP_SHOW_ECONNRESET, 39).
-define(INET_LOPT_LINE_DELIM, 40).
-define(INET_OPT_TCLASS, 41).
+-define(INET_OPT_BIND_TO_DEVICE, 42).
% Specific SCTP options: separate range:
-define(SCTP_OPT_RTOINFO, 100).
-define(SCTP_OPT_ASSOCINFO, 101).
diff --git a/lib/kernel/src/kernel.appup.src b/lib/kernel/src/kernel.appup.src
index b505524471..2dc90e2b3e 100644
--- a/lib/kernel/src/kernel.appup.src
+++ b/lib/kernel/src/kernel.appup.src
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max one major revision back
- [{<<"5\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-19.*
+ [{<<"5\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-19.*
%% Down to - max one major revision back
- [{<<"5\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-19.*
+ [{<<"5\\.[0-2](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-19.*
}.
diff --git a/lib/kernel/src/kernel.erl b/lib/kernel/src/kernel.erl
index 59eca242b1..b901da95b8 100644
--- a/lib/kernel/src/kernel.erl
+++ b/lib/kernel/src/kernel.erl
@@ -100,63 +100,112 @@ get_error_logger_type() ->
%%%-----------------------------------------------------------------
init([]) ->
- SupFlags = {one_for_all, 0, 1},
-
- Config = {kernel_config,
- {kernel_config, start_link, []},
- permanent, 2000, worker, [kernel_config]},
- Code = {code_server,
- {code, start_link, []},
- permanent, 2000, worker, [code]},
- File = {file_server_2,
- {file_server, start_link, []},
- permanent, 2000, worker,
- [file, file_server, file_io_server, prim_file]},
- StdError = {standard_error,
- {standard_error, start_link, []},
- temporary, 2000, supervisor, [user_sup]},
- User = {user,
- {user_sup, start, []},
- temporary, 2000, supervisor, [user_sup]},
-
+ SupFlags = #{strategy => one_for_all,
+ intensity => 0,
+ period => 1},
+
+ Config = #{id => kernel_config,
+ start => {kernel_config, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [kernel_config]},
+
+ Code = #{id => code_server,
+ start => {code, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [code]},
+
+ File = #{id => file_server_2,
+ start => {file_server, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modeules => [file, file_server, file_io_server, prim_file]},
+
+ StdError = #{id => standard_error,
+ start => {standard_error, start_link, []},
+ restart => temporary,
+ shutdown => 2000,
+ type => supervisor,
+ modules => [user_sup]},
+
+ User = #{id => user,
+ start => {user_sup, start, []},
+ restart => temporary,
+ shutdown => 2000,
+ type => supervisor,
+ modules => [user_sup]},
+
+ SafeSup = #{id => kernel_safe_sup,
+ start =>{supervisor, start_link, [{local, kernel_safe_sup}, ?MODULE, safe]},
+ restart => permanent,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [?MODULE]},
+
case init:get_argument(mode) of
- {ok, [["minimal"]]} ->
- SafeSupervisor = {kernel_safe_sup,
- {supervisor, start_link,
- [{local, kernel_safe_sup}, ?MODULE, safe]},
- permanent, infinity, supervisor, [?MODULE]},
- {ok, {SupFlags,
- [Code, File, StdError, User,
- Config, SafeSupervisor]}};
- _ ->
- Rpc = {rex, {rpc, start_link, []},
- permanent, 2000, worker, [rpc]},
- Global = {global_name_server, {global, start_link, []},
- permanent, 2000, worker, [global]},
- Glo_grp = {global_group, {global_group,start_link,[]},
- permanent, 2000, worker, [global_group]},
- InetDb = {inet_db, {inet_db, start_link, []},
- permanent, 2000, worker, [inet_db]},
- NetSup = {net_sup, {erl_distribution, start_link, []},
- permanent, infinity, supervisor,[erl_distribution]},
+ {ok, [["minimal"]]} ->
+ {ok, {SupFlags, [Code, File, StdError, User, Config, SafeSup]}};
+ _ ->
+ Rpc = #{id => rex,
+ start => {rpc, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [rpc]},
+
+ Global = #{id => global_name_server,
+ start => {global, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [global]},
+
+ GlGroup = #{id => global_group,
+ start => {global_group,start_link,[]},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [global_group]},
+
+ InetDb = #{id => inet_db,
+ start => {inet_db, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [inet_db]},
+
+ NetSup = #{id => net_sup,
+ start => {erl_distribution, start_link, []},
+ restart => permanent,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [erl_distribution]},
+
SigSrv = #{id => erl_signal_server,
start => {gen_event, start_link, [{local, erl_signal_server}]},
- type => worker, restart => permanent, shutdown => 2000, modules => dynamic},
- DistAC = start_dist_ac(),
-
- Timer = start_timer(),
-
- SafeSupervisor = {kernel_safe_sup,
- {supervisor, start_link,
- [{local, kernel_safe_sup}, ?MODULE, safe]},
- permanent, infinity, supervisor, [?MODULE]},
- {ok, {SupFlags,
- [Code, Rpc, Global, InetDb | DistAC] ++
- [NetSup, Glo_grp, File, SigSrv,
- StdError, User, Config, SafeSupervisor] ++ Timer}}
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => dynamic},
+
+ DistAC = start_dist_ac(),
+
+ Timer = start_timer(),
+
+ {ok, {SupFlags,
+ [Code, Rpc, Global, InetDb | DistAC] ++
+ [NetSup, GlGroup, File, SigSrv,
+ StdError, User, Config, SafeSup] ++ Timer}}
end;
init(safe) ->
- SupFlags = {one_for_one, 4, 3600},
+ SupFlags = #{strategy => one_for_one,
+ intensity => 4,
+ period => 3600},
+
Boot = start_boot_server(),
DiskLog = start_disk_log(),
Pg2 = start_pg2(),
@@ -170,60 +219,85 @@ init(safe) ->
{ok, {SupFlags, Boot ++ DiskLog ++ Pg2}}.
start_dist_ac() ->
- Spec = [{dist_ac,{dist_ac,start_link,[]},permanent,2000,worker,[dist_ac]}],
+ Spec = [#{id => dist_ac,
+ start => {dist_ac,start_link,[]},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [dist_ac]}],
case application:get_env(kernel, start_dist_ac) of
- {ok, true} -> Spec;
- {ok, false} -> [];
- undefined ->
- case application:get_env(kernel, distributed) of
- {ok, _} -> Spec;
- _ -> []
- end
+ {ok, true} -> Spec;
+ {ok, false} -> [];
+ undefined ->
+ case application:get_env(kernel, distributed) of
+ {ok, _} -> Spec;
+ _ -> []
+ end
end.
start_boot_server() ->
case application:get_env(kernel, start_boot_server) of
- {ok, true} ->
- Args = get_boot_args(),
- [{boot_server, {erl_boot_server, start_link, [Args]}, permanent,
- 1000, worker, [erl_boot_server]}];
- _ ->
- []
+ {ok, true} ->
+ Args = get_boot_args(),
+ [#{id => boot_server,
+ start => {erl_boot_server, start_link, [Args]},
+ restart => permanent,
+ shutdown => 1000,
+ type => worker,
+ modules => [erl_boot_server]}];
+ _ ->
+ []
end.
get_boot_args() ->
case application:get_env(kernel, boot_server_slaves) of
- {ok, Slaves} -> Slaves;
- _ -> []
+ {ok, Slaves} -> Slaves;
+ _ -> []
end.
start_disk_log() ->
case application:get_env(kernel, start_disk_log) of
- {ok, true} ->
- [{disk_log_server,
- {disk_log_server, start_link, []},
- permanent, 2000, worker, [disk_log_server]},
- {disk_log_sup, {disk_log_sup, start_link, []}, permanent,
- 1000, supervisor, [disk_log_sup]}];
- _ ->
- []
+ {ok, true} ->
+ [#{id => disk_log_server,
+ start => {disk_log_server, start_link, []},
+ restart => permanent,
+ shutdown => 2000,
+ type => worker,
+ modules => [disk_log_server]},
+ #{id => disk_log_sup,
+ start => {disk_log_sup, start_link, []},
+ restart => permanent,
+ shutdown => 1000,
+ type => supervisor,
+ modules => [disk_log_sup]}];
+ _ ->
+ []
end.
start_pg2() ->
case application:get_env(kernel, start_pg2) of
- {ok, true} ->
- [{pg2, {pg2, start_link, []}, permanent, 1000, worker, [pg2]}];
- _ ->
- []
+ {ok, true} ->
+ [#{id => pg2,
+ start => {pg2, start_link, []},
+ restart => permanent,
+ shutdown => 1000,
+ type => worker,
+ modules => [pg2]}];
+ _ ->
+ []
end.
start_timer() ->
case application:get_env(kernel, start_timer) of
- {ok, true} ->
- [{timer_server, {timer, start_link, []}, permanent, 1000, worker,
- [timer]}];
- _ ->
- []
+ {ok, true} ->
+ [#{id => timer_server,
+ start => {timer, start_link, []},
+ restart => permanent,
+ shutdown => 1000,
+ type => worker,
+ modules => [timer]}];
+ _ ->
+ []
end.
%%-----------------------------------------------------------------
diff --git a/lib/kernel/test/code_SUITE.erl b/lib/kernel/test/code_SUITE.erl
index 1f4591a5a3..088d851b09 100644
--- a/lib/kernel/test/code_SUITE.erl
+++ b/lib/kernel/test/code_SUITE.erl
@@ -107,6 +107,10 @@ init_per_testcase(big_boot_embedded, Config) ->
_Else ->
{skip, "Needs crypto!"}
end;
+init_per_testcase(on_load_embedded, Config) ->
+ LibRoot = code:lib_dir(),
+ LinkName = filename:join(LibRoot, "on_load_app-1.0"),
+ [{link_name,LinkName}|Config];
init_per_testcase(_Func, Config) ->
P = code:get_path(),
[{code_path, P}|Config].
@@ -124,6 +128,10 @@ end_per_testcase(TC, Config) when TC == mult_lib_roots;
NodeName = list_to_atom(atom_to_list(TC)++"@"++HostName),
test_server:stop_node(NodeName),
end_per_testcase(Config);
+end_per_testcase(on_load_embedded, Config) ->
+ LinkName = proplists:get_value(link_name, Config),
+ _ = del_link(LinkName),
+ end_per_testcase(Config);
end_per_testcase(_Func, Config) ->
end_per_testcase(Config).
@@ -1271,10 +1279,9 @@ on_load_embedded(Config) when is_list(Config) ->
on_load_embedded_1(Config) ->
DataDir = proplists:get_value(data_dir, Config),
+ LinkName = proplists:get_value(link_name, Config),
%% Link the on_load_app application into the lib directory.
- LibRoot = code:lib_dir(),
- LinkName = filename:join(LibRoot, "on_load_app-1.0"),
OnLoadApp = filename:join(DataDir, "on_load_app-1.0"),
del_link(LinkName),
io:format("LinkName :~p, OnLoadApp: ~p~n",[LinkName,OnLoadApp]),
@@ -1308,8 +1315,7 @@ on_load_embedded_1(Config) ->
ok = rpc:call(Node, on_load_embedded, status, []),
%% Clean up.
- stop_node(Node),
- ok = del_link(LinkName).
+ stop_node(Node).
del_link(LinkName) ->
case file:delete(LinkName) of
@@ -1360,9 +1366,8 @@ create_big_boot(Config) ->
%% corresponding beam file (if hipe is not enabled).
filter_app("hipe",_) -> false;
-%% Dialyzer and typer depends on hipe
+%% Dialyzer depends on hipe
filter_app("dialyzer",_) -> false;
-filter_app("typer",_) -> false;
%% Orber requires explicit configuration
filter_app("orber",_) -> false;
diff --git a/lib/kernel/test/disk_log_SUITE.erl b/lib/kernel/test/disk_log_SUITE.erl
index 23fe975ef7..079cc2f90f 100644
--- a/lib/kernel/test/disk_log_SUITE.erl
+++ b/lib/kernel/test/disk_log_SUITE.erl
@@ -481,7 +481,7 @@ halt_ro_crash(Conf) when is_list(Conf) ->
%% This is how it was before R6B:
%% {C1,T1,15} = disk_log:chunk(a,start),
%% {C2,T2} = disk_log:chunk(a,C1),
- {C1,_OneItem,7478} = disk_log:chunk(a,start),
+ {C1,_OneItem,7476} = disk_log:chunk(a,start),
{C2, [], 7} = disk_log:chunk(a,C1),
eof = disk_log:chunk(a,C2),
ok = disk_log:close(a),
@@ -2502,8 +2502,8 @@ error_repair(Conf) when is_list(Conf) ->
ok = disk_log:close(n),
BadFile = add_ext(File, 2), % current file
set_opened(BadFile),
- crash(BadFile, 28), % the binary is now invalid
- {repaired,n,{recovered,0},{badbytes,26}} =
+ crash(BadFile, 26), % the binary is now invalid
+ {repaired,n,{recovered,0},{badbytes,24}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {40,No}}]),
ok = disk_log:close(n),
@@ -2518,8 +2518,8 @@ error_repair(Conf) when is_list(Conf) ->
ok = disk_log:close(n),
BadFile2 = add_ext(File, 1), % current file
set_opened(BadFile2),
- crash(BadFile2, 51), % the second binary is now invalid
- {repaired,n,{recovered,1},{badbytes,26}} =
+ crash(BadFile2, 47), % the second binary is now invalid
+ {repaired,n,{recovered,1},{badbytes,24}} =
disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {size, {4000,No}}]),
ok = disk_log:close(n),
@@ -2571,7 +2571,7 @@ error_repair(Conf) when is_list(Conf) ->
ok = disk_log:close(n),
set_opened(File),
crash(File, 30),
- {repaired,n,{recovered,3},{badbytes,16}} =
+ {repaired,n,{recovered,3},{badbytes,15}} =
disk_log:open([{name, n}, {file, File}, {type, halt},
{format, internal},{repair,true},
{head_func, {?MODULE, head_fun, [{ok,"head"}]}}]),
@@ -2797,7 +2797,7 @@ chunk(Conf) when is_list(Conf) ->
ok = disk_log:log_terms(n, [{some,terms}]), % second file full
2 = curf(n),
BadFile = add_ext(File, 1),
- crash(BadFile, 28), % the _binary_ is now invalid
+ crash(BadFile, 26), % the _binary_ is now invalid
{error, {corrupt_log_file, BFile}} = disk_log:chunk(n, start, 1),
BadFile = BFile,
ok = disk_log:close(n),
@@ -2807,7 +2807,7 @@ chunk(Conf) when is_list(Conf) ->
{format, internal}]),
ok = disk_log:log_terms(n, [{this,is}]),
ok = disk_log:sync(n),
- crash(File, 28), % the _binary_ is now invalid
+ crash(File, 26), % the _binary_ is now invalid
{error, {corrupt_log_file, File2}} = disk_log:chunk(n, start, 1),
crash(File, 10),
{error,{corrupt_log_file,_}} = disk_log:bchunk(n, start, 1),
@@ -2901,8 +2901,8 @@ chunk(Conf) when is_list(Conf) ->
{ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{format, internal}, {mode, read_only}]),
CrashFile = add_ext(File, 1),
- crash(CrashFile, 51), % the binary term {some,terms} is now bad
- {H1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
+ crash(CrashFile, 46), % the binary term {some,terms} is now bad
+ {H1, [{this,is}], 16} = disk_log:chunk(n, start, 10),
{H2, [{on,a},{wrap,file}]} = disk_log:chunk(n, H1),
eof = disk_log:chunk(n, H2),
ok = disk_log:close(n),
@@ -2916,8 +2916,8 @@ chunk(Conf) when is_list(Conf) ->
ok = disk_log:close(n),
{ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
{format, internal}, {mode, read_only}]),
- crash(File, 51), % the binary term {some,terms} is now bad
- {J1, [{this,is}], 18} = disk_log:chunk(n, start, 10),
+ crash(File, 46), % the binary term {some,terms} is now bad
+ {J1, [{this,is}], 16} = disk_log:chunk(n, start, 10),
{J2, [{on,a},{halt,file}]} = disk_log:chunk(n, J1),
eof = disk_log:chunk(n, J2),
ok = disk_log:close(n),
@@ -2932,8 +2932,8 @@ chunk(Conf) when is_list(Conf) ->
ok = disk_log:close(n),
{ok, n} = disk_log:open([{name, n}, {file, File}, {type, halt},
{format, internal}, {mode, read_only}]),
- crash(File, 44), % the binary term {s} is now bad
- {J11, [{this,is}], 7} = disk_log:chunk(n, start, 10),
+ crash(File, 40), % the binary term {s} is now bad
+ {J11, [{this,is}], 6} = disk_log:chunk(n, start, 10),
{J21, [{on,a},{halt,file}]} = disk_log:chunk(n, J11),
eof = disk_log:chunk(n, J21),
ok = disk_log:close(n),
@@ -3052,7 +3052,7 @@ truncate(Conf) when is_list(Conf) ->
ok = disk_log:truncate(n, apa),
rec(1, {disk_log, node(), n, {truncated, 6}}),
{0, 0} = no_overflows(n),
- 23 = curb(n),
+ 22 = curb(n),
1 = curf(n),
1 = cur_cnt(n),
true = (Size == sz(n)),
@@ -3072,7 +3072,7 @@ truncate(Conf) when is_list(Conf) ->
ok = disk_log:truncate(n, apa),
rec(1, {disk_log, node(), n, {truncated, 3}}),
{0, 0} = no_overflows(n),
- 23 = curb(n),
+ 22 = curb(n),
1 = curf(n),
1 = cur_cnt(n),
true = (Size == sz(n)),
@@ -3181,45 +3181,45 @@ info_current(Conf) when is_list(Conf) ->
%% Internal with header.
{ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{head, header}, {size, {100,No}}]),
- {26, 1} = {curb(n), cur_cnt(n)},
+ {25, 1} = {curb(n), cur_cnt(n)},
{1, 1} = {no_written_items(n), no_items(n)},
ok = disk_log:log(n, B),
- {94, 2} = {curb(n), cur_cnt(n)},
+ {93, 2} = {curb(n), cur_cnt(n)},
{2, 2} = {no_written_items(n), no_items(n)},
ok = disk_log:close(n),
{ok, n} = disk_log:open([{name, n}, {file, File}, {type, wrap},
{notify, true},
{head, header}, {size, {100,No}}]),
- {94, 2} = {curb(n), cur_cnt(n)},
+ {93, 2} = {curb(n), cur_cnt(n)},
{0, 2} = {no_written_items(n), no_items(n)},
ok = disk_log:log(n, B),
rec(1, {disk_log, node(), n, {wrap, 0}}),
- {94, 2} = {curb(n), cur_cnt(n)},
+ {93, 2} = {curb(n), cur_cnt(n)},
{2, 4} = {no_written_items(n), no_items(n)},
disk_log:inc_wrap_file(n),
rec(1, {disk_log, node(), n, {wrap, 0}}),
- {26, 1} = {curb(n), cur_cnt(n)},
+ {25, 1} = {curb(n), cur_cnt(n)},
{3, 4} = {no_written_items(n), no_items(n)},
ok = disk_log:log_terms(n, [B,B,B]),
%% Used to be one message, but now one per wrapped file.
rec(1, {disk_log, node(), n, {wrap, 0}}),
rec(1, {disk_log, node(), n, {wrap, 2}}),
- {94, 2} = {curb(n), cur_cnt(n)},
+ {93, 2} = {curb(n), cur_cnt(n)},
{8, 7} = {no_written_items(n), no_items(n)},
ok = disk_log:log_terms(n, [B]),
rec(1, {disk_log, node(), n, {wrap, 2}}),
ok = disk_log:log_terms(n, [B]),
rec(1, {disk_log, node(), n, {wrap, 2}}),
- {94, 2} = {curb(n), cur_cnt(n)},
+ {93, 2} = {curb(n), cur_cnt(n)},
{12, 7} = {no_written_items(n), no_items(n)},
ok = disk_log:log_terms(n, [BB,BB]),
%% Used to be one message, but now one per wrapped file.
rec(2, {disk_log, node(), n, {wrap, 2}}),
- {194, 2} = {curb(n), cur_cnt(n)},
+ {193, 2} = {curb(n), cur_cnt(n)},
{16, 7} = {no_written_items(n), no_items(n)},
ok = disk_log:log_terms(n, [SB,SB,SB]),
rec(1, {disk_log, node(), n, {wrap, 2}}),
- {80, 4} = {curb(n), cur_cnt(n)},
+ {79, 4} = {curb(n), cur_cnt(n)},
{20, 9} = {no_written_items(n), no_items(n)},
ok = disk_log:close(n),
del(File, No),
diff --git a/lib/kernel/test/erl_distribution_wb_SUITE.erl b/lib/kernel/test/erl_distribution_wb_SUITE.erl
index 61aa3b32ee..c1dc208cc1 100644
--- a/lib/kernel/test/erl_distribution_wb_SUITE.erl
+++ b/lib/kernel/test/erl_distribution_wb_SUITE.erl
@@ -56,10 +56,14 @@
-define(DFLAG_HIDDEN_ATOM_CACHE,16#40).
-define(DFLAG_NEW_FUN_TAGS,16#80).
-define(DFLAG_EXTENDED_PIDS_PORTS,16#100).
+-define(DFLAG_UTF8_ATOMS, 16#10000).
%% From R9 and forward extended references is compulsory
%% From R10 and forward extended pids and ports are compulsory
--define(COMPULSORY_DFLAGS, (?DFLAG_EXTENDED_REFERENCES bor ?DFLAG_EXTENDED_PIDS_PORTS)).
+%% From R20 and forward UTF8 atoms are compulsory
+-define(COMPULSORY_DFLAGS, (?DFLAG_EXTENDED_REFERENCES bor
+ ?DFLAG_EXTENDED_PIDS_PORTS bor
+ ?DFLAG_UTF8_ATOMS)).
-define(shutdown(X), exit(X)).
diff --git a/lib/kernel/test/inet_SUITE.erl b/lib/kernel/test/inet_SUITE.erl
index f60c13d2e3..86f6b95fb9 100644
--- a/lib/kernel/test/inet_SUITE.erl
+++ b/lib/kernel/test/inet_SUITE.erl
@@ -40,7 +40,8 @@
lookup_bad_search_option/1,
getif/1,
getif_ifr_name_overflow/1,getservbyname_overflow/1, getifaddrs/1,
- parse_strict_address/1, simple_netns/1, simple_netns_open/1]).
+ parse_strict_address/1, simple_netns/1, simple_netns_open/1,
+ simple_bind_to_device/1, simple_bind_to_device_open/1]).
-export([get_hosts/1, get_ipv6_hosts/1, parse_hosts/1, parse_address/1,
kill_gethost/0, parallell_gethost/0, test_netns/0]).
@@ -58,7 +59,8 @@ all() ->
gethostnative_debug_level, gethostnative_soft_restart,
lookup_bad_search_option,
getif, getif_ifr_name_overflow, getservbyname_overflow,
- getifaddrs, parse_strict_address, simple_netns, simple_netns_open].
+ getifaddrs, parse_strict_address, simple_netns, simple_netns_open,
+ simple_bind_to_device, simple_bind_to_device_open].
groups() ->
[{parse, [], [parse_hosts, parse_address]}].
@@ -1247,3 +1249,67 @@ cmd(CmdString) ->
io:put_chars(["# ",CmdString,io_lib:nl()]),
io:put_chars([os:cmd(CmdString++" ; echo ' =>' $?")]),
ok.
+
+-define(CAP_NET_RAW, 13). %% from /usr/include/linux/capability.h
+
+can_bind_to_device({unix, linux}, {Major, _, _})
+ when Major > 2 ->
+ Status = os:cmd("cat /proc/self/status | grep CapEff"),
+ [_, CapEffStr] = string:tokens(Status, [$\n, $\t]),
+ CapEff = list_to_integer(CapEffStr, 16),
+ if CapEff band (1 bsl ?CAP_NET_RAW) =/= 0 ->
+ ok;
+ true ->
+ {skip,"insufficient capabilities, CAP_NET_RAW not granted"}
+ end;
+can_bind_to_device(_OS, _Version) ->
+ {skip,"socket option bind_to_device not supported on this OS or version"}.
+
+simple_bind_to_device(Config) when is_list(Config) ->
+ case can_bind_to_device(os:type(), os:version()) of
+ ok ->
+ {ok,U} = gen_udp:open(0),
+ jog_bind_to_device_opt(U),
+ ok = gen_udp:close(U),
+ %%
+ {ok,L} = gen_tcp:listen(0, []),
+ jog_bind_to_device_opt(L),
+ ok = gen_tcp:close(L),
+ %%
+ case gen_sctp:open() of
+ {ok,S} ->
+ jog_bind_to_device_opt(S),
+ ok = gen_sctp:close(S);
+ {error,eprotonosupport} ->
+ ok
+ end;
+ Other ->
+ Other
+ end.
+
+%% Smoke test bind_to_device support.
+simple_bind_to_device_open(Config) when is_list(Config) ->
+ case can_bind_to_device(os:type(), os:version()) of
+ ok ->
+ {ok,U} = gen_udp:open(0, [binary,{bind_to_device,<<"lo">>},inet]),
+ ok = gen_udp:close(U),
+ {ok,T} = gen_tcp:listen(0, [binary,{bind_to_device,<<"lo">>},inet]),
+ ok = gen_tcp:close(T),
+
+ case gen_sctp:open(0, [binary,{bind_to_device,<<"lo">>},inet]) of
+ {ok,S} ->
+ ok = gen_sctp:close(S);
+ {error,eprotonosupport} ->
+ ok
+ end;
+ Other ->
+ Other
+ end.
+
+jog_bind_to_device_opt(S) ->
+ %% This is just jogging the option mechanics
+ ok = inet:setopts(S, [{bind_to_device,<<>>}]),
+ {ok,[{bind_to_device,<<>>}]} = inet:getopts(S, [bind_to_device]),
+ ok = inet:setopts(S, [{bind_to_device,<<"lo">>}]),
+ {ok,[{bind_to_device,<<"lo">>}]} = inet:getopts(S, [bind_to_device]),
+ ok.
diff --git a/lib/kernel/test/pg2_SUITE.erl b/lib/kernel/test/pg2_SUITE.erl
index fdc268cb5a..9460608a3e 100644
--- a/lib/kernel/test/pg2_SUITE.erl
+++ b/lib/kernel/test/pg2_SUITE.erl
@@ -31,7 +31,7 @@
-export([
otp_7277/1, otp_8259/1, otp_8653/1,
- compat/1, basic/1]).
+ basic/1]).
-define(TESTCASE, testcase_name).
-define(testcase, proplists:get_value(?TESTCASE, Config)).
@@ -56,7 +56,7 @@ all() ->
groups() ->
[{tickets, [],
- [otp_7277, otp_8259, otp_8653, compat, basic]}].
+ [otp_7277, otp_8259, otp_8653, basic]}].
init_per_suite(Config) ->
Config.
@@ -218,29 +218,6 @@ loop() ->
exit(normal)
end.
-%% OTP-8259. Check that 'exchange' and 'del_member' work.
-compat(Config) when is_list(Config) ->
- case test_server:is_release_available("r13b") of
- true ->
- Pid = spawn(forever()),
- G = a,
- ok = pg2:create(G),
- ok = pg2:join(G, Pid),
- ok = pg2:join(G, Pid),
- {ok, A} = start_node_rel(r13, r13b, slave),
- pong = net_adm:ping(A),
- wait_for_ready_net(Config),
- {ok, _} = rpc:call(A, pg2, start, []),
- ?UNTIL([Pid,Pid] =:= rpc:call(A, pg2, get_members, [a])),
- true = exit(Pid, kill),
- ?UNTIL([] =:= pg2:get_members(a)),
- ?UNTIL([] =:= rpc:call(A, pg2, get_members, [a])),
- test_server:stop_node(A),
- ok;
- false ->
- {skipped, "No support for old node"}
- end.
-
%% OTP-8259. Some basic tests.
basic(Config) when is_list(Config) ->
_ = [pg2:delete(G) || G <- pg2:which_groups()],
diff --git a/lib/kernel/test/prim_file_SUITE.erl b/lib/kernel/test/prim_file_SUITE.erl
index 8be94f1e57..0c84a7d1cc 100644
--- a/lib/kernel/test/prim_file_SUITE.erl
+++ b/lib/kernel/test/prim_file_SUITE.erl
@@ -19,8 +19,8 @@
%%
-module(prim_file_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2,
- read_write_file/1]).
+ init_per_group/2,end_per_group/2, init_per_testcase/2, end_per_testcase/2,
+ read_write_file/1, free_memory/0]).
-export([cur_dir_0a/1, cur_dir_0b/1,
cur_dir_1a/1, cur_dir_1b/1,
make_del_dir_a/1, make_del_dir_b/1,
@@ -115,6 +115,18 @@ groups() ->
[make_link_a, make_link_b, read_link_info_for_non_link,
symlinks_a, symlinks_b, list_dir_error]}].
+init_per_testcase(large_write, Config) ->
+ {ok, Started} = application:ensure_all_started(os_mon),
+ [{started, Started}|Config];
+init_per_testcase(_TestCase, Config) ->
+ Config.
+
+end_per_testcase(large_write, Config) ->
+ [application:stop(App) || App <- lists:reverse(proplists:get_value(started, Config))],
+ ok;
+end_per_testcase(_, _Config) ->
+ ok.
+
init_per_group(_GroupName, Config) ->
Config.
@@ -2022,11 +2034,13 @@ run_large_file_test(Config, Run, Name) ->
{{unix,sunos},OsVersion} when OsVersion < {5,5,1} ->
{skip,"Only supported on Win32, Unix or SunOS >= 5.5.1"};
{{unix,_},_} ->
- N = unix_free(proplists:get_value(priv_dir, Config)),
- io:format("Free disk: ~w KByte~n", [N]),
- if N < 5 bsl 20 ->
+ DiscFree = unix_free(proplists:get_value(priv_dir, Config)),
+ MemFree = free_memory(),
+ io:format("Free disk: ~w KByte~n", [DiscFree]),
+ io:format("Free mem: ~w MByte~n", [MemFree]),
+ if DiscFree < 5 bsl 20; MemFree < 5 bsl 10 ->
%% Less than 5 GByte free
- {skip,"Less than 5 GByte free disk"};
+ {skip,"Less than 5 GByte free disk/mem"};
true ->
do_run_large_file_test(Config, Run, Name)
end;
@@ -2079,6 +2093,27 @@ zip_data([], Bs) ->
zip_data(As, []) ->
As.
+%% Stolen from emulator -> alloc_SUITE
+free_memory() ->
+ %% Free memory in MB.
+ try
+ SMD = memsup:get_system_memory_data(),
+ {value, {free_memory, Free}} = lists:keysearch(free_memory, 1, SMD),
+ TotFree = (Free +
+ case lists:keysearch(cached_memory, 1, SMD) of
+ {value, {cached_memory, Cached}} -> Cached;
+ false -> 0
+ end +
+ case lists:keysearch(buffered_memory, 1, SMD) of
+ {value, {buffered_memory, Buffed}} -> Buffed;
+ false -> 0
+ end),
+ TotFree div (1024*1024)
+ catch
+ error : undef ->
+ ct:fail({"os_mon not built"})
+ end.
+
%%%-----------------------------------------------------------------
%%% Utilities
rm_rf(Mod,Dir) ->
diff --git a/lib/kernel/vsn.mk b/lib/kernel/vsn.mk
index 8d2517e680..76b020e8ed 100644
--- a/lib/kernel/vsn.mk
+++ b/lib/kernel/vsn.mk
@@ -1 +1 @@
-KERNEL_VSN = 5.1.1
+KERNEL_VSN = 5.2
diff --git a/lib/observer/doc/src/etop.xml b/lib/observer/doc/src/etop.xml
index d70d9d1d23..059f9f05d8 100644
--- a/lib/observer/doc/src/etop.xml
+++ b/lib/observer/doc/src/etop.xml
@@ -35,7 +35,7 @@
<file></file>
</header>
<module>etop</module>
- <modulesummary>Erlang Top is a tool for presenting information about Erlang
+ <modulesummary>Erlang Top is a tool for presenting information about Erlang
processes similar to the information presented by "top" in UNIX.</modulesummary>
<description>
@@ -60,11 +60,11 @@
<p>Value: <c>atom()</c></p>
<p>Mandatory</p></item>
<tag><c>setcookie</c></tag>
- <item><p>Cookie to use for the <c>etop</c> node. Must be same as the
+ <item><p>Cookie to use for the <c>etop</c> node. Must be same as the
cookie on the measured node.</p>
<p>Value: <c>atom()</c></p></item>
<tag><c>lines</c></tag>
- <item><p>Number of lines (processes) to display.</p>
+ <item><p>Number of lines (processes) to display.</p>
<p>Value: <c>integer()</c></p>
<p>Default: <c>10</c></p></item>
<tag><c>interval</c></tag>
@@ -92,7 +92,7 @@
<p>Default: <c>on</c></p></item>
</taglist>
- <p>For detalis about Erlang Top, see the
+ <p>For details about Erlang Top, see the
<seealso marker="etop_ug">User's Guide</seealso>.</p>
</description>
diff --git a/lib/observer/doc/src/notes.xml b/lib/observer/doc/src/notes.xml
index 8f3ebcb4de..79e2b2b9db 100644
--- a/lib/observer/doc/src/notes.xml
+++ b/lib/observer/doc/src/notes.xml
@@ -32,6 +32,47 @@
<p>This document describes the changes made to the Observer
application.</p>
+<section><title>Observer 2.3.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ etop erroneously reported the average scheduler
+ utilization since the tool was first started instead of
+ the scheduler utilization since last update. This is now
+ corrected.</p>
+ <p>
+ Own Id: OTP-14090 Aux Id: seq13232 </p>
+ </item>
+ <item>
+ <p>
+ crashdump_viewer crashed when the 'Slogan' had more than
+ one line. This is now corrected.</p>
+ <p>
+ Own Id: OTP-14093 Aux Id: ERL-318 </p>
+ </item>
+ <item>
+ <p>
+ When clicking an HTML-link to a port before the port tab
+ has been opened for the first time, observer would crash
+ since port info is not initiated. This is now corrected.</p>
+ <p>
+ Own Id: OTP-14151 Aux Id: PR-1296 </p>
+ </item>
+ <item>
+ <p>The dialyzer and observer applications will now use a
+ portable way to find the home directory. That means that
+ there is no longer any need to manually set the HOME
+ environment variable on Windows.</p>
+ <p>
+ Own Id: OTP-14249 Aux Id: ERL-161 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Observer 2.3</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/observer/doc/src/observer.xml b/lib/observer/doc/src/observer.xml
index 4d43ffe39f..fc6395d2c0 100644
--- a/lib/observer/doc/src/observer.xml
+++ b/lib/observer/doc/src/observer.xml
@@ -43,7 +43,7 @@
<seealso marker="ttb"><c>ttb</c></seealso>.
</p>
- <p>For detalis about how to get started, see the
+ <p>For details about how to get started, see the
<seealso marker="observer_ug"><c>User's Guide</c></seealso>.</p>
</description>
<funcs>
diff --git a/lib/observer/doc/src/observer_ug.xml b/lib/observer/doc/src/observer_ug.xml
index 6eb72f3e58..ae85ab7a29 100644
--- a/lib/observer/doc/src/observer_ug.xml
+++ b/lib/observer/doc/src/observer_ug.xml
@@ -107,6 +107,11 @@
see module
<seealso marker="erts:erts_alloc"><c>erts_alloc</c></seealso>
in application ERTS.</p>
+ <p>The <c>Max Carrier size</c> column shows the maximum value seen by observer
+ since the last node change or since the start of the application, i.e. switching
+ nodes will reset the max column. Values are sampled so higher values may have
+ existed than what is shown.
+ </p>
</section>
<section>
diff --git a/lib/observer/src/cdv_ets_cb.erl b/lib/observer/src/cdv_ets_cb.erl
index ddd2d42df6..18f0c86fd3 100644
--- a/lib/observer/src/cdv_ets_cb.erl
+++ b/lib/observer/src/cdv_ets_cb.erl
@@ -30,26 +30,23 @@
-include("crashdump_viewer.hrl").
%% Defines
--define(COL_ID, 0).
--define(COL_NAME, ?COL_ID+1).
--define(COL_SLOT, ?COL_NAME+1).
--define(COL_OWNER, ?COL_SLOT+1).
+-define(COL_NAME, 0).
+-define(COL_IS_NAMED, ?COL_NAME+1).
+-define(COL_OWNER, ?COL_IS_NAMED+1).
-define(COL_OBJ, ?COL_OWNER+1).
-define(COL_MEM, ?COL_OBJ+1).
%% Callbacks for cdv_virtual_list_wx
-col_to_elem(id) -> col_to_elem(?COL_ID);
-col_to_elem(?COL_ID) -> #ets_table.id;
+col_to_elem(id) -> col_to_elem(?COL_NAME);
+col_to_elem(?COL_IS_NAMED) -> #ets_table.is_named;
col_to_elem(?COL_NAME) -> #ets_table.name;
-col_to_elem(?COL_SLOT) -> #ets_table.slot;
col_to_elem(?COL_OWNER) -> #ets_table.pid;
col_to_elem(?COL_OBJ) -> #ets_table.size;
col_to_elem(?COL_MEM) -> #ets_table.memory.
col_spec() ->
- [{"Id", ?wxLIST_FORMAT_LEFT, 200},
- {"Name", ?wxLIST_FORMAT_LEFT, 200},
- {"Slot", ?wxLIST_FORMAT_RIGHT, 50},
+ [{"Name", ?wxLIST_FORMAT_LEFT, 200},
+ {"Is Named", ?wxLIST_FORMAT_CENTRE, 70},
{"Owner", ?wxLIST_FORMAT_CENTRE, 120},
{"Objects", ?wxLIST_FORMAT_RIGHT, 80},
{"Memory", ?wxLIST_FORMAT_RIGHT, 80}
@@ -68,7 +65,7 @@ get_details(Id, Data) ->
{ok,{"Table:" ++ Id,Proplist,""}}.
get_detail_cols(all) ->
- {[{ets, ?COL_ID}, {process, ?COL_OWNER}],true};
+ {[{ets, ?COL_NAME}, {process, ?COL_OWNER}],true};
get_detail_cols(_W) ->
{[],true}.
diff --git a/lib/observer/src/crashdump_viewer.erl b/lib/observer/src/crashdump_viewer.erl
index 13e73f027d..e21f1c501b 100644
--- a/lib/observer/src/crashdump_viewer.erl
+++ b/lib/observer/src/crashdump_viewer.erl
@@ -1555,10 +1555,14 @@ split_pid_list_no_space([],[],Pids) ->
%% Page with external ets tables
get_ets_tables(File,Pid,WS) ->
ParseFun = fun(Fd,Id) ->
- get_etsinfo(Fd,#ets_table{pid=list_to_pid(Id)},WS)
+ ET = get_etsinfo(Fd,#ets_table{pid=list_to_pid(Id)},WS),
+ ET#ets_table{is_named=tab_is_named(ET)}
end,
lookup_and_parse_index(File,{?ets,Pid},ParseFun,"ets").
+tab_is_named(#ets_table{id=Name,name=Name}) -> "yes";
+tab_is_named(#ets_table{}) -> "no".
+
get_etsinfo(Fd,EtsTable = #ets_table{details=Ds},WS) ->
case line_head(Fd) of
"Slot" ->
diff --git a/lib/observer/src/crashdump_viewer.hrl b/lib/observer/src/crashdump_viewer.hrl
index a08659efd6..742e145641 100644
--- a/lib/observer/src/crashdump_viewer.hrl
+++ b/lib/observer/src/crashdump_viewer.hrl
@@ -118,6 +118,7 @@
slot,
id,
name,
+ is_named,
data_type="hash",
buckets="-",
size,
diff --git a/lib/observer/src/observer_alloc_wx.erl b/lib/observer/src/observer_alloc_wx.erl
index ca54080e15..9e1442a5ca 100644
--- a/lib/observer/src/observer_alloc_wx.erl
+++ b/lib/observer/src/observer_alloc_wx.erl
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
-module(observer_alloc_wx).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -36,6 +36,7 @@
wins,
mem,
samples,
+ max,
panel,
paint,
appmon,
@@ -48,10 +49,10 @@
[make_win/4, setup_graph_drawing/1, refresh_panel/4, interval_dialog/2,
add_data/5, precalc/4]).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
try
TopP = wxPanel:new(Notebook),
Main = wxBoxSizer:new(?wxVERTICAL),
@@ -74,7 +75,8 @@ init([Notebook, Parent]) ->
wins = Windows,
mem = MemWin,
paint = PaintInfo,
- time = setup_time()
+ time = setup_time(Config),
+ max = #{}
}
}
catch _:Err ->
@@ -82,9 +84,11 @@ init([Notebook, Parent]) ->
{stop, Err}
end.
-setup_time() ->
- Freq = 1,
- #ti{fetch=Freq, disp=?DISP_FREQ/Freq}.
+setup_time(Config) ->
+ Freq = maps:get(fetch, Config, 1),
+ #ti{disp=?DISP_FREQ/Freq,
+ fetch=Freq,
+ secs=maps:get(secs, Config, ?DISP_SECONDS)}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
handle_event(#wx{id=?ID_REFRESH_INTERVAL, event=#wxCommand{type=command_menu_selected}},
@@ -115,6 +119,10 @@ handle_sync_event(#wx{obj=Panel, event = #wxPaint{}},_,
refresh_panel(Active, Win, Ti, Paint),
ok.
%%%%%%%%%%
+handle_call(get_config, _, #state{time=Ti}=State) ->
+ #ti{fetch=Fetch, secs=Range} = Ti,
+ {reply, #{fetch=>Fetch, secs=>Range}, State};
+
handle_call(Event, From, _State) ->
error({unhandled_call, Event, From}).
@@ -126,16 +134,17 @@ handle_info({Key, {promise_reply, {badrpc, _}}}, #state{async=Key} = State) ->
{noreply, State#state{active=false, appmon=undefined}};
handle_info({Key, {promise_reply, SysInfo}},
- #state{async=Key, panel=_Panel, samples=Data, active=Active, wins=Wins0,
- time=#ti{tick=Tick, disp=Disp0}=Ti} = S0) ->
+ #state{async=Key, samples=Data, max=Max0,
+ active=Active, wins=Wins0, time=#ti{tick=Tick, disp=Disp0}=Ti} = S0) ->
Disp = trunc(Disp0),
Next = max(Tick - Disp, 0),
erlang:send_after(1000 div ?DISP_FREQ, self(), {refresh, Next}),
Info = alloc_info(SysInfo),
+ Max = lists:foldl(fun calc_max/2, Max0, Info),
{Wins, Samples} = add_data(Info, Data, Wins0, Ti, Active),
- S1 = S0#state{time=Ti#ti{tick=Next}, wins=Wins, samples=Samples, async=undefined},
+ S1 = S0#state{time=Ti#ti{tick=Next}, wins=Wins, samples=Samples, max=Max, async=undefined},
if Active ->
- update_alloc(S0, Info),
+ update_alloc(S0, Info, Max),
State = precalc(S1),
{noreply, State};
true ->
@@ -187,25 +196,35 @@ code_change(_, _, State) ->
restart_fetcher(Node, #state{panel=Panel, wins=Wins0, time=Ti} = State) ->
SysInfo = observer_wx:try_rpc(Node, observer_backend, sys_info, []),
Info = alloc_info(SysInfo),
+ Max = lists:foldl(fun calc_max/2, #{}, Info),
{Wins, Samples} = add_data(Info, {0, queue:new()}, Wins0, Ti, true),
erlang:send_after(1000 div ?DISP_FREQ, self(), {refresh, 0}),
wxWindow:refresh(Panel),
precalc(State#state{active=true, appmon=Node, time=Ti#ti{tick=0},
- wins=Wins, samples=Samples}).
+ wins=Wins, samples=Samples, max=Max}).
precalc(#state{samples=Data0, paint=Paint, time=Ti, wins=Wins0}=State) ->
Wins = [precalc(Ti, Data0, Paint, Win) || Win <- Wins0],
State#state{wins=Wins}.
+calc_max({Name, _, Cs}, Max0) ->
+ case maps:get(Name, Max0, 0) of
+ Value when Value < Cs ->
+ Max0#{Name=>Cs};
+ _V ->
+ Max0
+ end.
-update_alloc(#state{mem=Grid}, Fields) ->
+update_alloc(#state{mem=Grid}, Fields, Max) ->
wxWindow:freeze(Grid),
- Max = wxListCtrl:getItemCount(Grid),
+ Last = wxListCtrl:getItemCount(Grid),
Update = fun({Name, BS, CS}, Row) ->
- (Row >= Max) andalso wxListCtrl:insertItem(Grid, Row, ""),
+ (Row >= Last) andalso wxListCtrl:insertItem(Grid, Row, ""),
+ MaxV = maps:get(Name, Max, CS),
wxListCtrl:setItem(Grid, Row, 0, observer_lib:to_str(Name)),
wxListCtrl:setItem(Grid, Row, 1, observer_lib:to_str(BS div 1024)),
wxListCtrl:setItem(Grid, Row, 2, observer_lib:to_str(CS div 1024)),
+ wxListCtrl:setItem(Grid, Row, 3, observer_lib:to_str(MaxV div 1024)),
Row + 1
end,
wx:foldl(Update, 0, Fields),
@@ -269,7 +288,9 @@ create_mem_info(Parent) ->
end,
ListItems = [{"Allocator Type", ?wxLIST_FORMAT_LEFT, 200},
{"Block size (kB)", ?wxLIST_FORMAT_RIGHT, 150},
- {"Carrier size (kB)",?wxLIST_FORMAT_RIGHT, 150}],
+ {"Carrier size (kB)",?wxLIST_FORMAT_RIGHT, 150},
+ {"Max Carrier size (kB)",?wxLIST_FORMAT_RIGHT, 150}
+ ],
lists:foldl(AddListEntry, 0, ListItems),
wxListItem:destroy(Li),
diff --git a/lib/observer/src/observer_app_wx.erl b/lib/observer/src/observer_app_wx.erl
index 80a41fdde9..63ca3aeba7 100644
--- a/lib/observer/src/observer_app_wx.erl
+++ b/lib/observer/src/observer_app_wx.erl
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
-module(observer_app_wx).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -73,10 +73,10 @@
-define(wxGC, wxGraphicsContext).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
-init([Notebook, Parent]) ->
+init([Notebook, Parent, _Config]) ->
Panel = wxPanel:new(Notebook, [{size, wxWindow:getClientSize(Notebook)},
{winid, 1}
]),
@@ -258,6 +258,8 @@ handle_sync_event(#wx{event = #wxPaint{}},_,
destroy_gc(GC),
ok.
%%%%%%%%%%
+handle_call(get_config, _, State) ->
+ {reply, #{}, State};
handle_call(Event, From, _State) ->
error({unhandled_call, Event, From}).
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 47844c1307..68095d7f58 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -24,7 +24,7 @@
display_progress_dialog/2, destroy_progress_dialog/0,
wait_for_progress/0, report_progress/1,
user_term/3, user_term_multiline/3,
- interval_dialog/4, start_timer/1, stop_timer/1,
+ interval_dialog/4, start_timer/1, start_timer/2, stop_timer/1, timer_config/1,
display_info/2, display_info/3, fill_info/2, update_info/2, to_str/1,
create_menus/3, create_menu_item/3,
create_attrs/0,
@@ -90,6 +90,12 @@ stop_timer(Timer = {true, _}) -> Timer;
stop_timer(Timer = {_, Intv}) ->
setup_timer(false, Timer),
{true, Intv}.
+
+start_timer(#{interval:=Intv}, _Def) ->
+ setup_timer(true, {false, Intv});
+start_timer(_, Def) ->
+ setup_timer(true, {false, Def}).
+
start_timer(Intv) when is_integer(Intv) ->
setup_timer(true, {true, Intv});
start_timer(Timer) ->
@@ -105,6 +111,11 @@ setup_timer(Bool, {Timer, Old}) ->
timer:cancel(Timer),
setup_timer(Bool, {false, Old}).
+timer_config({_, Interval}) ->
+ #{interval=>Interval};
+timer_config(#{}=Config) ->
+ Config.
+
display_info_dialog(Parent,Str) ->
display_info_dialog(Parent,"",Str).
display_info_dialog(Parent,Title,Str) ->
diff --git a/lib/observer/src/observer_perf_wx.erl b/lib/observer/src/observer_perf_wx.erl
index b0ead42e3f..fc5fb226db 100644
--- a/lib/observer/src/observer_perf_wx.erl
+++ b/lib/observer/src/observer_perf_wx.erl
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
-module(observer_perf_wx).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -55,12 +55,12 @@
-define(wxGC, wxGraphicsContext).
--record(paint, {font, small, pen, pen2, pens, usegc = false}).
+-record(paint, {font, small, pen, pen2, pens, dot_pens, usegc = false}).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
try
Panel = wxPanel:new(Notebook),
Main = wxBoxSizer:new(?wxVERTICAL),
@@ -81,7 +81,9 @@ init([Notebook, Parent]) ->
panel =Panel,
wins = Windows,
paint=PaintInfo,
- samples=reset_data()
+ samples=reset_data(),
+ time=#ti{fetch=maps:get(fetch, Config, ?FETCH_DATA),
+ secs=maps:get(secs, Config, ?DISP_SECONDS)}
},
{Panel, State0}
catch _:Err ->
@@ -124,13 +126,17 @@ setup_graph_drawing(Panels) ->
{F, SF}
end,
BlackPen = wxPen:new({0,0,0}, [{width, 1}]),
- Pens = [wxPen:new(Col, [{width, 1}]) || Col <- tuple_to_list(colors())],
+ Pens = [wxPen:new(Col, [{width, 1}, {style, ?wxSOLID}])
+ || Col <- tuple_to_list(colors())],
+ DotPens = [wxPen:new(Col, [{width, 1}, {style, ?wxDOT}])
+ || Col <- tuple_to_list(colors())],
#paint{usegc = UseGC,
font = Font,
small = SmallFont,
pen = ?wxGREY_PEN,
pen2 = BlackPen,
- pens = list_to_tuple(Pens)
+ pens = list_to_tuple(Pens),
+ dot_pens = list_to_tuple(DotPens)
}.
@@ -173,6 +179,10 @@ refresh_panel(Active, #win{name=_Id, panel=Panel}=Win, Ti, #paint{usegc=UseGC}=P
destroy_gc(GC).
%%%%%%%%%%
+handle_call(get_config, _, #state{time=Ti}=State) ->
+ #ti{fetch=Fetch, secs=Range} = Ti,
+ {reply, #{fetch=>Fetch, secs=>Range}, State};
+
handle_call(Event, From, _State) ->
error({unhandled_call, Event, From}).
@@ -181,17 +191,17 @@ handle_cast(Event, _State) ->
%%%%%%%%%%
handle_info({stats, 1, _, _, _} = Stats,
#state{panel=Panel, samples=Data, active=Active, wins=Wins0,
- time=#ti{tick=Tick, disp=Disp0}=Ti} = State0) ->
+ appmon=Node, time=#ti{tick=Tick, disp=Disp0}=Ti} = State0) ->
if Active ->
Disp = trunc(Disp0),
Next = max(Tick - Disp, 0),
erlang:send_after(1000 div ?DISP_FREQ, self(), {refresh, Next}),
- {Wins, Samples} = add_data(Stats, Data, Wins0, Ti, Active),
+ {Wins, Samples} = add_data(Stats, Data, Wins0, Ti, Active, Node),
State = precalc(State0#state{time=Ti#ti{tick=Next}, wins=Wins, samples=Samples}),
wxWindow:refresh(Panel),
{noreply, State};
true ->
- {Wins1, Samples} = add_data(Stats, Data, Wins0, Ti, Active),
+ {Wins1, Samples} = add_data(Stats, Data, Wins0, Ti, Active, Node),
Wins = [W#win{max=undefined} || W <- Wins1],
{noreply, State0#state{samples=Samples, wins=Wins, time=Ti#ti{tick=0}}}
end;
@@ -206,7 +216,7 @@ handle_info({refresh, Seq}, #state{panel=Panel, time=#ti{tick=Seq, disp=DispF}=T
handle_info({refresh, _}, State) ->
{noreply, State};
-handle_info({active, Node}, #state{parent=Parent, panel=Panel, appmon=Old, time=_Ti} = State) ->
+handle_info({active, Node}, #state{parent=Parent, panel=Panel, appmon=Old} = State) ->
create_menus(Parent, []),
try
Node = node(Old),
@@ -247,13 +257,17 @@ restart_fetcher(Node, #state{appmon=Old, panel=Panel, time=#ti{fetch=Freq}=Ti, w
reset_data() ->
{0, queue:new()}.
-add_data(Stats, {N, Q0}, Wins, #ti{fetch=Fetch, secs=Secs}, Active) when N > (Secs*Fetch+1) ->
+add_data(Stats, Q, Wins, Ti, Active) ->
+ add_data(Stats, Q, Wins, Ti, Active, ignore).
+
+add_data(Stats, {N, Q0}, Wins, #ti{fetch=Fetch, secs=Secs}, Active, Node)
+ when N > (Secs*Fetch+1) ->
{{value, Drop}, Q} = queue:out(Q0),
- add_data_1(Wins, Stats, N, {Drop,Q}, Active);
-add_data(Stats, {N, Q}, Wins, _, Active) ->
- add_data_1(Wins, Stats, N+1, {empty, Q}, Active).
+ add_data_1(Wins, Stats, N, {Drop,Q}, Active, Node);
+add_data(Stats, {N, Q}, Wins, _, Active, Node) ->
+ add_data_1(Wins, Stats, N+1, {empty, Q}, Active, Node).
-add_data_1([#win{state={_,St}}|_]=Wins0, Last, N, {Drop, Q}, Active)
+add_data_1([#win{state={_,St}}|_]=Wins0, Last, N, {Drop, Q}, Active, Node)
when St /= undefined ->
try
{Wins, Stat} =
@@ -269,14 +283,12 @@ add_data_1([#win{state={_,St}}|_]=Wins0, Last, N, {Drop, Q}, Active)
end, #{}, Wins0),
{Wins, {N,queue:in(Stat#{}, Q)}}
catch no_scheduler_change ->
- {[Win#win{state=init_data(Id, Last),
- info = info(Id, Last)}
+ {[Win#win{state=init_data(Id, Last), info=info(Id, Last, Node)}
|| #win{name=Id}=Win <- Wins0], {0,queue:new()}}
end;
-add_data_1(Wins, Stats, 1, {_, Q}, _) ->
- {[Win#win{state=init_data(Id, Stats),
- info = info(Id, Stats)}
+add_data_1(Wins, Stats, 1, {_, Q}, _, Node) ->
+ {[Win#win{state=init_data(Id, Stats), info=info(Id, Stats, Node)}
|| #win{name=Id}=Win <- Wins], {0,Q}}.
add_data_2(#win{name=Id, state=S0}=Win, Stats, Map) ->
@@ -382,16 +394,24 @@ lmax(MState, Values, State) ->
init_data(runq, {stats, _, T0, _, _}) -> {mk_max(),lists:sort(T0)};
init_data(io, {stats, _, _, {{_,In0}, {_,Out0}}, _}) -> {mk_max(), {In0,Out0}};
-init_data(memory, _) -> {mk_max(), info(memory, undefined)};
+init_data(memory, _) -> {mk_max(), info(memory, undefined, undefined)};
init_data(alloc, _) -> {mk_max(), unused};
init_data(utilz, _) -> {mk_max(), unused}.
-info(runq, {stats, _, T0, _, _}) -> lists:seq(1, length(T0));
-info(memory, _) -> [total, processes, atom, binary, code, ets];
-info(io, _) -> [input, output];
-info(alloc, First) -> [Type || {Type, _, _} <- First];
-info(utilz, First) -> [Type || {Type, _, _} <- First];
-info(_, []) -> [].
+info(runq, {stats, _, T0, _, _}, Node) ->
+ Dirty = get_dirty_cpu(Node),
+ {lists:seq(1, length(T0)-Dirty), Dirty};
+info(memory, _, _) -> [total, processes, atom, binary, code, ets];
+info(io, _, _) -> [input, output];
+info(alloc, First, _) -> [Type || {Type, _, _} <- First];
+info(utilz, First, _) -> [Type || {Type, _, _} <- First];
+info(_, [], _) -> [].
+
+get_dirty_cpu(Node) ->
+ case rpc:call(node(Node), erlang, system_info, [dirty_cpu_schedulers]) of
+ {badrpc,_R} -> 0;
+ N -> N
+ end.
collect_data(runq, {stats, _, T0, _, _}, {Max,S0}) ->
S1 = lists:sort(T0),
@@ -471,9 +491,10 @@ window_geom({W,H}, {_, Max, _Unit, MaxUnit},
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-draw_win(DC, #win{no_samples=Samples, geom=#{scale:={WS,HS}}, graphs=Graphs, max={_,Max,_,_}}=Win,
+draw_win(DC, #win{name=Name, no_samples=Samples, geom=#{scale:={WS,HS}},
+ graphs=Graphs, max={_,Max,_,_}, info=Info}=Win,
#ti{tick=Tick, fetch=FetchFreq, secs=Secs, disp=DispFreq}=Ti,
- Paint=#paint{pens=Pens}) when Samples >= 2, Graphs =/= [] ->
+ Paint=#paint{pens=Pens, dot_pens=Dots}) when Samples >= 2, Graphs =/= [] ->
%% Draw graphs
{X0,Y0,DrawBs} = draw_borders(DC, Ti, Win, Paint),
Offset = Tick / DispFreq,
@@ -483,14 +504,23 @@ draw_win(DC, #win{no_samples=Samples, geom=#{scale:={WS,HS}}, graphs=Graphs, max
end,
Start = X0 + (max(Secs*FetchFreq+Full-Samples, 0) - Offset)*WS,
Last = Secs*FetchFreq*WS+X0,
+ Dirty = case {Name, Info} of
+ {runq, {_, DCpu}} -> DCpu;
+ _ -> 0
+ end,
+ NoGraphs = length(Graphs),
+ NoCpu = NoGraphs - Dirty,
Draw = fun(Lines0, N) ->
- setPen(DC, element(1+ ((N-1) rem tuple_size(Pens)), Pens)),
+ case Dirty > 0 andalso N > NoCpu of
+ true -> setPen(DC, element(1+ ((N-NoCpu-1) rem tuple_size(Dots)), Dots));
+ false -> setPen(DC, element(1+ ((N-1) rem tuple_size(Pens)), Pens))
+ end,
Order = lists:reverse(Lines0),
[{_,Y}|Lines] = translate(Order, {Start, Y0}, 0, WS, {X0,Max*HS,Last}, []),
strokeLines(DC, [{Last,Y}|Lines]),
N-1
end,
- lists:foldl(Draw, length(Graphs), Graphs),
+ lists:foldl(Draw, NoGraphs, Graphs),
DrawBs(),
ok;
@@ -655,11 +685,17 @@ draw_borders(DC, #ti{secs=Secs, fetch=FetchFreq},
case Type of
runq ->
+ {TextInfo, DirtyCpus} = Info,
drawText(DC, "Scheduler Utilization (%) ", TopTextX, ?BH),
TN0 = Text(TopTextX, BottomTextY, "Scheduler: ", 0),
- lists:foldl(fun(Id, Pos0) ->
- Text(Pos0, BottomTextY, integer_to_list(Id), Id)
- end, TN0, Info);
+ Id = fun(Id, Pos0) ->
+ Text(Pos0, BottomTextY, integer_to_list(Id), Id)
+ end,
+ TN1 = lists:foldl(Id, TN0, TextInfo),
+ TN2 = Text(TN1, BottomTextY, "Dirty cpu: ", 0),
+ TN3 = lists:foldl(Id, TN2, lists:seq(1, DirtyCpus)),
+ _ = Text(TN3, BottomTextY, "(dotted)", 0),
+ ok;
memory ->
drawText(DC, "Memory Usage " ++ Unit, TopTextX,?BH),
lists:foldl(fun(MType, {PenId, Pos0}) ->
@@ -748,10 +784,10 @@ calc_max1(Max) ->
end.
colors() ->
- {{240, 100, 100}, {100, 240, 100}, {100, 100, 240},
- {220, 220, 80}, {100, 240, 240}, {240, 100, 240},
- {100, 25, 25}, {25, 100, 25}, {25, 25, 100},
- {120, 120, 0}, {25, 100, 100}, {100, 50, 100}
+ {{240, 100, 100}, {0, 128, 0}, {25, 45, 170}, {255, 165, 0},
+ {220, 220, 40}, {100, 240, 240},{240, 100, 240}, {160, 40, 40},
+ {100, 100, 240}, {140, 140, 0}, {25, 200, 100}, {120, 25, 240},
+ {255, 140, 163}, {25, 120, 120}, {120, 25, 120}, {110, 90, 60}
}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/observer/src/observer_port_wx.erl b/lib/observer/src/observer_port_wx.erl
index c21d2705c0..db5e6ceb38 100644
--- a/lib/observer/src/observer_port_wx.erl
+++ b/lib/observer/src/observer_port_wx.erl
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
-module(observer_port_wx).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -77,10 +77,10 @@
open_wins=[]
}).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
Panel = wxPanel:new(Notebook),
Sizer = wxBoxSizer:new(?wxVERTICAL),
Style = ?wxLC_REPORT bor ?wxLC_HRULES,
@@ -110,12 +110,12 @@ init([Notebook, Parent]) ->
wxListCtrl:connect(Grid, size, [{skip, true}]),
wxWindow:setFocus(Grid),
- {Panel, #state{grid=Grid, parent=Parent, panel=Panel, timer={false, 10}}}.
+ {Panel, #state{grid=Grid, parent=Parent, panel=Panel, timer=Config}}.
handle_event(#wx{id=?ID_REFRESH},
State = #state{node=Node, grid=Grid, opt=Opt}) ->
Ports0 = get_ports(Node),
- Ports = update_grid(Grid, Opt, Ports0),
+ Ports = update_grid(Grid, sel(State), Opt, Ports0),
{noreply, State#state{ports=Ports}};
handle_event(#wx{obj=Obj, event=#wxClose{}}, #state{open_wins=Opened} = State) ->
@@ -134,7 +134,7 @@ handle_event(#wx{event=#wxList{type=command_list_col_click, col=Col}},
NewKey -> Opt0#opt{sort_key=NewKey}
end,
Ports0 = get_ports(Node),
- Ports = update_grid(Grid, Opt, Ports0),
+ Ports = update_grid(Grid, sel(State), Opt, Ports0),
wxWindow:setFocus(Grid),
{noreply, State#state{opt=Opt, ports=Ports}};
@@ -260,6 +260,9 @@ handle_event(Event, _State) ->
handle_sync_event(_Event, _Obj, _State) ->
ok.
+handle_call(get_config, _, #state{timer=Timer}=State) ->
+ {reply, observer_lib:timer_config(Timer), State};
+
handle_call(Event, From, _State) ->
error({unhandled_call, Event, From}).
@@ -269,7 +272,7 @@ handle_cast(Event, _State) ->
handle_info({portinfo_open, PortIdStr},
State = #state{node=Node, grid=Grid, opt=Opt, open_wins=Opened}) ->
Ports0 = get_ports(Node),
- Ports = update_grid(Grid, Opt, Ports0),
+ Ports = update_grid(Grid, sel(State), Opt, Ports0),
Port = lists:keyfind(PortIdStr, #port.id_str, Ports),
NewOpened =
case Port of
@@ -288,17 +291,17 @@ handle_info(refresh_interval, State = #state{node=Node, grid=Grid, opt=Opt,
%% no change
{noreply, State};
Ports0 ->
- Ports = update_grid(Grid, Opt, Ports0),
+ Ports = update_grid(Grid, sel(State), Opt, Ports0),
{noreply, State#state{ports=Ports}}
end;
handle_info({active, Node}, State = #state{parent=Parent, grid=Grid, opt=Opt,
timer=Timer0}) ->
Ports0 = get_ports(Node),
- Ports = update_grid(Grid, Opt, Ports0),
+ Ports = update_grid(Grid, sel(State), Opt, Ports0),
wxWindow:setFocus(Grid),
create_menus(Parent),
- Timer = observer_lib:start_timer(Timer0),
+ Timer = observer_lib:start_timer(Timer0, 10),
{noreply, State#state{node=Node, ports=Ports, timer=Timer}};
handle_info(not_active, State = #state{timer = Timer0}) ->
@@ -511,9 +514,9 @@ filter_monitor_info() ->
[Pid || {process, Pid} <- Ms]
end.
-update_grid(Grid, Opt, Ports) ->
- wx:batch(fun() -> update_grid2(Grid, Opt, Ports) end).
-update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Ports) ->
+update_grid(Grid, Sel, Opt, Ports) ->
+ wx:batch(fun() -> update_grid2(Grid, Sel, Opt, Ports) end).
+update_grid2(Grid, Sel, #opt{sort_key=Sort,sort_incr=Dir}, Ports) ->
wxListCtrl:deleteAllItems(Grid),
Update =
fun(#port{id = Id,
@@ -533,6 +536,12 @@ update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Ports) ->
observer_lib:to_str(Val))
end,
[{0,Id},{1,Connected},{2,Name},{3,Ctrl},{4,Slot}]),
+ case lists:member(Id, Sel) of
+ true ->
+ wxListCtrl:setItemState(Grid, Row, 16#FFFF, ?wxLIST_STATE_SELECTED);
+ false ->
+ wxListCtrl:setItemState(Grid, Row, 0, ?wxLIST_STATE_SELECTED)
+ end,
Row + 1
end,
PortInfo = case Dir of
@@ -542,6 +551,8 @@ update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Ports) ->
lists:foldl(Update, 0, PortInfo),
PortInfo.
+sel(#state{grid=Grid, ports=Ports}) ->
+ [Id || #port{id=Id} <- get_selected_items(Grid, Ports)].
get_selected_items(Grid, Data) ->
get_indecies(get_selected_items(Grid, -1, []), Data).
diff --git a/lib/observer/src/observer_pro_wx.erl b/lib/observer/src/observer_pro_wx.erl
index f07b9e295a..3ecf8bdd92 100644
--- a/lib/observer/src/observer_pro_wx.erl
+++ b/lib/observer/src/observer_pro_wx.erl
@@ -20,7 +20,7 @@
-behaviour(wx_object).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -86,18 +86,19 @@
right_clicked_pid,
holder}).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
Attrs = observer_lib:create_attrs(),
Self = self(),
- Holder = spawn_link(fun() -> init_table_holder(Self, Attrs) end),
- {ProPanel, State} = setup(Notebook, Parent, Holder),
+ Acc = maps:get(acc, Config, false),
+ Holder = spawn_link(fun() -> init_table_holder(Self, Acc, Attrs) end),
+ {ProPanel, State} = setup(Notebook, Parent, Holder, Config),
{ProPanel, State#state{holder=Holder}}.
-setup(Notebook, Parent, Holder) ->
+setup(Notebook, Parent, Holder, Config) ->
ProPanel = wxPanel:new(Notebook, []),
Grid = create_list_box(ProPanel, Holder),
@@ -113,7 +114,7 @@ setup(Notebook, Parent, Holder) ->
panel=ProPanel,
parent_notebook=Notebook,
holder=Holder,
- timer={false, 10}
+ timer=Config
},
{ProPanel, State}.
@@ -246,7 +247,7 @@ handle_info({active, Node},
#state{holder=Holder, timer=Timer, parent=Parent}=State) ->
create_pro_menu(Parent, Holder),
Holder ! {change_node, Node},
- {noreply, State#state{timer=observer_lib:start_timer(Timer)}};
+ {noreply, State#state{timer=observer_lib:start_timer(Timer, 10)}};
handle_info(not_active, #state{timer=Timer0}=State) ->
Timer = observer_lib:stop_timer(Timer0),
@@ -264,11 +265,15 @@ terminate(_Reason, #state{holder=Holder}) ->
code_change(_, _, State) ->
{ok, State}.
+handle_call(get_config, _, #state{holder=Holder, timer=Timer}=State) ->
+ Conf = observer_lib:timer_config(Timer),
+ Accum = call(Holder, {get_accum, self()}),
+ {reply, Conf#{acc=>Accum}, State};
+
handle_call(Msg, _From, State) ->
io:format("~p:~p: Unhandled call ~p~n",[?MODULE, ?LINE, Msg]),
{reply, ok, State}.
-
handle_cast(Msg, State) ->
io:format("~p:~p: Unhandled cast ~p~n", [?MODULE, ?LINE, Msg]),
{noreply, State}.
@@ -453,14 +458,19 @@ rm_selected(_, [], [], AccIds, AccPids) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%TABLE HOLDER%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init_table_holder(Parent, Attrs) ->
+init_table_holder(Parent, Accum0, Attrs) ->
Backend = spawn_link(node(), observer_backend,etop_collect,[self()]),
+ Accum = case Accum0 of
+ true -> true;
+ false -> []
+ end,
table_holder(#holder{parent=Parent,
etop=#etop_info{},
info=array:new(),
node=node(),
backend_pid=Backend,
- attrs=Attrs
+ attrs=Attrs,
+ accum=Accum
}).
table_holder(#holder{info=Info, attrs=Attrs,
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl
index fa824995f7..2529e79e20 100644
--- a/lib/observer/src/observer_sys_wx.erl
+++ b/lib/observer/src/observer_sys_wx.erl
@@ -20,7 +20,7 @@
-behaviour(wx_object).
--export([start_link/2]).
+-export([start_link/3]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
handle_event/2, handle_cast/2]).
@@ -41,12 +41,12 @@
fields,
timer}).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
SysInfo = observer_backend:sys_info(),
{Sys, Mem, Cpu, Stats} = info_fields(),
Panel = wxPanel:new(Notebook),
@@ -69,7 +69,7 @@ init([Notebook, Parent]) ->
wxSizer:add(Sizer, HSizer1, [{flag, ?wxEXPAND bor BorderFlags bor ?wxBOTTOM},
{proportion, 0}, {border, 5}]),
wxPanel:setSizer(Panel, Sizer),
- Timer = observer_lib:start_timer(10),
+ Timer = observer_lib:start_timer(Config, 10),
{Panel, #sys_wx_state{parent=Parent,
parent_notebook=Notebook,
panel=Panel, sizer=Sizer,
@@ -167,6 +167,9 @@ terminate(_Reason, _State) ->
code_change(_, _, State) ->
{ok, State}.
+handle_call(get_config, _, #sys_wx_state{timer=Timer}=State) ->
+ {reply, observer_lib:timer_config(Timer), State};
+
handle_call(Msg, _From, State) ->
io:format("~p~p: Unhandled Call ~p~n",[?MODULE, ?LINE, Msg]),
{reply, ok, State}.
diff --git a/lib/observer/src/observer_trace_wx.erl b/lib/observer/src/observer_trace_wx.erl
index af90e2100c..247a4608d5 100644
--- a/lib/observer/src/observer_trace_wx.erl
+++ b/lib/observer/src/observer_trace_wx.erl
@@ -19,7 +19,7 @@
-module(observer_trace_wx).
--export([start_link/2, add_processes/1, add_ports/1]).
+-export([start_link/3, add_processes/1, add_ports/1]).
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
handle_event/2, handle_cast/2]).
@@ -88,8 +88,8 @@
-record(titem, {id, opts}).
-start_link(Notebook, ParentPid) ->
- wx_object:start_link(?MODULE, [Notebook, ParentPid], []).
+start_link(Notebook, ParentPid, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, ParentPid, Config], []).
add_processes(Pids) when is_list(Pids) ->
wx_object:cast(observer_wx:get_tracer(), {add_processes, Pids}).
@@ -99,10 +99,10 @@ add_ports(Ports) when is_list(Ports) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init([Notebook, ParentPid]) ->
- wx:batch(fun() -> create_window(Notebook, ParentPid) end).
+init([Notebook, ParentPid, Config]) ->
+ wx:batch(fun() -> create_window(Notebook, ParentPid, Config) end).
-create_window(Notebook, ParentPid) ->
+create_window(Notebook, ParentPid, Config) ->
%% Create the window
Panel = wxPanel:new(Notebook, [{size, wxWindow:getClientSize(Notebook)}]),
Sizer = wxBoxSizer:new(?wxVERTICAL),
@@ -130,11 +130,16 @@ create_window(Notebook, ParentPid) ->
wxSizer:add(Sizer, Buttons, [{flag, ?wxLEFT bor ?wxRIGHT bor ?wxDOWN},
{border, 5}, {proportion,0}]),
wxWindow:setSizer(Panel, Sizer),
+ MS = parse_ms(maps:get(match_specs, Config, []), default_matchspecs()),
{Panel, #state{parent=ParentPid, panel=Panel,
n_view=NodeView, proc_view=ProcessView, port_view=PortView,
m_view=ModView, f_view=FuncView,
toggle_button = ToggleButton,
- match_specs=default_matchspecs()}}.
+ output=maps:get(output, Config, []),
+ def_proc_flags=maps:get(procflags, Config, []),
+ def_port_flags=maps:get(portflags, Config, []),
+ match_specs=MS
+ }}.
default_matchspecs() ->
[{Key,default_matchspecs(Key)} || Key <- [funcs,send,'receive']].
@@ -397,27 +402,19 @@ handle_event(#wx{id=?LOG_SAVE, userData=TCtrl}, #state{panel=Panel} = State) ->
{noreply, State};
handle_event(#wx{id = ?SAVE_TRACEOPTS},
- #state{panel = Panel,
- def_proc_flags = ProcFlags,
- def_port_flags = PortFlags,
- match_specs = MatchSpecs,
- tpatterns = TracePatterns,
- output = Output
- } = State) ->
+ #state{panel = Panel} = State) ->
Dialog = wxFileDialog:new(Panel, [{style, ?wxFD_SAVE bor ?wxFD_OVERWRITE_PROMPT}]),
case wxFileDialog:showModal(Dialog) of
?wxID_OK ->
Path = wxFileDialog:getPath(Dialog),
- write_file(Panel, Path,
- ProcFlags, PortFlags, MatchSpecs, Output,
- dict:to_list(TracePatterns)
- );
+ write_file(Panel, Path, get_config(State));
_ ->
ok
end,
wxDialog:destroy(Dialog),
{noreply, State};
+
handle_event(#wx{id = ?LOAD_TRACEOPTS}, #state{panel = Panel} = State) ->
Dialog = wxFileDialog:new(Panel, [{style, ?wxFD_FILE_MUST_EXIST}]),
State2 = case wxFileDialog:showModal(Dialog) of
@@ -690,6 +687,10 @@ handle_event(#wx{id=ID, event = What}, State) ->
{noreply, State}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+handle_call(get_config, _, State) ->
+ Config0 = get_config(State),
+ Config = lists:keydelete(trace_p, 1, Config0),
+ {reply, maps:from_list(Config), State};
handle_call(Msg, From, _State) ->
error({unhandled_call, Msg, From}).
@@ -1101,26 +1102,38 @@ ftup(Trace, Index, Size) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-write_file(Frame, Filename, ProcFlags, PortFlags, MatchSpecs, Output, TPs) ->
+get_config(#state{def_proc_flags = ProcFlags,
+ def_port_flags = PortFlags,
+ match_specs = MatchSpecs0,
+ tpatterns = TracePatterns,
+ output = Output}) ->
MSToList = fun(#match_spec{name=Id, term=T, func=F}) ->
[{name,Id},{term,T},{func,F}]
end,
- MSTermList = [{ms,Key,[MSToList(MS) || MS <- MSs]} ||
- {Key,MSs} <- MatchSpecs],
+ MatchSpecs = [{ms,Key,[MSToList(MS) || MS <- MSs]} ||
+ {Key,MSs} <- MatchSpecs0],
TPToTuple = fun(#tpattern{fa={F,A}, ms=Ms}) ->
- {F,A,MSToList(Ms)}
+ {F,A,MSToList(Ms)}
end,
ModuleTermList = [{tp, Module, [TPToTuple(FTP) || FTP <- FTPs]} ||
- {Module,FTPs} <- TPs],
-
+ {Module,FTPs} <- dict:to_list(TracePatterns)],
+ [{procflags,ProcFlags},
+ {portflags,PortFlags},
+ {match_specs,MatchSpecs},
+ {output,Output},
+ {trace_p,ModuleTermList}].
+
+write_file(Frame, Filename, Config) ->
Str =
["%%%\n%%% This file is generated by Observer\n",
"%%%\n%%% DO NOT EDIT!\n%%%\n",
- [io_lib:format("~p.~n",[MSTerm]) || MSTerm <- MSTermList],
- io_lib:format("~p.~n",[{procflags,ProcFlags}]),
- io_lib:format("~p.~n",[{portflags,PortFlags}]),
- io_lib:format("~p.~n",[{output,Output}]),
- [io_lib:format("~p.~n",[ModuleTerm]) || ModuleTerm <- ModuleTermList]
+ [io_lib:format("~p.~n",[MSTerm]) ||
+ MSTerm <- proplists:get_value(match_specs, Config)],
+ io_lib:format("~p.~n",[lists:keyfind(procflags, 1, Config)]),
+ io_lib:format("~p.~n",[lists:keyfind(portflags, 1, Config)]),
+ io_lib:format("~p.~n",[lists:keyfind(output, 1, Config)]),
+ [io_lib:format("~p.~n",[ModuleTerm]) ||
+ ModuleTerm <- proplists:get_value(trace_p, Config)]
],
case file:write_file(Filename, list_to_binary(Str)) of
diff --git a/lib/observer/src/observer_tv_table.erl b/lib/observer/src/observer_tv_table.erl
index 75e6919642..46da65e005 100644
--- a/lib/observer/src/observer_tv_table.erl
+++ b/lib/observer/src/observer_tv_table.erl
@@ -233,9 +233,22 @@ handle_event(#wx{id=?ID_REFRESH},State = #state{pid=Pid}) ->
{noreply, State};
handle_event(#wx{event=#wxList{type=command_list_col_click, col=Col}},
- State = #state{pid=Pid}) ->
+ State = #state{pid=Pid, grid=Grid, selected=OldSel}) ->
+ SelObj = case OldSel of
+ undefined -> undefined;
+ _ -> get_row(Pid, OldSel, term)
+ end,
Pid ! {sort, Col+1},
- {noreply, State};
+ case SelObj =/= undefined andalso search(Pid, SelObj, -1, true, term) of
+ false when is_integer(OldSel) ->
+ wxListCtrl:setItemState(Grid, OldSel, 0, ?wxLIST_STATE_SELECTED),
+ {noreply, State#state{selected=undefined}};
+ false ->
+ {noreply, State#state{selected=undefined}};
+ Row ->
+ wxListCtrl:setItemState(Grid, Row, 16#FFFF, ?wxLIST_STATE_SELECTED),
+ {noreply, State#state{selected=Row}}
+ end;
handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) ->
observer_lib:set_listctrl_col_size(Grid, W),
@@ -607,6 +620,17 @@ keysort(Col, Table) ->
end,
lists:sort(Sort, Table).
+search([Term, -1, true, term], S=#holder{parent=Parent, table=Table}) ->
+ Search = fun(Idx, [Tuple|_]) ->
+ Tuple =:= Term andalso throw(Idx),
+ Tuple
+ end,
+ try array:map(Search, Table) of
+ _ -> Parent ! {self(), false}
+ catch Index ->
+ Parent ! {self(), Index}
+ end,
+ S;
search([Str, Row, Dir0, CaseSens],
S=#holder{parent=Parent, n=N, table=Table}) ->
Opt = case CaseSens of
@@ -642,6 +666,8 @@ get_row(From, Row, Col, Table) ->
From ! {self(), format(Object)};
[Object|_] when Col =:= all_multiline ->
From ! {self(), io_lib:format("~p", [Object])};
+ [Object|_] when Col =:= term ->
+ From ! {self(), Object};
[Object|_] when tuple_size(Object) >= Col ->
From ! {self(), format(element(Col, Object))};
_ ->
diff --git a/lib/observer/src/observer_tv_wx.erl b/lib/observer/src/observer_tv_wx.erl
index 4356cb890c..e112c54534 100644
--- a/lib/observer/src/observer_tv_wx.erl
+++ b/lib/observer/src/observer_tv_wx.erl
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
-module(observer_tv_wx).
--export([start_link/2, display_table_info/4]).
+-export([start_link/3, display_table_info/4]).
%% wx_object callbacks
-export([init/1, handle_info/2, terminate/2, code_change/3, handle_call/3,
@@ -58,10 +58,10 @@
timer
}).
-start_link(Notebook, Parent) ->
- wx_object:start_link(?MODULE, [Notebook, Parent], []).
+start_link(Notebook, Parent, Config) ->
+ wx_object:start_link(?MODULE, [Notebook, Parent, Config], []).
-init([Notebook, Parent]) ->
+init([Notebook, Parent, Config]) ->
Panel = wxPanel:new(Notebook),
Sizer = wxBoxSizer:new(?wxVERTICAL),
Style = ?wxLC_REPORT bor ?wxLC_SINGLE_SEL bor ?wxLC_HRULES,
@@ -78,11 +78,11 @@ init([Notebook, Parent]) ->
Col + 1
end,
ListItems = [{"Table Name", ?wxLIST_FORMAT_LEFT, 200},
- {"Table Id", ?wxLIST_FORMAT_RIGHT, 100},
{"Objects", ?wxLIST_FORMAT_RIGHT, 100},
{"Size (kB)", ?wxLIST_FORMAT_RIGHT, 100},
{"Owner Pid", ?wxLIST_FORMAT_CENTER, 150},
- {"Owner Name", ?wxLIST_FORMAT_LEFT, 200}
+ {"Owner Name", ?wxLIST_FORMAT_LEFT, 200},
+ {"Table Id", ?wxLIST_FORMAT_LEFT, 250}
],
lists:foldl(AddListEntry, 0, ListItems),
wxListItem:destroy(Li),
@@ -94,25 +94,31 @@ init([Notebook, Parent]) ->
wxListCtrl:connect(Grid, size, [{skip, true}]),
wxWindow:setFocus(Grid),
- {Panel, #state{grid=Grid, parent=Parent, panel=Panel, timer={false, 10}}}.
+ {Panel, #state{grid=Grid, parent=Parent, panel=Panel,
+ timer=Config,
+ opt=#opt{type=maps:get(type, Config, ets),
+ sys_hidden=maps:get(sys_hidden, Config, true),
+ unread_hidden=maps:get(unread_hidden, Config, true)}
+ }}.
handle_event(#wx{id=?ID_REFRESH},
State = #state{node=Node, grid=Grid, opt=Opt}) ->
Tables = get_tables(Node, Opt),
- Tabs = update_grid(Grid, Opt, Tables),
- {noreply, State#state{tabs=Tabs}};
+ {Tabs,Sel} = update_grid(Grid, sel(State), Opt, Tables),
+ Sel =/= undefined andalso wxListCtrl:ensureVisible(Grid, Sel),
+ {noreply, State#state{tabs=Tabs, selected=Sel}};
handle_event(#wx{event=#wxList{type=command_list_col_click, col=Col}},
State = #state{node=Node, grid=Grid,
opt=Opt0=#opt{sort_key=Key, sort_incr=Bool}}) ->
- Opt = case Col+2 of
+ Opt = case col2key(Col) of
Key -> Opt0#opt{sort_incr=not Bool};
NewKey -> Opt0#opt{sort_key=NewKey}
end,
Tables = get_tables(Node, Opt),
- Tabs = update_grid(Grid, Opt, Tables),
+ {Tabs,Sel} = update_grid(Grid, sel(State), Opt, Tables),
wxWindow:setFocus(Grid),
- {noreply, State#state{opt=Opt, tabs=Tabs}};
+ {noreply, State#state{opt=Opt, tabs=Tabs, selected=Sel}};
handle_event(#wx{id=Id}, State = #state{node=Node, grid=Grid, opt=Opt0})
when Id >= ?ID_ETS, Id =< ?ID_SYSTEM_TABLES ->
@@ -129,9 +135,9 @@ handle_event(#wx{id=Id}, State = #state{node=Node, grid=Grid, opt=Opt0})
self() ! Error,
{noreply, State};
Tables ->
- Tabs = update_grid(Grid, Opt, Tables),
+ {Tabs, Sel} = update_grid(Grid, sel(State), Opt, Tables),
wxWindow:setFocus(Grid),
- {noreply, State#state{opt=Opt, tabs=Tabs}}
+ {noreply, State#state{opt=Opt, tabs=Tabs, selected=Sel}}
end;
handle_event(#wx{event=#wxSize{size={W,_}}}, State=#state{grid=Grid}) ->
@@ -202,6 +208,12 @@ handle_event(Event, _State) ->
handle_sync_event(_Event, _Obj, _State) ->
ok.
+handle_call(get_config, _, #state{timer=Timer, opt=Opt}=State) ->
+ #opt{type=Type, sys_hidden=Sys, unread_hidden=Unread} = Opt,
+ Conf0 = observer_lib:timer_config(Timer),
+ Conf = Conf0#{type=>Type, sys_hidden=>Sys, unread_hidden=>Unread},
+ {reply, Conf, State};
+
handle_call(Event, From, _State) ->
error({unhandled_call, Event, From}).
@@ -215,8 +227,9 @@ handle_info(refresh_interval, State = #state{node=Node, grid=Grid, opt=Opt,
%% no change
{noreply, State};
Tables ->
- Tabs = update_grid(Grid, Opt, Tables),
- {noreply, State#state{tabs=Tabs}}
+ {Tabs, Sel} = update_grid(Grid, sel(State), Opt, Tables),
+ Sel =/= undefined andalso wxListCtrl:ensureVisible(Grid, Sel),
+ {noreply, State#state{tabs=Tabs, selected=Sel}}
end;
handle_info({active, Node}, State = #state{parent=Parent, grid=Grid, opt=Opt0,
@@ -228,11 +241,11 @@ handle_info({active, Node}, State = #state{parent=Parent, grid=Grid, opt=Opt0,
Opt1 = Opt0#opt{type=ets},
{get_tables(Node, Opt1), Opt1}
end,
- Tabs = update_grid(Grid, Opt, Tables),
+ {Tabs,Sel} = update_grid(Grid, sel(State), Opt, Tables),
wxWindow:setFocus(Grid),
create_menus(Parent, Opt),
- Timer = observer_lib:start_timer(Timer0),
- {noreply, State#state{node=Node, tabs=Tabs, timer=Timer, opt=Opt}};
+ Timer = observer_lib:start_timer(Timer0, 10),
+ {noreply, State#state{node=Node, tabs=Tabs, timer=Timer, opt=Opt, selected=Sel}};
handle_info(not_active, State = #state{timer = Timer0}) ->
Timer = observer_lib:stop_timer(Timer0),
@@ -296,6 +309,13 @@ get_tables2(Node, #opt{type=Type, sys_hidden=Sys, unread_hidden=Unread}) ->
[list_to_tabrec(Tab) || Tab <- Result]
end.
+col2key(0) -> #tab.name;
+col2key(1) -> #tab.size;
+col2key(2) -> #tab.memory;
+col2key(3) -> #tab.owner;
+col2key(4) -> #tab.reg_name;
+col2key(5) -> #tab.id.
+
list_to_tabrec(PL) ->
#tab{name = proplists:get_value(name, PL),
id = proplists:get_value(id, PL, ignore),
@@ -366,13 +386,15 @@ list_to_strings([A]) -> integer_to_list(A);
list_to_strings([A|B]) ->
integer_to_list(A) ++ " ," ++ list_to_strings(B).
-update_grid(Grid, Opt, Tables) ->
- wx:batch(fun() -> update_grid2(Grid, Opt, Tables) end).
-update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Tables) ->
+update_grid(Grid, Selected, Opt, Tables) ->
+ wx:batch(fun() -> update_grid2(Grid, Selected, Opt, Tables) end).
+
+update_grid2(Grid, {SelName,SelId}, #opt{sort_key=Sort,sort_incr=Dir}, Tables) ->
wxListCtrl:deleteAllItems(Grid),
Update =
fun(#tab{name = Name, id = Id, owner = Owner, size = Size, memory = Memory,
- protection = Protection, reg_name = RegName}, Row) ->
+ protection = Protection, reg_name = RegName},
+ {Row, Sel}) ->
_Item = wxListCtrl:insertItem(Grid, Row, ""),
if (Row rem 2) =:= 0 ->
wxListCtrl:setItemBackgroundColour(Grid, Row, ?BG_EVEN);
@@ -387,13 +409,26 @@ update_grid2(Grid, #opt{sort_key=Sort,sort_incr=Dir}, Tables) ->
({Col, Val}) ->
wxListCtrl:setItem(Grid, Row, Col, observer_lib:to_str(Val))
end,
- [{0,Name}, {1,Id}, {2,Size}, {3, Memory div 1024},
- {4,Owner}, {5,RegName}]),
- Row + 1
+ [{0,Name}, {1,Size}, {2, Memory div 1024},
+ {3,Owner}, {4,RegName}, {5,Id}]),
+ if SelName =:= Name, SelId =:= Id ->
+ wxListCtrl:setItemState(Grid, Row, 16#FFFF, ?wxLIST_STATE_SELECTED),
+ {Row+1, Row};
+ true ->
+ wxListCtrl:setItemState(Grid, Row, 0, ?wxLIST_STATE_SELECTED),
+ {Row+1, Sel}
+ end
end,
ProcInfo = case Dir of
false -> lists:reverse(lists:keysort(Sort, Tables));
true -> lists:keysort(Sort, Tables)
end,
- lists:foldl(Update, 0, ProcInfo),
- ProcInfo.
+ {_, Sel} = lists:foldl(Update, {0, undefined}, ProcInfo),
+ {ProcInfo, Sel}.
+
+sel(#state{selected=Sel, tabs=Tabs}) ->
+ try lists:nth(Sel+1, Tabs) of
+ #tab{name=Name, id=Id} -> {Name, Id}
+ catch _:_ ->
+ {undefined, undefined}
+ end.
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 83de4fa64c..0a591babdd 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -54,20 +54,14 @@
status_bar,
notebook,
main_panel,
- pro_panel,
- port_panel,
- tv_panel,
- sys_panel,
- trace_panel,
- app_panel,
- perf_panel,
- allc_panel,
+ panels,
active_tab,
node,
nodes,
prev_node="",
log = false,
- reply_to=false
+ reply_to=false,
+ config
}).
start() ->
@@ -118,6 +112,10 @@ init(_Args) ->
setup(#state{frame = Frame} = State) ->
%% Setup Menubar & Menus
+ Config = load_config(),
+ Cnf = fun(Who) ->
+ proplists:get_value(Who, Config, #{})
+ end,
MenuBar = wxMenuBar:new(),
{Nodes, NodeMenus} = get_nodes(),
@@ -131,7 +129,7 @@ setup(#state{frame = Frame} = State) ->
Notebook = wxNotebook:new(Panel, ?ID_NOTEBOOK, [{style, ?wxBK_DEFAULT}]),
%% System Panel
- SysPanel = observer_sys_wx:start_link(Notebook, self()),
+ SysPanel = observer_sys_wx:start_link(Notebook, self(), Cnf(sys_panel)),
wxNotebook:addPage(Notebook, SysPanel, "System", []),
%% Setup sizer create early to get it when window shows
@@ -145,43 +143,44 @@ setup(#state{frame = Frame} = State) ->
wxFrame:setTitle(Frame, atom_to_list(node())),
wxStatusBar:setStatusText(StatusBar, atom_to_list(node())),
- wxNotebook:connect(Notebook, command_notebook_page_changing),
- wxFrame:connect(Frame, close_window, [{skip, true}]),
+ wxNotebook:connect(Notebook, command_notebook_page_changed, [{skip, true}]),
+ wxFrame:connect(Frame, close_window, []),
wxMenu:connect(Frame, command_menu_selected),
wxFrame:show(Frame),
%% Freeze and thaw is buggy currently
- DoFreeze = [?wxMAJOR_VERSION,?wxMINOR_VERSION] < [2,9],
+ DoFreeze = [?wxMAJOR_VERSION,?wxMINOR_VERSION] < [2,9]
+ orelse element(1, os:type()) =:= win32,
DoFreeze andalso wxWindow:freeze(Panel),
%% I postpone the creation of the other tabs so they can query/use
%% the window size
%% Perf Viewer Panel
- PerfPanel = observer_perf_wx:start_link(Notebook, self()),
+ PerfPanel = observer_perf_wx:start_link(Notebook, self(), Cnf(perf_panel)),
wxNotebook:addPage(Notebook, PerfPanel, "Load Charts", []),
%% Memory Allocator Viewer Panel
- AllcPanel = observer_alloc_wx:start_link(Notebook, self()),
+ AllcPanel = observer_alloc_wx:start_link(Notebook, self(), Cnf(allc_panel)),
wxNotebook:addPage(Notebook, AllcPanel, ?ALLOC_STR, []),
%% App Viewer Panel
- AppPanel = observer_app_wx:start_link(Notebook, self()),
+ AppPanel = observer_app_wx:start_link(Notebook, self(), Cnf(app_panel)),
wxNotebook:addPage(Notebook, AppPanel, "Applications", []),
%% Process Panel
- ProPanel = observer_pro_wx:start_link(Notebook, self()),
+ ProPanel = observer_pro_wx:start_link(Notebook, self(), Cnf(pro_panel)),
wxNotebook:addPage(Notebook, ProPanel, "Processes", []),
%% Port Panel
- PortPanel = observer_port_wx:start_link(Notebook, self()),
+ PortPanel = observer_port_wx:start_link(Notebook, self(), Cnf(port_panel)),
wxNotebook:addPage(Notebook, PortPanel, "Ports", []),
%% Table Viewer Panel
- TVPanel = observer_tv_wx:start_link(Notebook, self()),
+ TVPanel = observer_tv_wx:start_link(Notebook, self(), Cnf(tv_panel)),
wxNotebook:addPage(Notebook, TVPanel, "Table Viewer", []),
%% Trace Viewer Panel
- TracePanel = observer_trace_wx:start_link(Notebook, self()),
+ TracePanel = observer_trace_wx:start_link(Notebook, self(), Cnf(trace_panel)),
wxNotebook:addPage(Notebook, TracePanel, ?TRACE_STR, []),
%% Force redraw (windows needs it)
@@ -193,19 +192,21 @@ setup(#state{frame = Frame} = State) ->
SysPid = wx_object:get_pid(SysPanel),
SysPid ! {active, node()},
+ Panels = [{sys_panel, SysPanel, "System"}, %% In order
+ {perf_panel, PerfPanel, "Load Charts"},
+ {allc_panel, AllcPanel, ?ALLOC_STR},
+ {app_panel, AppPanel, "Applications"},
+ {pro_panel, ProPanel, "Processes"},
+ {port_panel, PortPanel, "Ports"},
+ {tv_panel, TVPanel, "Table Viewer"},
+ {trace_panel, TracePanel, ?TRACE_STR}],
+
UpdState = State#state{main_panel = Panel,
notebook = Notebook,
menubar = MenuBar,
status_bar = StatusBar,
- sys_panel = SysPanel,
- pro_panel = ProPanel,
- port_panel = PortPanel,
- tv_panel = TVPanel,
- trace_panel = TracePanel,
- app_panel = AppPanel,
- perf_panel = PerfPanel,
- allc_panel = AllcPanel,
active_tab = SysPid,
+ panels = Panels,
node = node(),
nodes = Nodes
},
@@ -228,10 +229,12 @@ setup(#state{frame = Frame} = State) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%Callbacks
-handle_event(#wx{event=#wxNotebook{type=command_notebook_page_changing}},
- #state{active_tab=Previous, node=Node} = State) ->
- case get_active_pid(State) of
- Previous -> {noreply, State};
+handle_event(#wx{event=#wxNotebook{type=command_notebook_page_changed, nSel=Next}},
+ #state{active_tab=Previous, node=Node, panels=Panels} = State) ->
+ {_, Obj, _} = lists:nth(Next+1, Panels),
+ case wx_object:get_pid(Obj) of
+ Previous ->
+ {noreply, State};
Pid ->
Previous ! not_active,
Pid ! {active, Node},
@@ -362,8 +365,7 @@ handle_event(#wx{id = Id, event = #wxCommand{type = command_menu_selected}},
end,
{noreply, change_node_view(Node, LState)};
-handle_event(Event, State) ->
- Pid = get_active_pid(State),
+handle_event(Event, #state{active_tab=Pid} = State) ->
Pid ! Event,
{noreply, State}.
@@ -388,7 +390,8 @@ handle_call({create_menus, TabMenus}, _From,
handle_call({get_attrib, Attrib}, _From, State) ->
{reply, get(Attrib), State};
-handle_call(get_tracer, _From, State=#state{trace_panel=TraceP}) ->
+handle_call(get_tracer, _From, State=#state{panels=Panels}) ->
+ {_, TraceP, _} = lists:keyfind(trace_panel, 1, Panels),
{reply, TraceP, State};
handle_call(get_active_node, _From, State=#state{node=Node}) ->
@@ -424,9 +427,7 @@ handle_info({nodedown, Node},
create_txt_dialog(Frame, Msg, "Node down", ?wxICON_EXCLAMATION),
{noreply, State3};
-handle_info({open_link, Id0}, State = #state{pro_panel=ProcViewer,
- port_panel=PortViewer,
- frame=Frame}) ->
+handle_info({open_link, Id0}, State = #state{panels=Panels,frame=Frame}) ->
Id = case Id0 of
[_|_] -> try list_to_pid(Id0) catch _:_ -> Id0 end;
_ -> Id0
@@ -434,8 +435,10 @@ handle_info({open_link, Id0}, State = #state{pro_panel=ProcViewer,
%% Forward to process tab
case Id of
Pid when is_pid(Pid) ->
+ {pro_panel, ProcViewer, _} = lists:keyfind(pro_panel, 1, Panels),
wx_object:get_pid(ProcViewer) ! {procinfo_open, Pid};
"#Port" ++ _ = Port ->
+ {port_panel, PortViewer, _} = lists:keyfind(port_panel, 1, Panels),
wx_object:get_pid(PortViewer) ! {portinfo_open, Port};
_ ->
Msg = io_lib:format("Information about ~p is not available or implemented",[Id]),
@@ -465,15 +468,13 @@ handle_info({stop, Me}, State) when Me =:= self() ->
handle_info(_Info, State) ->
{noreply, State}.
-stop_servers(#state{node=Node, log=LogOn, sys_panel=Sys, pro_panel=Procs, tv_panel=TVs,
- trace_panel=Trace, app_panel=Apps, perf_panel=Perfs,
- allc_panel=Alloc, port_panel=Ports} = _State) ->
+stop_servers(#state{node=Node, log=LogOn, panels=Panels} = _State) ->
LogOn andalso rpc:block_call(Node, rb, stop, []),
Me = self(),
- Tabs = [Sys, Procs, Ports, TVs, Trace, Apps, Perfs, Alloc],
+ save_config(Panels),
Stop = fun() ->
try
- _ = [wx_object:stop(Panel) || Panel <- Tabs],
+ _ = [wx_object:stop(Panel) || {_, Panel, _} <- Panels],
ok
catch _:_ -> ok
end,
@@ -490,6 +491,27 @@ terminate(_Reason, #state{frame = Frame, reply_to=From}) ->
end,
ok.
+load_config() ->
+ case file:consult(config_file()) of
+ {ok, Config} -> Config;
+ _ -> []
+ end.
+
+save_config(Panels) ->
+ Configs = [{Name, wx_object:call(Panel, get_config)} || {Name, Panel, _} <- Panels],
+ File = config_file(),
+ case filelib:ensure_dir(File) of
+ ok ->
+ Format = [io_lib:format("~p.~n",[Conf]) || Conf <- Configs],
+ _ = file:write_file(File, Format);
+ _ ->
+ ignore
+ end.
+
+config_file() ->
+ Dir = filename:basedir(user_config, "erl_observer"),
+ filename:join(Dir, "config.txt").
+
code_change(_, _, State) ->
{ok, State}.
@@ -549,8 +571,7 @@ connect2(NodeName, Opts, Cookie) ->
{error, net_kernel, Reason}
end.
-change_node_view(Node, State) ->
- Tab = get_active_pid(State),
+change_node_view(Node, #state{active_tab=Tab} = State) ->
Tab ! not_active,
Tab ! {active, Node},
StatusText = ["Observer - " | atom_to_list(Node)],
@@ -562,38 +583,13 @@ check_page_title(Notebook) ->
Selection = wxNotebook:getSelection(Notebook),
wxNotebook:getPageText(Notebook, Selection).
-get_active_pid(#state{notebook=Notebook, pro_panel=Pro, sys_panel=Sys,
- tv_panel=Tv, trace_panel=Trace, app_panel=App,
- perf_panel=Perf, allc_panel=Alloc, port_panel=Port
- }) ->
- Panel = case check_page_title(Notebook) of
- "Processes" -> Pro;
- "Ports" -> Port;
- "System" -> Sys;
- "Table Viewer" -> Tv;
- ?TRACE_STR -> Trace;
- "Load Charts" -> Perf;
- "Applications" -> App;
- ?ALLOC_STR -> Alloc
- end,
- wx_object:get_pid(Panel).
-
-pid2panel(Pid, #state{pro_panel=Pro, sys_panel=Sys,
- tv_panel=Tv, trace_panel=Trace, app_panel=App,
- perf_panel=Perf, allc_panel=Alloc, port_panel=Port}) ->
- case Pid of
- Pro -> "Processes";
- Port -> "Ports";
- Sys -> "System";
- Tv -> "Table Viewer" ;
- Trace -> ?TRACE_STR;
- Perf -> "Load Charts";
- App -> "Applications";
- Alloc -> ?ALLOC_STR;
- _ -> "unknown"
+pid2panel(Pid, #state{panels=Panels}) ->
+ PanelPids = [{Name, wx_object:get_pid(Obj)} || {Name, Obj, _} <- Panels],
+ case lists:keyfind(Pid, 2, PanelPids) of
+ false -> "unknown";
+ {Name,_} -> Name
end.
-
create_connect_dialog(ping, #state{frame = Frame, prev_node=Prev}) ->
Dialog = wxTextEntryDialog:new(Frame, "Connect to node", [{value, Prev}]),
case wxDialog:showModal(Dialog) of
diff --git a/lib/observer/test/crashdump_helper.erl b/lib/observer/test/crashdump_helper.erl
index e57c8162e4..fce15bca89 100644
--- a/lib/observer/test/crashdump_helper.erl
+++ b/lib/observer/test/crashdump_helper.erl
@@ -20,7 +20,7 @@
-module(crashdump_helper).
-export([n1_proc/2,remote_proc/2]).
--compile(r13).
+-compile(r18).
-include_lib("common_test/include/ct.hrl").
n1_proc(N2,Creator) ->
diff --git a/lib/observer/vsn.mk b/lib/observer/vsn.mk
index dd23b08484..ca9ad72473 100644
--- a/lib/observer/vsn.mk
+++ b/lib/observer/vsn.mk
@@ -1 +1 @@
-OBSERVER_VSN = 2.3
+OBSERVER_VSN = 2.3.1
diff --git a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
index 8f7da2425b..620c91d406 100644
--- a/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
+++ b/lib/orber/COSS/CosNaming/CosNaming_NamingContextExt_impl.erl
@@ -610,11 +610,16 @@ convert_list([{N, T, _O}|Rest], HowMany, Counter, Acc) ->
%% Returns :
%%----------------------------------------------------------------------
destroy(OE_THIS, OE_State) ->
- case corba:get_subobject_key(OE_THIS) of
- <<131,100,0,9,117,110,100,101,102,105,110,101,100>> ->
- %% undefined binary.
- corba:raise(#'NO_PERMISSION'{completion_status=?COMPLETED_NO});
- SubobjKey ->
+ SubobjKey = corba:get_subobject_key(OE_THIS),
+ try begin
+ true = (byte_size(SubobjKey) < 20),
+ undefined = binary_to_term(SubobjKey)
+ end
+ of
+ _ ->
+ corba:raise(#'NO_PERMISSION'{completion_status=?COMPLETED_NO})
+ catch
+ error:_ -> %% Not atom 'undefined', carry on...
_DF =
fun() ->
case mnesia:wread({orber_CosNaming, SubobjKey}) of
diff --git a/lib/os_mon/doc/src/notes.xml b/lib/os_mon/doc/src/notes.xml
index e6e80b046d..df4151147c 100644
--- a/lib/os_mon/doc/src/notes.xml
+++ b/lib/os_mon/doc/src/notes.xml
@@ -31,6 +31,21 @@
</header>
<p>This document describes the changes made to the OS_Mon application.</p>
+<section><title>Os_Mon 2.4.2</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Support s390x in os_mon.</p>
+ <p>
+ Own Id: OTP-14161 Aux Id: PR-1309 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Os_Mon 2.4.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/os_mon/vsn.mk b/lib/os_mon/vsn.mk
index 1ac0fb1d27..59a3d9dee4 100644
--- a/lib/os_mon/vsn.mk
+++ b/lib/os_mon/vsn.mk
@@ -1 +1 @@
-OS_MON_VSN = 2.4.1
+OS_MON_VSN = 2.4.2
diff --git a/lib/parsetools/doc/src/leex.xml b/lib/parsetools/doc/src/leex.xml
index 29d546105f..1227625287 100644
--- a/lib/parsetools/doc/src/leex.xml
+++ b/lib/parsetools/doc/src/leex.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2009</year><year>2016</year>
+ <year>2009</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -446,7 +446,8 @@ D = [0-9]
</item>
</taglist>
- <p>The following examples define Erlang data types:</p>
+ <p>The following examples define simplified versions of a few
+ Erlang data types:</p>
<code>
Atoms [a-z][0-9a-zA-Z_]*
diff --git a/lib/parsetools/doc/src/yecc.xml b/lib/parsetools/doc/src/yecc.xml
index 9188bd2a22..004fc1668d 100644
--- a/lib/parsetools/doc/src/yecc.xml
+++ b/lib/parsetools/doc/src/yecc.xml
@@ -207,7 +207,7 @@
<code>
Header "%% Copyright (C)"
"%% @private"
-"%% @Author John"</code>
+"%% @Author John".</code>
<p>Next comes a declaration of the <c>nonterminal categories</c>
to be used in the rules. For example:</p>
<code type="none">
diff --git a/lib/parsetools/src/leex.erl b/lib/parsetools/src/leex.erl
index e0f37ae9df..e2e7d7359f 100644
--- a/lib/parsetools/src/leex.erl
+++ b/lib/parsetools/src/leex.erl
@@ -1548,22 +1548,23 @@ out_action_code(File, XrlFile, {_A,Code,_Vars,Name,Args,ArgsChars}) ->
L = erl_scan:line(hd(Code)),
output_file_directive(File, XrlFile, L-2),
io:fwrite(File, "~s(~s) ->~n", [Name, ArgsChars]),
- io:fwrite(File, " ~s\n", [pp_tokens(Code, L)]).
+ io:fwrite(File, " ~ts\n", [pp_tokens(Code, L, File)]).
-%% pp_tokens(Tokens, Line) -> [char()].
+%% pp_tokens(Tokens, Line, File) -> [char()].
%% Prints the tokens keeping the line breaks of the original code.
-pp_tokens(Tokens, Line0) -> pp_tokens(Tokens, Line0, none).
+pp_tokens(Tokens, Line0, File) -> pp_tokens(Tokens, Line0, File, none).
-pp_tokens([], _Line0, _) -> [];
-pp_tokens([T | Ts], Line0, Prev) ->
+pp_tokens([], _Line0, _, _) -> [];
+pp_tokens([T | Ts], Line0, File, Prev) ->
Line = erl_scan:line(T),
- [pp_sep(Line, Line0, Prev, T), pp_symbol(T) | pp_tokens(Ts, Line, T)].
+ [pp_sep(Line, Line0, Prev, T),
+ pp_symbol(T, File) | pp_tokens(Ts, Line, File, T)].
-pp_symbol({var,_,Var}) -> atom_to_list(Var);
-pp_symbol({_,_,Symbol}) -> io_lib:fwrite("~p", [Symbol]);
-pp_symbol({dot, _}) -> ".";
-pp_symbol({Symbol, _}) -> atom_to_list(Symbol).
+pp_symbol({var,_,Var}, _) -> atom_to_list(Var);
+pp_symbol({_,_,Symbol}, File) -> format_symbol(Symbol, File);
+pp_symbol({dot, _}, _) -> ".";
+pp_symbol({Symbol, _}, _) -> atom_to_list(Symbol).
pp_sep(Line, Line0, Prev, T) when Line > Line0 ->
["\n " | pp_sep(Line - 1, Line0, Prev, T)];
@@ -1622,17 +1623,17 @@ out_dfa_edges(File, DFA) ->
end, orddict:new(), Pt),
foreach(fun (T) ->
Crs = orddict:fetch(T, Tdict),
- Edgelab = dfa_edgelabel(Crs),
+ Edgelab = dfa_edgelabel(Crs, File),
io:fwrite(File, " ~b -> ~b [label=\"~ts\"];~n",
[S,T,Edgelab])
end, sort(orddict:fetch_keys(Tdict)))
end, DFA).
-dfa_edgelabel([C]) when is_integer(C) -> quote(C);
-dfa_edgelabel(Cranges) ->
+dfa_edgelabel([C], File) when is_integer(C) -> quote(C, File);
+dfa_edgelabel(Cranges, File) ->
%% io:fwrite("el: ~p\n", [Cranges]),
- "[" ++ map(fun ({A,B}) -> [quote(A), "-", quote(B)];
- (C) -> [quote(C)]
+ "[" ++ map(fun ({A,B}) -> [quote(A, File), "-", quote(B, File)];
+ (C) -> [quote(C, File)]
end, Cranges) ++ "]".
set_encoding(#leex{encoding = none}, File) ->
@@ -1651,33 +1652,50 @@ output_file_directive(File, Filename, Line) ->
format_filename(Filename0, File) ->
Filename = filename:flatten(Filename0),
+ case enc(File) of
+ unicode -> io_lib:write_string(Filename);
+ latin1 -> io_lib:write_string_as_latin1(Filename)
+ end.
+
+format_symbol(Symbol, File) ->
+ Format = case enc(File) of
+ latin1 -> "~p";
+ unicode -> "~tp"
+ end,
+ io_lib:fwrite(Format, [Symbol]).
+
+enc(File) ->
case lists:keyfind(encoding, 1, io:getopts(File)) of
- {encoding, unicode} -> io_lib:write_string(Filename);
- _ -> io_lib:write_string_as_latin1(Filename)
+ false -> latin1; % should never happen
+ {encoding, Enc} -> Enc
end.
-quote($^) -> "\\^";
-quote($.) -> "\\.";
-quote($$) -> "\\$";
-quote($-) -> "\\-";
-quote($[) -> "\\[";
-quote($]) -> "\\]";
-quote($\s) -> "\\\\s";
-quote($\") -> "\\\"";
-quote($\b) -> "\\\\b";
-quote($\f) -> "\\\\f";
-quote($\n) -> "\\\\n";
-quote($\r) -> "\\\\r";
-quote($\t) -> "\\\\t";
-quote($\e) -> "\\\\e";
-quote($\v) -> "\\\\v";
-quote($\d) -> "\\\\d";
-quote($\\) -> "\\\\";
-quote(C) when is_integer(C) ->
+quote($^, _File) -> "\\^";
+quote($., _File) -> "\\.";
+quote($$, _File) -> "\\$";
+quote($-, _File) -> "\\-";
+quote($[, _File) -> "\\[";
+quote($], _File) -> "\\]";
+quote($\s, _File) -> "\\\\s";
+quote($\", _File) -> "\\\"";
+quote($\b, _File) -> "\\\\b";
+quote($\f, _File) -> "\\\\f";
+quote($\n, _File) -> "\\\\n";
+quote($\r, _File) -> "\\\\r";
+quote($\t, _File) -> "\\\\t";
+quote($\e, _File) -> "\\\\e";
+quote($\v, _File) -> "\\\\v";
+quote($\d, _File) -> "\\\\d";
+quote($\\, _File) -> "\\\\";
+quote(C, File) when is_integer(C) ->
%% Must remove the $ and get the \'s right.
- case io_lib:write_char(C) of
+ S = case enc(File) of
+ unicode -> io_lib:write_char(C);
+ latin1 -> io_lib:write_char_as_latin1(C)
+ end,
+ case S of
[$$,$\\|Cs] -> "\\\\" ++ Cs;
[$$|Cs] -> Cs
end;
-quote(maxchar) ->
+quote(maxchar, _File) ->
"MAXCHAR".
diff --git a/lib/parsetools/src/yecc.erl b/lib/parsetools/src/yecc.erl
index f6b80eb1b4..48559ec402 100644
--- a/lib/parsetools/src/yecc.erl
+++ b/lib/parsetools/src/yecc.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@
-record(rule, {
n, % rule n in the grammar file
- line,
+ anno,
symbols, % the names of symbols
tokens,
is_guard, % the action is a guard (not used)
@@ -105,7 +105,7 @@
-record(user_code, {state, terminal, funname, action}).
--record(symbol, {line = none, name}).
+-record(symbol, {anno = none, name}).
%% ACCEPT is neither an atom nor a non-terminal.
-define(ACCEPT, {}).
@@ -154,13 +154,13 @@ compile(Input0, Output0,
format_error(bad_declaration) ->
io_lib:fwrite("unknown or bad declaration, ignored", []);
format_error({bad_expect, SymName}) ->
- io_lib:fwrite("argument ~s of Expect is not an integer",
+ io_lib:fwrite("argument ~ts of Expect is not an integer",
[format_symbol(SymName)]);
format_error({bad_rootsymbol, SymName}) ->
- io_lib:fwrite("rootsymbol ~s is not a nonterminal",
+ io_lib:fwrite("rootsymbol ~ts is not a nonterminal",
[format_symbol(SymName)]);
format_error({bad_states, SymName}) ->
- io_lib:fwrite("argument ~s of States is not an integer",
+ io_lib:fwrite("argument ~ts of States is not an integer",
[format_symbol(SymName)]);
format_error({conflict, Conflict}) ->
format_conflict(Conflict);
@@ -169,19 +169,19 @@ format_error({conflicts, SR, RR}) ->
format_error({duplicate_declaration, Tag}) ->
io_lib:fwrite("duplicate declaration of ~s", [atom_to_list(Tag)]);
format_error({duplicate_nonterminal, Nonterminal}) ->
- io_lib:fwrite("duplicate non-terminals ~s",
+ io_lib:fwrite("duplicate non-terminals ~ts",
[format_symbol(Nonterminal)]);
format_error({duplicate_precedence, Op}) ->
- io_lib:fwrite("duplicate precedence operator ~s",
+ io_lib:fwrite("duplicate precedence operator ~ts",
[format_symbol(Op)]);
format_error({duplicate_terminal, Terminal}) ->
- io_lib:fwrite("duplicate terminal ~s",
+ io_lib:fwrite("duplicate terminal ~ts",
[format_symbol(Terminal)]);
format_error({endsymbol_is_nonterminal, Symbol}) ->
- io_lib:fwrite("endsymbol ~s is a nonterminal",
+ io_lib:fwrite("endsymbol ~ts is a nonterminal",
[format_symbol(Symbol)]);
format_error({endsymbol_is_terminal, Symbol}) ->
- io_lib:fwrite("endsymbol ~s is a terminal",
+ io_lib:fwrite("endsymbol ~ts is a terminal",
[format_symbol(Symbol)]);
format_error({error, Module, Error}) ->
Module:format_error(Error);
@@ -192,7 +192,7 @@ format_error(illegal_empty) ->
format_error({internal_error, Error}) ->
io_lib:fwrite("internal yecc error: ~w", [Error]);
format_error({missing_syntax_rule, Nonterminal}) ->
- io_lib:fwrite("no syntax rule for non-terminal symbol ~s",
+ io_lib:fwrite("no syntax rule for non-terminal symbol ~ts",
[format_symbol(Nonterminal)]);
format_error({n_states, Exp, N}) ->
io_lib:fwrite("expected ~w states, but got ~p states", [Exp, N]);
@@ -201,31 +201,31 @@ format_error(no_grammar_rules) ->
format_error(nonterminals_missing) ->
io_lib:fwrite("Nonterminals is missing", []);
format_error({precedence_op_is_endsymbol, SymName}) ->
- io_lib:fwrite("precedence operator ~s is endsymbol",
+ io_lib:fwrite("precedence operator ~ts is endsymbol",
[format_symbol(SymName)]);
format_error({precedence_op_is_unknown, SymName}) ->
- io_lib:fwrite("unknown precedence operator ~s",
+ io_lib:fwrite("unknown precedence operator ~ts",
[format_symbol(SymName)]);
format_error({reserved, N}) ->
io_lib:fwrite("the use of ~w should be avoided", [N]);
format_error({symbol_terminal_and_nonterminal, SymName}) ->
- io_lib:fwrite("symbol ~s is both a terminal and nonterminal",
+ io_lib:fwrite("symbol ~ts is both a terminal and nonterminal",
[format_symbol(SymName)]);
format_error(rootsymbol_missing) ->
io_lib:fwrite("Rootsymbol is missing", []);
format_error(terminals_missing) ->
io_lib:fwrite("Terminals is missing", []);
format_error({undefined_nonterminal, Symbol}) ->
- io_lib:fwrite("undefined nonterminal: ~s", [format_symbol(Symbol)]);
+ io_lib:fwrite("undefined nonterminal: ~ts", [format_symbol(Symbol)]);
format_error({undefined_pseudo_variable, Atom}) ->
io_lib:fwrite("undefined pseudo variable ~w", [Atom]);
format_error({undefined_symbol, SymName}) ->
- io_lib:fwrite("undefined rhs symbol ~s", [format_symbol(SymName)]);
+ io_lib:fwrite("undefined rhs symbol ~ts", [format_symbol(SymName)]);
format_error({unused_nonterminal, Nonterminal}) ->
- io_lib:fwrite("non-terminal symbol ~s not used",
+ io_lib:fwrite("non-terminal symbol ~ts not used",
[format_symbol(Nonterminal)]);
format_error({unused_terminal, Terminal}) ->
- io_lib:fwrite("terminal symbol ~s not used",
+ io_lib:fwrite("terminal symbol ~ts not used",
[format_symbol(Terminal)]);
format_error({bad_symbol, String}) ->
io_lib:fwrite("bad symbol ~ts", [String]);
@@ -517,7 +517,7 @@ parse_grammar(Grammar, Inport, NextLine, St0) ->
parse_grammar(Inport, NextLine, St).
parse_grammar({error,ErrorLine,Error}, St) ->
- add_error(ErrorLine, Error, St);
+ add_error(erl_anno:new(ErrorLine), Error, St);
parse_grammar({rule, Rule, Tokens}, St0) ->
NmbrOfDaughters = case Rule of
[_, #symbol{name = '$empty'}] -> 0;
@@ -534,15 +534,15 @@ parse_grammar({rule, Rule, Tokens}, St0) ->
St#yecc{rules_list = [RuleDef | St#yecc.rules_list]};
parse_grammar({prec, Prec}, St) ->
St#yecc{prec = Prec ++ St#yecc.prec};
-parse_grammar({#symbol{}, [{string,Line,String}]}, St) ->
- add_error(Line, {bad_symbol, String}, St);
-parse_grammar({#symbol{line = Line, name = Name}, Symbols}, St) ->
+parse_grammar({#symbol{}, [{string,Anno,String}]}, St) ->
+ add_error(Anno, {bad_symbol, String}, St);
+parse_grammar({#symbol{anno = Anno, name = Name}, Symbols}, St) ->
CF = fun(I) ->
case element(I, St) of
[] ->
setelement(I, St, Symbols);
_ ->
- add_error(Line, {duplicate_declaration, Name}, St)
+ add_error(Anno, {duplicate_declaration, Name}, St)
end
end,
OneSymbol = length(Symbols) =:= 1,
@@ -553,7 +553,7 @@ parse_grammar({#symbol{line = Line, name = Name}, Symbols}, St) ->
'Endsymbol' when OneSymbol -> CF(#yecc.endsymbol);
'Expect' when OneSymbol -> CF(#yecc.expect_shift_reduce);
'States' when OneSymbol -> CF(#yecc.expect_n_states); % undocumented
- _ -> add_warning(Line, bad_declaration, St)
+ _ -> add_warning(Anno, bad_declaration, St)
end.
read_grammar(Inport, St, Line) ->
@@ -599,7 +599,7 @@ precedence(_) -> unknown.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
check_grammar(St0) ->
- Empty = #symbol{line = none, name = '$empty'},
+ Empty = #symbol{anno = none, name = '$empty'},
AllSymbols = St0#yecc.nonterminals ++ St0#yecc.terminals ++ [Empty],
St1 = St0#yecc{all_symbols = AllSymbols},
Cs = [fun check_nonterminals/1, fun check_terminals/1,
@@ -640,12 +640,12 @@ check_rootsymbol(St) ->
case St#yecc.rootsymbol of
[] ->
add_error(rootsymbol_missing, St);
- [#symbol{line = Line, name = SymName}] ->
+ [#symbol{anno = Anno, name = SymName}] ->
case kind_of_symbol(St, SymName) of
nonterminal ->
St#yecc{rootsymbol = SymName};
_ ->
- add_error(Line, {bad_rootsymbol, SymName}, St)
+ add_error(Anno, {bad_rootsymbol, SymName}, St)
end
end.
@@ -653,12 +653,12 @@ check_endsymbol(St) ->
case St#yecc.endsymbol of
[] ->
St#yecc{endsymbol = '$end'};
- [#symbol{line = Line, name = SymName}] ->
+ [#symbol{anno = Anno, name = SymName}] ->
case kind_of_symbol(St, SymName) of
nonterminal ->
- add_error(Line, {endsymbol_is_nonterminal, SymName}, St);
+ add_error(Anno, {endsymbol_is_nonterminal, SymName}, St);
terminal ->
- add_error(Line, {endsymbol_is_terminal, SymName}, St);
+ add_error(Anno, {endsymbol_is_terminal, SymName}, St);
_ ->
St#yecc{endsymbol = SymName}
end
@@ -670,8 +670,8 @@ check_expect(St0) ->
St0#yecc{expect_shift_reduce = 0};
[#symbol{name = Expect}] when is_integer(Expect) ->
St0#yecc{expect_shift_reduce = Expect};
- [#symbol{line = Line, name = Name}] ->
- St1 = add_error(Line, {bad_expect, Name}, St0),
+ [#symbol{anno = Anno, name = Name}] ->
+ St1 = add_error(Anno, {bad_expect, Name}, St0),
St1#yecc{expect_shift_reduce = 0}
end.
@@ -681,27 +681,27 @@ check_states(St) ->
St;
[#symbol{name = NStates}] when is_integer(NStates) ->
St#yecc{expect_n_states = NStates};
- [#symbol{line = Line, name = Name}] ->
- add_error(Line, {bad_states, Name}, St)
+ [#symbol{anno = Anno, name = Name}] ->
+ add_error(Anno, {bad_states, Name}, St)
end.
check_precedences(St0) ->
{St1, _} =
- foldr(fun({#symbol{line = Line, name = Op},_I,_A}, {St,Ps}) ->
+ foldr(fun({#symbol{anno = Anno, name = Op},_I,_A}, {St,Ps}) ->
case member(Op, Ps) of
true ->
- {add_error(Line, {duplicate_precedence,Op}, St),
+ {add_error(Anno, {duplicate_precedence,Op}, St),
Ps};
false ->
{St, [Op | Ps]}
end
end, {St0,[]}, St0#yecc.prec),
- foldl(fun({#symbol{line = Line, name = Op},I,A}, St) ->
+ foldl(fun({#symbol{anno = Anno, name = Op},I,A}, St) ->
case kind_of_symbol(St, Op) of
endsymbol ->
- add_error(Line,{precedence_op_is_endsymbol,Op}, St);
+ add_error(Anno,{precedence_op_is_endsymbol,Op}, St);
unknown ->
- add_error(Line, {precedence_op_is_unknown, Op}, St);
+ add_error(Anno, {precedence_op_is_unknown, Op}, St);
_ ->
St#yecc{prec = [{Op,I,A} | St#yecc.prec]}
end
@@ -709,13 +709,13 @@ check_precedences(St0) ->
check_rule(Rule0, {St0,Rules}) ->
Symbols = Rule0#rule.symbols,
- #symbol{line = HeadLine, name = Head} = hd(Symbols),
+ #symbol{anno = HeadAnno, name = Head} = hd(Symbols),
case member(Head, St0#yecc.nonterminals) of
false ->
- {add_error(HeadLine, {undefined_nonterminal, Head}, St0), Rules};
+ {add_error(HeadAnno, {undefined_nonterminal, Head}, St0), Rules};
true ->
St = check_rhs(tl(Symbols), St0),
- Rule = Rule0#rule{line = HeadLine, symbols = names(Symbols)},
+ Rule = Rule0#rule{anno = HeadAnno, symbols = names(Symbols)},
{St, [Rule | Rules]}
end.
@@ -725,7 +725,7 @@ check_rules(St0) ->
[] ->
add_error(no_grammar_rules, St);
_ ->
- Rule = #rule{line = none,
+ Rule = #rule{anno = none,
symbols = [?ACCEPT, St#yecc.rootsymbol],
tokens = []},
Rules1 = [Rule | Rules0],
@@ -740,9 +740,9 @@ duplicates(List) ->
names(Symbols) ->
map(fun(Symbol) -> Symbol#symbol.name end, Symbols).
-symbol_line(Name, St) ->
- #symbol{line = Line} = symbol_find(Name, St#yecc.all_symbols),
- Line.
+symbol_anno(Name, St) ->
+ #symbol{anno = Anno} = symbol_find(Name, St#yecc.all_symbols),
+ Anno.
symbol_member(Symbol, Symbols) ->
symbol_find(Symbol#symbol.name, Symbols) =/= false.
@@ -894,31 +894,33 @@ report_warnings(St) ->
add_error(E, St) ->
add_error(none, E, St).
-add_error(Line, E, St) ->
- add_error(St#yecc.infile, Line, E, St).
+add_error(Anno, E, St) ->
+ add_error(St#yecc.infile, Anno, E, St).
-add_error(File, Line, E, St) ->
- St#yecc{errors = [{File,{Line,?MODULE,E}}|St#yecc.errors]}.
+add_error(File, Anno, E, St) ->
+ Loc = location(Anno),
+ St#yecc{errors = [{File,{Loc,?MODULE,E}}|St#yecc.errors]}.
add_errors(SymNames, E0, St0) ->
foldl(fun(SymName, St) ->
- add_error(symbol_line(SymName, St), {E0, SymName}, St)
+ add_error(symbol_anno(SymName, St), {E0, SymName}, St)
end, St0, SymNames).
-add_warning(Line, W, St) ->
- St#yecc{warnings = [{St#yecc.infile,{Line,?MODULE,W}}|St#yecc.warnings]}.
+add_warning(Anno, W, St) ->
+ Loc = location(Anno),
+ St#yecc{warnings = [{St#yecc.infile,{Loc,?MODULE,W}}|St#yecc.warnings]}.
add_warnings(SymNames, W0, St0) ->
foldl(fun(SymName, St) ->
- add_warning(symbol_line(SymName, St), {W0, SymName}, St)
+ add_warning(symbol_anno(SymName, St), {W0, SymName}, St)
end, St0, SymNames).
check_rhs([#symbol{name = '$empty'}], St) ->
St;
check_rhs(Rhs, St0) ->
case symbol_find('$empty', Rhs) of
- #symbol{line = Line} ->
- add_error(Line, illegal_empty, St0);
+ #symbol{anno = Anno} ->
+ add_error(Anno, illegal_empty, St0);
false ->
foldl(fun(Sym, St) ->
case symbol_member(Sym, St#yecc.all_symbols) of
@@ -926,13 +928,13 @@ check_rhs(Rhs, St0) ->
St;
false ->
E = {undefined_symbol,Sym#symbol.name},
- add_error(Sym#symbol.line, E, St)
+ add_error(Sym#symbol.anno, E, St)
end
end, St0, Rhs)
end.
check_action(Tokens) ->
- case erl_parse:parse_exprs(add_roberts_dot(Tokens, 0)) of
+ case erl_parse:parse_exprs(add_roberts_dot(Tokens, erl_anno:new(0))) of
{error, _Error} ->
{false, false};
{ok, [Expr | Exprs]} ->
@@ -940,10 +942,10 @@ check_action(Tokens) ->
{IsGuard, true}
end.
-add_roberts_dot([], Line) ->
- [{'dot', Line}];
-add_roberts_dot([{'dot', Line} | _], _) ->
- [{'dot', Line}];
+add_roberts_dot([], Anno) ->
+ [{'dot', Anno}];
+add_roberts_dot([{'dot', Anno} | _], _) ->
+ [{'dot', Anno}];
add_roberts_dot([Token | Tokens], _) ->
[Token | add_roberts_dot(Tokens, element(2, Token))].
@@ -953,21 +955,22 @@ subst_pseudo_vars([H0 | T0], NmbrOfDaughters, St0) ->
{H, St1} = subst_pseudo_vars(H0, NmbrOfDaughters, St0),
{T, St} = subst_pseudo_vars(T0, NmbrOfDaughters, St1),
{[H | T], St};
-subst_pseudo_vars({atom, Line, Atom}, NmbrOfDaughters, St0) ->
+subst_pseudo_vars({atom, Anno, Atom}, NmbrOfDaughters, St0) ->
case atom_to_list(Atom) of
[$$ | Rest] ->
try list_to_integer(Rest) of
N when N > 0, N =< NmbrOfDaughters ->
- {{var, Line, list_to_atom(append("__", Rest))}, St0};
+ {{var, Anno, list_to_atom(append("__", Rest))}, St0};
_ ->
- St = add_error(Line, {undefined_pseudo_variable, Atom},
+ St = add_error(Anno,
+ {undefined_pseudo_variable, Atom},
St0),
- {{atom, Line, '$undefined'}, St}
+ {{atom, Anno, '$undefined'}, St}
catch
- error: _ -> {{atom, Line, Atom}, St0}
+ error: _ -> {{atom, Anno, Atom}, St0}
end;
_ ->
- {{atom, Line, Atom}, St0}
+ {{atom, Anno, Atom}, St0}
end;
subst_pseudo_vars(Tuple, NmbrOfDaughters, St0) when is_tuple(Tuple) ->
{L, St} = subst_pseudo_vars(tuple_to_list(Tuple), NmbrOfDaughters, St0),
@@ -1806,9 +1809,9 @@ report_conflict(Conflict, St, ActionName, How) ->
Formated = format_symbol(ActionName),
case How of
prec ->
- io:fwrite(<<"Resolved in favor of ~s.\n\n">>, [Formated]);
+ io:fwrite(<<"Resolved in favor of ~ts.\n\n">>, [Formated]);
default ->
- io:fwrite(<<"Conflict resolved in favor of ~s.\n\n">>,
+ io:fwrite(<<"Conflict resolved in favor of ~ts.\n\n">>,
[Formated])
end;
true ->
@@ -1853,7 +1856,7 @@ format_conflict({Symbol, N, _, {one_level_up,
{L1, RuleN1, {P1, Ass1}},
{L2, RuleN2, {P2, Ass2}}}}) ->
S1 = io_lib:fwrite(<<"Conflicting precedences of symbols when "
- "scanning ~s in state ~w:\n">>,
+ "scanning ~ts in state ~w:\n">>,
[format_symbol(Symbol), N]),
S2 = io_lib:fwrite(<<" ~s ~w (rule ~w at line ~w)\n"
" vs.\n">>,
@@ -1863,26 +1866,26 @@ format_conflict({Symbol, N, _, {one_level_up,
[S1, S2, S3];
format_conflict({Symbol, N, Reduce, Confl}) ->
S1 = io_lib:fwrite(<<"Parse action conflict scanning symbol "
- "~s in state ~w:\n">>, [format_symbol(Symbol), N]),
+ "~ts in state ~w:\n">>, [format_symbol(Symbol), N]),
S2 = case Reduce of
{[HR | TR], RuleNmbr, RuleLine} ->
- io_lib:fwrite(<<" Reduce to ~s from ~s (rule ~w at "
+ io_lib:fwrite(<<" Reduce to ~ts from ~ts (rule ~w at "
"line ~w)\n vs.\n">>,
[format_symbol(HR), format_symbols(TR),
RuleNmbr, RuleLine])
end,
S3 = case Confl of
{reduce, [HR2|TR2], RuleNmbr2, RuleLine2} ->
- io_lib:fwrite(<<" reduce to ~s from ~s "
+ io_lib:fwrite(<<" reduce to ~ts from ~ts "
"(rule ~w at line ~w).">>,
[format_symbol(HR2), format_symbols(TR2),
RuleNmbr2, RuleLine2]);
{shift, NewState, Sym} ->
io_lib:fwrite(<<" shift to state ~w, adding right "
- "sisters to ~s.">>,
+ "sisters to ~ts.">>,
[NewState, format_symbol(Sym)]);
{accept, Rootsymbol} ->
- io_lib:fwrite(<<" reduce to rootsymbol ~s.">>,
+ io_lib:fwrite(<<" reduce to rootsymbol ~ts.">>,
[format_symbol(Rootsymbol)])
end,
[S1, S2, S3].
@@ -1923,8 +1926,9 @@ format_conflict({Symbol, N, Reduce, Confl}) ->
-define(CODE_VERSION, "1.4").
-define(YECC_BUG(M, A),
- iolist_to_binary([" erlang:error({yecc_bug,\"",?CODE_VERSION,"\",",
- io_lib:fwrite(M, A), "}).\n\n"])).
+ unicode:characters_to_binary(
+ [" erlang:error({yecc_bug,\"",?CODE_VERSION,"\",",
+ io_lib:fwrite(M, A), "}).\n\n"])).
%% Returns number of newlines in included files.
output_prelude(Outport, Inport, St0) when St0#yecc.includefile =:= [] ->
@@ -1977,7 +1981,7 @@ output_header(St0) ->
output_goto(St, [{_Nonterminal, []} | Go], StateInfo) ->
output_goto(St, Go, StateInfo);
output_goto(St0, [{Nonterminal, List} | Go], StateInfo) ->
- F = function_name(yeccgoto, Nonterminal),
+ F = function_name(St0, yeccgoto, Nonterminal),
St05 = fwrite(St0, <<"-dialyzer({nowarn_function, ~w/7}).\n">>, [F]),
St10 = output_goto1(St05, List, F, StateInfo, true),
St = output_goto_fini(F, Nonterminal, St10),
@@ -2015,7 +2019,8 @@ output_goto_fini(F, NT, #yecc{includefile_version = {1,1}}=St0) ->
St = fwrite(St10, <<"~w(State, _Cat, _Ss, _Stack, _T, _Ts, _Tzr) ->\n">>,
[F]),
fwrite(St,
- ?YECC_BUG(<<"{~w, State, missing_in_goto_table}">>, [NT]),
+ ?YECC_BUG(<<"{~ts, State, missing_in_goto_table}">>,
+ [quoted_atom(St0, NT)]),
[]);
output_goto_fini(_F, _NT, St) ->
fwrite(St, <<".\n\n">>, []).
@@ -2024,7 +2029,7 @@ output_goto_fini(_F, _NT, St) ->
find_user_code(ParseActions, St) ->
[#user_code{state = State,
terminal = Terminal,
- funname = inlined_function_name(State, Terminal),
+ funname = inlined_function_name(St, State, Terminal),
action = Action} ||
{State, La_actions} <- ParseActions,
{Action, Terminals, RuleNmbr, NmbrOfDaughters}
@@ -2145,14 +2150,14 @@ output_action(St, State, Terminal, #reduce{}=Action, IsFirst, SI) ->
output_reduce(St, State, Terminal, Action, IsFirst, SI);
output_action(St0, State, Terminal, #shift{state = NewState}, IsFirst, _SI) ->
St10 = delim(St0, IsFirst),
- St = fwrite(St10, <<"yeccpars2_~w(S, ~s, Ss, Stack, T, Ts, Tzr) ->\n">>,
- [State, quoted_atom(Terminal)]),
+ St = fwrite(St10, <<"yeccpars2_~w(S, ~ts, Ss, Stack, T, Ts, Tzr) ->\n">>,
+ [State, quoted_atom(St10, Terminal)]),
output_call_to_includefile(NewState, St);
output_action(St0, State, Terminal, accept, IsFirst, _SI) ->
St10 = delim(St0, IsFirst),
St = fwrite(St10,
- <<"yeccpars2_~w(_S, ~s, _Ss, Stack, _T, _Ts, _Tzr) ->\n">>,
- [State, quoted_atom(Terminal)]),
+ <<"yeccpars2_~w(_S, ~ts, _Ss, Stack, _T, _Ts, _Tzr) ->\n">>,
+ [State, quoted_atom(St10, Terminal)]),
fwrite(St, <<" {ok, hd(Stack)}">>, []);
output_action(St, _State, _Terminal, nonassoc, _IsFirst, _SI) ->
St.
@@ -2171,19 +2176,19 @@ output_state_actions_fini(State, IsFirst, St0) ->
St = fwrite(St10, <<"yeccpars2_~w(_, _, _, _, T, _, _) ->\n">>, [State]),
fwrite(St, <<" yeccerror(T).\n\n">>, []).
-output_reduce(St0, State, Terminal0,
+output_reduce(St0, State, Terminal,
#reduce{rule_nmbr = RuleNmbr,
head = Head,
nmbr_of_daughters = NmbrOfDaughters},
IsFirst, StateInfo) ->
St10 = delim(St0, IsFirst),
- Terminal = if
- is_atom(Terminal0) -> quoted_atom(Terminal0);
- true -> Terminal0
- end,
+ QuotedTerminal = if
+ is_atom(Terminal) -> quoted_atom(St10, Terminal);
+ true -> Terminal
+ end,
St20 = fwrite(St10,
- <<"yeccpars2_~w(_S, ~s, Ss, Stack, T, Ts, Tzr) ->\n">>,
- [State, Terminal]),
+ <<"yeccpars2_~w(_S, ~ts, Ss, Stack, T, Ts, Tzr) ->\n">>,
+ [State, QuotedTerminal]),
St30 =
if
NmbrOfDaughters < 2 ->
@@ -2202,7 +2207,7 @@ output_reduce(St0, State, Terminal0,
_ ->
NewStack = "NewStack",
fwrite(St30, <<" NewStack = ~w(Stack),\n">>,
- [inlined_function_name(State, Terminal0)])
+ [inlined_function_name(St30, State, Terminal)])
end,
if
NmbrOfDaughters =:= 0 ->
@@ -2218,13 +2223,13 @@ output_reduce(St0, State, Terminal0,
St = fwrite(St40, <<"~s">>, [C]),
%% Short-circuit call to yeccpars2:
fwrite(St,
- <<" yeccpars2_~w(~s, ~s, [~w | Ss], ~s, T, Ts, Tzr)">>,
- [Repr, NextS, Terminal, State, NewStack]);
+ <<" yeccpars2_~w(~s, ~ts, [~w | Ss], ~s, T, Ts, Tzr)">>,
+ [Repr, NextS, QuotedTerminal, State, NewStack]);
true ->
fwrite(St40,
- <<" ~w(hd(~s), ~s, ~s, ~s, T, Ts, Tzr)">>,
- [function_name(yeccgoto, Head), Ns,
- Terminal, Ns, NewStack])
+ <<" ~w(hd(~s), ~ts, ~s, ~s, T, Ts, Tzr)">>,
+ [function_name(St40, yeccgoto, Head), Ns,
+ QuotedTerminal, Ns, NewStack])
end.
delim(St, true) ->
@@ -2232,8 +2237,10 @@ delim(St, true) ->
delim(St, false) ->
fwrite(St, <<";\n">>, []).
-quoted_atom(Atom) ->
- io_lib:fwrite(<<"~w">>, [Atom]).
+quoted_atom(#yecc{encoding = latin1}, Atom) when is_atom(Atom) ->
+ io_lib:write_atom_as_latin1(Atom);
+quoted_atom(_St, Atomic) ->
+ io_lib:write(Atomic).
output_inlined(St, UserCodeActions, Infile) ->
foldl(fun(#user_code{funname = InlinedFunctionName,
@@ -2285,19 +2292,21 @@ output_inlined(St0, FunctionName, Reduce, Infile) ->
fwrite(St, <<" [begin\n ~ts\n end | ~s].\n\n">>,
[pp_tokens(Tokens, Line0, St#yecc.encoding), Stack]).
-inlined_function_name(State, "Cat") ->
- inlined_function_name(State, "");
-inlined_function_name(State, Terminal) ->
- list_to_atom(concat([yeccpars2_, State, '_', Terminal])).
+inlined_function_name(St, State, Terminal) ->
+ End = case Terminal of
+ "Cat" -> [];
+ _ -> [quoted_atom(St, Terminal)]
+ end,
+ list_to_atom(concat([yeccpars2_, State, '_'] ++ End)).
--compile({nowarn_unused_function,function_name/2}).
-function_name(Name, Suf) ->
- list_to_atom(concat([Name, '_' | quoted_atom(Suf)])).
+-compile({nowarn_unused_function,function_name/3}).
+function_name(St, Name, Suf) ->
+ list_to_atom(concat([Name, '_'] ++ [quoted_atom(St, Suf)])).
rule(RulePointer, St) ->
- #rule{n = N, line = Line, symbols = Symbols} =
+ #rule{n = N, anno = Anno, symbols = Symbols} =
dict:fetch(RulePointer, St#yecc.rule_pointer2rule),
- {Symbols, Line, N}.
+ {Symbols, Anno, N}.
get_rule(RuleNmbr, St) ->
dict:fetch(RuleNmbr, St#yecc.rule_pointer2rule).
@@ -2463,7 +2472,7 @@ include(St, File, Outport) ->
include1(eof, _, _, _File, L, _St) ->
L;
include1({error, _}=_Error, _Inport, _Outport, File, L, St) ->
- throw(add_error(File, L, cannot_parse, St));
+ throw(add_error(File, erl_anno:new(L), cannot_parse, St));
include1(Line, Inport, Outport, File, L, St) ->
Incr = case member($\n, Line) of
true -> 1;
@@ -2488,7 +2497,7 @@ includefile_version(Includefile) ->
parse_file(Epp) ->
case epp:parse_erl_form(Epp) of
- {ok, {function,_Line,yeccpars1,7,_Clauses}} ->
+ {ok, {function,_Anno,yeccpars1,7,_Clauses}} ->
{1,4};
{eof,_Line} ->
{1,1};
@@ -2503,7 +2512,7 @@ pp_tokens(Tokens, Line0, Enc) ->
pp_tokens1([], _Line0, _Enc, _T0) ->
[];
pp_tokens1([T | Ts], Line0, Enc, T0) ->
- Line = element(2, T),
+ Line = location(anno(T)),
[pp_sep(Line, Line0, T0), pp_symbol(T, Enc)|pp_tokens1(Ts, Line, Enc, T)].
pp_symbol({var,_,Var}, _Enc) -> Var;
@@ -2538,10 +2547,17 @@ output_file_directive(St, _Filename, _Line) ->
St.
first_line(Tokens) ->
- element(2, hd(Tokens)).
+ location(anno(hd(Tokens))).
last_line(Tokens) ->
- element(2, lists:last(Tokens)).
+ location(anno(lists:last(Tokens))).
+
+location(none) -> none;
+location(Anno) ->
+ erl_anno:line(Anno).
+
+anno(Token) ->
+ element(2, Token).
%% Keep track of the current line in the generated file.
fwrite(#yecc{outport = Outport, line = Line}=St, Format, Args) ->
diff --git a/lib/parsetools/src/yeccgramm.yrl b/lib/parsetools/src/yeccgramm.yrl
index c7b2ef6a86..40aa85a43e 100644
--- a/lib/parsetools/src/yeccgramm.yrl
+++ b/lib/parsetools/src/yeccgramm.yrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -39,43 +39,38 @@ rule -> head '->' symbols attached_code dot: {rule, ['$1' | '$3'], '$4'}.
head -> symbol : '$1'.
symbols -> symbol : ['$1'].
symbols -> symbol symbols : ['$1' | '$2'].
-strings -> string : [string('$1')].
-strings -> string strings : [string('$1') | '$2'].
+strings -> string : ['$1'].
+strings -> string strings : ['$1' | '$2'].
attached_code -> ':' tokens : {erlang_code, '$2'}.
-attached_code -> '$empty' : {erlang_code, [{atom, 0, '$undefined'}]}.
+attached_code -> '$empty' : {erlang_code,
+ [{atom, erl_anno:new(0), '$undefined'}]}.
tokens -> token : ['$1'].
tokens -> token tokens : ['$1' | '$2'].
symbol -> var : symbol('$1').
symbol -> atom : symbol('$1').
symbol -> integer : symbol('$1').
symbol -> reserved_word : symbol('$1').
-token -> var : token('$1').
-token -> atom : token('$1').
-token -> float : token('$1').
-token -> integer : token('$1').
-token -> string : token('$1').
-token -> char : token('$1').
-token -> reserved_symbol : {value_of('$1'), line_of('$1')}.
-token -> reserved_word : {value_of('$1'), line_of('$1')}.
-token -> '->' : {'->', line_of('$1')}. % Have to be treated in this
-token -> ':' : {':', line_of('$1')}. % manner, because they are also
- % special symbols of the metagrammar
+token -> var : '$1'.
+token -> atom : '$1'.
+token -> float : '$1'.
+token -> integer : '$1'.
+token -> string : '$1'.
+token -> char : '$1'.
+token -> reserved_symbol : {value_of('$1'), anno_of('$1')}.
+token -> reserved_word : {value_of('$1'), anno_of('$1')}.
+token -> '->' : {'->', anno_of('$1')}. % Have to be treated in this
+token -> ':' : {':', anno_of('$1')}. % manner, because they are also
+ % special symbols of the metagrammar
Erlang code.
--record(symbol, {line, name}).
+-record(symbol, {anno, name}).
symbol(Symbol) ->
- #symbol{line = line_of(Symbol), name = value_of(Symbol)}.
-
-token(Token) ->
- setelement(2, Token, line_of(Token)).
-
-string(Token) ->
- setelement(2, Token, line_of(Token)).
+ #symbol{anno = anno_of(Symbol), name = value_of(Symbol)}.
value_of(Token) ->
element(3, Token).
-line_of(Token) ->
- erl_anno:line(element(2, Token)).
+anno_of(Token) ->
+ element(2, Token).
diff --git a/lib/parsetools/src/yeccparser.erl b/lib/parsetools/src/yeccparser.erl
index 0025284ccf..6f6f66d56c 100644
--- a/lib/parsetools/src/yeccparser.erl
+++ b/lib/parsetools/src/yeccparser.erl
@@ -1,29 +1,23 @@
-module(yeccparser).
-export([parse/1, parse_and_scan/1, format_error/1]).
--file("yeccgramm.yrl", 63).
+-file("yeccgramm.yrl", 65).
--record(symbol, {line, name}).
+-record(symbol, {anno, name}).
symbol(Symbol) ->
- #symbol{line = line_of(Symbol), name = value_of(Symbol)}.
-
-token(Token) ->
- setelement(2, Token, line_of(Token)).
-
-string(Token) ->
- setelement(2, Token, line_of(Token)).
+ #symbol{anno = anno_of(Symbol), name = value_of(Symbol)}.
value_of(Token) ->
element(3, Token).
-line_of(Token) ->
- erl_anno:line(element(2, Token)).
+anno_of(Token) ->
+ element(2, Token).
--file("lib/parsetools/include/yeccpre.hrl", 0).
+-file("/ldisk/hasse/otp/lib/parsetools/include/yeccpre.hrl", 0).
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -147,21 +141,10 @@ yecc_end(Line) ->
{'$end', Line}.
yecctoken_end_location(Token) ->
- try
- Str = erl_scan:text(Token),
- Line = erl_scan:line(Token),
- Parts = re:split(Str, "\n"),
- Dline = length(Parts) - 1,
- Yline = Line + Dline,
- case erl_scan:column(Token) of
- Column when is_integer(Column) ->
- Col = byte_size(lists:last(Parts)),
- {Yline, Col + if Dline =:= 0 -> Column; true -> 1 end};
- undefined ->
- Yline
- end
- catch _:_ ->
- yecctoken_location(Token)
+ try erl_anno:end_location(element(2, Token)) of
+ undefined -> yecctoken_location(Token);
+ Loc -> Loc
+ catch _:_ -> yecctoken_location(Token)
end.
-compile({nowarn_unused_function, yeccerror/1}).
@@ -172,15 +155,15 @@ yeccerror(Token) ->
-compile({nowarn_unused_function, yecctoken_to_string/1}).
yecctoken_to_string(Token) ->
- case catch erl_scan:text(Token) of
- Txt when is_list(Txt) -> Txt;
- _ -> yecctoken2string(Token)
+ try erl_scan:text(Token) of
+ undefined -> yecctoken2string(Token);
+ Txt -> Txt
+ catch _:_ -> yecctoken2string(Token)
end.
yecctoken_location(Token) ->
- case catch erl_scan:location(Token) of
- Loc when Loc =/= undefined -> Loc;
- _ -> element(2, Token)
+ try erl_scan:location(Token)
+ catch _:_ -> element(2, Token)
end.
-compile({nowarn_unused_function, yecctoken2string/1}).
@@ -204,8 +187,9 @@ yecctoken2string(Other) ->
--file("yeccgramm.erl", 207).
+-file("yeccgramm.erl", 190).
+-dialyzer({nowarn_function, yeccpars2/7}).
yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_0(S, Cat, Ss, Stack, T, Ts, Tzr);
%% yeccpars2(1=S, Cat, Ss, Stack, T, Ts, Tzr) ->
@@ -281,6 +265,7 @@ yeccpars2(35=S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2(Other, _, _, _, _, _, _) ->
erlang:error({yecc_bug,"1.4",{missing_state_in_action_table, Other}}).
+-dialyzer({nowarn_function, yeccpars2_0/7}).
yeccpars2_0(S, atom, Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 6, Ss, Stack, T, Ts, Tzr);
yeccpars2_0(S, integer, Ss, Stack, T, Ts, Tzr) ->
@@ -308,11 +293,13 @@ yeccpars2_1(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccgoto_grammar(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccpars2_3/7}).
yeccpars2_3(S, '->', Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 10, Ss, Stack, T, Ts, Tzr);
yeccpars2_3(_, _, _, _, T, _, _) ->
yeccerror(T).
+-dialyzer({nowarn_function, yeccpars2_4/7}).
yeccpars2_4(_S, '$end', _Ss, Stack, _T, _Ts, _Tzr) ->
{ok, hd(Stack)};
yeccpars2_4(_, _, _, _, T, _, _) ->
@@ -362,11 +349,13 @@ yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
NewStack = yeccpars2_13_(Stack),
yeccgoto_symbols(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccpars2_14/7}).
yeccpars2_14(S, dot, Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 29, Ss, Stack, T, Ts, Tzr);
yeccpars2_14(_, _, _, _, T, _, _) ->
yeccerror(T).
+-dialyzer({nowarn_function, yeccpars2_15/7}).
yeccpars2_15(S, '->', Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 18, Ss, Stack, T, Ts, Tzr);
yeccpars2_15(S, ':', Ss, Stack, T, Ts, Tzr) ->
@@ -428,20 +417,16 @@ yeccpars2_19(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
yeccpars2_20(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_20_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_21(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_21_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_22(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_22_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_23(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_23_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_24(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
NewStack = yeccpars2_24_(Stack),
@@ -452,12 +437,10 @@ yeccpars2_25(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
yeccpars2_26(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_26_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_27(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
- NewStack = yeccpars2_27_(Stack),
- yeccgoto_token(hd(Ss), Cat, Ss, NewStack, T, Ts, Tzr).
+ yeccgoto_token(hd(Ss), Cat, Ss, Stack, T, Ts, Tzr).
yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
[_|Nss] = Ss,
@@ -469,11 +452,13 @@ yeccpars2_29(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
NewStack = yeccpars2_29_(Stack),
yeccgoto_rule(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccpars2_30/7}).
yeccpars2_30(S, dot, Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 35, Ss, Stack, T, Ts, Tzr);
yeccpars2_30(_, _, _, _, T, _, _) ->
yeccerror(T).
+-dialyzer({nowarn_function, yeccpars2_31/7}).
yeccpars2_31(S, dot, Ss, Stack, T, Ts, Tzr) ->
yeccpars1(S, 34, Ss, Stack, T, Ts, Tzr);
yeccpars2_31(_, _, _, _, T, _, _) ->
@@ -500,26 +485,33 @@ yeccpars2_35(_S, Cat, Ss, Stack, T, Ts, Tzr) ->
NewStack = yeccpars2_35_(Stack),
yeccgoto_declaration(hd(Nss), Cat, Nss, NewStack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_attached_code/7}).
yeccgoto_attached_code(11, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_14(14, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_declaration/7}).
yeccgoto_declaration(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_5(_S, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_grammar/7}).
yeccgoto_grammar(0, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_4(4, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_head/7}).
yeccgoto_head(0, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_3(3, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_rule/7}).
yeccgoto_rule(0=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_2(_S, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_strings/7}).
yeccgoto_strings(1, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_31(31, Cat, Ss, Stack, T, Ts, Tzr);
yeccgoto_strings(32=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_33(_S, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_symbol/7}).
yeccgoto_symbol(0, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_1(1, Cat, Ss, Stack, T, Ts, Tzr);
yeccgoto_symbol(1, Cat, Ss, Stack, T, Ts, Tzr) ->
@@ -529,6 +521,7 @@ yeccgoto_symbol(10, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccgoto_symbol(12, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_12(12, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_symbols/7}).
yeccgoto_symbols(1, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_30(30, Cat, Ss, Stack, T, Ts, Tzr);
yeccgoto_symbols(10, Cat, Ss, Stack, T, Ts, Tzr) ->
@@ -536,18 +529,20 @@ yeccgoto_symbols(10, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccgoto_symbols(12=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_13(_S, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_token/7}).
yeccgoto_token(15, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr);
yeccgoto_token(17, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_17(17, Cat, Ss, Stack, T, Ts, Tzr).
+-dialyzer({nowarn_function, yeccgoto_tokens/7}).
yeccgoto_tokens(15=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_16(_S, Cat, Ss, Stack, T, Ts, Tzr);
yeccgoto_tokens(17=_S, Cat, Ss, Stack, T, Ts, Tzr) ->
yeccpars2_28(_S, Cat, Ss, Stack, T, Ts, Tzr).
-compile({inline,yeccpars2_6_/1}).
--file("yeccgramm.yrl", 44).
+-file("yeccgramm.yrl", 46).
yeccpars2_6_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -555,7 +550,7 @@ yeccpars2_6_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_7_/1}).
--file("yeccgramm.yrl", 45).
+-file("yeccgramm.yrl", 47).
yeccpars2_7_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -563,7 +558,7 @@ yeccpars2_7_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_8_/1}).
--file("yeccgramm.yrl", 46).
+-file("yeccgramm.yrl", 48).
yeccpars2_8_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -571,7 +566,7 @@ yeccpars2_8_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_9_/1}).
--file("yeccgramm.yrl", 43).
+-file("yeccgramm.yrl", 45).
yeccpars2_9_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -579,14 +574,15 @@ yeccpars2_9_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_11_/1}).
--file("yeccgramm.yrl", 40).
+-file("yeccgramm.yrl", 41).
yeccpars2_11_(__Stack0) ->
[begin
- { erlang_code , [ { atom , 0 , '$undefined' } ] }
+ { erlang_code ,
+ [ { atom , erl_anno : new ( 0 ) , '$undefined' } ] }
end | __Stack0].
-compile({inline,yeccpars2_12_/1}).
--file("yeccgramm.yrl", 35).
+-file("yeccgramm.yrl", 36).
yeccpars2_12_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -594,7 +590,7 @@ yeccpars2_12_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_13_/1}).
--file("yeccgramm.yrl", 36).
+-file("yeccgramm.yrl", 37).
yeccpars2_13_(__Stack0) ->
[__2,__1 | __Stack] = __Stack0,
[begin
@@ -602,7 +598,7 @@ yeccpars2_13_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_16_/1}).
--file("yeccgramm.yrl", 39).
+-file("yeccgramm.yrl", 40).
yeccpars2_16_(__Stack0) ->
[__2,__1 | __Stack] = __Stack0,
[begin
@@ -610,7 +606,7 @@ yeccpars2_16_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_17_/1}).
--file("yeccgramm.yrl", 41).
+-file("yeccgramm.yrl", 43).
yeccpars2_17_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
@@ -618,87 +614,39 @@ yeccpars2_17_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_18_/1}).
--file("yeccgramm.yrl", 55).
+-file("yeccgramm.yrl", 57).
yeccpars2_18_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
- { '->' , line_of ( __1 ) }
+ { '->' , anno_of ( __1 ) }
end | __Stack].
-compile({inline,yeccpars2_19_/1}).
--file("yeccgramm.yrl", 56).
+-file("yeccgramm.yrl", 58).
yeccpars2_19_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
- { ':' , line_of ( __1 ) }
- end | __Stack].
-
--compile({inline,yeccpars2_20_/1}).
--file("yeccgramm.yrl", 48).
-yeccpars2_20_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
- end | __Stack].
-
--compile({inline,yeccpars2_21_/1}).
--file("yeccgramm.yrl", 52).
-yeccpars2_21_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
- end | __Stack].
-
--compile({inline,yeccpars2_22_/1}).
--file("yeccgramm.yrl", 49).
-yeccpars2_22_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
- end | __Stack].
-
--compile({inline,yeccpars2_23_/1}).
--file("yeccgramm.yrl", 50).
-yeccpars2_23_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
+ { ':' , anno_of ( __1 ) }
end | __Stack].
-compile({inline,yeccpars2_24_/1}).
--file("yeccgramm.yrl", 53).
+-file("yeccgramm.yrl", 55).
yeccpars2_24_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
- { value_of ( __1 ) , line_of ( __1 ) }
+ { value_of ( __1 ) , anno_of ( __1 ) }
end | __Stack].
-compile({inline,yeccpars2_25_/1}).
--file("yeccgramm.yrl", 54).
+-file("yeccgramm.yrl", 56).
yeccpars2_25_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
- { value_of ( __1 ) , line_of ( __1 ) }
- end | __Stack].
-
--compile({inline,yeccpars2_26_/1}).
--file("yeccgramm.yrl", 51).
-yeccpars2_26_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
- end | __Stack].
-
--compile({inline,yeccpars2_27_/1}).
--file("yeccgramm.yrl", 47).
-yeccpars2_27_(__Stack0) ->
- [__1 | __Stack] = __Stack0,
- [begin
- token ( __1 )
+ { value_of ( __1 ) , anno_of ( __1 ) }
end | __Stack].
-compile({inline,yeccpars2_28_/1}).
--file("yeccgramm.yrl", 42).
+-file("yeccgramm.yrl", 44).
yeccpars2_28_(__Stack0) ->
[__2,__1 | __Stack] = __Stack0,
[begin
@@ -706,7 +654,7 @@ yeccpars2_28_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_29_/1}).
--file("yeccgramm.yrl", 33).
+-file("yeccgramm.yrl", 34).
yeccpars2_29_(__Stack0) ->
[__5,__4,__3,__2,__1 | __Stack] = __Stack0,
[begin
@@ -714,23 +662,23 @@ yeccpars2_29_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_32_/1}).
--file("yeccgramm.yrl", 37).
+-file("yeccgramm.yrl", 38).
yeccpars2_32_(__Stack0) ->
[__1 | __Stack] = __Stack0,
[begin
- [ string ( __1 ) ]
+ [ __1 ]
end | __Stack].
-compile({inline,yeccpars2_33_/1}).
--file("yeccgramm.yrl", 38).
+-file("yeccgramm.yrl", 39).
yeccpars2_33_(__Stack0) ->
[__2,__1 | __Stack] = __Stack0,
[begin
- [ string ( __1 ) | __2 ]
+ [ __1 | __2 ]
end | __Stack].
-compile({inline,yeccpars2_34_/1}).
--file("yeccgramm.yrl", 32).
+-file("yeccgramm.yrl", 33).
yeccpars2_34_(__Stack0) ->
[__3,__2,__1 | __Stack] = __Stack0,
[begin
@@ -738,7 +686,7 @@ yeccpars2_34_(__Stack0) ->
end | __Stack].
-compile({inline,yeccpars2_35_/1}).
--file("yeccgramm.yrl", 31).
+-file("yeccgramm.yrl", 32).
yeccpars2_35_(__Stack0) ->
[__3,__2,__1 | __Stack] = __Stack0,
[begin
@@ -746,4 +694,4 @@ yeccpars2_35_(__Stack0) ->
end | __Stack].
--file("yeccgramm.yrl", 82).
+-file("yeccgramm.yrl", 77).
diff --git a/lib/parsetools/test/leex_SUITE.erl b/lib/parsetools/test/leex_SUITE.erl
index 54602848ec..3f5d9fee3e 100644
--- a/lib/parsetools/test/leex_SUITE.erl
+++ b/lib/parsetools/test/leex_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2010-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2010-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@
pt/1, man/1, ex/1, ex2/1, not_yet/1,
line_wrap/1,
- otp_10302/1, otp_11286/1, unicode/1, otp_13916/1]).
+ otp_10302/1, otp_11286/1, unicode/1, otp_13916/1, otp_14285/1]).
% Default timetrap timeout (set in init_per_testcase).
-define(default_timeout, ?t:minutes(1)).
@@ -67,7 +67,7 @@ all() ->
groups() ->
[{checks, [], [file, compile, syntax]},
{examples, [], [pt, man, ex, ex2, not_yet, unicode]},
- {tickets, [], [otp_10302, otp_11286, otp_13916]},
+ {tickets, [], [otp_10302, otp_11286, otp_13916, otp_14285]},
{bugs, [], [line_wrap]}].
init_per_suite(Config) ->
@@ -1131,6 +1131,45 @@ otp_13916(Config) when is_list(Config) ->
?line run(Config, Ts),
ok.
+otp_14285(Config) ->
+ Dir = ?privdir,
+ Filename = filename:join(Dir, "file.xrl"),
+
+ Ts = [{otp_14285_1,
+ <<"%% encoding: latin-1\n"
+ "Definitions.\n"
+ "A = a\n"
+ "Z = z\n"
+ "L = [{A}-{Z}]\n"
+ "U = [\\x{400}]\n"
+ "Rules.\n"
+ "{L}+ : {token,l}.\n"
+ "{U}+ : {token,'\\x{400}'}.\n"
+ "Erlang code.\n"
+ "-export([t/0]).\n"
+ "t() ->\n"
+ " {ok,['\\x{400}'],1} = string(\"\\x{400}\"), ok.\n">>,
+ default,
+ ok},
+ {otp_14285_2,
+ <<"%% encoding: UTF-8\n"
+ "Definitions.\n"
+ "A = a\n"
+ "Z = z\n"
+ "L = [{A}-{Z}]\n"
+ "U = [\x{400}]\n"
+ "Rules.\n"
+ "{L}+ : {token,l}.\n"
+ "{U}+ : {token,'\x{400}'}.\n"
+ "Erlang code.\n"
+ "-export([t/0]).\n"
+ "t() ->\n"
+ " {ok,['\x{400}'],1} = string(\"\x{400}\"), ok.\n">>,
+ default,
+ ok}],
+ run(Config, Ts),
+ ok.
+
start_node(Name, Args) ->
[_,Host] = string:tokens(atom_to_list(node()), "@"),
ct:log("Trying to start ~w@~s~n", [Name,Host]),
diff --git a/lib/parsetools/test/yecc_SUITE.erl b/lib/parsetools/test/yecc_SUITE.erl
index 5bd71d5d19..a7166b91ed 100644
--- a/lib/parsetools/test/yecc_SUITE.erl
+++ b/lib/parsetools/test/yecc_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2005-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@
otp_5369/1, otp_6362/1, otp_7945/1, otp_8483/1, otp_8486/1,
otp_7292/1, otp_7969/1, otp_8919/1, otp_10302/1, otp_11269/1,
- otp_11286/1]).
+ otp_11286/1, otp_14285/1]).
% Default timetrap timeout (set in init_per_testcase).
-define(default_timeout, ?t:minutes(1)).
@@ -78,7 +78,7 @@ groups() ->
{bugs, [],
[otp_5369, otp_6362, otp_7945, otp_8483, otp_8486]},
{improvements, [], [otp_7292, otp_7969, otp_8919, otp_10302,
- otp_11269, otp_11286]}].
+ otp_11269, otp_11286, otp_14285]}].
init_per_suite(Config) ->
Config.
@@ -1524,7 +1524,7 @@ otp_7945(suite) -> [];
otp_7945(Config) when is_list(Config) ->
A2 = erl_anno:new(2),
A3 = erl_anno:new(3),
- {error,_} = erl_parse:parse([{atom,3,foo},{'.',A2,9,9}]),
+ {error,_} = erl_parse:parse([{atom,A3,foo},{'.',A2,9,9}]),
ok.
otp_8483(doc) ->
@@ -2048,6 +2048,90 @@ otp_11286(Config) when is_list(Config) ->
true = test_server:stop_node(Node),
ok.
+otp_14285(Config) ->
+ Dir = ?privdir,
+ YeccPre = filename:join(Dir, "yeccpre.hrl"),
+ ?line ok = file:write_file(YeccPre,
+ [<<"-export([t/0]).\n">>,my_yeccpre()]),
+
+ T0 = <<"
+ Nonterminals '\\x{400}'.
+ Terminals t.
+ Rootsymbol '\\x{400}'.
+ '\\x{400}' -> t : '$1'.
+ Erlang code.
+ t() ->
+ L = [{t, 1}],
+ {ok, R} = parse(L),
+ {t, 1} = R,
+ ok.">>,
+ Ts0 = [{otp_14285_1,
+ [<<"%% coding: Latin-1\n">>,T0],YeccPre,ok},
+ {otp_14285_2,
+ [<<"%% coding: coding: UTF-8\n">>,T0],YeccPre,ok}],
+ run(Config, Ts0),
+ file:delete(YeccPre),
+
+ T1 = <<"
+ Nonterminals '1\\x{400}' list 'unused\\x{400}'.
+ Terminals '2\\x{400}'.
+ Rootsymbol '1\\x{400}'.
+
+ '1\\x{400}' -> list : '$1'.
+
+ list -> '2\\x{400}' : '$1'.
+ list -> list '2\\x{400}' : {foo,'\\x{400}'}.
+
+ Erlang code.
+
+ -export([t/0]).
+
+ t() ->
+ L = [{'2\\x{400}', 1}, {'2\\x{400}',2}],
+ {ok, R} = parse(L),
+ {foo,A} = R,
+ '\\x{400}' = A,
+ [1024] = atom_to_list(A),
+ ok.">>,
+
+ Ts1 = [{otp_14285_3,
+ [<<"%% coding: Latin-1\n">>,T1],default,ok},
+ {otp_14285_4,
+ [<<"%% coding: UTF-8\n">>,T1],default,ok}],
+ run(Config, Ts1),
+
+ T2 = <<"
+ Nonterminals E.
+ Terminals '-' '+' '=' id.
+ Rootsymbol E.
+ Endsymbol '\\x{400}'.
+
+ E -> E '=' E : {op, '=', '$1', '$3'}.
+ E -> E '+' E : {op, '+', '$1', '$3'}.
+ E -> '-' E : {op, '-', '$2'}.
+ E -> id : '$1'.
+
+ Nonassoc 100 '='.
+ Right 200 '+' '-'.
+
+ Erlang code.
+
+ -export([t/0]).
+
+ t() ->
+ {ok,{op,'=',{id,1},{op,'-',{op,'+',{id,4},{id,6}}}}} =
+ parse([{id,1},{'=',2},{'-',3},{id,4},{'+',5},{id,6},
+ {'\\x{400}',1}]),
+ ok.">>,
+
+ Ts2 = [{otp_14285_5,
+ [<<"%% coding: Latin-1\n">>,T2],default,ok},
+ {otp_14285_6,
+ [<<"%% coding: UTF-8\n">>,T2],default,ok}],
+ run(Config, Ts2),
+
+ ok.
+
start_node(Name, Args) ->
[_,Host] = string:tokens(atom_to_list(node()), "@"),
ct:log("Trying to start ~w@~s~n", [Name,Host]),
diff --git a/lib/public_key/doc/src/notes.xml b/lib/public_key/doc/src/notes.xml
index 74d1a57936..92e314186e 100644
--- a/lib/public_key/doc/src/notes.xml
+++ b/lib/public_key/doc/src/notes.xml
@@ -35,6 +35,34 @@
<file>notes.xml</file>
</header>
+<section><title>Public_Key 1.4</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ New function <c>pkix_verify_hostname/2,3</c> Implements
+ certificate hostname checking. See the manual and RFC
+ 6125.</p>
+ <p>
+ Own Id: OTP-13009</p>
+ </item>
+ <item>
+ <p>
+ The ssh host key fingerprint generation now also takes a
+ list of algorithms and returns a list of corresponding
+ fingerprints. See
+ <c>public_key:ssh_hostkey_fingerprint/2</c> and the
+ option <c>silently_accept_hosts</c> in
+ <c>ssh:connect</c>.</p>
+ <p>
+ Own Id: OTP-14223</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Public_Key 1.3</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/public_key/doc/src/public_key.xml b/lib/public_key/doc/src/public_key.xml
index c97ec361d1..940585575c 100644
--- a/lib/public_key/doc/src/public_key.xml
+++ b/lib/public_key/doc/src/public_key.xml
@@ -331,13 +331,17 @@
</func>
<func>
- <name>generate_key(Params) -> {Public::binary(), Private::binary()} | #'ECPrivateKey'{} </name>
+ <name>generate_key(Params) -> {Public::binary(), Private::binary()} | #'ECPrivateKey'{} | #'RSAPrivateKey'{}</name>
<fsummary>Generates a new keypair.</fsummary>
<type>
- <v>Params = #'DHParameter'{} | {namedCurve, oid()} | #'ECParameters'{}</v>
+ <v>Params = #'DHParameter'{} | {namedCurve, oid()} | #'ECParameters'{}
+ | {rsa, Size::integer(), PubExp::integer} </v>
</type>
<desc>
- <p>Generates a new keypair.</p>
+ <p>Generates a new keypair. Note that except for Diffie-Hellman
+ the public key is included in the private key structure. See also
+ <seealso marker="crypto:crypto#generate_key/2">crypto:generate_key/2</seealso>
+ </p>
</desc>
</func>
diff --git a/lib/public_key/src/public_key.app.src b/lib/public_key/src/public_key.app.src
index 88ef07c5a6..dbd732c384 100644
--- a/lib/public_key/src/public_key.app.src
+++ b/lib/public_key/src/public_key.app.src
@@ -14,7 +14,7 @@
{applications, [asn1, crypto, kernel, stdlib]},
{registered, []},
{env, []},
- {runtime_dependencies, ["stdlib-2.0","kernel-3.0","erts-6.0","crypto-3.3",
+ {runtime_dependencies, ["stdlib-2.0","kernel-3.0","erts-6.0","crypto-3.8",
"asn1-3.0"]}
]
}.
diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl
index 50d4d82d15..7b5819fa84 100644
--- a/lib/public_key/src/public_key.erl
+++ b/lib/public_key/src/public_key.erl
@@ -395,9 +395,15 @@ dh_gex_group(Min, N, Max, Groups) ->
pubkey_ssh:dh_gex_group(Min, N, Max, Groups).
%%--------------------------------------------------------------------
--spec generate_key(#'DHParameter'{} | {namedCurve, Name ::oid()} |
- #'ECParameters'{}) -> {Public::binary(), Private::binary()} |
- #'ECPrivateKey'{}.
+-spec generate_key(#'DHParameter'{}) ->
+ {Public::binary(), Private::binary()};
+ ({namedCurve, Name ::oid()}) ->
+ #'ECPrivateKey'{};
+ (#'ECParameters'{}) ->
+ #'ECPrivateKey'{};
+ ({rsa, Size::pos_integer(), PubExp::pos_integer()}) ->
+ #'RSAPrivateKey'{}.
+
%% Description: Generates a new keypair
%%--------------------------------------------------------------------
generate_key(#'DHParameter'{prime = P, base = G}) ->
@@ -405,7 +411,43 @@ generate_key(#'DHParameter'{prime = P, base = G}) ->
generate_key({namedCurve, _} = Params) ->
ec_generate_key(Params);
generate_key(#'ECParameters'{} = Params) ->
- ec_generate_key(Params).
+ ec_generate_key(Params);
+generate_key({rsa, ModulusSize, PublicExponent}) ->
+ case crypto:generate_key(rsa, {ModulusSize,PublicExponent}) of
+ {[E, N], [E, N, D, P, Q, D_mod_P_1, D_mod_Q_1, InvQ_mod_P]} ->
+ Nint = crypto:bytes_to_integer(N),
+ Eint = crypto:bytes_to_integer(E),
+ #'RSAPrivateKey'{version = 0, % Two-factor (I guess since otherPrimeInfos is not given)
+ modulus = Nint,
+ publicExponent = Eint,
+ privateExponent = crypto:bytes_to_integer(D),
+ prime1 = crypto:bytes_to_integer(P),
+ prime2 = crypto:bytes_to_integer(Q),
+ exponent1 = crypto:bytes_to_integer(D_mod_P_1),
+ exponent2 = crypto:bytes_to_integer(D_mod_Q_1),
+ coefficient = crypto:bytes_to_integer(InvQ_mod_P)};
+
+ {[E, N], [E, N, D]} -> % FIXME: what to set the other fields in #'RSAPrivateKey'?
+ % Answer: Miller [Mil76]
+ % G.L. Miller. Riemann's hypothesis and tests for primality.
+ % Journal of Computer and Systems Sciences,
+ % 13(3):300-307,
+ % 1976.
+ Nint = crypto:bytes_to_integer(N),
+ Eint = crypto:bytes_to_integer(E),
+ #'RSAPrivateKey'{version = 0, % Two-factor (I guess since otherPrimeInfos is not given)
+ modulus = Nint,
+ publicExponent = Eint,
+ privateExponent = crypto:bytes_to_integer(D),
+ prime1 = '?',
+ prime2 = '?',
+ exponent1 = '?',
+ exponent2 = '?',
+ coefficient = '?'};
+
+ Other ->
+ Other
+ end.
%%--------------------------------------------------------------------
-spec compute_key(#'ECPoint'{} , #'ECPrivateKey'{}) -> binary().
@@ -562,7 +604,7 @@ pkix_match_dist_point(#'CertificateList'{
%%--------------------------------------------------------------------
-spec pkix_sign(#'OTPTBSCertificate'{},
- rsa_private_key() | dsa_private_key()) -> Der::binary().
+ rsa_private_key() | dsa_private_key() | ec_private_key()) -> Der::binary().
%%
%% Description: Sign a pkix x.509 certificate. Returns the corresponding
%% der encoded 'Certificate'{}
@@ -1198,8 +1240,11 @@ ec_curve_spec( #'ECParameters'{fieldID = FieldId, curve = PCurve, base = Base, o
FieldId#'FieldID'.parameters},
Curve = {PCurve#'Curve'.a, PCurve#'Curve'.b, none},
{Field, Curve, Base, Order, CoFactor};
-ec_curve_spec({namedCurve, OID}) ->
- pubkey_cert_records:namedCurves(OID).
+ec_curve_spec({namedCurve, OID}) when is_tuple(OID), is_integer(element(1,OID)) ->
+ ec_curve_spec({namedCurve, pubkey_cert_records:namedCurves(OID)});
+ec_curve_spec({namedCurve, Name}) when is_atom(Name) ->
+ crypto:ec_curve(Name).
+
ec_key({PubKey, PrivateKey}, Params) ->
#'ECPrivateKey'{version = 1,
diff --git a/lib/public_key/test/erl_make_certs.erl b/lib/public_key/test/erl_make_certs.erl
index 3dab70784c..95d0dec920 100644
--- a/lib/public_key/test/erl_make_certs.erl
+++ b/lib/public_key/test/erl_make_certs.erl
@@ -346,10 +346,22 @@ make_key(ec, _Opts) ->
%% RSA key generation (OBS: for testing only)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+gen_rsa2(Size) ->
+ try
+ %% The numbers 2048,17 is choosen to not cause the cryptolib on
+ %% FIPS-enabled test machines be mad at us.
+ public_key:generate_key({rsa, 2048, 17})
+ catch
+ error:notsup ->
+ %% Disabled dirty_schedulers => crypto:generate_key not working
+ weak_gen_rsa2(Size)
+ end.
+
+
-define(SMALL_PRIMES, [65537,97,89,83,79,73,71,67,61,59,53,
47,43,41,37,31,29,23,19,17,13,11,7,5,3]).
-gen_rsa2(Size) ->
+weak_gen_rsa2(Size) ->
P = prime(Size),
Q = prime(Size),
N = P*Q,
diff --git a/lib/public_key/vsn.mk b/lib/public_key/vsn.mk
index 2f541d8d84..b94768ae77 100644
--- a/lib/public_key/vsn.mk
+++ b/lib/public_key/vsn.mk
@@ -1 +1 @@
-PUBLIC_KEY_VSN = 1.3
+PUBLIC_KEY_VSN = 1.4
diff --git a/lib/reltool/doc/src/notes.xml b/lib/reltool/doc/src/notes.xml
index 2365a68feb..b47d451055 100644
--- a/lib/reltool/doc/src/notes.xml
+++ b/lib/reltool/doc/src/notes.xml
@@ -38,7 +38,22 @@
thus constitutes one section in this document. The title of each
section is the version number of Reltool.</p>
- <section><title>Reltool 0.7.2</title>
+ <section><title>Reltool 0.7.3</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fixed xml issues in old release notes</p>
+ <p>
+ Own Id: OTP-14269</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Reltool 0.7.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
@@ -52,13 +67,13 @@
Some dependency chains would even be missed for
applications that are included in a 'rel' spec in the
reltool config. E.g.</p>
- <p>
+
<list> <item>Application x has y as included application,
and y in turn has z as included application. Then z is
not included. </item> <item>Application x has y in its
'applications' tag in the .app file, and y in turn has z
as included application. Then z is not included.</item>
- </list></p>
+ </list>
<p>
These bugs are now corrected.</p>
<p>
diff --git a/lib/reltool/src/reltool.hrl b/lib/reltool/src/reltool.hrl
index 3b1e868757..c61c3a0c71 100644
--- a/lib/reltool/src/reltool.hrl
+++ b/lib/reltool/src/reltool.hrl
@@ -289,8 +289,8 @@
"^lib",
"^releases"]).
-define(EMBEDDED_EXCL_SYS_FILTERS,
- ["^bin/(erlc|dialyzer|typer)(|\\.exe)\$",
- "^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)\$",
+ ["^bin/(erlc|dialyzer)(|\\.exe)\$",
+ "^erts.*/bin/(erlc|dialyzer)(|\\.exe)\$",
"^erts.*/bin/.*(debug|pdb)"]).
-define(EMBEDDED_INCL_APP_FILTERS, ["^ebin",
"^include",
@@ -303,7 +303,7 @@
"^erts.*/bin",
"^lib\$"]).
-define(STANDALONE_EXCL_SYS_FILTERS,
- ["^erts.*/bin/(erlc|dialyzer|typer)(|\\.exe)\$",
+ ["^erts.*/bin/(erlc|dialyzer)(|\\.exe)\$",
"^erts.*/bin/(start|escript|to_erl|run_erl)(|\\.exe)\$",
"^erts.*/bin/.*(debug|pdb)"]).
-define(STANDALONE_INCL_APP_FILTERS, ["^ebin",
diff --git a/lib/reltool/vsn.mk b/lib/reltool/vsn.mk
index 2b23ff6f20..2d07eeb8f0 100644
--- a/lib/reltool/vsn.mk
+++ b/lib/reltool/vsn.mk
@@ -1 +1 @@
-RELTOOL_VSN = 0.7.2
+RELTOOL_VSN = 0.7.3
diff --git a/lib/runtime_tools/doc/src/notes.xml b/lib/runtime_tools/doc/src/notes.xml
index 4c79a560ec..0eafc437cc 100644
--- a/lib/runtime_tools/doc/src/notes.xml
+++ b/lib/runtime_tools/doc/src/notes.xml
@@ -32,6 +32,24 @@
<p>This document describes the changes made to the Runtime_Tools
application.</p>
+<section><title>Runtime_Tools 1.11.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ etop erroneously reported the average scheduler
+ utilization since the tool was first started instead of
+ the scheduler utilization since last update. This is now
+ corrected.</p>
+ <p>
+ Own Id: OTP-14090 Aux Id: seq13232 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Runtime_Tools 1.11</title>
<section><title>Improvements and New Features</title>
diff --git a/lib/runtime_tools/src/dyntrace.erl b/lib/runtime_tools/src/dyntrace.erl
index 58c5a773c3..5fe62a46f6 100644
--- a/lib/runtime_tools/src/dyntrace.erl
+++ b/lib/runtime_tools/src/dyntrace.erl
@@ -61,8 +61,8 @@
enabled_garbage_collection/3,
enabled/3]).
-
-export([user_trace_i4s4/9]). % Know what you're doing!
+-compile(no_native).
-on_load(on_load/0).
-type probe_arg() :: integer() | iolist().
diff --git a/lib/runtime_tools/src/observer_backend.erl b/lib/runtime_tools/src/observer_backend.erl
index b27bc63d15..99fedf66ed 100644
--- a/lib/runtime_tools/src/observer_backend.erl
+++ b/lib/runtime_tools/src/observer_backend.erl
@@ -179,8 +179,8 @@ inet_port_extra({_,Type},Port) when Type =:= "udp_inet";
{error, _} -> []
end ++
case inet:getopts(Port,
- [active, broadcast, buffer, delay_send,
- deliver, dontroute, exit_on_close,
+ [active, broadcast, buffer, bind_to_device,
+ delay_send, deliver, dontroute, exit_on_close,
header, high_msgq_watermark, high_watermark,
ipv6_v6only, keepalive, linger, low_msgq_watermark,
low_watermark, mode, netns, nodelay, packet,
diff --git a/lib/runtime_tools/vsn.mk b/lib/runtime_tools/vsn.mk
index 53fc51c198..8ec532de76 100644
--- a/lib/runtime_tools/vsn.mk
+++ b/lib/runtime_tools/vsn.mk
@@ -1 +1 @@
-RUNTIME_TOOLS_VSN = 1.11
+RUNTIME_TOOLS_VSN = 1.11.1
diff --git a/lib/sasl/doc/src/notes.xml b/lib/sasl/doc/src/notes.xml
index 190b937f03..cd3f0e1864 100644
--- a/lib/sasl/doc/src/notes.xml
+++ b/lib/sasl/doc/src/notes.xml
@@ -31,6 +31,28 @@
</header>
<p>This document describes the changes made to the SASL application.</p>
+<section><title>SASL 3.0.3</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ When both options 'warnings_as_errors' and 'silent' were
+ given to systools:make_script or systools:make_relup, no
+ error reason would be returned if warnings occurred.
+ Instead only the atom 'error' was returned. This is now
+ corrected.</p>
+ <p>
+ Options 'warnings_as_errors' and 'no_warn_sasl' are now
+ also allowed for systools:make_tar.</p>
+ <p>
+ Own Id: OTP-14170</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>SASL 3.0.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/sasl/test/systools_SUITE.erl b/lib/sasl/test/systools_SUITE.erl
index 0c98232467..1a8bd3f607 100644
--- a/lib/sasl/test/systools_SUITE.erl
+++ b/lib/sasl/test/systools_SUITE.erl
@@ -87,25 +87,25 @@ end_per_group(_GroupName, Config) ->
init_per_suite(Config) when is_list(Config) ->
+ %% To use in end_per_testcase
+ Path = code:get_path(),
+ {ok,Cwd} = file:get_cwd(),
+
%% Make of copy of the data directory.
DataDir = ?datadir,
PrivDir = ?privdir,
CopyDir = fname(PrivDir, "datacopy"),
+ ok = file:make_dir(CopyDir),
TarFile = fname(PrivDir, "datacopy.tgz"),
- {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
- ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
- ok = erl_tar:close(Tar),
- ok = erl_tar:extract(TarFile, [compressed]),
+ ok = file:set_cwd(DataDir),
+ ok = erl_tar:create(TarFile, ["."], [compressed]),
+ ok = erl_tar:extract(TarFile, [compressed, {cwd,CopyDir}]),
ok = file:delete(TarFile),
%% Compile source files in the copy directory.
Sources = filelib:wildcard(fname([CopyDir,'*','*','*','*','*.erl'])),
lists:foreach(fun compile_source/1, Sources),
- %% To use in end_per_testcase
- Path = code:get_path(),
- {ok,Cwd} = file:get_cwd(),
-
[{copy_dir, CopyDir}, {cwd,Cwd}, {path,Path} | Config].
compile_source(File) ->
diff --git a/lib/sasl/vsn.mk b/lib/sasl/vsn.mk
index e35a0c2977..6aa662a743 100644
--- a/lib/sasl/vsn.mk
+++ b/lib/sasl/vsn.mk
@@ -1 +1 @@
-SASL_VSN = 3.0.2
+SASL_VSN = 3.0.3
diff --git a/lib/snmp/doc/src/notes.xml b/lib/snmp/doc/src/notes.xml
index 3323d32878..f1919a6bb1 100644
--- a/lib/snmp/doc/src/notes.xml
+++ b/lib/snmp/doc/src/notes.xml
@@ -34,7 +34,27 @@
</header>
- <section><title>SNMP 5.2.4</title>
+ <section><title>SNMP 5.2.5</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The SNMP MIB compiler has been fixed to compile MIBS with
+ refinements on user types such as in RFC 4669
+ RADIUS-AUTH-SERVER-MIB.mib. Problem reported and
+ researched by Kenneth Lakin and Daniel Goertzen.</p>
+ <p>
+ See also: https://bugs.erlang.org/browse/ERL-325</p>
+ <p>
+ Own Id: OTP-14145 Aux Id: ERL-325 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SNMP 5.2.4</title>
<section><title>Fixed Bugs and Malfunctions</title>
<list>
diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml
index 1837350284..c8c6e61cc8 100644
--- a/lib/ssh/doc/src/notes.xml
+++ b/lib/ssh/doc/src/notes.xml
@@ -30,6 +30,102 @@
<file>notes.xml</file>
</header>
+<section><title>Ssh 4.4.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ ssh:daemon_info/1 crashed if the listening IP was not
+ 'any'</p>
+ <p>
+ Own Id: OTP-14298 Aux Id: seq13294 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>Ssh 4.4.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Fix bug when opening connections. If the tcp setup
+ failed, that would in some cases not result in an error
+ return value.</p>
+ <p>
+ Own Id: OTP-14108</p>
+ </item>
+ <item>
+ <p>
+ Reduce information leakage in case of decryption errors.</p>
+ <p>
+ Own Id: OTP-14109</p>
+ </item>
+ <item>
+ <p>
+ The key exchange algorithm
+ diffie-hellman-group-exchange-sha* has a server-option
+ <c>{dh_gex_limits,{Min,Max}}</c>. There was a hostkey
+ signature validation error on the client side if the
+ option was used and the <c>Min</c> or the <c>Max</c>
+ differed from the corresponding values obtained from the
+ client.</p>
+ <p>
+ This bug is now corrected.</p>
+ <p>
+ Own Id: OTP-14166</p>
+ </item>
+ <item>
+ <p>
+ The sftpd server now correctly uses <c>root_dir</c> and
+ <c>cwd</c> when resolving file paths if both are
+ provided. The <c>cwd</c> handling is also corrected.</p>
+ <p>
+ Thanks to kape1395!</p>
+ <p>
+ Own Id: OTP-14225 Aux Id: PR-1331, PR-1335 </p>
+ </item>
+ <item>
+ <p>
+ Ssh_cli used a function that does not handle non-utf8
+ unicode correctly.</p>
+ <p>
+ Own Id: OTP-14230 Aux Id: ERL-364 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ The implementation of the key exchange algorithms
+ diffie-hellman-group-exchange-sha* are optimized, up to a
+ factor of 11 for the slowest ( = biggest and safest)
+ group size.</p>
+ <p>
+ Own Id: OTP-14169 Aux Id: seq-13261 </p>
+ </item>
+ <item>
+ <p>
+ The ssh host key fingerprint generation now also takes a
+ list of algorithms and returns a list of corresponding
+ fingerprints. See
+ <c>public_key:ssh_hostkey_fingerprint/2</c> and the
+ option <c>silently_accept_hosts</c> in
+ <c>ssh:connect</c>.</p>
+ <p>
+ Own Id: OTP-14223</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Ssh 4.4</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/ssh/doc/src/ssh.xml b/lib/ssh/doc/src/ssh.xml
index f6e26f5ee8..368261968d 100644
--- a/lib/ssh/doc/src/ssh.xml
+++ b/lib/ssh/doc/src/ssh.xml
@@ -243,21 +243,6 @@
<p><c>Peer</c> is in the format of <c>{Host,Port}</c>.</p>
</item>
- <tag><c><![CDATA[{public_key_alg, 'ssh-rsa' | 'ssh-dss'}]]></c></tag>
- <item>
- <note>
- <p>This option will be removed in OTP 20, but is kept for compatibility. It is ignored if
- the preferred <c>pref_public_key_algs</c> option is used.</p>
- </note>
- <p>Sets the preferred public key algorithm to use for user
- authentication. If the preferred algorithm fails,
- the other algorithm is tried. If <c>{public_key_alg, 'ssh-rsa'}</c> is set, it is translated
- to <c>{pref_public_key_algs, ['ssh-rsa','ssh-dss']}</c>. If it is
- <c>{public_key_alg, 'ssh-dss'}</c>, it is translated
- to <c>{pref_public_key_algs, ['ssh-dss','ssh-rsa']}</c>.
- </p>
- </item>
-
<tag><c><![CDATA[{pref_public_key_algs, list()}]]></c></tag>
<item>
<p>List of user (client) public key algorithms to try to use.</p>
@@ -394,7 +379,7 @@
on the given port.</fsummary>
<type>
<v>Port = integer()</v>
- <v>HostAddress = ip_address() | any</v>
+ <v>HostAddress = ip_address() | any | loopback</v>
<v>Options = [{Option, Value}]</v>
<v>Option = atom()</v>
<v>Value = term()</v>
@@ -405,6 +390,26 @@
<p>Starts a server listening for SSH connections on the given
port. If the <c>Port</c> is 0, a random free port is selected. See
<seealso marker="#daemon_info/1">daemon_info/1</seealso> about how to find the selected port number.</p>
+
+ <p>Please note that by historical reasons both the <c>HostAddress</c> argument and the inet socket option
+ <c>ip</c> set the listening address. This is a source of possible inconsistent settings.</p>
+
+ <p>The rules for handling the two address passing options are:</p>
+ <list>
+ <item>if <c>HostAddress</c> is an IP-address, that IP-address is the listening address.
+ An 'ip'-option will be discarded if present.</item>
+
+ <item>if <c>HostAddress</c> is <c>loopback</c>, the listening address
+ is <c>loopback</c> and an loopback address will be choosen by the underlying layers.
+ An 'ip'-option will be discarded if present.</item>
+
+ <item>if <c>HostAddress</c> is <c>any</c> and no 'ip'-option is present, the listening address is
+ <c>any</c> and the socket will listen to all addresses</item>
+
+ <item>if <c>HostAddress</c> is <c>any</c> and an 'ip'-option is present, the listening address is
+ set to the value of the 'ip'-option</item>
+ </list>
+
<p>Options:</p>
<taglist>
<tag><c><![CDATA[{inet, inet | inet6}]]></c></tag>
@@ -714,6 +719,12 @@
<p><c>Peer</c> is in the format of <c>{Host,Port}</c>.</p>
</item>
+ <tag><c><![CDATA[{idle_time, integer()}]]></c></tag>
+ <item>
+ <p>Sets a time-out on a connection when no channels are active.
+ Defaults to <c>infinity</c>.</p>
+ </item>
+
<tag><c><![CDATA[{ssh_msg_debug_fun, fun(ConnectionRef::ssh_connection_ref(), AlwaysDisplay::boolean(), Msg::binary(), LanguageTag::binary()) -> _}]]></c></tag>
<item>
<p>Provide a fun to implement your own logging of the SSH message SSH_MSG_DEBUG. The last three parameters are from the message, see RFC4253, section 11.3. The <c>ConnectionRef</c> is the reference to the connection on which the message arrived. The return value from the fun is not checked.</p>
@@ -726,9 +737,10 @@
</func>
<func>
- <name>daemon_info(Daemon) -> {ok, [{port,Port}]} | {error,Error}</name>
+ <name>daemon_info(Daemon) -> {ok, [DaemonInfo]} | {error,Error}</name>
<fsummary>Get info about a daemon</fsummary>
<type>
+ <v>DaemonInfo = {port,Port::pos_integer()} | {listen_address, any|ip_address()} | {profile,atom()}</v>
<v>Port = integer()</v>
<v>Error = bad_daemon_ref</v>
</type>
diff --git a/lib/ssh/doc/src/ssh_app.xml b/lib/ssh/doc/src/ssh_app.xml
index 5f710decc1..515b0639d5 100644
--- a/lib/ssh/doc/src/ssh_app.xml
+++ b/lib/ssh/doc/src/ssh_app.xml
@@ -109,7 +109,7 @@
</section>
<section>
<title>Host Keys</title>
- <p>RSA and DSA host keys are supported and are
+ <p>RSA, DSA and ECDSA host keys are supported and are
expected to be found in files named <c>ssh_host_rsa_key</c>,
<c>ssh_host_dsa_key</c> and <c>ssh_host_ecdsa_key</c>.
</p>
@@ -160,7 +160,7 @@
<item>ecdsa-sha2-nistp384</item>
<item>ecdsa-sha2-nistp521</item>
<item>ssh-rsa</item>
- <item>(ssh-dss, retired: can be enabled with the <c>preferred_algorithms</c> option)</item>
+ <item>ssh-dss</item>
</list>
</item>
diff --git a/lib/ssh/src/ssh.app.src b/lib/ssh/src/ssh.app.src
index 95d2686094..974292fde1 100644
--- a/lib/ssh/src/ssh.app.src
+++ b/lib/ssh/src/ssh.app.src
@@ -42,10 +42,10 @@
{env, []},
{mod, {ssh_app, []}},
{runtime_dependencies, [
- "crypto-3.3",
+ "crypto-3.7.3",
"erts-6.0",
"kernel-3.0",
- "public_key-1.1",
- "stdlib-3.1"
+ "public_key-1.4",
+ "stdlib-3.3"
]}]}.
diff --git a/lib/ssh/src/ssh.erl b/lib/ssh/src/ssh.erl
index 53aba14458..3e80a04b70 100644
--- a/lib/ssh/src/ssh.erl
+++ b/lib/ssh/src/ssh.erl
@@ -26,6 +26,7 @@
-include("ssh_connect.hrl").
-include_lib("public_key/include/public_key.hrl").
-include_lib("kernel/include/file.hrl").
+-include_lib("kernel/include/inet.hrl").
-export([start/0, start/1, stop/0,
connect/2, connect/3, connect/4,
@@ -108,7 +109,7 @@ connect(Socket, UserOptions, Timeout) when is_port(Socket),
case valid_socket_to_use(Socket, ?GET_OPT(transport,Options)) of
ok ->
{ok, {Host,_Port}} = inet:sockname(Socket),
- Opts = ?PUT_INTERNAL_OPT([{user_pid,self()}, {host,fmt_host(Host)}], Options),
+ Opts = ?PUT_INTERNAL_OPT([{user_pid,self()}, {host,Host}], Options),
ssh_connection_handler:start_connection(client, Socket, Opts, Timeout);
{error,SockError} ->
{error,SockError}
@@ -120,7 +121,7 @@ connect(Host, Port, UserOptions) when is_integer(Port),
is_list(UserOptions) ->
connect(Host, Port, UserOptions, infinity).
-connect(Host, Port, UserOptions, Timeout) when is_integer(Port),
+connect(Host0, Port, UserOptions, Timeout) when is_integer(Port),
Port>0,
is_list(UserOptions) ->
case ssh_options:handle_options(client, UserOptions) of
@@ -130,6 +131,7 @@ connect(Host, Port, UserOptions, Timeout) when is_integer(Port),
{_, Transport, _} = TransportOpts = ?GET_OPT(transport, Options),
ConnectionTimeout = ?GET_OPT(connect_timeout, Options),
SocketOpts = [{active,false} | ?GET_OPT(socket_options,Options)],
+ Host = mangle_connect_address(Host0, SocketOpts),
try Transport:connect(Host, Port, SocketOpts, ConnectionTimeout) of
{ok, Socket} ->
Opts = ?PUT_INTERNAL_OPT([{user_pid,self()}, {host,Host}], Options),
@@ -138,7 +140,6 @@ connect(Host, Port, UserOptions, Timeout) when is_integer(Port),
{error, Reason}
catch
exit:{function_clause, _F} ->
- io:format('function_clause ~p~n',[_F]),
{error, {options, {transport, TransportOpts}}};
exit:badarg ->
{error, {options, {socket_options, SocketOpts}}}
@@ -183,16 +184,88 @@ daemon(Port) ->
daemon(Port, []).
-daemon(Port, UserOptions) when is_integer(Port), Port >= 0 ->
- daemon(any, Port, UserOptions);
-
daemon(Socket, UserOptions) when is_port(Socket) ->
- daemon(socket, Socket, UserOptions).
+ try
+ #{} = Options = ssh_options:handle_options(server, UserOptions),
+ case valid_socket_to_use(Socket, ?GET_OPT(transport,Options)) of
+ ok ->
+ {ok, {IP,Port}} = inet:sockname(Socket),
+ finalize_start(IP, Port, ?GET_OPT(profile, Options),
+ ?PUT_INTERNAL_OPT({connected_socket, Socket}, Options),
+ fun(Opts, DefaultResult) ->
+ try ssh_acceptor:handle_established_connection(
+ IP, Port, Opts, Socket)
+ of
+ {error,Error} ->
+ {error,Error};
+ _ ->
+ DefaultResult
+ catch
+ C:R ->
+ {error,{could_not_start_connection,{C,R}}}
+ end
+ end);
+ {error,SockError} ->
+ {error,SockError}
+ end
+ catch
+ throw:bad_fd ->
+ {error,bad_fd};
+ throw:bad_socket ->
+ {error,bad_socket};
+ error:{badmatch,{error,Error}} ->
+ {error,Error};
+ error:Error ->
+ {error,Error};
+ _C:_E ->
+ {error,{cannot_start_daemon,_C,_E}}
+ end;
+
+daemon(Port, UserOptions) when 0 =< Port, Port =< 65535 ->
+ daemon(any, Port, UserOptions).
+
+
+daemon(Host0, Port0, UserOptions0) when 0 =< Port0, Port0 =< 65535,
+ Host0 == any ; Host0 == loopback ; is_tuple(Host0) ->
+ try
+ {Host1, UserOptions} = handle_daemon_args(Host0, UserOptions0),
+ #{} = Options0 = ssh_options:handle_options(server, UserOptions),
+
+ {{Host,Port}, ListenSocket} =
+ open_listen_socket(Host1, Port0, Options0),
+
+ %% Now Host,Port is what to use for the supervisor to register its name,
+ %% and ListenSocket is for listening on connections. But it is still owned
+ %% by self()...
+
+ finalize_start(Host, Port, ?GET_OPT(profile, Options0),
+ ?PUT_INTERNAL_OPT({lsocket,{ListenSocket,self()}}, Options0),
+ fun(Opts, Result) ->
+ {_, Callback, _} = ?GET_OPT(transport, Opts),
+ receive
+ {request_control, ListenSocket, ReqPid} ->
+ ok = Callback:controlling_process(ListenSocket, ReqPid),
+ ReqPid ! {its_yours,ListenSocket},
+ Result
+ end
+ end)
+ catch
+ throw:bad_fd ->
+ {error,bad_fd};
+ throw:bad_socket ->
+ {error,bad_socket};
+ error:{badmatch,{error,Error}} ->
+ {error,Error};
+ error:Error ->
+ {error,Error};
+ _C:_E ->
+ {error,{cannot_start_daemon,_C,_E}}
+ end;
+
+daemon(_, _, _) ->
+ {error, badarg}.
-daemon(Host0, Port, UserOptions0) ->
- {Host, UserOptions} = handle_daemon_args(Host0, UserOptions0),
- start_daemon(Host, Port, ssh_options:handle_options(server, UserOptions)).
%%--------------------------------------------------------------------
-spec daemon_info(daemon_ref()) -> ok_error( [{atom(), term()}] ).
@@ -200,11 +273,19 @@ daemon(Host0, Port, UserOptions0) ->
daemon_info(Pid) ->
case catch ssh_system_sup:acceptor_supervisor(Pid) of
AsupPid when is_pid(AsupPid) ->
- [Port] =
- [Prt || {{ssh_acceptor_sup,any,Prt,default},
- _WorkerPid,worker,[ssh_acceptor]} <- supervisor:which_children(AsupPid)],
- {ok, [{port,Port}]};
-
+ [{IP,Port,Profile}] =
+ [{IP,Prt,Prf}
+ || {{ssh_acceptor_sup,Hst,Prt,Prf},_Pid,worker,[ssh_acceptor]}
+ <- supervisor:which_children(AsupPid),
+ IP <- [case inet:parse_strict_address(Hst) of
+ {ok,IP} -> IP;
+ _ -> Hst
+ end]
+ ],
+ {ok, [{port,Port},
+ {ip,IP},
+ {profile,Profile}
+ ]};
_ ->
{error,bad_daemon_ref}
end.
@@ -220,8 +301,14 @@ stop_listener(SysSup) ->
ssh_system_sup:stop_listener(SysSup).
stop_listener(Address, Port) ->
stop_listener(Address, Port, ?DEFAULT_PROFILE).
+stop_listener(any, Port, Profile) ->
+ map_ip(fun(IP) ->
+ ssh_system_sup:stop_listener(IP, Port, Profile)
+ end, [{0,0,0,0},{0,0,0,0,0,0,0,0}]);
stop_listener(Address, Port, Profile) ->
- ssh_system_sup:stop_listener(Address, Port, Profile).
+ map_ip(fun(IP) ->
+ ssh_system_sup:stop_listener(IP, Port, Profile)
+ end, {address,Address}).
%%--------------------------------------------------------------------
-spec stop_daemon(daemon_ref()) -> ok.
@@ -234,9 +321,15 @@ stop_listener(Address, Port, Profile) ->
stop_daemon(SysSup) ->
ssh_system_sup:stop_system(SysSup).
stop_daemon(Address, Port) ->
- ssh_system_sup:stop_system(Address, Port, ?DEFAULT_PROFILE).
+ stop_daemon(Address, Port, ?DEFAULT_PROFILE).
+stop_daemon(any, Port, Profile) ->
+ map_ip(fun(IP) ->
+ ssh_system_sup:stop_system(IP, Port, Profile)
+ end, [{0,0,0,0},{0,0,0,0,0,0,0,0}]);
stop_daemon(Address, Port, Profile) ->
- ssh_system_sup:stop_system(Address, Port, Profile).
+ map_ip(fun(IP) ->
+ ssh_system_sup:stop_system(IP, Port, Profile)
+ end, {address,Address}).
%%--------------------------------------------------------------------
-spec shell(inet:socket() | string()) -> _.
@@ -290,35 +383,34 @@ default_algorithms() ->
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
-handle_daemon_args(Host, UserOptions0) ->
- case Host of
- socket ->
- {Host, UserOptions0};
- any ->
- {ok, Host0} = inet:gethostname(),
- Inet = proplists:get_value(inet, UserOptions0, inet),
- {Host0, [Inet | UserOptions0]};
- {_,_,_,_} ->
- {Host, [inet, {ip,Host} | UserOptions0]};
- {_,_,_,_,_,_,_,_} ->
- {Host, [inet6, {ip,Host} | UserOptions0]};
- _ ->
- error(badarg)
+%% The handle_daemon_args/2 function basically only sets the ip-option in Opts
+%% so that it is correctly set when opening the listening socket.
+
+handle_daemon_args(any, Opts) ->
+ case proplists:get_value(ip, Opts) of
+ undefined -> {any, Opts};
+ IP -> {IP, Opts}
+ end;
+
+handle_daemon_args(IPaddr, Opts) when is_tuple(IPaddr) ; IPaddr == loopback ->
+ case proplists:get_value(ip, Opts) of
+ undefined -> {IPaddr, [{ip,IPaddr}|Opts]};
+ IPaddr -> {IPaddr, Opts};
+ IP -> {IPaddr, [{ip,IPaddr}|Opts--[{ip,IP}]]} %% Backward compatibility
end.
%%%----------------------------------------------------------------
valid_socket_to_use(Socket, {tcp,_,_}) ->
%% Is this tcp-socket a valid socket?
- case {is_tcp_socket(Socket),
- {ok,[{active,false}]} == inet:getopts(Socket, [active])
- }
+ try {is_tcp_socket(Socket),
+ {ok,[{active,false}]} == inet:getopts(Socket, [active])
+ }
of
- {true, true} ->
- ok;
- {true, false} ->
- {error, not_passive_mode};
- _ ->
- {error, not_tcp_socket}
+ {true, true} -> ok;
+ {true, false} -> {error, not_passive_mode};
+ _ -> {error, not_tcp_socket}
+ catch
+ _:_ -> {error, bad_socket}
end;
valid_socket_to_use(_, {L4,_,_}) ->
@@ -332,158 +424,62 @@ is_tcp_socket(Socket) ->
end.
%%%----------------------------------------------------------------
-start_daemon(_, _, {error,Error}) ->
- {error,Error};
-
-start_daemon(socket, Socket, Options) ->
- case valid_socket_to_use(Socket, ?GET_OPT(transport,Options)) of
- ok ->
- try
- do_start_daemon(Socket, Options)
- catch
- throw:bad_fd -> {error,bad_fd};
- throw:bad_socket -> {error,bad_socket};
- _C:_E -> {error,{cannot_start_daemon,_C,_E}}
- end;
- {error,SockError} ->
- {error,SockError}
- end;
+open_listen_socket(_Host0, Port0, Options0) ->
+ {ok,LSock} =
+ case ?GET_SOCKET_OPT(fd, Options0) of
+ undefined ->
+ ssh_acceptor:listen(Port0, Options0);
+ Fd when is_integer(Fd) ->
+ %% Do gen_tcp:listen with the option {fd,Fd}:
+ ssh_acceptor:listen(0, Options0)
+ end,
+ {ok,{LHost,LPort}} = inet:sockname(LSock),
+ {{LHost,LPort}, LSock}.
-start_daemon(Host, Port, Options) ->
+%%%----------------------------------------------------------------
+finalize_start(Host, Port, Profile, Options0, F) ->
try
- do_start_daemon(Host, Port, Options)
+ sshd_sup:start_child(Host, Port, Profile, Options0)
+ of
+ {error, {already_started, _}} ->
+ {error, eaddrinuse};
+ {error, Error} ->
+ {error, Error};
+ Result = {ok,_} ->
+ F(Options0, Result)
catch
- throw:bad_fd -> {error,bad_fd};
- throw:bad_socket -> {error,bad_socket};
- _C:_E -> {error,{cannot_start_daemon,_C,_E}}
+ exit:{noproc, _} ->
+ {error, ssh_not_started}
end.
+%%%----------------------------------------------------------------
+map_ip(Fun, {address,IP}) when is_tuple(IP) ->
+ Fun(IP);
+map_ip(Fun, {address,Address}) ->
+ IPs = try {ok,#hostent{h_addr_list=IP0s}} = inet:gethostbyname(Address),
+ IP0s
+ catch
+ _:_ -> []
+ end,
+ map_ip(Fun, IPs);
+map_ip(Fun, IPs) ->
+ lists:map(Fun, IPs).
-do_start_daemon(Socket, Options) ->
- {ok, {IP,Port}} =
- try {ok,_} = inet:sockname(Socket)
- catch
- _:_ -> throw(bad_socket)
- end,
- Host = fmt_host(IP),
- Opts = ?PUT_INTERNAL_OPT([{asocket, Socket},
- {asock_owner,self()},
- {address, Host},
- {port, Port},
- {role, server}], Options),
-
- Profile = ?GET_OPT(profile, Options),
- case ssh_system_sup:system_supervisor(Host, Port, Profile) of
- undefined ->
- try sshd_sup:start_child(Opts) of
- {error, {already_started, _}} ->
- {error, eaddrinuse};
- Result = {ok,_} ->
- call_ssh_acceptor_handle_connection(Host, Port, Opts, Socket, Result);
- Result = {error, _} ->
- Result
- catch
- exit:{noproc, _} ->
- {error, ssh_not_started}
- end;
- Sup ->
- AccPid = ssh_system_sup:acceptor_supervisor(Sup),
- case ssh_acceptor_sup:start_child(AccPid, Opts) of
- {error, {already_started, _}} ->
- {error, eaddrinuse};
- {ok, _} ->
- call_ssh_acceptor_handle_connection(Host, Port, Opts, Socket, {ok,Sup});
- Other ->
- Other
- end
- end.
-
-do_start_daemon(Host0, Port0, Options0) ->
- {Host,Port1} =
- try
- case ?GET_SOCKET_OPT(fd, Options0) of
- undefined ->
- {Host0,Port0};
- Fd when Port0==0 ->
- find_hostport(Fd)
- end
- catch
- _:_ -> throw(bad_fd)
- end,
- {Port, WaitRequestControl, Options1} =
- case Port1 of
- 0 -> %% Allocate the socket here to get the port number...
- {ok,LSock} = ssh_acceptor:callback_listen(0, Options0),
- {ok,{_,LPort}} = inet:sockname(LSock),
- {LPort,
- LSock,
- ?PUT_INTERNAL_OPT({lsocket,{LSock,self()}}, Options0)
- };
- _ ->
- {Port1, false, Options0}
- end,
- Options = ?PUT_INTERNAL_OPT([{address, Host},
- {port, Port},
- {role, server}], Options1),
- Profile = ?GET_OPT(profile, Options0),
- case ssh_system_sup:system_supervisor(Host, Port, Profile) of
- undefined ->
- try sshd_sup:start_child(Options) of
- {error, {already_started, _}} ->
- {error, eaddrinuse};
- Result = {ok,_} ->
- sync_request_control(WaitRequestControl, Options),
- Result;
- Result = {error, _} ->
- Result
- catch
- exit:{noproc, _} ->
- {error, ssh_not_started}
- end;
- Sup ->
- AccPid = ssh_system_sup:acceptor_supervisor(Sup),
- case ssh_acceptor_sup:start_child(AccPid, Options) of
- {error, {already_started, _}} ->
- {error, eaddrinuse};
- {ok, _} ->
- sync_request_control(WaitRequestControl, Options),
- {ok, Sup};
- Other ->
- Other
- end
- end.
-
-call_ssh_acceptor_handle_connection(Host, Port, Options, Socket, DefaultResult) ->
- {_, Callback, _} = ?GET_OPT(transport, Options),
- try ssh_acceptor:handle_connection(Callback, Host, Port, Options, Socket)
- of
- {error,Error} -> {error,Error};
- _ -> DefaultResult
- catch
- C:R -> {error,{could_not_start_connection,{C,R}}}
- end.
-
-
-sync_request_control(false, _Options) ->
- ok;
-sync_request_control(LSock, Options) ->
- {_, Callback, _} = ?GET_OPT(transport, Options),
- receive
- {request_control,LSock,ReqPid} ->
- ok = Callback:controlling_process(LSock, ReqPid),
- ReqPid ! {its_yours,LSock},
- ok
+%%%----------------------------------------------------------------
+mangle_connect_address(A, SockOpts) ->
+ mangle_connect_address1(A, proplists:get_value(inet6,SockOpts,false)).
+
+loopback(true) -> {0,0,0,0,0,0,0,1};
+loopback(false) -> {127,0,0,1}.
+
+mangle_connect_address1( loopback, V6flg) -> loopback(V6flg);
+mangle_connect_address1( any, V6flg) -> loopback(V6flg);
+mangle_connect_address1({0,0,0,0}, _) -> loopback(false);
+mangle_connect_address1({0,0,0,0,0,0,0,0}, _) -> loopback(true);
+mangle_connect_address1( IP, _) when is_tuple(IP) -> IP;
+mangle_connect_address1(A, _) ->
+ case catch inet:parse_address(A) of
+ {ok, {0,0,0,0}} -> loopback(false);
+ {ok, {0,0,0,0,0,0,0,0}} -> loopback(true);
+ _ -> A
end.
-
-find_hostport(Fd) ->
- %% Using internal functions inet:open/8 and inet:close/0.
- %% Don't try this at home unless you know what you are doing!
- {ok,S} = inet:open(Fd, {0,0,0,0}, 0, [], tcp, inet, stream, inet_tcp),
- {ok, HostPort} = inet:sockname(S),
- ok = inet:close(S),
- HostPort.
-
-fmt_host({A,B,C,D}) ->
- lists:concat([A,".",B,".",C,".",D]);
-fmt_host(T={_,_,_,_,_,_,_,_}) ->
- lists:flatten(string:join([io_lib:format("~.16B",[A]) || A <- tuple_to_list(T)], ":")).
diff --git a/lib/ssh/src/ssh.hrl b/lib/ssh/src/ssh.hrl
index c1ba58ed40..315310f700 100644
--- a/lib/ssh/src/ssh.hrl
+++ b/lib/ssh/src/ssh.hrl
@@ -75,9 +75,12 @@
%% Option access macros
-define(do_get_opt(C,K,O), ssh_options:get_value(C,K,O, ?MODULE,?LINE)).
--define(do_get_opt(C,K,O,D), ssh_options:get_value(C,K,O,D,?MODULE,?LINE)).
+-define(do_get_opt(C,K,O,D), ssh_options:get_value(C,K,O,?LAZY(D),?MODULE,?LINE)).
+
+-define(LAZY(D), fun()-> D end).
-define(GET_OPT(Key,Opts), ?do_get_opt(user_options, Key,Opts ) ).
+-define(GET_OPT(Key,Opts,Def), ?do_get_opt(user_options, Key,Opts,Def) ).
-define(GET_INTERNAL_OPT(Key,Opts), ?do_get_opt(internal_options,Key,Opts ) ).
-define(GET_INTERNAL_OPT(Key,Opts,Def), ?do_get_opt(internal_options,Key,Opts,Def) ).
-define(GET_SOCKET_OPT(Key,Opts), ?do_get_opt(socket_options, Key,Opts ) ).
@@ -89,6 +92,10 @@
-define(PUT_INTERNAL_OPT(KeyVal,Opts), ?do_put_opt(internal_options,KeyVal,Opts) ).
-define(PUT_SOCKET_OPT(KeyVal,Opts), ?do_put_opt(socket_options, KeyVal,Opts) ).
+-define(do_del_opt(C,K,O), ssh_options:delete_key(C,K,O, ?MODULE,?LINE)).
+-define(DELETE_INTERNAL_OPT(Key,Opts), ?do_del_opt(internal_options,Key,Opts) ).
+
+
%% Types
-type role() :: client | server .
-type ok_error(SuccessType) :: {ok, SuccessType} | {error, any()} .
@@ -109,12 +116,25 @@
-type double_algs() :: list( {client2serverlist,simple_algs()} | {server2client,simple_algs()} )
| simple_algs() .
+-type options() :: #{socket_options := socket_options(),
+ internal_options := internal_options(),
+ option_key() => any()
+ }.
+
+-type socket_options() :: proplists:proplist().
+-type internal_options() :: #{option_key() => any()}.
+
+-type option_key() :: atom().
+
+
%% Records
-record(ssh,
{
- role, %% client | server
- peer, %% string version of peer address
+ role :: client | role(),
+ peer :: undefined |
+ {inet:hostname(),
+ {inet:ip_adress(),inet:port_number()}}, %% string version of peer address
c_vsn, %% client version {Major,Minor}
s_vsn, %% server version {Major,Minor}
diff --git a/lib/ssh/src/ssh_acceptor.erl b/lib/ssh/src/ssh_acceptor.erl
index 42be18f2ad..f7fbd7ccad 100644
--- a/lib/ssh/src/ssh_acceptor.erl
+++ b/lib/ssh/src/ssh_acceptor.erl
@@ -27,8 +27,8 @@
%% Internal application API
-export([start_link/4,
number_of_connections/1,
- callback_listen/2,
- handle_connection/5]).
+ listen/2,
+ handle_established_connection/4]).
%% spawn export
-export([acceptor_init/5, acceptor_loop/6]).
@@ -42,41 +42,57 @@ start_link(Port, Address, Options, AcceptTimeout) ->
Args = [self(), Port, Address, Options, AcceptTimeout],
proc_lib:start_link(?MODULE, acceptor_init, Args).
+%%%----------------------------------------------------------------
+number_of_connections(SystemSup) ->
+ length([X ||
+ {R,X,supervisor,[ssh_subsystem_sup]} <- supervisor:which_children(SystemSup),
+ is_pid(X),
+ is_reference(R)
+ ]).
+
+%%%----------------------------------------------------------------
+listen(Port, Options) ->
+ {_, Callback, _} = ?GET_OPT(transport, Options),
+ SockOpts = [{active, false}, {reuseaddr,true} | ?GET_OPT(socket_options, Options)],
+ case Callback:listen(Port, SockOpts) of
+ {error, nxdomain} ->
+ Callback:listen(Port, lists:delete(inet6, SockOpts));
+ {error, enetunreach} ->
+ Callback:listen(Port, lists:delete(inet6, SockOpts));
+ {error, eafnosupport} ->
+ Callback:listen(Port, lists:delete(inet6, SockOpts));
+ Other ->
+ Other
+ end.
+
+%%%----------------------------------------------------------------
+handle_established_connection(Address, Port, Options, Socket) ->
+ {_, Callback, _} = ?GET_OPT(transport, Options),
+ handle_connection(Callback, Address, Port, Options, Socket).
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
acceptor_init(Parent, Port, Address, Opts, AcceptTimeout) ->
- {_, Callback, _} = ?GET_OPT(transport, Opts),
try
- {LSock0,SockOwner0} = ?GET_INTERNAL_OPT(lsocket, Opts),
- true = is_pid(SockOwner0),
- {ok,{_,Port}} = inet:sockname(LSock0),
- {LSock0, SockOwner0}
+ ?GET_INTERNAL_OPT(lsocket, Opts)
of
{LSock, SockOwner} ->
- %% Use existing socket
- proc_lib:init_ack(Parent, {ok, self()}),
- request_ownership(LSock, SockOwner),
- acceptor_loop(Callback, Port, Address, Opts, LSock, AcceptTimeout)
- catch
- error:{badkey,lsocket} ->
- %% Open new socket
- try
- socket_listen(Port, Opts)
- of
- {ok, ListenSocket} ->
+ case inet:sockname(LSock) of
+ {ok,{_,Port}} -> % A usable, open LSock
proc_lib:init_ack(Parent, {ok, self()}),
- {_, Callback, _} = ?GET_OPT(transport, Opts),
- acceptor_loop(Callback,
- Port, Address, Opts, ListenSocket, AcceptTimeout);
- {error,Error} ->
- proc_lib:init_ack(Parent, Error),
- {error,Error}
- catch
- _:_ ->
- {error,listen_socket_failed}
- end;
+ request_ownership(LSock, SockOwner),
+ {_, Callback, _} = ?GET_OPT(transport, Opts),
+ acceptor_loop(Callback, Port, Address, Opts, LSock, AcceptTimeout);
+ {error,_} -> % Not open, a restart
+ {ok,NewLSock} = listen(Port, Opts),
+ proc_lib:init_ack(Parent, {ok, self()}),
+ Opts1 = ?DELETE_INTERNAL_OPT(lsocket, Opts),
+ {_, Callback, _} = ?GET_OPT(transport, Opts1),
+ acceptor_loop(Callback, Port, Address, Opts1, NewLSock, AcceptTimeout)
+ end
+ catch
_:_ ->
{error,use_existing_socket_failed}
end.
@@ -88,30 +104,7 @@ request_ownership(LSock, SockOwner) ->
{its_yours,LSock} -> ok
end.
-
-socket_listen(Port0, Opts) ->
- Port = case ?GET_SOCKET_OPT(fd, Opts) of
- undefined -> Port0;
- _ -> 0
- end,
- callback_listen(Port, Opts).
-
-
-callback_listen(Port, Opts0) ->
- {_, Callback, _} = ?GET_OPT(transport, Opts0),
- Opts = ?PUT_SOCKET_OPT([{active, false}, {reuseaddr,true}], Opts0),
- SockOpts = ?GET_OPT(socket_options, Opts),
- case Callback:listen(Port, SockOpts) of
- {error, nxdomain} ->
- Callback:listen(Port, lists:delete(inet6, SockOpts));
- {error, enetunreach} ->
- Callback:listen(Port, lists:delete(inet6, SockOpts));
- {error, eafnosupport} ->
- Callback:listen(Port, lists:delete(inet6, SockOpts));
- Other ->
- Other
- end.
-
+%%%----------------------------------------------------------------
acceptor_loop(Callback, Port, Address, Opts, ListenSocket, AcceptTimeout) ->
case (catch Callback:accept(ListenSocket, AcceptTimeout)) of
{ok, Socket} ->
@@ -128,6 +121,7 @@ acceptor_loop(Callback, Port, Address, Opts, ListenSocket, AcceptTimeout) ->
ListenSocket, AcceptTimeout)
end.
+%%%----------------------------------------------------------------
handle_connection(Callback, Address, Port, Options, Socket) ->
Profile = ?GET_OPT(profile, Options),
SystemSup = ssh_system_sup:system_supervisor(Address, Port, Profile),
@@ -135,7 +129,8 @@ handle_connection(Callback, Address, Port, Options, Socket) ->
MaxSessions = ?GET_OPT(max_sessions, Options),
case number_of_connections(SystemSup) < MaxSessions of
true ->
- {ok, SubSysSup} = ssh_system_sup:start_subsystem(SystemSup, Options),
+ {ok, SubSysSup} =
+ ssh_system_sup:start_subsystem(SystemSup, server, Address, Port, Profile, Options),
ConnectionSup = ssh_subsystem_sup:connection_supervisor(SubSysSup),
NegTimeout = ?GET_OPT(negotiation_timeout, Options),
ssh_connection_handler:start_connection(server, Socket,
@@ -159,7 +154,7 @@ handle_connection(Callback, Address, Port, Options, Socket) ->
{error,max_sessions}
end.
-
+%%%----------------------------------------------------------------
handle_error(timeout) ->
ok;
@@ -186,10 +181,3 @@ handle_error(Reason) ->
error_logger:error_report(String),
exit({accept_failed, String}).
-
-number_of_connections(SystemSup) ->
- length([X ||
- {R,X,supervisor,[ssh_subsystem_sup]} <- supervisor:which_children(SystemSup),
- is_pid(X),
- is_reference(R)
- ]).
diff --git a/lib/ssh/src/ssh_acceptor_sup.erl b/lib/ssh/src/ssh_acceptor_sup.erl
index 77f7826918..26defcfdbd 100644
--- a/lib/ssh/src/ssh_acceptor_sup.erl
+++ b/lib/ssh/src/ssh_acceptor_sup.erl
@@ -29,7 +29,7 @@
-include("ssh.hrl").
--export([start_link/1, start_child/2, stop_child/4]).
+-export([start_link/4, start_child/5, stop_child/4]).
%% Supervisor callback
-export([init/1]).
@@ -41,19 +41,19 @@
%%%=========================================================================
%%% API
%%%=========================================================================
-start_link(Servers) ->
- supervisor:start_link(?MODULE, [Servers]).
+start_link(Address, Port, Profile, Options) ->
+ supervisor:start_link(?MODULE, [Address, Port, Profile, Options]).
-start_child(AccSup, Options) ->
- Spec = child_spec(Options),
+start_child(AccSup, Address, Port, Profile, Options) ->
+ Spec = child_spec(Address, Port, Profile, Options),
case supervisor:start_child(AccSup, Spec) of
{error, already_present} ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Profile = ?GET_OPT(profile, Options),
+ %% Is this ever called?
stop_child(AccSup, Address, Port, Profile),
supervisor:start_child(AccSup, Spec);
Reply ->
+ %% Reply = {ok,SystemSupPid} when the user calls ssh:daemon
+ %% after having called ssh:stop_listening
Reply
end.
@@ -69,34 +69,29 @@ stop_child(AccSup, Address, Port, Profile) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
-init([Options]) ->
- RestartStrategy = one_for_one,
- MaxR = 10,
- MaxT = 3600,
- Children = [child_spec(Options)],
- {ok, {{RestartStrategy, MaxR, MaxT}, Children}}.
+init([Address, Port, Profile, Options]) ->
+ %% Initial start of ssh_acceptor_sup for this port or new start after
+ %% ssh:stop_daemon
+ SupFlags = #{strategy => one_for_one,
+ intensity => 10,
+ period => 3600
+ },
+ ChildSpecs = [child_spec(Address, Port, Profile, Options)],
+ {ok, {SupFlags,ChildSpecs}}.
%%%=========================================================================
%%% Internal functions
%%%=========================================================================
-child_spec(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
+child_spec(Address, Port, Profile, Options) ->
Timeout = ?GET_INTERNAL_OPT(timeout, Options, ?DEFAULT_TIMEOUT),
- Profile = ?GET_OPT(profile, Options),
- Name = id(Address, Port, Profile),
- StartFunc = {ssh_acceptor, start_link, [Port, Address, Options, Timeout]},
- Restart = transient,
- Shutdown = brutal_kill,
- Modules = [ssh_acceptor],
- Type = worker,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+ #{id => id(Address, Port, Profile),
+ start => {ssh_acceptor, start_link, [Port, Address, Options, Timeout]},
+ restart => transient,
+ shutdown => 5500, %brutal_kill,
+ type => worker,
+ modules => [ssh_acceptor]
+ }.
id(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {ssh_acceptor_sup, any, Port, Profile};
- false ->
- {ssh_acceptor_sup, Address, Port, Profile}
- end.
+ {ssh_acceptor_sup, Address, Port, Profile}.
diff --git a/lib/ssh/src/ssh_connection_handler.erl b/lib/ssh/src/ssh_connection_handler.erl
index b9c643c77e..84bb7dc23f 100644
--- a/lib/ssh/src/ssh_connection_handler.erl
+++ b/lib/ssh/src/ssh_connection_handler.erl
@@ -60,7 +60,7 @@
]).
%%% Behaviour callbacks
--export([callback_mode/0, handle_event/4, terminate/3,
+-export([init/1, callback_mode/0, handle_event/4, terminate/3,
format_status/2, code_change/4]).
%%% Exports not intended to be used :). They are used for spawning and tests
@@ -80,7 +80,11 @@
) -> {ok, pid()}.
%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
start_link(Role, Socket, Options) ->
- {ok, proc_lib:spawn_link(?MODULE, init_connection_handler, [Role, Socket, Options])}.
+ {ok, proc_lib:spawn_opt(?MODULE,
+ init_connection_handler,
+ [Role, Socket, Options],
+ [link, {message_queue_data,off_heap}]
+ )}.
%%--------------------------------------------------------------------
@@ -333,8 +337,7 @@ renegotiate_data(ConnectionHandler) ->
transport_protocol :: atom(), % ex: tcp
transport_cb :: atom(), % ex: gen_tcp
transport_close_tag :: atom(), % ex: tcp_closed
- ssh_params :: #ssh{}
- | undefined,
+ ssh_params :: #ssh{},
socket :: inet:socket(),
decrypted_data_buffer = <<>> :: binary(),
encrypted_data_buffer = <<>> :: binary(),
@@ -358,75 +361,78 @@ renegotiate_data(ConnectionHandler) ->
) -> no_return().
%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
init_connection_handler(Role, Socket, Opts) ->
- process_flag(trap_exit, true),
- S0 = init_process_state(Role, Socket, Opts),
- try
- {Protocol, Callback, CloseTag} = ?GET_OPT(transport, Opts),
- S0#data{ssh_params = init_ssh_record(Role, Socket, Opts),
- transport_protocol = Protocol,
- transport_cb = Callback,
- transport_close_tag = CloseTag
- }
- of
- S ->
- gen_statem:enter_loop(?MODULE,
- [], %%[{debug,[trace,log,statistics,debug]} || Role==server],
- {hello,Role},
- S)
- catch
- _:Error ->
- gen_statem:enter_loop(?MODULE,
- [],
- {init_error,Error},
- S0)
- end.
-
-
-init_process_state(Role, Socket, Opts) ->
- D = #data{connection_state =
- C = #connection{channel_cache = ssh_channel:cache_create(),
- channel_id_seed = 0,
- port_bindings = [],
- requests = [],
- options = Opts},
- starter = ?GET_INTERNAL_OPT(user_pid, Opts),
- socket = Socket,
- opts = Opts
- },
- case Role of
- client ->
- %% Start the renegotiation timers
- timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]),
- timer:apply_after(?REKEY_DATA_TIMOUT, gen_statem, cast, [self(), data_size]),
- cache_init_idle_timer(D);
- server ->
- D#data{connection_state = init_connection(Role, C, Opts)}
+ case init([Role, Socket, Opts]) of
+ {ok, StartState, D} ->
+ process_flag(trap_exit, true),
+ gen_statem:enter_loop(?MODULE,
+ [], %%[{debug,[trace,log,statistics,debug]} || Role==server],
+ StartState,
+ D);
+
+ {stop, enotconn} ->
+ %% Handles the abnormal sequence:
+ %% SYN->
+ %% <-SYNACK
+ %% ACK->
+ %% RST->
+ exit({shutdown, "TCP connection to server was prematurely closed by the client"});
+
+ {stop, OtherError} ->
+ exit({shutdown, {init,OtherError}})
end.
-init_connection(server, C = #connection{}, Opts) ->
- Sups = ?GET_INTERNAL_OPT(supervisors, Opts),
- SystemSup = proplists:get_value(system_sup, Sups),
- SubSystemSup = proplists:get_value(subsystem_sup, Sups),
- ConnectionSup = proplists:get_value(connection_sup, Sups),
+init([Role,Socket,Opts]) ->
+ case inet:peername(Socket) of
+ {ok, PeerAddr} ->
+ {Protocol, Callback, CloseTag} = ?GET_OPT(transport, Opts),
+ C = #connection{channel_cache = ssh_channel:cache_create(),
+ channel_id_seed = 0,
+ port_bindings = [],
+ requests = [],
+ options = Opts},
+ D0 = #data{starter = ?GET_INTERNAL_OPT(user_pid, Opts),
+ connection_state = C,
+ socket = Socket,
+ transport_protocol = Protocol,
+ transport_cb = Callback,
+ transport_close_tag = CloseTag,
+ ssh_params = init_ssh_record(Role, Socket, PeerAddr, Opts),
+ opts = Opts
+ },
+ D = case Role of
+ client ->
+ %% Start the renegotiation timers
+ timer:apply_after(?REKEY_TIMOUT, gen_statem, cast, [self(), renegotiate]),
+ timer:apply_after(?REKEY_DATA_TIMOUT, gen_statem, cast, [self(), data_size]),
+ cache_init_idle_timer(D0);
+ server ->
+ Sups = ?GET_INTERNAL_OPT(supervisors, Opts),
+ cache_init_idle_timer(
+ D0#data{connection_state =
+ C#connection{cli_spec = ?GET_OPT(ssh_cli, Opts, {ssh_cli,[?GET_OPT(shell, Opts)]}),
+ exec = ?GET_OPT(exec, Opts),
+ system_supervisor = proplists:get_value(system_sup, Sups),
+ sub_system_supervisor = proplists:get_value(subsystem_sup, Sups),
+ connection_supervisor = proplists:get_value(connection_sup, Sups)
+ }})
+ end,
+ {ok, {hello,Role}, D};
+
+ {error,Error} ->
+ {stop, Error}
+ end.
- Shell = ?GET_OPT(shell, Opts),
- Exec = ?GET_OPT(exec, Opts),
- CliSpec = case ?GET_OPT(ssh_cli, Opts) of
- undefined -> {ssh_cli, [Shell]};
- Spec -> Spec
- end,
- C#connection{cli_spec = CliSpec,
- exec = Exec,
- system_supervisor = SystemSup,
- sub_system_supervisor = SubSystemSup,
- connection_supervisor = ConnectionSup
- }.
init_ssh_record(Role, Socket, Opts) ->
- {ok, PeerAddr} = inet:peername(Socket),
+ %% Export of this internal function is
+ %% intended for low-level protocol test suites
+ {ok,PeerAddr} = inet:peername(Socket),
+ init_ssh_record(Role, Socket, PeerAddr, Opts).
+
+init_ssh_record(Role, _Socket, PeerAddr, Opts) ->
KeyCb = ?GET_OPT(key_cb, Opts),
AuthMethods =
case Role of
@@ -444,7 +450,12 @@ init_ssh_record(Role, Socket, Opts) ->
{Vsn, Version} = ssh_transport:versions(Role, Opts),
case Role of
client ->
- PeerName = ?GET_INTERNAL_OPT(host, Opts),
+ PeerName = case ?GET_INTERNAL_OPT(host, Opts) of
+ PeerIP when is_tuple(PeerIP) ->
+ inet_parse:ntoa(PeerIP);
+ PeerName0 ->
+ PeerName0
+ end,
S0#ssh{c_vsn = Vsn,
c_version = Version,
io_cb = case ?GET_OPT(user_interaction, Opts) of
@@ -476,8 +487,7 @@ init_ssh_record(Role, Socket, Opts) ->
-type renegotiate_flag() :: init | renegotiate.
-type state_name() ::
- {init_error,any()}
- | {hello, role()}
+ {hello, role()}
| {kexinit, role(), renegotiate_flag()}
| {key_exchange, role(), renegotiate_flag()}
| {key_exchange_dh_gex_init, server, renegotiate_flag()}
@@ -499,26 +509,9 @@ init_ssh_record(Role, Socket, Opts) ->
%% . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
-%%% ######## Error in the initialisation ####
-
callback_mode() ->
handle_event_function.
-handle_event(_, _Event, {init_error,Error}, _) ->
- case Error of
- {badmatch,{error,enotconn}} ->
- %% Handles the abnormal sequence:
- %% SYN->
- %% <-SYNACK
- %% ACK->
- %% RST->
- {stop, {shutdown,"TCP connenction to server was prematurely closed by the client"}};
-
- OtherError ->
- {stop, {shutdown,{init,OtherError}}}
- end;
-
-
%%% ######## {hello, client|server} ####
%% The very first event that is sent when the we are set as controlling process of Socket
handle_event(_, socket_control, {hello,_}, D) ->
@@ -808,7 +801,7 @@ handle_event(_, #ssh_msg_userauth_info_request{} = Msg, {userauth_keyboard_inter
send_bytes(Reply, D),
{next_state, {userauth_keyboard_interactive_info_response,client}, D#data{ssh_params = Ssh}};
not_ok ->
- {next_state, {userauth,client}, D, [{next_event, internal, Msg}]}
+ {next_state, {userauth,client}, D, [postpone]}
end;
handle_event(_, #ssh_msg_userauth_info_response{} = Msg, {userauth_keyboard_interactive, server}, D) ->
@@ -837,14 +830,14 @@ handle_event(_, #ssh_msg_userauth_info_response{} = Msg, {userauth_keyboard_inte
{next_state, {connected,server}, D#data{auth_user = User,
ssh_params = Ssh#ssh{authenticated = true}}};
-handle_event(_, Msg = #ssh_msg_userauth_failure{}, {userauth_keyboard_interactive, client},
+handle_event(_, #ssh_msg_userauth_failure{}, {userauth_keyboard_interactive, client},
#data{ssh_params = Ssh0} = D0) ->
Prefs = [{Method,M,F,A} || {Method,M,F,A} <- Ssh0#ssh.userauth_preference,
Method =/= "keyboard-interactive"],
D = D0#data{ssh_params = Ssh0#ssh{userauth_preference=Prefs}},
- {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
+ {next_state, {userauth,client}, D, [postpone]};
-handle_event(_, Msg=#ssh_msg_userauth_failure{}, {userauth_keyboard_interactive_info_response, client},
+handle_event(_, #ssh_msg_userauth_failure{}, {userauth_keyboard_interactive_info_response, client},
#data{ssh_params = Ssh0} = D0) ->
Opts = Ssh0#ssh.opts,
D = case ?GET_OPT(password, Opts) of
@@ -854,23 +847,23 @@ handle_event(_, Msg=#ssh_msg_userauth_failure{}, {userauth_keyboard_interactive_
D0#data{ssh_params =
Ssh0#ssh{opts = ?PUT_OPT({password,not_ok}, Opts)}} % FIXME:intermodule dependency
end,
- {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
+ {next_state, {userauth,client}, D, [postpone]};
-handle_event(_, Msg=#ssh_msg_userauth_success{}, {userauth_keyboard_interactive_info_response, client}, D) ->
- {next_state, {userauth,client}, D, [{next_event, internal, Msg}]};
+handle_event(_, #ssh_msg_userauth_success{}, {userauth_keyboard_interactive_info_response, client}, D) ->
+ {next_state, {userauth,client}, D, [postpone]};
-handle_event(_, Msg=#ssh_msg_userauth_info_request{}, {userauth_keyboard_interactive_info_response, client}, D) ->
- {next_state, {userauth_keyboard_interactive,client}, D, [{next_event, internal, Msg}]};
+handle_event(_, #ssh_msg_userauth_info_request{}, {userauth_keyboard_interactive_info_response, client}, D) ->
+ {next_state, {userauth_keyboard_interactive,client}, D, [postpone]};
%%% ######## {connected, client|server} ####
-handle_event(_, {#ssh_msg_kexinit{},_} = Event, {connected,Role}, D0) ->
+handle_event(_, {#ssh_msg_kexinit{},_}, {connected,Role}, D0) ->
{KeyInitMsg, SshPacket, Ssh} = ssh_transport:key_exchange_init_msg(D0#data.ssh_params),
D = D0#data{ssh_params = Ssh,
key_exchange_init_msg = KeyInitMsg},
send_bytes(SshPacket, D),
- {next_state, {kexinit,Role,renegotiate}, D, [{next_event, internal, Event}]};
+ {next_state, {kexinit,Role,renegotiate}, D, [postpone]};
handle_event(_, #ssh_msg_disconnect{description=Desc} = Msg, StateName, D0) ->
{disconnect, _, {{replies,Replies}, _}} =
@@ -919,6 +912,9 @@ handle_event(internal, Msg=#ssh_msg_channel_extended_data{}, StateName, D) -
handle_event(internal, Msg=#ssh_msg_channel_eof{}, StateName, D) ->
handle_connection_msg(Msg, StateName, D);
+handle_event(internal, Msg=#ssh_msg_channel_close{}, {connected,server} = StateName, D) ->
+ handle_connection_msg(Msg, StateName, cache_request_idle_timer_check(D));
+
handle_event(internal, Msg=#ssh_msg_channel_close{}, StateName, D) ->
handle_connection_msg(Msg, StateName, D);
diff --git a/lib/ssh/src/ssh_connection_sup.erl b/lib/ssh/src/ssh_connection_sup.erl
index 0f54053f52..fad796f196 100644
--- a/lib/ssh/src/ssh_connection_sup.erl
+++ b/lib/ssh/src/ssh_connection_sup.erl
@@ -45,19 +45,17 @@ start_child(Sup, Args) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
init(_) ->
- RestartStrategy = simple_one_for_one,
- MaxR = 0,
- MaxT = 3600,
-
- Name = undefined, % As simple_one_for_one is used.
- StartFunc = {ssh_connection_handler, start_link, []},
- Restart = temporary, % E.g. should not be restarted
- Shutdown = 4000,
- Modules = [ssh_connection_handler],
- Type = worker,
-
- ChildSpec = {Name, StartFunc, Restart, Shutdown, Type, Modules},
- {ok, {{RestartStrategy, MaxR, MaxT}, [ChildSpec]}}.
+ SupFlags = #{strategy => simple_one_for_one,
+ intensity => 0,
+ period => 3600
+ },
+ ChildSpecs = [#{id => undefined, % As simple_one_for_one is used.
+ start => {ssh_connection_handler, start_link, []},
+ restart => temporary,
+ shutdown => 4000,
+ type => worker,
+ modules => [ssh_connection_handler]
+ }
+ ],
+ {ok, {SupFlags,ChildSpecs}}.
diff --git a/lib/ssh/src/ssh_file.erl b/lib/ssh/src/ssh_file.erl
index 898b4cc5c4..88f4d10792 100644
--- a/lib/ssh/src/ssh_file.erl
+++ b/lib/ssh/src/ssh_file.erl
@@ -221,6 +221,8 @@ file_name(Type, Name, Opts) ->
%% in: "host" out: "host,1.2.3.4.
+add_ip(IP) when is_tuple(IP) ->
+ ssh_connection:encode_ip(IP);
add_ip(Host) ->
case inet:getaddr(Host, inet) of
{ok, Addr} ->
diff --git a/lib/ssh/src/ssh_options.erl b/lib/ssh/src/ssh_options.erl
index 395be6b220..ee3cdbb8a0 100644
--- a/lib/ssh/src/ssh_options.erl
+++ b/lib/ssh/src/ssh_options.erl
@@ -28,6 +28,7 @@
-export([default/1,
get_value/5, get_value/6,
put_value/5,
+ delete_key/5,
handle_options/2
]).
@@ -37,16 +38,6 @@
%%%================================================================
%%% Types
--type options() :: #{socket_options := socket_options(),
- internal_options := internal_options(),
- option_key() => any()
- }.
-
--type socket_options() :: proplists:proplist().
--type internal_options() :: #{option_key() => any()}.
-
--type option_key() :: atom().
-
-type option_in() :: proplists:property() | proplists:proplist() .
-type option_class() :: internal_options | socket_options | user_options .
@@ -75,22 +66,23 @@ get_value(Class, Key, Opts, _CallerMod, _CallerLine) when is_map(Opts) ->
user_options -> maps:get(Key, Opts)
end;
get_value(Class, Key, Opts, _CallerMod, _CallerLine) ->
- io:format("*** Bad Opts GET OPT ~p ~p:~p Key=~p,~n Opts=~p~n",[Class,_CallerMod,_CallerLine,Key,Opts]),
error({bad_options,Class, Key, Opts, _CallerMod, _CallerLine}).
--spec get_value(option_class(), option_key(), options(), any(),
+-spec get_value(option_class(), option_key(), options(), fun(() -> any()),
atom(), non_neg_integer()) -> any() | no_return().
-get_value(socket_options, Key, Opts, Def, _CallerMod, _CallerLine) when is_map(Opts) ->
- proplists:get_value(Key, maps:get(socket_options,Opts), Def);
-get_value(Class, Key, Opts, Def, CallerMod, CallerLine) when is_map(Opts) ->
+get_value(socket_options, Key, Opts, DefFun, _CallerMod, _CallerLine) when is_map(Opts) ->
+ proplists:get_value(Key, maps:get(socket_options,Opts), DefFun);
+get_value(Class, Key, Opts, DefFun, CallerMod, CallerLine) when is_map(Opts) ->
try get_value(Class, Key, Opts, CallerMod, CallerLine)
+ of
+ undefined -> DefFun();
+ Value -> Value
catch
- error:{badkey,Key} -> Def
+ error:{badkey,Key} -> DefFun()
end;
-get_value(Class, Key, Opts, _Def, _CallerMod, _CallerLine) ->
- io:format("*** Bad Opts GET OPT ~p ~p:~p Key=~p,~n Opts=~p~n",[Class,_CallerMod,_CallerLine,Key,Opts]),
+get_value(Class, Key, Opts, _DefFun, _CallerMod, _CallerLine) ->
error({bad_options,Class, Key, Opts, _CallerMod, _CallerLine}).
@@ -136,6 +128,19 @@ put_socket_value(A, SockOpts) when is_atom(A) ->
%%%================================================================
%%%
+%%% Delete an option
+%%%
+
+-spec delete_key(option_class(), option_key(), options(),
+ atom(), non_neg_integer()) -> options().
+
+delete_key(internal_options, Key, Opts, _CallerMod, _CallerLine) when is_map(Opts) ->
+ InternalOpts = maps:get(internal_options,Opts),
+ Opts#{internal_options := maps:remove(Key, InternalOpts)}.
+
+
+%%%================================================================
+%%%
%%% Initialize the options
%%%
@@ -200,17 +205,6 @@ save({K,V}, _, _) when K == reuseaddr ;
save({allow_user_interaction,V}, Opts, Vals) ->
save({user_interaction,V}, Opts, Vals);
-save({public_key_alg,V}, Defs, Vals) -> % To remove in OTP-20
- New = case V of
- 'ssh-rsa' -> ['ssh-rsa', 'ssh-dss'];
- ssh_rsa -> ['ssh-rsa', 'ssh-dss'];
- 'ssh-dss' -> ['ssh-dss', 'ssh-rsa'];
- ssh_dsa -> ['ssh-dss', 'ssh-rsa'];
- _ -> error({eoptions, {public_key_alg,V},
- "Unknown algorithm, try pref_public_key_algs instead"})
- end,
- save({pref_public_key_algs,New}, Defs, Vals);
-
%% Special case for socket options 'inet' and 'inet6'
save(Inet, Defs, OptMap) when Inet==inet ; Inet==inet6 ->
save({inet,Inet}, Defs, OptMap);
@@ -501,12 +495,6 @@ default(client) ->
class => user_options
},
- {idle_time, def} =>
- #{default => infinity,
- chk => fun check_timeout/1,
- class => user_options
- },
-
%%%%% Undocumented
{keyboard_interact_fun, def} =>
#{default => undefined,
@@ -559,6 +547,12 @@ default(common) ->
class => user_options
},
+ {idle_time, def} =>
+ #{default => infinity,
+ chk => fun check_timeout/1,
+ class => user_options
+ },
+
%% This is a "SocketOption"...
%% {fd, def} =>
%% #{default => undefined,
@@ -803,18 +797,17 @@ read_moduli_file(D, I, Acc) ->
check_silently_accept_hosts(B) when is_boolean(B) -> true;
check_silently_accept_hosts(F) when is_function(F,2) -> true;
-check_silently_accept_hosts({S,F}) when is_atom(S),
- is_function(F,2) ->
- lists:member(S, ?SHAs) andalso
- lists:member(S, proplists:get_value(hashs,crypto:supports()));
-check_silently_accept_hosts({L,F}) when is_list(L),
- is_function(F,2) ->
- lists:all(fun(S) ->
- lists:member(S, ?SHAs) andalso
- lists:member(S, proplists:get_value(hashs,crypto:supports()))
- end, L);
+check_silently_accept_hosts({false,S}) when is_atom(S) -> valid_hash(S);
+check_silently_accept_hosts({S,F}) when is_function(F,2) -> valid_hash(S);
check_silently_accept_hosts(_) -> false.
+
+valid_hash(S) -> valid_hash(S, proplists:get_value(hashs,crypto:supports())).
+
+valid_hash(S, Ss) when is_atom(S) -> lists:member(S, ?SHAs) andalso lists:member(S, Ss);
+valid_hash(L, Ss) when is_list(L) -> lists:all(fun(S) -> valid_hash(S,Ss) end, L);
+valid_hash(X, _) -> error_in_check(X, "Expect atom or list in fingerprint spec").
+
%%%----------------------------------------------------------------
check_preferred_algorithms(Algs) ->
try alg_duplicates(Algs, [], [])
@@ -882,6 +875,7 @@ handle_pref_alg(Key, Vs, _) ->
chk_alg_vs(OptKey, Values, SupportedValues) ->
case (Values -- SupportedValues) of
[] -> Values;
+ [none] -> [none]; % for testing only
Bad -> error_in_check({OptKey,Bad}, "Unsupported value(s) found")
end.
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl
index 140856c8e3..f1f7b57e8d 100644
--- a/lib/ssh/src/ssh_sftp.erl
+++ b/lib/ssh/src/ssh_sftp.erl
@@ -1063,15 +1063,6 @@ attr_to_info(A) when is_record(A, ssh_xfer_attr) ->
gid = A#ssh_xfer_attr.group}.
-%% Added workaround for sftp timestam problem. (Timestamps should be
-%% in UTC but they where not) . The workaround uses a deprecated
-%% function i calandar. This will work as expected most of the time
-%% but has problems for the same reason as
-%% calendar:local_time_to_universal_time/1. We consider it better that
-%% the timestamps work as expected most of the time instead of none of
-%% the time. Hopfully the file-api will be updated so that we can
-%% solve this problem in a better way in the future.
-
unix_to_datetime(undefined) ->
undefined;
unix_to_datetime(UTCSecs) ->
diff --git a/lib/ssh/src/ssh_sftpd.erl b/lib/ssh/src/ssh_sftpd.erl
index 9352046795..b879116393 100644
--- a/lib/ssh/src/ssh_sftpd.erl
+++ b/lib/ssh/src/ssh_sftpd.erl
@@ -34,8 +34,7 @@
%%--------------------------------------------------------------------
%% External exports
--export([subsystem_spec/1,
- listen/1, listen/2, listen/3, stop/1]).
+-export([subsystem_spec/1]).
-export([init/1, handle_ssh_msg/2, handle_msg/2, terminate/2]).
@@ -76,29 +75,6 @@
subsystem_spec(Options) ->
{"sftp", {?MODULE, Options}}.
-%%% DEPRECATED START %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-%%--------------------------------------------------------------------
-%% Function: listen() -> Pid | {error,Error}
-%% Description: Starts the server
-%%--------------------------------------------------------------------
-listen(Port) ->
- listen(any, Port, []).
-listen(Port, Options) ->
- listen(any, Port, Options).
-listen(Addr, Port, Options) ->
- SubSystems = [subsystem_spec(Options)],
- ssh:daemon(Addr, Port, [{subsystems, SubSystems} |Options]).
-
-%%--------------------------------------------------------------------
-%% Function: stop(Pid) -> ok
-%% Description: Stops the listener
-%%--------------------------------------------------------------------
-stop(Pid) ->
- ssh:stop_listener(Pid).
-
-
-%%% DEPRECATED END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%====================================================================
%% subsystem callbacks
diff --git a/lib/ssh/src/ssh_subsystem_sup.erl b/lib/ssh/src/ssh_subsystem_sup.erl
index cf82db458f..cf409ade6b 100644
--- a/lib/ssh/src/ssh_subsystem_sup.erl
+++ b/lib/ssh/src/ssh_subsystem_sup.erl
@@ -28,7 +28,7 @@
-include("ssh.hrl").
--export([start_link/1,
+-export([start_link/5,
connection_supervisor/1,
channel_supervisor/1
]).
@@ -39,8 +39,8 @@
%%%=========================================================================
%%% API
%%%=========================================================================
-start_link(Options) ->
- supervisor:start_link(?MODULE, [Options]).
+start_link(Role, Address, Port, Profile, Options) ->
+ supervisor:start_link(?MODULE, [Role, Address, Port, Profile, Options]).
connection_supervisor(SupPid) ->
Children = supervisor:which_children(SupPid),
@@ -53,49 +53,40 @@ channel_supervisor(SupPid) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init([Options]) ->
- RestartStrategy = one_for_all,
- MaxR = 0,
- MaxT = 3600,
- Children = child_specs(Options),
- {ok, {{RestartStrategy, MaxR, MaxT}, Children}}.
+init([Role, Address, Port, Profile, Options]) ->
+ SupFlags = #{strategy => one_for_all,
+ intensity => 0,
+ period => 3600
+ },
+ ChildSpecs = child_specs(Role, Address, Port, Profile, Options),
+ {ok, {SupFlags,ChildSpecs}}.
%%%=========================================================================
%%% Internal functions
%%%=========================================================================
-child_specs(Options) ->
- case ?GET_INTERNAL_OPT(role, Options) of
- client ->
- [];
- server ->
- [ssh_channel_child_spec(Options), ssh_connectinon_child_spec(Options)]
- end.
+child_specs(client, _Address, _Port, _Profile, _Options) ->
+ [];
+child_specs(server, Address, Port, Profile, Options) ->
+ [ssh_channel_child_spec(server, Address, Port, Profile, Options),
+ ssh_connection_child_spec(server, Address, Port, Profile, Options)].
-ssh_connectinon_child_spec(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Role = ?GET_INTERNAL_OPT(role, Options),
- Name = id(Role, ssh_connection_sup, Address, Port),
- StartFunc = {ssh_connection_sup, start_link, [Options]},
- Restart = temporary,
- Shutdown = 5000,
- Modules = [ssh_connection_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
-ssh_channel_child_spec(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Role = ?GET_INTERNAL_OPT(role, Options),
- Name = id(Role, ssh_channel_sup, Address, Port),
- StartFunc = {ssh_channel_sup, start_link, [Options]},
- Restart = temporary,
- Shutdown = infinity,
- Modules = [ssh_channel_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+ssh_connection_child_spec(Role, Address, Port, _Profile, Options) ->
+ #{id => id(Role, ssh_connection_sup, Address, Port),
+ start => {ssh_connection_sup, start_link, [Options]},
+ restart => temporary,
+ shutdown => 5000,
+ type => supervisor,
+ modules => [ssh_connection_sup]
+ }.
+
+ssh_channel_child_spec(Role, Address, Port, _Profile, Options) ->
+ #{id => id(Role, ssh_channel_sup, Address, Port),
+ start => {ssh_channel_sup, start_link, [Options]},
+ restart => temporary,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [ssh_channel_sup]
+ }.
id(Role, Sup, Address, Port) ->
{Role, Sup, Address, Port}.
diff --git a/lib/ssh/src/ssh_sup.erl b/lib/ssh/src/ssh_sup.erl
index 8b57387589..26574763e4 100644
--- a/lib/ssh/src/ssh_sup.erl
+++ b/lib/ssh/src/ssh_sup.erl
@@ -31,63 +31,20 @@
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init([]) ->
- SupFlags = {one_for_one, 10, 3600},
- Children = children(),
- {ok, {SupFlags, Children}}.
-
-%%%=========================================================================
-%%% Internal functions
-%%%=========================================================================
-get_services() ->
- case (catch application:get_env(ssh, services)) of
- {ok, Services} ->
- Services;
- _ ->
- []
- end.
-
-children() ->
- Services = get_services(),
- Clients = [Service || Service <- Services, is_client(Service)],
- Servers = [Service || Service <- Services, is_server(Service)],
-
- [server_child_spec(Servers), client_child_spec(Clients)].
-
-server_child_spec(Servers) ->
- Name = sshd_sup,
- StartFunc = {sshd_sup, start_link, [Servers]},
- Restart = permanent,
- Shutdown = infinity,
- Modules = [sshd_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
-client_child_spec(Clients) ->
- Name = sshc_sup,
- StartFunc = {sshc_sup, start_link, [Clients]},
- Restart = permanent,
- Shutdown = infinity,
- Modules = [sshc_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
-is_server({sftpd, _}) ->
- true;
-is_server({shelld, _}) ->
- true;
-is_server(_) ->
- false.
-
-is_client({sftpc, _}) ->
- true;
-is_client({shellc, _}) ->
- true;
-is_client(_) ->
- false.
-
-
-
+init(_) ->
+ SupFlags = #{strategy => one_for_one,
+ intensity => 10,
+ period => 3600
+ },
+ ChildSpecs = [#{id => Module,
+ start => {Module, start_link, []},
+ restart => permanent,
+ shutdown => 4000, %brutal_kill,
+ type => supervisor,
+ modules => [Module]
+ }
+ || Module <- [sshd_sup,
+ sshc_sup]
+ ],
+ {ok, {SupFlags,ChildSpecs}}.
diff --git a/lib/ssh/src/ssh_system_sup.erl b/lib/ssh/src/ssh_system_sup.erl
index b0bbd3aae5..84b4cd3241 100644
--- a/lib/ssh/src/ssh_system_sup.erl
+++ b/lib/ssh/src/ssh_system_sup.erl
@@ -21,7 +21,7 @@
%%
%%----------------------------------------------------------------------
%% Purpose: The ssh server instance supervisor, an instans of this supervisor
-%% exists for every ip-address and port combination, hangs under
+%% exists for every ip-address and port combination, hangs under
%% sshd_sup.
%%----------------------------------------------------------------------
@@ -31,64 +31,103 @@
-include("ssh.hrl").
--export([start_link/1, stop_listener/1,
+-export([start_link/4, stop_listener/1,
stop_listener/3, stop_system/1,
stop_system/3, system_supervisor/3,
- subsystem_supervisor/1, channel_supervisor/1,
- connection_supervisor/1,
- acceptor_supervisor/1, start_subsystem/2, restart_subsystem/3,
- restart_acceptor/3, stop_subsystem/2]).
+ subsystem_supervisor/1, channel_supervisor/1,
+ connection_supervisor/1,
+ acceptor_supervisor/1, start_subsystem/6,
+ stop_subsystem/2]).
%% Supervisor callback
-export([init/1]).
%%%=========================================================================
-%%% Internal API
+%%% API
%%%=========================================================================
-start_link(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Profile = ?GET_OPT(profile, Options),
+start_link(Address, Port, Profile, Options) ->
Name = make_name(Address, Port, Profile),
- supervisor:start_link({local, Name}, ?MODULE, [Options]).
+ supervisor:start_link({local, Name}, ?MODULE, [Address, Port, Profile, Options]).
-stop_listener(SysSup) ->
- stop_acceptor(SysSup).
+%%%=========================================================================
+%%% Supervisor callback
+%%%=========================================================================
+init([Address, Port, Profile, Options]) ->
+ SupFlags = #{strategy => one_for_one,
+ intensity => 0,
+ period => 3600
+ },
+ ChildSpecs =
+ case ?GET_INTERNAL_OPT(connected_socket,Options,undefined) of
+ undefined ->
+ [#{id => id(ssh_acceptor_sup, Address, Port, Profile),
+ start => {ssh_acceptor_sup, start_link, [Address, Port, Profile, Options]},
+ restart => transient,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [ssh_acceptor_sup]
+ }];
+ _ ->
+ []
+ end,
+ {ok, {SupFlags,ChildSpecs}}.
+
+%%%=========================================================================
+%%% Service API
+%%%=========================================================================
+stop_listener(SystemSup) ->
+ {Name, AcceptorSup, _, _} = lookup(ssh_acceptor_sup, SystemSup),
+ case supervisor:terminate_child(AcceptorSup, Name) of
+ ok ->
+ supervisor:delete_child(AcceptorSup, Name);
+ Error ->
+ Error
+ end.
stop_listener(Address, Port, Profile) ->
- Name = make_name(Address, Port, Profile),
- stop_acceptor(whereis(Name)).
-
+ stop_listener(
+ system_supervisor(Address, Port, Profile)).
+
+
stop_system(SysSup) ->
- Name = sshd_sup:system_name(SysSup),
- spawn(fun() -> sshd_sup:stop_child(Name) end),
+ spawn(fun() -> sshd_sup:stop_child(SysSup) end),
ok.
-stop_system(Address, Port, Profile) ->
+stop_system(Address, Port, Profile) ->
spawn(fun() -> sshd_sup:stop_child(Address, Port, Profile) end),
ok.
+
system_supervisor(Address, Port, Profile) ->
Name = make_name(Address, Port, Profile),
whereis(Name).
subsystem_supervisor(SystemSup) ->
- ssh_subsystem_sup(supervisor:which_children(SystemSup)).
+ {_, Child, _, _} = lookup(ssh_subsystem_sup, SystemSup),
+ Child.
channel_supervisor(SystemSup) ->
- SubSysSup = ssh_subsystem_sup(supervisor:which_children(SystemSup)),
- ssh_subsystem_sup:channel_supervisor(SubSysSup).
+ ssh_subsystem_sup:channel_supervisor(
+ subsystem_supervisor(SystemSup)).
connection_supervisor(SystemSup) ->
- SubSysSup = ssh_subsystem_sup(supervisor:which_children(SystemSup)),
- ssh_subsystem_sup:connection_supervisor(SubSysSup).
+ ssh_subsystem_sup:connection_supervisor(
+ subsystem_supervisor(SystemSup)).
acceptor_supervisor(SystemSup) ->
- ssh_acceptor_sup(supervisor:which_children(SystemSup)).
+ {_, Child, _, _} = lookup(ssh_acceptor_sup, SystemSup),
+ Child.
-start_subsystem(SystemSup, Options) ->
- Spec = ssh_subsystem_child_spec(Options),
- supervisor:start_child(SystemSup, Spec).
+
+start_subsystem(SystemSup, Role, Address, Port, Profile, Options) ->
+ SubsystemSpec =
+ #{id => make_ref(),
+ start => {ssh_subsystem_sup, start_link, [Role, Address, Port, Profile, Options]},
+ restart => temporary,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [ssh_subsystem_sup]},
+ supervisor:start_child(SystemSup, SubsystemSpec).
stop_subsystem(SystemSup, SubSys) ->
case catch lists:keyfind(SubSys, 2, supervisor:which_children(SystemSup)) of
@@ -106,100 +145,21 @@ stop_subsystem(SystemSup, SubSys) ->
ok
end.
-
-restart_subsystem(Address, Port, Profile) ->
- SysSupName = make_name(Address, Port, Profile),
- SubSysName = id(ssh_subsystem_sup, Address, Port, Profile),
- case supervisor:terminate_child(SysSupName, SubSysName) of
- ok ->
- supervisor:restart_child(SysSupName, SubSysName);
- Error ->
- Error
- end.
-
-restart_acceptor(Address, Port, Profile) ->
- SysSupName = make_name(Address, Port, Profile),
- AcceptorName = id(ssh_acceptor_sup, Address, Port, Profile),
- supervisor:restart_child(SysSupName, AcceptorName).
-
-%%%=========================================================================
-%%% Supervisor callback
-%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init([Options]) ->
- RestartStrategy = one_for_one,
- MaxR = 0,
- MaxT = 3600,
- Children = case ?GET_INTERNAL_OPT(asocket,Options,undefined) of
- undefined -> child_specs(Options);
- _ -> []
- end,
- {ok, {{RestartStrategy, MaxR, MaxT}, Children}}.
-
%%%=========================================================================
%%% Internal functions
%%%=========================================================================
-child_specs(Options) ->
- [ssh_acceptor_child_spec(Options)].
-
-ssh_acceptor_child_spec(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Profile = ?GET_OPT(profile, Options),
- Name = id(ssh_acceptor_sup, Address, Port, Profile),
- StartFunc = {ssh_acceptor_sup, start_link, [Options]},
- Restart = transient,
- Shutdown = infinity,
- Modules = [ssh_acceptor_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
-ssh_subsystem_child_spec(Options) ->
- Name = make_ref(),
- StartFunc = {ssh_subsystem_sup, start_link, [Options]},
- Restart = temporary,
- Shutdown = infinity,
- Modules = [ssh_subsystem_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
-
-
id(Sup, Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {Sup, any, Port, Profile};
- false ->
- {Sup, Address, Port, Profile}
- end.
+ {Sup, Address, Port, Profile}.
make_name(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- list_to_atom(lists:flatten(io_lib:format("ssh_system_~p_~p_~p_sup",
- [any, Port, Profile])));
- false ->
- list_to_atom(lists:flatten(io_lib:format("ssh_system_~p_~p_~p_sup",
- [Address, Port, Profile])))
- end.
+ list_to_atom(lists:flatten(io_lib:format("ssh_system_~s_~p_~p_sup", [fmt_host(Address), Port, Profile]))).
-ssh_subsystem_sup([{_, Child, _, [ssh_subsystem_sup]} | _]) ->
- Child;
-ssh_subsystem_sup([_ | Rest]) ->
- ssh_subsystem_sup(Rest).
+fmt_host(IP) when is_tuple(IP) -> inet:ntoa(IP);
+fmt_host(A) when is_atom(A) -> A;
+fmt_host(S) when is_list(S) -> S.
-ssh_acceptor_sup([{_, Child, _, [ssh_acceptor_sup]} | _]) ->
- Child;
-ssh_acceptor_sup([_ | Rest]) ->
- ssh_acceptor_sup(Rest).
-stop_acceptor(Sup) ->
- [{Name, AcceptorSup}] =
- [{SupName, ASup} || {SupName, ASup, _, [ssh_acceptor_sup]} <-
- supervisor:which_children(Sup)],
- case supervisor:terminate_child(AcceptorSup, Name) of
- ok ->
- supervisor:delete_child(AcceptorSup, Name);
- Error ->
- Error
- end.
+lookup(SupModule, SystemSup) ->
+ lists:keyfind([SupModule], 4,
+ supervisor:which_children(SystemSup)).
+
diff --git a/lib/ssh/src/ssh_transport.erl b/lib/ssh/src/ssh_transport.erl
index 02c995399a..6b47868d5c 100644
--- a/lib/ssh/src/ssh_transport.erl
+++ b/lib/ssh/src/ssh_transport.erl
@@ -181,7 +181,7 @@ ssh_vsn() ->
end.
random_id(Nlo, Nup) ->
- [crypto:rand_uniform($a,$z+1) || _<- lists:duplicate(crypto:rand_uniform(Nlo,Nup+1),x) ].
+ [$a + rand:uniform($z-$a+1) - 1 || _<- lists:duplicate(Nlo + rand:uniform(Nup-Nlo+1) - 1, x)].
hello_version_msg(Data) ->
[Data,"\r\n"].
@@ -200,9 +200,6 @@ is_valid_mac(Mac, Data, #ssh{recv_mac = Algorithm,
recv_mac_key = Key, recv_sequence = SeqNum}) ->
Mac == mac(Algorithm, Key, SeqNum, Data).
-yes_no(Ssh, Prompt) ->
- (Ssh#ssh.io_cb):yes_no(Prompt, Ssh).
-
format_version({Major,Minor}, SoftwareVersion) ->
"SSH-" ++ integer_to_list(Major) ++ "." ++
integer_to_list(Minor) ++ "-" ++ SoftwareVersion.
@@ -755,16 +752,44 @@ public_algo({#'ECPoint'{},{namedCurve,OID}}) ->
accepted_host(Ssh, PeerName, Public, Opts) ->
case ?GET_OPT(silently_accept_hosts, Opts) of
- F when is_function(F,2) ->
+
+ %% Original option values; User question and no host key fingerprints known.
+ %% Keep the original question unchanged:
+ false -> yes == yes_no(Ssh, "New host " ++ PeerName ++ " accept");
+ true -> true;
+
+ %% Variant: User question but with host key fingerprint in the question:
+ {false,Alg} ->
+ HostKeyAlg = (Ssh#ssh.algorithms)#alg.hkey,
+ Prompt = io_lib:format("The authenticity of the host can't be established.~n"
+ "~s host key fingerprint is ~s.~n"
+ "New host ~p accept",
+ [fmt_hostkey(HostKeyAlg),
+ public_key:ssh_hostkey_fingerprint(Alg,Public),
+ PeerName]),
+ yes == yes_no(Ssh, Prompt);
+
+ %% Call-back alternatives: A user provided fun is called for the decision:
+ F when is_function(F,2) ->
true == (catch F(PeerName, public_key:ssh_hostkey_fingerprint(Public)));
+
{DigestAlg,F} when is_function(F,2) ->
- true == (catch F(PeerName, public_key:ssh_hostkey_fingerprint(DigestAlg,Public)));
- true ->
- true;
- false ->
- yes == yes_no(Ssh, "New host " ++ PeerName ++ " accept")
+ true == (catch F(PeerName, public_key:ssh_hostkey_fingerprint(DigestAlg,Public)))
+
end.
+
+yes_no(Ssh, Prompt) ->
+ (Ssh#ssh.io_cb):yes_no(Prompt, Ssh#ssh.opts).
+
+
+fmt_hostkey('ssh-rsa') -> "RSA";
+fmt_hostkey('ssh-dss') -> "DSA";
+fmt_hostkey(A) when is_atom(A) -> fmt_hostkey(atom_to_list(A));
+fmt_hostkey("ecdsa"++_) -> "ECDSA";
+fmt_hostkey(X) -> X.
+
+
known_host_key(#ssh{opts = Opts, key_cb = {KeyCb,KeyCbOpts}, peer = {PeerName,_}} = Ssh,
Public, Alg) ->
UserOpts = ?GET_OPT(user_options, Opts),
@@ -1016,7 +1041,7 @@ padding_length(Size, #ssh{encrypt_block_size = BlockSize,
end,
PadBlockSize = max(BlockSize,4),
MaxExtraBlocks = (max(RandomLengthPadding,MinPaddingLen) - MinPaddingLen) div PadBlockSize,
- ExtraPaddingLen = try crypto:rand_uniform(0,MaxExtraBlocks)*PadBlockSize
+ ExtraPaddingLen = try (rand:uniform(MaxExtraBlocks+1) - 1) * PadBlockSize
catch _:_ -> 0
end,
MinPaddingLen + ExtraPaddingLen.
diff --git a/lib/ssh/src/sshc_sup.erl b/lib/ssh/src/sshc_sup.erl
index 15858f36e1..c71b81dc6d 100644
--- a/lib/ssh/src/sshc_sup.erl
+++ b/lib/ssh/src/sshc_sup.erl
@@ -27,23 +27,25 @@
-behaviour(supervisor).
--export([start_link/1, start_child/1, stop_child/1]).
+-export([start_link/0, start_child/1, stop_child/1]).
%% Supervisor callback
-export([init/1]).
+-define(SSHC_SUP, ?MODULE).
+
%%%=========================================================================
%%% API
%%%=========================================================================
-start_link(Args) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, [Args]).
+start_link() ->
+ supervisor:start_link({local,?SSHC_SUP}, ?MODULE, []).
start_child(Args) ->
supervisor:start_child(?MODULE, Args).
stop_child(Client) ->
spawn(fun() ->
- ClientSup = whereis(?MODULE),
+ ClientSup = whereis(?SSHC_SUP),
supervisor:terminate_child(ClientSup, Client)
end),
ok.
@@ -51,22 +53,17 @@ stop_child(Client) ->
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init(Args) ->
- RestartStrategy = simple_one_for_one,
- MaxR = 0,
- MaxT = 3600,
- {ok, {{RestartStrategy, MaxR, MaxT}, [child_spec(Args)]}}.
-
-%%%=========================================================================
-%%% Internal functions
-%%%=========================================================================
-child_spec(_) ->
- Name = undefined, % As simple_one_for_one is used.
- StartFunc = {ssh_connection_handler, start_link, []},
- Restart = temporary,
- Shutdown = 4000,
- Modules = [ssh_connection_handler],
- Type = worker,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+init(_) ->
+ SupFlags = #{strategy => simple_one_for_one,
+ intensity => 0,
+ period => 3600
+ },
+ ChildSpecs = [#{id => undefined, % As simple_one_for_one is used.
+ start => {ssh_connection_handler, start_link, []},
+ restart => temporary,
+ shutdown => 4000,
+ type => worker,
+ modules => [ssh_connection_handler]
+ }
+ ],
+ {ok, {SupFlags,ChildSpecs}}.
diff --git a/lib/ssh/src/sshd_sup.erl b/lib/ssh/src/sshd_sup.erl
index 14f1937abd..449ba20d02 100644
--- a/lib/ssh/src/sshd_sup.erl
+++ b/lib/ssh/src/sshd_sup.erl
@@ -19,7 +19,7 @@
%%
%%
%%----------------------------------------------------------------------
-%% Purpose: The top supervisor for ssh servers hangs under
+%% Purpose: The top supervisor for ssh servers hangs under
%% ssh_sup.
%%----------------------------------------------------------------------
@@ -29,90 +29,79 @@
-include("ssh.hrl").
--export([start_link/1, start_child/1, stop_child/1,
- stop_child/3, system_name/1]).
+-export([start_link/0,
+ start_child/4,
+ stop_child/1,
+ stop_child/3
+]).
%% Supervisor callback
-export([init/1]).
+-define(SSHD_SUP, ?MODULE).
+
%%%=========================================================================
%%% API
%%%=========================================================================
-start_link(Servers) ->
- supervisor:start_link({local, ?MODULE}, ?MODULE, [Servers]).
+start_link() ->
+ %% No children are start now. We wait until the user calls ssh:daemon
+ %% and uses start_child/4 to create the children
+ supervisor:start_link({local,?SSHD_SUP}, ?MODULE, []).
-start_child(Options) ->
- Address = ?GET_INTERNAL_OPT(address, Options),
- Port = ?GET_INTERNAL_OPT(port, Options),
- Profile = ?GET_OPT(profile, Options),
+start_child(Address, Port, Profile, Options) ->
case ssh_system_sup:system_supervisor(Address, Port, Profile) of
undefined ->
- Spec = child_spec(Address, Port, Options),
- case supervisor:start_child(?MODULE, Spec) of
- {error, already_present} ->
- Name = id(Address, Port, Profile),
- supervisor:delete_child(?MODULE, Name),
- supervisor:start_child(?MODULE, Spec);
- Reply ->
- Reply
- end;
+ %% Here we start listening on a new Host/Port/Profile
+ Spec = child_spec(Address, Port, Profile, Options),
+ supervisor:start_child(?SSHD_SUP, Spec);
Pid ->
+ %% Here we resume listening on a new Host/Port/Profile after
+ %% haveing stopped listening to he same with ssh:stop_listen(Pid)
AccPid = ssh_system_sup:acceptor_supervisor(Pid),
- ssh_acceptor_sup:start_child(AccPid, Options)
+ ssh_acceptor_sup:start_child(AccPid, Address, Port, Profile, Options),
+ {ok,Pid}
end.
-stop_child(Name) ->
- supervisor:terminate_child(?MODULE, Name).
+stop_child(ChildId) when is_tuple(ChildId) ->
+ supervisor:terminate_child(?SSHD_SUP, ChildId);
+stop_child(ChildPid) when is_pid(ChildPid)->
+ stop_child(system_name(ChildPid)).
-stop_child(Address, Port, Profile) ->
- Name = id(Address, Port, Profile),
- stop_child(Name).
-system_name(SysSup) ->
- Children = supervisor:which_children(sshd_sup),
- system_name(SysSup, Children).
+stop_child(Address, Port, Profile) ->
+ Id = id(Address, Port, Profile),
+ stop_child(Id).
%%%=========================================================================
%%% Supervisor callback
%%%=========================================================================
--spec init( [term()] ) -> {ok,{supervisor:sup_flags(),[supervisor:child_spec()]}} | ignore .
-
-init([Servers]) ->
- RestartStrategy = one_for_one,
- MaxR = 10,
- MaxT = 3600,
- Fun = fun(ServerOpts) ->
- Address = ?GET_INTERNAL_OPT(address, ServerOpts),
- Port = ?GET_INTERNAL_OPT(port, ServerOpts),
- child_spec(Address, Port, ServerOpts)
- end,
- Children = lists:map(Fun, Servers),
- {ok, {{RestartStrategy, MaxR, MaxT}, Children}}.
+init(_) ->
+ SupFlags = #{strategy => one_for_one,
+ intensity => 10,
+ period => 3600
+ },
+ ChildSpecs = [
+ ],
+ {ok, {SupFlags,ChildSpecs}}.
%%%=========================================================================
%%% Internal functions
%%%=========================================================================
-child_spec(Address, Port, Options) ->
- Profile = ?GET_OPT(profile, Options),
- Name = id(Address, Port,Profile),
- StartFunc = {ssh_system_sup, start_link, [Options]},
- Restart = temporary,
- Shutdown = infinity,
- Modules = [ssh_system_sup],
- Type = supervisor,
- {Name, StartFunc, Restart, Shutdown, Type, Modules}.
+child_spec(Address, Port, Profile, Options) ->
+ #{id => id(Address, Port, Profile),
+ start => {ssh_system_sup, start_link, [Address, Port, Profile, Options]},
+ restart => temporary,
+ shutdown => infinity,
+ type => supervisor,
+ modules => [ssh_system_sup]
+ }.
id(Address, Port, Profile) ->
- case is_list(Address) of
- true ->
- {server, ssh_system_sup, any, Port, Profile};
- false ->
- {server, ssh_system_sup, Address, Port, Profile}
+ {server, ssh_system_sup, Address, Port, Profile}.
+
+system_name(SysSup) ->
+ case lists:keyfind(SysSup, 2, supervisor:which_children(?SSHD_SUP)) of
+ {Name, SysSup, _, _} -> Name;
+ false -> undefind
end.
-system_name([], _ ) ->
- undefined;
-system_name(SysSup, [{Name, SysSup, _, _} | _]) ->
- Name;
-system_name(SysSup, [_ | Rest]) ->
- system_name(SysSup, Rest).
diff --git a/lib/ssh/test/Makefile b/lib/ssh/test/Makefile
index 3fca78237c..fab79a7a43 100644
--- a/lib/ssh/test/Makefile
+++ b/lib/ssh/test/Makefile
@@ -36,7 +36,7 @@ MODULES= \
ssh_options_SUITE \
ssh_renegotiate_SUITE \
ssh_basic_SUITE \
- ssh_benchmark_SUITE \
+ ssh_bench_SUITE \
ssh_connection_SUITE \
ssh_protocol_SUITE \
ssh_sftp_SUITE \
@@ -50,6 +50,7 @@ MODULES= \
ssh_key_cb_options \
ssh_trpt_test_lib \
ssh_echo_server \
+ ssh_bench_dev_null \
ssh_peername_sockname_server \
ssh_test_cli \
ssh_relay \
diff --git a/lib/ssh/test/ssh.spec b/lib/ssh/test/ssh.spec
index 0076fc275e..68268cb20d 100644
--- a/lib/ssh/test/ssh.spec
+++ b/lib/ssh/test/ssh.spec
@@ -1,6 +1,7 @@
{suites,"../ssh_test",all}.
-{skip_suites, "../ssh_test", [ssh_benchmark_SUITE],
+{skip_suites, "../ssh_test", [ssh_bench_SUITE
+ ],
"Benchmarks run separately"}.
diff --git a/lib/ssh/test/ssh_algorithms_SUITE.erl b/lib/ssh/test/ssh_algorithms_SUITE.erl
index 6f75d83c4a..2990d1e02a 100644
--- a/lib/ssh/test/ssh_algorithms_SUITE.erl
+++ b/lib/ssh/test/ssh_algorithms_SUITE.erl
@@ -235,13 +235,12 @@ sshc_simple_exec_os_cmd(Config) ->
Parent = self(),
Client = spawn(
fun() ->
- Cmd = lists:concat(["ssh -p ",Port,
- " -C"
- " -o UserKnownHostsFile=",KnownHosts,
- " -o StrictHostKeyChecking=no"
- " ",Host," 1+1."]),
- Result = os:cmd(Cmd),
- ct:log("~p~n = ~p",[Cmd, Result]),
+ Result = ssh_test_lib:open_sshc(Host, Port,
+ [" -C"
+ " -o UserKnownHostsFile=",KnownHosts,
+ " -o StrictHostKeyChecking=no"
+ ],
+ " 1+1."),
Parent ! {result, self(), Result, "2"}
end),
receive
diff --git a/lib/ssh/test/ssh_basic_SUITE.erl b/lib/ssh/test/ssh_basic_SUITE.erl
index cdf6cf9ae1..089d191fea 100644
--- a/lib/ssh/test/ssh_basic_SUITE.erl
+++ b/lib/ssh/test/ssh_basic_SUITE.erl
@@ -46,7 +46,8 @@
exec_key_differs2/1,
exec_key_differs3/1,
exec_key_differs_fail/1,
- idle_time/1,
+ idle_time_client/1,
+ idle_time_server/1,
inet6_option/1,
inet_option/1,
internal_error/1,
@@ -139,7 +140,7 @@ basic_tests() ->
exec, exec_compressed,
shell, shell_no_unicode, shell_unicode_string,
cli, known_hosts,
- idle_time, openssh_zlib_basic_test,
+ idle_time_client, idle_time_server, openssh_zlib_basic_test,
misc_ssh_options, inet_option, inet6_option].
@@ -522,8 +523,8 @@ exec_compressed(Config) when is_list(Config) ->
end.
%%--------------------------------------------------------------------
-%%% Idle timeout test
-idle_time(Config) ->
+%%% Idle timeout test, client
+idle_time_client(Config) ->
SystemDir = filename:join(proplists:get_value(priv_dir, Config), system),
UserDir = proplists:get_value(priv_dir, Config),
@@ -544,6 +545,28 @@ idle_time(Config) ->
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
+%%% Idle timeout test, server
+idle_time_server(Config) ->
+ SystemDir = filename:join(proplists:get_value(priv_dir, Config), system),
+ UserDir = proplists:get_value(priv_dir, Config),
+
+ {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_dir, UserDir},
+ {idle_time, 2000},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+ ConnectionRef =
+ ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
+ {user_dir, UserDir},
+ {user_interaction, false}]),
+ {ok, Id} = ssh_connection:session_channel(ConnectionRef, 1000),
+ ssh_connection:close(ConnectionRef, Id),
+ receive
+ after 10000 ->
+ {error, closed} = ssh_connection:session_channel(ConnectionRef, 1000)
+ end,
+ ssh:stop_daemon(Pid).
+
+%%--------------------------------------------------------------------
%%% Test that ssh:shell/2 works
shell(Config) when is_list(Config) ->
process_flag(trap_exit, true),
@@ -719,7 +742,8 @@ known_hosts(Config) when is_list(Config) ->
Lines = string:tokens(binary_to_list(Binary), "\n"),
[Line] = Lines,
[HostAndIp, Alg, _KeyData] = string:tokens(Line, " "),
- [Host, _Ip] = string:tokens(HostAndIp, ","),
+ [StoredHost, _Ip] = string:tokens(HostAndIp, ","),
+ true = ssh_test_lib:match_ip(StoredHost, Host),
"ssh-" ++ _ = Alg,
ssh:stop_daemon(Pid).
%%--------------------------------------------------------------------
diff --git a/lib/ssh/test/ssh_bench.spec b/lib/ssh/test/ssh_bench.spec
index 029f0bd074..b0b64713cf 100644
--- a/lib/ssh/test/ssh_bench.spec
+++ b/lib/ssh/test/ssh_bench.spec
@@ -1 +1,2 @@
-{suites,"../ssh_test",[ssh_benchmark_SUITE]}.
+{suites,"../ssh_test",[ssh_bench_SUITE
+ ]}.
diff --git a/lib/ssh/test/ssh_bench_SUITE.erl b/lib/ssh/test/ssh_bench_SUITE.erl
new file mode 100644
index 0000000000..317e50ed1d
--- /dev/null
+++ b/lib/ssh/test/ssh_bench_SUITE.erl
@@ -0,0 +1,252 @@
+%%%-------------------------------------------------------------------
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+-module(ssh_bench_SUITE).
+-compile(export_all).
+
+-include_lib("common_test/include/ct_event.hrl").
+-include_lib("common_test/include/ct.hrl").
+
+-include_lib("ssh/src/ssh.hrl").
+-include_lib("ssh/src/ssh_transport.hrl").
+-include_lib("ssh/src/ssh_connect.hrl").
+-include_lib("ssh/src/ssh_userauth.hrl").
+
+%%%================================================================
+%%%
+%%% Suite declarations
+%%%
+
+suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]},
+ {timetrap,{minutes,1}}
+ ].
+all() -> [connect,
+ transfer_text
+ ].
+
+-define(UID, "foo").
+-define(PWD, "bar").
+-define(Nruns, 8).
+
+%%%================================================================
+%%%
+%%% Init per suite
+%%%
+
+init_per_suite(Config) ->
+ catch ssh:stop(),
+ try
+ ok = ssh:start()
+ of
+ ok ->
+ DataSize = 1000000,
+ SystemDir = proplists:get_value(data_dir, Config),
+ Algs = insert_none(ssh:default_algorithms()),
+ {_ServerPid, _Host, Port} =
+ ssh_test_lib:daemon([{system_dir, SystemDir},
+ {user_passwords, [{?UID,?PWD}]},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {preferred_algorithms, Algs},
+ {max_random_length_padding, 0},
+ {subsystems, [{"/dev/null", {ssh_bench_dev_null,[DataSize]}}]}
+ ]),
+ [{host,"localhost"}, {port,Port}, {uid,?UID}, {pwd,?PWD}, {data_size,DataSize} | Config]
+ catch
+ C:E ->
+ {skip, io_lib:format("Couldn't start ~p:~p",[C,E])}
+ end.
+
+end_per_suite(_Config) ->
+ catch ssh:stop(),
+ ok.
+
+%%%================================================================
+%%%
+%%% Init per testcase
+%%%
+
+init_per_testcase(_Func, Conf) ->
+ Conf.
+
+end_per_testcase(_Func, _Conf) ->
+ ok.
+
+%%%================================================================
+%%%
+%%% Testcases
+%%%
+
+%%%----------------------------------------------------------------
+%%% Measure the time for an Erlang client to connect to an Erlang
+%%% server on the localhost
+
+connect(Config) ->
+ KexAlgs = proplists:get_value(kex, ssh:default_algorithms()),
+ ct:log("KexAlgs = ~p",[KexAlgs]),
+ lists:foreach(
+ fun(KexAlg) ->
+ PrefAlgs = preferred_algorithms(KexAlg),
+ report([{value, measure_connect(Config,
+ [{preferred_algorithms,PrefAlgs}])},
+ {suite, ?MODULE},
+ {name, mk_name(["Connect erlc erld ",KexAlg," [µs]"])}
+ ])
+ end, KexAlgs).
+
+
+measure_connect(Config, Opts) ->
+ Port = proplists:get_value(port, Config),
+ ConnectOptions = [{user, proplists:get_value(uid, Config)},
+ {password, proplists:get_value(pwd, Config)},
+ {user_dir, proplists:get_value(priv_dir, Config)},
+ {silently_accept_hosts, true},
+ {user_interaction, false},
+ {max_random_length_padding, 0}
+ ] ++ Opts,
+ median(
+ [begin
+ {Time, {ok,Pid}} = timer:tc(ssh,connect,["localhost", Port, ConnectOptions]),
+ ssh:close(Pid),
+ Time
+ end || _ <- lists:seq(1,?Nruns)]).
+
+%%%----------------------------------------------------------------
+%%% Measure the time to transfer a set of data with
+%%% and without crypto
+
+transfer_text(Config) ->
+ Port = proplists:get_value(port, Config),
+ Options = [{user, proplists:get_value(uid, Config)},
+ {password, proplists:get_value(pwd, Config)},
+ {user_dir, proplists:get_value(priv_dir, Config)},
+ {silently_accept_hosts, true},
+ {user_interaction, false},
+ {max_random_length_padding, 0}
+ ],
+ Data = gen_data(proplists:get_value(data_size,Config)),
+
+ [connect_measure(Port, Crypto, Mac, Data, Options)
+ || {Crypto,Mac} <- [{ none, none},
+ {'aes128-ctr', 'hmac-sha1'},
+ {'aes256-ctr', 'hmac-sha1'},
+%% {'[email protected]', 'hmac-sha1'},
+ {'aes128-cbc', 'hmac-sha1'},
+ {'3des-cbc', 'hmac-sha1'},
+ {'aes128-ctr', 'hmac-sha2-256'},
+ {'aes128-ctr', 'hmac-sha2-512'}
+ ],
+ crypto_mac_supported(Crypto,Mac)].
+
+
+crypto_mac_supported(none, none) ->
+ true;
+crypto_mac_supported(C, M) ->
+ Algs = ssh:default_algorithms(),
+ [{_,Cs},_] = proplists:get_value(cipher, Algs),
+ [{_,Ms},_] = proplists:get_value(mac, Algs),
+ lists:member(C,Cs) andalso lists:member(M,Ms).
+
+
+gen_data(DataSz) ->
+ Data0 = << <<C>> || _ <- lists:seq(1,DataSz div 256),
+ C <- lists:seq(0,255) >>,
+ Data1 = << <<C>> || C <- lists:seq(0,(DataSz rem 256) - 1) >>,
+ <<Data0/binary, Data1/binary>>.
+
+
+%% connect_measure(Port, Cipher, Mac, Data, Options) ->
+%% report([{value, 1},
+%% {suite, ?MODULE},
+%% {name, mk_name(["Transfer 1M bytes ",Cipher,"/",Mac," [µs]"])}]);
+connect_measure(Port, Cipher, Mac, Data, Options) ->
+ Times =
+ [begin
+ {ok,C} = ssh:connect("localhost", Port, [{preferred_algorithms, [{cipher,[Cipher]},
+ {mac,[Mac]}]}
+ |Options]),
+ {ok,Ch} = ssh_connection:session_channel(C, 10000),
+ success = ssh_connection:subsystem(C, Ch, "/dev/null", 10000),
+ {Time,ok} = timer:tc(?MODULE, send_wait_acc, [C, Ch, Data]),
+ ok = ssh_connection:send_eof(C, Ch),
+ ssh:close(C),
+ Time
+ end || _ <- lists:seq(1,?Nruns)],
+
+ report([{value, median(Times)},
+ {suite, ?MODULE},
+ {name, mk_name(["Transfer 1M bytes ",Cipher,"/",Mac," [µs]"])}]).
+
+send_wait_acc(C, Ch, Data) ->
+ ssh_connection:send(C, Ch, Data),
+ receive
+ {ssh_cm, C, {data, Ch, 0, <<"READY">>}} -> ok
+ end.
+
+
+%%%================================================================
+%%%
+%%% Private
+%%%
+
+%%%----------------------------------------------------------------
+insert_none(L) ->
+ lists:foldl(fun insert_none/2, [], L).
+
+insert_none({T,L}, Acc) when T==cipher ;
+ T==mac ->
+ [{T, [{T1,L1++[none]} || {T1,L1} <- L]} | Acc];
+insert_none(_, Acc) ->
+ Acc.
+
+%%%----------------------------------------------------------------
+mk_name(Name) -> [char(C) || C <- lists:concat(Name)].
+
+char($-) -> $_;
+char(C) -> C.
+
+%%%----------------------------------------------------------------
+preferred_algorithms(KexAlg) ->
+ [{kex, [KexAlg]},
+ {public_key, ['ssh-rsa']},
+ {cipher, ['aes128-ctr']},
+ {mac, ['hmac-sha1']},
+ {compression, [none]}
+ ].
+
+%%%----------------------------------------------------------------
+median(Data) when is_list(Data) ->
+ SortedData = lists:sort(Data),
+ N = length(Data),
+ Median =
+ case N rem 2 of
+ 0 ->
+ MeanOfMiddle = (lists:nth(N div 2, SortedData) +
+ lists:nth(N div 2 + 1, SortedData)) / 2,
+ round(MeanOfMiddle);
+ 1 ->
+ lists:nth(N div 2 + 1, SortedData)
+ end,
+ ct:log("median(~p) = ~p",[SortedData,Median]),
+ Median.
+
+
+report(Data) ->
+ ct:log("EventData = ~p",[Data]),
+ ct_event:notify(#event{name = benchmark_data,
+ data = Data}).
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_dsa b/lib/ssh/test/ssh_bench_SUITE_data/id_dsa
index d306f8b26e..d306f8b26e 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_dsa
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_dsa
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256 b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256
index 4b1eb12eaa..4b1eb12eaa 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256.pub b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256.pub
index a0147e60fa..a0147e60fa 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa256.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa256.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384 b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384
index 4e8aa40959..4e8aa40959 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384.pub b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384.pub
index 41e722e545..41e722e545 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa384.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa384.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521 b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521
index 7196f46e97..7196f46e97 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521.pub b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521.pub
index 8f059120bc..8f059120bc 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_ecdsa521.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_ecdsa521.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/id_rsa b/lib/ssh/test/ssh_bench_SUITE_data/id_rsa
index 9d7e0dd5fb..9d7e0dd5fb 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/id_rsa
+++ b/lib/ssh/test/ssh_bench_SUITE_data/id_rsa
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key
index 51ab6fbd88..51ab6fbd88 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key.pub b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key.pub
index 4dbb1305b0..4dbb1305b0 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_dsa_key.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_dsa_key.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256 b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256
index 2979ea88ed..2979ea88ed 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256.pub b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256.pub
index 85dc419345..85dc419345 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key256.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key256.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384 b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384
index fb1a862ded..fb1a862ded 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384.pub b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384.pub
index 428d5fb7d7..428d5fb7d7 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key384.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key384.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521 b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521
index 3e51ec2ecd..3e51ec2ecd 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521.pub b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521.pub
index 017a29f4da..017a29f4da 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_ecdsa_key521.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_ecdsa_key521.pub
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key
index 79968bdd7d..79968bdd7d 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key
diff --git a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key.pub b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key.pub
index 75d2025c71..75d2025c71 100644
--- a/lib/ssh/test/ssh_benchmark_SUITE_data/ssh_host_rsa_key.pub
+++ b/lib/ssh/test/ssh_bench_SUITE_data/ssh_host_rsa_key.pub
diff --git a/lib/ssh/test/ssh_bench_dev_null.erl b/lib/ssh/test/ssh_bench_dev_null.erl
new file mode 100644
index 0000000000..0e390b7712
--- /dev/null
+++ b/lib/ssh/test/ssh_bench_dev_null.erl
@@ -0,0 +1,58 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2005-2016. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+%%% Description: Example ssh server
+-module(ssh_bench_dev_null).
+-behaviour(ssh_daemon_channel).
+
+-record(state, {
+ cm,
+ chid,
+ n,
+ sum = 0
+ }).
+
+-export([init/1, handle_msg/2, handle_ssh_msg/2, terminate/2]).
+
+init([N]) -> {ok, #state{n=N}}.
+
+handle_msg({ssh_channel_up, ChId, CM}, S) ->
+ {ok, S#state{cm = CM,
+ chid = ChId}}.
+
+
+
+handle_ssh_msg({ssh_cm, CM, {data,ChId,0,Data}}, #state{n=N, sum=Sum0, cm=CM, chid=ChId} = S) ->
+ Sum = Sum0 + size(Data),
+ if Sum == N ->
+ %% Got all
+ ssh_connection:send(CM, ChId, <<"READY">>),
+ {ok, S#state{sum=Sum}};
+ Sum < N ->
+ %% Expects more
+ {ok, S#state{sum=Sum}}
+ end;
+handle_ssh_msg({ssh_cm, _, {exit_signal,ChId,_,_,_}}, S) -> {stop, ChId, S};
+handle_ssh_msg({ssh_cm, _, {exit_status,ChId,_} }, S) -> {stop, ChId, S};
+handle_ssh_msg({ssh_cm, _, _ }, S) -> {ok, S}.
+
+terminate(_, _) -> ok.
diff --git a/lib/ssh/test/ssh_benchmark_SUITE.erl b/lib/ssh/test/ssh_benchmark_SUITE.erl
deleted file mode 100644
index fc90750455..0000000000
--- a/lib/ssh/test/ssh_benchmark_SUITE.erl
+++ /dev/null
@@ -1,571 +0,0 @@
-%%%-------------------------------------------------------------------
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-%%
--module(ssh_benchmark_SUITE).
--compile(export_all).
-
--include_lib("common_test/include/ct_event.hrl").
--include_lib("common_test/include/ct.hrl").
-
--include_lib("ssh/src/ssh.hrl").
--include_lib("ssh/src/ssh_transport.hrl").
--include_lib("ssh/src/ssh_connect.hrl").
--include_lib("ssh/src/ssh_userauth.hrl").
-
-
-suite() -> [{ct_hooks,[{ts_install_cth,[{nodenames,2}]}]},
- {timetrap,{minutes,6}}
- ].
-%%suite() -> [{ct_hooks,[ts_install_cth]}].
-
-all() -> [{group, opensshc_erld}
-%% {group, erlc_opensshd}
- ].
-
-groups() ->
- [{opensshc_erld, [{repeat, 3}], [openssh_client_shell,
- openssh_client_sftp]}
- ].
-
-
-init_per_suite(Config) ->
- catch ssh:stop(),
- try
- report_client_algorithms(),
- ok = ssh:start(),
- {ok,TracerPid} = erlang_trace(),
- [{tracer_pid,TracerPid} | init_sftp_dirs(Config)]
- catch
- C:E ->
- {skip, io_lib:format("Couldn't start ~p:~p",[C,E])}
- end.
-
-end_per_suite(_Config) ->
- catch ssh:stop(),
- ok.
-
-
-
-init_per_group(opensshc_erld, Config) ->
- case ssh_test_lib:ssh_type() of
- openSSH ->
- DataDir = proplists:get_value(data_dir, Config),
- UserDir = proplists:get_value(priv_dir, Config),
- ssh_test_lib:setup_dsa(DataDir, UserDir),
- ssh_test_lib:setup_rsa(DataDir, UserDir),
- ssh_test_lib:setup_ecdsa("256", DataDir, UserDir),
- AlgsD = ssh:default_algorithms(),
- AlgsC = ssh_test_lib:default_algorithms(sshc),
- Common = ssh_test_lib:intersect_bi_dir(
- ssh_test_lib:intersection(AlgsD, AlgsC)),
- ct:pal("~p~n~nErld:~n~p~n~nOpenSSHc:~n~p~n~nCommon:~n~p",
- [inet:gethostname(), AlgsD, AlgsC, Common]),
- [{c_kexs, ssh_test_lib:sshc(kex)},
- {c_ciphers, ssh_test_lib:sshc(cipher)},
- {common_algs, Common}
- | Config];
- _ ->
- {skip, "No OpenSsh client found"}
- end;
-
-init_per_group(erlc_opensshd, _) ->
- {skip, "Group erlc_opensshd not implemented"};
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, _Config) ->
- ok.
-
-
-init_per_testcase(_Func, Conf) ->
- Conf.
-
-end_per_testcase(_Func, _Conf) ->
- ok.
-
-
-init_sftp_dirs(Config) ->
- UserDir = proplists:get_value(priv_dir, Config),
- SrcDir = filename:join(UserDir, "sftp_src"),
- ok = file:make_dir(SrcDir),
- SrcFile = "big_data",
- DstDir = filename:join(UserDir, "sftp_dst"),
- ok = file:make_dir(DstDir),
- N = 100 * 1024*1024,
- ok = file:write_file(filename:join(SrcDir,SrcFile), crypto:strong_rand_bytes(N)),
- [{sftp_src_dir,SrcDir}, {sftp_dst_dir,DstDir}, {src_file,SrcFile}, {sftp_size,N}
- | Config].
-
-%%%================================================================
-openssh_client_shell(Config) ->
- lists:foreach(
- fun(PrefAlgs=[{kex,[Kex]}]) when Kex == 'diffie-hellman-group-exchange-sha256' ->
- lists:foreach(
- fun(Grp) ->
- openssh_client_shell(Config,
- [{preferred_algorithms, PrefAlgs},
- {dh_gex_groups, [Grp]}
- ])
- end, moduli());
- (PrefAlgs) ->
- openssh_client_shell(Config,
- [{preferred_algorithms, PrefAlgs}])
- end, variants(kex,Config) ++ variants(cipher,Config)
- ).
-
-
-openssh_client_shell(Config, Options) ->
- SystemDir = proplists:get_value(data_dir, Config),
- UserDir = proplists:get_value(priv_dir, Config),
- KnownHosts = filename:join(UserDir, "known_hosts"),
-
- {ok, TracerPid} = erlang_trace(),
- {ServerPid, _Host, Port} =
- ssh_test_lib:daemon([{system_dir, SystemDir},
- {failfun, fun ssh_test_lib:failfun/2} |
- Options]),
- ct:sleep(500),
-
- Data = lists:duplicate(100000, $a),
- Cmd = lists:concat(["ssh -p ",Port,
- " -o UserKnownHostsFile=", KnownHosts,
- " -o \"StrictHostKeyChecking no\"",
- " localhost '\"",Data,"\"'."]),
-%% ct:pal("Cmd ="++Cmd),
-
- Parent = self(),
- SlavePid = spawn(fun() ->
- Parent ! {self(),os:cmd(Cmd)}
- end),
- receive
- {SlavePid, _ClientResponse} ->
-%% ct:pal("ClientResponse = ~p",[_ClientResponse]),
- {ok, List} = get_trace_list(TracerPid),
- Times = find_times(List, [accept_to_hello, kex, kex_to_auth, auth, to_prompt]),
- Algs = find_algs(List),
- ct:pal("Algorithms = ~p~n~nTimes = ~p",[Algs,Times]),
- lists:foreach(
- fun({Tag,Value,Unit}) ->
- EventData =
- case Tag of
- {A,B} when A==encrypt ; A==decrypt ->
- [{value, Value},
- {suite, ?MODULE},
- {name, mk_name(["Cipher ",A," ",B," [",Unit,"]"])}
- ];
- kex ->
- KexAlgStr = fmt_alg(Algs#alg.kex, List),
- [{value, Value},
- {suite, ?MODULE},
- {name, mk_name(["Erl server kex ",KexAlgStr," [",Unit,"]"])}
- ];
- _ when is_atom(Tag) ->
- [{value, Value},
- {suite, ?MODULE},
- {name, mk_name(["Erl server ",Tag," [",Unit,"]"])}
- ]
- end,
- ct:pal("ct_event:notify ~p",[EventData]),
- ct_event:notify(#event{name = benchmark_data,
- data = EventData})
- end, Times),
- ssh:stop_daemon(ServerPid),
- ok
- after 60*1000 ->
- ssh:stop_daemon(ServerPid),
- exit(SlavePid, kill),
- {fail, timeout}
- end.
-
-
-%%%================================================================
-openssh_client_sftp(Config) ->
- lists:foreach(
- fun(PrefAlgs) ->
- openssh_client_sftp(Config, [{preferred_algorithms,PrefAlgs}])
- end, variants(cipher,Config)).
-
-
-openssh_client_sftp(Config, Options) ->
- SystemDir = proplists:get_value(data_dir, Config),
- UserDir = proplists:get_value(priv_dir, Config),
- SftpSrcDir = proplists:get_value(sftp_src_dir, Config),
- SrcFile = proplists:get_value(src_file, Config),
- SrcSize = proplists:get_value(sftp_size, Config),
- KnownHosts = filename:join(UserDir, "known_hosts"),
-
- {ok, TracerPid} = erlang_trace(),
- {ServerPid, _Host, Port} =
- ssh_test_lib:daemon([{system_dir, SystemDir},
- {subsystems,[ssh_sftpd:subsystem_spec([%{cwd, SftpSrcDir},
- {root, SftpSrcDir}])]},
- {failfun, fun ssh_test_lib:failfun/2}
- | Options]),
- ct:pal("ServerPid = ~p",[ServerPid]),
- ct:sleep(500),
- Cmd = lists:concat(["sftp",
- " -b -",
- " -P ",Port,
- " -o UserKnownHostsFile=", KnownHosts,
- " -o \"StrictHostKeyChecking no\"",
- " localhost:",SrcFile
- ]),
-%% ct:pal("Cmd = ~p",[Cmd]),
-
- Parent = self(),
- SlavePid = spawn(fun() ->
- Parent ! {self(),os:cmd(Cmd)}
- end),
- receive
- {SlavePid, _ClientResponse} ->
- ct:pal("ClientResponse = ~p~nServerPid = ~p",[_ClientResponse,ServerPid]),
- {ok, List} = get_trace_list(TracerPid),
-%%ct:pal("List=~p",[List]),
- Times = find_times(List, [channel_open_close]),
- Algs = find_algs(List),
- ct:pal("Algorithms = ~p~n~nTimes = ~p",[Algs,Times]),
- lists:foreach(
- fun({{A,B},Value,Unit}) when A==encrypt ; A==decrypt ->
- Data = [{value, Value},
- {suite, ?MODULE},
- {name, mk_name(["Sftp Cipher ",A," ",B," [",Unit,"]"])}
- ],
- ct:pal("sftp ct_event:notify ~p",[Data]),
- ct_event:notify(#event{name = benchmark_data,
- data = Data});
- ({channel_open_close,Value,Unit}) ->
- Cipher = fmt_alg(Algs#alg.encrypt, List),
- Data = [{value, round( (1024*Value) / SrcSize )},
- {suite, ?MODULE},
- {name, mk_name(["Sftp transfer ",Cipher," [",Unit," per kbyte]"])}
- ],
- ct:pal("sftp ct_event:notify ~p",[Data]),
- ct_event:notify(#event{name = benchmark_data,
- data = Data});
- (_) ->
- skip
- end, Times),
- ssh:stop_daemon(ServerPid),
- ok
- after 2*60*1000 ->
- ssh:stop_daemon(ServerPid),
- exit(SlavePid, kill),
- {fail, timeout}
- end.
-
-%%%================================================================
-variants(Tag, Config) ->
- TagType =
- case proplists:get_value(Tag, ssh:default_algorithms()) of
- [{_,_}|_] -> one_way;
- [A|_] when is_atom(A) -> two_way
- end,
- [ [{Tag,tag_value(TagType,Alg)}]
- || Alg <- proplists:get_value(Tag, proplists:get_value(common_algs,Config))
- ].
-
-tag_value(two_way, Alg) -> [Alg];
-tag_value(one_way, Alg) -> [{client2server,[Alg]},
- {server2client,[Alg]}].
-
-%%%----------------------------------------------------------------
-fmt_alg(Alg, List) when is_atom(Alg) ->
- fmt_alg(atom_to_list(Alg), List);
-fmt_alg(Alg = "diffie-hellman-group-exchange-sha" ++ _, List) ->
- try
- integer_to_list(find_gex_size_string(List))
- of
- GexSize -> lists:concat([Alg," ",GexSize])
- catch
- _:_ -> Alg
- end;
-fmt_alg(Alg, _List) ->
- Alg.
-
-%%%----------------------------------------------------------------
-mk_name(Name) -> [char(C) || C <- lists:concat(Name)].
-
-char($-) -> $_;
-char(C) -> C.
-
-%%%----------------------------------------------------------------
-find_times(L, Xs) ->
- [find_time(X,L) || X <- Xs] ++
- function_algs_times_sizes([{ssh_transport,encrypt,2},
- {ssh_transport,decrypt,2},
- {ssh_message,decode,1},
- {ssh_message,encode,1}], L).
-
--record(call, {
- mfa,
- pid,
- t_call,
- t_return,
- args,
- result
- }).
-
-%%%----------------
--define(send(M), fun(C=#call{mfa = {ssh_message,encode,1},
- args = [M]}) ->
- C#call.t_return
- end).
-
--define(recv(M), fun(C=#call{mfa = {ssh_message,decode,1},
- result = M}) ->
- C#call.t_call
- end).
-
-find_time(accept_to_hello, L) ->
- [T0,T1] = find([fun(C=#call{mfa = {ssh_acceptor,handle_connection,5}}) ->
- C#call.t_call
- end,
- ?LINE,
- fun(C=#call{mfa = {ssh_connection_handler,handle_event,4},
- args = [_, {version_exchange,_}, {hello,_}, _]}) ->
- C#call.t_call
- end,
- ?LINE
- ], L, []),
- {accept_to_hello, now2micro_sec(now_diff(T1,T0)), microsec};
-find_time(kex, L) ->
- [T0,T1] = find([fun(C=#call{mfa = {ssh_connection_handler,handle_event,4},
- args = [_, {version_exchange,_}, {hello,_}, _]}) ->
- C#call.t_call
- end,
- ?LINE,
- ?send(#ssh_msg_newkeys{}),
- ?LINE
- ], L, []),
- {kex, now2micro_sec(now_diff(T1,T0)), microsec};
-find_time(kex_to_auth, L) ->
- [T0,T1] = find([?send(#ssh_msg_newkeys{}),
- ?LINE,
- ?recv(#ssh_msg_userauth_request{}),
- ?LINE
- ], L, []),
- {kex_to_auth, now2micro_sec(now_diff(T1,T0)), microsec};
-find_time(auth, L) ->
- [T0,T1] = find([?recv(#ssh_msg_userauth_request{}),
- ?LINE,
- ?send(#ssh_msg_userauth_success{}),
- ?LINE
- ], L, []),
- {auth, now2micro_sec(now_diff(T1,T0)), microsec};
-find_time(to_prompt, L) ->
- [T0,T1] = find([fun(C=#call{mfa = {ssh_acceptor,handle_connection,5}}) ->
- C#call.t_call
- end,
- ?LINE,
- ?recv(#ssh_msg_channel_request{request_type="env"}),
- ?LINE
- ], L, []),
- {to_prompt, now2micro_sec(now_diff(T1,T0)), microsec};
-find_time(channel_open_close, L) ->
- [T0,T1] = find([?recv(#ssh_msg_channel_request{request_type="subsystem"}),
- ?LINE,
- ?send(#ssh_msg_channel_close{}),
- ?LINE
- ], L, []),
- {channel_open_close, now2micro_sec(now_diff(T1,T0)), microsec}.
-
-
-
-find([F,Id|Fs], [C|Cs], Acc) when is_function(F,1) ->
- try
- F(C)
- of
- T -> find(Fs, Cs, [T|Acc])
- catch
- _:_ -> find([F,Id|Fs], Cs, Acc)
- end;
-find([], _, Acc) ->
- lists:reverse(Acc).
-
-
-find_algs(L) ->
- {value, #call{result={ok,Algs}}} =
- lists:keysearch({ssh_transport,select_algorithm,3}, #call.mfa, L),
- Algs.
-
-find_gex_size_string(L) ->
- %% server
- {value, #call{result={ok,{Size, _}}}} =
- lists:keysearch({public_key,dh_gex_group,4}, #call.mfa, L),
- Size.
-
-%%%----------------
-function_algs_times_sizes(EncDecs, L) ->
- Raw = [begin
- {Tag,Size} = function_ats_result(EncDec, C),
- {Tag, Size, now2micro_sec(now_diff(T1,T0))}
- end
- || EncDec <- EncDecs,
- C = #call{mfa = ED,
- % args = Args, %%[S,Data],
- t_call = T0,
- t_return = T1} <- L,
- ED == EncDec
- ],
- [{Alg, round(1024*Time/Size), "microsec per kbyte"} % Microseconds per 1k bytes.
- || {Alg,Size,Time} <- lists:foldl(fun increment/2, [], Raw)].
-
-function_ats_result({ssh_transport,encrypt,2}, #call{args=[S,Data]}) ->
- {{encrypt,S#ssh.encrypt}, binsize(Data)};
-function_ats_result({ssh_transport,decrypt,2}, #call{args=[S,Data]}) ->
- {{decrypt,S#ssh.decrypt}, binsize(Data)};
-function_ats_result({ssh_message,encode,1}, #call{result=Data}) ->
- {encode, size(Data)};
-function_ats_result({ssh_message,decode,1}, #call{args=[Data]}) ->
- {decode, size(Data)}.
-
-binsize(B) when is_binary(B) -> size(B);
-binsize({B1,B2}) when is_binary(B1), is_binary(B2) -> size(B1) + size(B2);
-binsize({B1,B2,_}) when is_binary(B1), is_binary(B2) -> size(B1) + size(B2).
-
-
-
-
-
-increment({Alg,Sz,T}, [{Alg,SumSz,SumT}|Acc]) ->
- [{Alg,SumSz+Sz,SumT+T} | Acc];
-increment(Spec, [X|Acc]) ->
- [X | increment(Spec,Acc)]; % Not so many Alg, 2 or 3
-increment({Alg,Sz,T},[]) ->
- [{Alg,Sz,T}].
-
-%%%----------------------------------------------------------------
-%%%
-%%% API for the traceing
-%%%
-get_trace_list(TracerPid) ->
- MonRef = monitor(process, TracerPid),
- TracerPid ! {get_trace_list,self()},
- receive
- {trace_list,L} ->
- demonitor(MonRef),
- {ok, pair_events(lists:reverse(L))};
- {'DOWN', MonRef, process, TracerPid, Info} ->
- {error, {tracer_down,Info}}
-
- after 3*60*1000 ->
- demonitor(MonRef),
- {error,no_reply}
- end.
-
-erlang_trace() ->
- TracerPid = spawn(fun trace_loop/0),
- 0 = erlang:trace(new, true, [call,timestamp,{tracer,TracerPid}]),
- [init_trace(MFA, tp(MFA))
- || MFA <- [{ssh_acceptor,handle_connection,5},
-%% {ssh_connection_handler,hello,2},
- {ssh_message,encode,1},
- {ssh_message,decode,1},
- {ssh_transport,select_algorithm,3},
- {ssh_transport,encrypt,2},
- {ssh_transport,decrypt,2},
- {ssh_message,encode,1},
- {ssh_message,decode,1},
- {public_key,dh_gex_group,4} % To find dh_gex group size
- ]],
- init_trace({ssh_connection_handler,handle_event,4},
- [{['_', {version_exchange,'_'}, {hello,'_'}, '_'],
- [],
- [return_trace]}]),
- {ok, TracerPid}.
-
-tp({_M,_F,Arity}) ->
- [{lists:duplicate(Arity,'_'), [], [{return_trace}]}].
-
-%%%----------------------------------------------------------------
-init_trace(MFA = {Module,_,_}, TP) ->
- case code:is_loaded(Module) of
- false -> code:load_file(Module);
- _ -> ok
- end,
- erlang:trace_pattern(MFA, TP, [local]).
-
-
-trace_loop() ->
- trace_loop([]).
-
-trace_loop(L) ->
- receive
- {get_trace_list, From} ->
- From ! {trace_list, L},
- trace_loop(L);
- Ev ->
- trace_loop([Ev|L])
- end.
-
-pair_events(L) ->
- pair_events(L, []).
-
-pair_events([{trace_ts,Pid,call,{M,F,Args},TS0} | L], Acc) ->
- Arity = length(Args),
- {ReturnValue,TS1} = find_return(Pid, {M,F,Arity}, L),
- pair_events(L, [#call{mfa = {M,F,Arity},
- pid = Pid,
- t_call = TS0,
- t_return = TS1,
- args = Args,
- result = ReturnValue} | Acc]);
-pair_events([_|L], Acc) ->
- pair_events(L, Acc);
-pair_events([], Acc) ->
- lists:reverse(Acc).
-
-
-find_return(Pid, MFA,
- [{trace_ts, Pid, return_from, MFA, ReturnValue, TS}|_]) ->
- {ReturnValue, TS};
-find_return(Pid, MFA, [_|L]) ->
- find_return(Pid, MFA, L);
-find_return(_, _, []) ->
- {undefined, undefined}.
-
-%%%----------------------------------------------------------------
-report_client_algorithms() ->
- try
- ssh_test_lib:extract_algos( ssh_test_lib:default_algorithms(sshc) )
- of
- ClientAlgs ->
- ct:pal("The client supports:~n~p",[ClientAlgs])
- catch
- Cls:Err ->
- ct:pal("Testing client about algorithms failed:~n~p ~p",[Cls,Err])
- end.
-
-%%%----------------------------------------------------------------
-
-
-now2sec({A,B,C}) -> A*1000000 + B + C/1000000.
-
-now2micro_sec({A,B,C}) -> (A*1000000 + B)*1000000 + C.
-
-now_diff({A1,B1,C1}, {A0,B0,C0}) -> {A1-A0, B1-B0, C1-C0}.
-
-%%%================================================================
-moduli() ->
- [{1023, 5, 16#CF973CD39DC7D62F2C45AAC5180491104C76E0FE5D80A10E6C06AE442F1F373167B0FCBC931F3C157B10A5557008FDE20D68051E6A4DB11CEE0B0749F76D7134B937A59DA998C42BC234A5C1A3CFCD70E624D253D7694076F7B1FD7B8D3427849C9377B3555796ACA58C69DFF542EEEC9859D3ADCE5CC88DF6F7817C9D182EB7},
- {2047, 5, 16#F7693FC11FDDEAA493D3BA36F1FFF9264AA9952209203192A88A697BE9D0E306E306A27430BD87AB9EE9DB4BC78C41950C2EB0E5E4C686E8B1BA6D6A2B1FE91EF40C5EA32C51018323E1D305FE637F35ACABDBFC40AD683F779570A76869EB90015A342B2D1F7C81602688081FCAAA8D623090258D9C5C729C8CDDC0C12CA2D561DD987DB79B6AD7A2A509EBC383BF223FD95BC5A2FCC26FB3F3A0DD3FDC1228E338D3290235A596F9465F7BF490974847E616229A9E60B8F4AA161C52F655843CCCAE8821B40C426B535DE087964778652BBD4EC601C0456AE7128B593FCC64402C891227AE6EE88CC839416FBF462B4852999C646BE0BED7D8CF2BE5E381EF},
- {4095, 2, 16#C8842271626E53546E0C712FA265713F2EE073C20A0723C96B6B182B1EAACC96233D4A199BD0E85F264078A513AD2454F284B8DF543D85019D1E70F2FF54BA43EFBC64AF465C170C3E376F5EC328F98E33E1ED8BED84FA097ABE584152B0E9827ED5CC2B1D4F5ECF2DC46F45C59816D02698EA26F319311E2B6973E83C37021CC8B416AEF653896A1764EE0CEE718A45E8B47CB960BD5907D0E843E8A8E7D4698363C3C3FB3ADC512368B72CAF16510C69052EA2AF51BE00BC8CA04DF1F00A00CC2CA4D74254A1E8738460FD244DDB446CB36554B0A24EEF3710E44DBCF39881E7D3F9AE223388084E7A49A3CB12612AE36416C0EB5628DF1477FEE4A5CF77CDC09AA0E2C989C0B7D1310AFA44B81DA79A65226C7EA510057991EABF9388DC5EA9F52FEA5D3B0872843F50878740794E523E9DC60E0EA1FC8746A7B2AA31FCA89AAA2FA907BED116C69D98F912DD5089BECF28577064225DE96FC214ED1794E7CCE8024F94036D915A123A464C951DA96A5ED7F286F205BEE71BDE2D133FD1891B31178FF25D31611A5B7839F0E68EAF0F8901A571E6917C580F31842A9F19C47E0638483B7947DDCD7864660AC2F8B2C430F1E7FC0F22FA51F96F0499332C5AD3FF9DC7F4332DD5BCCA820CC779B90C0F4C5F0CA52E96FAA187361753FBADC5C80D0492CD80A3EEA5D578772DA9FC1C0E10A0203098AF36D0ED2156BA7321EB},
- {6143, 5, 16#FD9E6B52785CD7BE64D396A599DA4B97CD0BB49183F932A97694D80CA553354DBC26E77B8A0EC002257AADDF6AD27819CE64A06416E4A80B6EA92F28EA8D5B96C774109EEE5816B4B18F84368D1B41864C11AA73D6881675D779B174F6B4E344303F3EFD11BD7DE468467242372FD00908F296F5A2B20E2684F9122D08A46D647B05E298F0BCDAB60468349CCA6DA1B9FEBBC69D256FB9A3F1980F68466364FCEF1C98C1405191A6737A3627BA7F7313A8A18FC0B8521BF3430B1C6805CB44BCEB39904DD30130D24B225B598ED83C5FD757B80189FD9D5C2F9596687C40BAB1C6ED6244944629849D074A4C33FB15DDB3F9760FC59C44BEBB0EC032177147F61789769DAAAE2123CE488F7ECF19BDA051925BA9ED11EAA72DF70C9ECC8F714B4C35728E6679E66A1B56CCAE0FBBD3F9EBF950D4D623ED78E77CC3AD604E91F304EA78CE876F036214BD6F1977BD04C9ADD707D7A3BCCE87AD5D5A11C95E7025B0EA9C649DCB37942A3970A4FB04C284E4DDB4DC90163353B98B1C254FFD28443353F17A87C02E0BDB9F05424CC44C86309F1D73706F039CDAAC3EDC1A64F38FB42707D351DB5360C2680ADC1CC8D1C4AD312ACC904382C26BE33DA0E61429A5940820356ED28586BEB629ED1521D12D25B4DA01926295F3DA504DC9F431B719AC63277BE675E6F6DD4F7499CA11A23744577D653941963E8DAB610F7F226DB52CE5C683F72AEED2B6CE35ED07C29410397A6F7F606477CCC0EDE18CD0D96A7863BC4606193A8799B5AC1EEE6AC5EE36AC3077EC8DAB30EE94434B45B78BC13D96F74D6C4056EAA528CD3C68D308344808819B12F2BFB95A5C1A7DEEE188BF139216DDB7D757D7A50D3C46CE18881D776D617DCFFAA62276045373AA4D9446D7570338F99C0CA8A08851B4F9D388B4C275D3F9B7BA25F235D4329F63F7457C2EB5C68CE2A96D19766F0ED8E19F66DF3C5E29A38795B2F92291BB6EAB6F70A7E89DC9691F28486E9CF87FF11D5DF2E6B030A30B5D476AD59A34EE7262712ED96CEF4A5CAC3F08B3563D44683F746DA094C9CDB34427AF8D8CC2AE1B23C3BEB637},
- {8191, 2, 16#DC61EF13E4F3FC10CC946EEABC33F83EFCB35E0F47E4EC25C1CCBB2C7B502B2EFB0691AA231C8476DD51BA73204E6EA10B1A970FE2CF14AF01E72E1AEA87519A91D00D1499189F94A6CDA9E29C05F11F17FE74A4919A710A2787E180744465DF81C62AA65662FDA46FA6175E8A31E5B29E66DED6701C8FC4217E91D733FE94380F046680967D4CEA7BAC8F3916CDF96AA2C474FAD9650F48403FD0B5B756D34667D36A07767FA33027AE55484D0F701C3CA16632F413A14E4B8645AFAF15B78978C19A7661EDC569BEC72394B1204B166A48FCD5F56BE29840C7794CA6D3440356F15858CDCA9B429C7EA92E17242893FDC8C9C63841A382C32F20CFAB121B4BCAFD7BF9EF07FBF7CDFFECA0CEF3A49C3E2B24FA836F3318435255655E1B281071F62D5E4CD63361299B7828F72936E3FEA9E8044562A6F6ADD5321187C3101E4669C6271598FE1A866C93FE2870A4CEB9254BA32A4719E439317EA42200A335B5CFFA7946A7D0F1BD1A69AA11288B73C71C80B77FE3707CB077DDDEA5CA36A449FAB230C9625A0B12F8275D3FF82F5DA380E7A3F11B6F155FE7E91AC960BD95D9B13F7423AB9B15CC3C4DC34EF296033F009468EA16A721AD659F56C18516025050749ABF05E6D3EBD9778142A530979291F46DAA399A86B7BCDF09CC3E6EEF101419762A306DB45AEFC96C64E83F28338D55905F6A387E0F515E580C3A9B35330E21C32198CDEE3AFB355967A098F635FCA7C49CB4E1E82464B2B390EF1F259E40B9A06235C0273F76284FE6BD534EF3AF7CB01A4A5252B8B94CADC2850B2E56D53F9A31D7C029DF967D0A30C05BC64E119BED6076818FABC8CDD93F3255693E14EFC1A740A5D63A5E847FFE87BAB1DDE0506E1762EA61EFA9F9756151ECCCADD91B98A961A901A2D8B01ABDDD29EC804E8C8D28214BBA26048F924CA66316696E51A49D02FF034D20E44914B1115339CAD3819E0CB1640F0084886FEDDE5E28C29DC48ED30A8C3D789734338F5A9DF42584326E536FD1CF30BC85B8DCBD6120D127C98FE4B3614074F13C2CA4854E6D794156C185C40EB3DA7619CE96ADAF0941BD5499848B034C2B11DFECC0BDFA81C594241F759EF53FC7CDE7F2DE4F23CF81A5A0B7D62E31DABB9198D40307F7824DD130B7D1B80E9B6D322FEEDB5ACE34944F0BFB7D016762A9B2E173BFDD69303766AFBAB45FAB75D05430B4A3515858C4B7F04E23414E4AD03842CB0A20D8FF4B59B7C852BA9A5BE982A8ADA5CB70C36CE2A4D2C31A7015C9F3275E43D192C1B2924424088907A057DA7F2D32A2149922AB2E33F2147D637A3508911CB3FEA5E1AAB4525BACF27B6DD7A3E0AFA978FC3A39DE8882FB22688C3CCC92B6E69ACB0BBF575AB3368E51A2F6A20C414C6F146727CC0045F29061E695D29F7C030CE6929EB3AD11A5CBD0CDEE37347869A3}].
diff --git a/lib/ssh/test/ssh_connection_SUITE.erl b/lib/ssh/test/ssh_connection_SUITE.erl
index 2819a4dbd9..b911cf0e9e 100644
--- a/lib/ssh/test/ssh_connection_SUITE.erl
+++ b/lib/ssh/test/ssh_connection_SUITE.erl
@@ -89,7 +89,7 @@ end_per_suite(Config) ->
%%--------------------------------------------------------------------
init_per_group(openssh, Config) ->
- case gen_tcp:connect("localhost", 22, []) of
+ case ssh_test_lib:gen_tcp_connect("localhost", 22, []) of
{error,econnrefused} ->
{skip,"No openssh deamon"};
{ok, Socket} ->
@@ -126,7 +126,7 @@ simple_exec(Config) when is_list(Config) ->
simple_exec_sock(_Config) ->
- {ok, Sock} = gen_tcp:connect("localhost", ?SSH_DEFAULT_PORT, [{active,false}]),
+ {ok, Sock} = ssh_test_lib:gen_tcp_connect("localhost", ?SSH_DEFAULT_PORT, [{active,false}]),
{ok, ConnectionRef} = ssh:connect(Sock, [{silently_accept_hosts, true},
{user_interaction, false}]),
do_simple_exec(ConnectionRef).
@@ -179,13 +179,13 @@ daemon_sock_not_tcp(_Config) ->
%%--------------------------------------------------------------------
connect_sock_not_passive(_Config) ->
- {ok,Sock} = gen_tcp:connect("localhost", ?SSH_DEFAULT_PORT, []),
+ {ok,Sock} = ssh_test_lib:gen_tcp_connect("localhost", ?SSH_DEFAULT_PORT, []),
{error, not_passive_mode} = ssh:connect(Sock, []),
gen_tcp:close(Sock).
%%--------------------------------------------------------------------
daemon_sock_not_passive(_Config) ->
- {ok,Sock} = gen_tcp:connect("localhost", ?SSH_DEFAULT_PORT, []),
+ {ok,Sock} = ssh_test_lib:gen_tcp_connect("localhost", ?SSH_DEFAULT_PORT, []),
{error, not_passive_mode} = ssh:daemon(Sock),
gen_tcp:close(Sock).
@@ -585,12 +585,13 @@ start_shell_sock_exec_fun(Config) when is_list(Config) ->
UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
file:make_dir(UserDir),
SysDir = proplists:get_value(data_dir, Config),
- {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "morot"},
- {exec, fun ssh_exec/1}]),
+ {Pid, HostD, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {user_dir, UserDir},
+ {password, "morot"},
+ {exec, fun ssh_exec/1}]),
+ Host = ssh_test_lib:ntoa(ssh_test_lib:mangle_connect_address(HostD)),
- {ok, Sock} = gen_tcp:connect(Host, Port, [{active,false}]),
+ {ok, Sock} = ssh_test_lib:gen_tcp_connect(Host, Port, [{active,false}]),
{ok,ConnectionRef} = ssh:connect(Sock, [{silently_accept_hosts, true},
{user, "foo"},
{password, "morot"},
@@ -623,7 +624,7 @@ start_shell_sock_daemon_exec(Config) ->
{ok,{_IP,Port}} = inet:sockname(Sl), % _IP is likely to be {0,0,0,0}. Win don't like...
spawn_link(fun() ->
- {ok,Ss} = gen_tcp:connect("localhost", Port, [{active,false}]),
+ {ok,Ss} = ssh_test_lib:gen_tcp_connect("localhost", Port, [{active,false}]),
{ok, _Pid} = ssh:daemon(Ss, [{system_dir, SysDir},
{user_dir, UserDir},
{password, "morot"},
@@ -658,10 +659,10 @@ gracefull_invalid_version(Config) when is_list(Config) ->
SysDir = proplists:get_value(data_dir, Config),
{_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "morot"}]),
+ {user_dir, UserDir},
+ {password, "morot"}]),
- {ok, S} = gen_tcp:connect(Host, Port, []),
+ {ok, S} = ssh_test_lib:gen_tcp_connect(Host, Port, []),
ok = gen_tcp:send(S, ["SSH-8.-1","\r\n"]),
receive
Verstring ->
@@ -680,10 +681,10 @@ gracefull_invalid_start(Config) when is_list(Config) ->
file:make_dir(UserDir),
SysDir = proplists:get_value(data_dir, Config),
{_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "morot"}]),
+ {user_dir, UserDir},
+ {password, "morot"}]),
- {ok, S} = gen_tcp:connect(Host, Port, []),
+ {ok, S} = ssh_test_lib:gen_tcp_connect(Host, Port, []),
ok = gen_tcp:send(S, ["foobar","\r\n"]),
receive
Verstring ->
@@ -702,10 +703,10 @@ gracefull_invalid_long_start(Config) when is_list(Config) ->
file:make_dir(UserDir),
SysDir = proplists:get_value(data_dir, Config),
{_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "morot"}]),
+ {user_dir, UserDir},
+ {password, "morot"}]),
- {ok, S} = gen_tcp:connect(Host, Port, []),
+ {ok, S} = ssh_test_lib:gen_tcp_connect(Host, Port, []),
ok = gen_tcp:send(S, [lists:duplicate(257, $a), "\r\n"]),
receive
Verstring ->
@@ -725,10 +726,10 @@ gracefull_invalid_long_start_no_nl(Config) when is_list(Config) ->
file:make_dir(UserDir),
SysDir = proplists:get_value(data_dir, Config),
{_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "morot"}]),
+ {user_dir, UserDir},
+ {password, "morot"}]),
- {ok, S} = gen_tcp:connect(Host, Port, []),
+ {ok, S} = ssh_test_lib:gen_tcp_connect(Host, Port, []),
ok = gen_tcp:send(S, [lists:duplicate(257, $a), "\r\n"]),
receive
Verstring ->
@@ -779,22 +780,21 @@ stop_listener(Config) when is_list(Config) ->
ct:fail("Exec Timeout")
end,
- {ok, HostAddr} = inet:getaddr(Host, inet),
- case ssh_test_lib:daemon(HostAddr, Port, [{system_dir, SysDir},
- {user_dir, UserDir},
- {password, "potatis"},
- {exec, fun ssh_exec/1}]) of
- {Pid1, HostAddr, Port} ->
+ case ssh_test_lib:daemon(Port, [{system_dir, SysDir},
+ {user_dir, UserDir},
+ {password, "potatis"},
+ {exec, fun ssh_exec/1}]) of
+ {Pid1, Host, Port} ->
ConnectionRef1 = ssh_test_lib:connect(Host, Port, [{silently_accept_hosts, true},
{user, "foo"},
{password, "potatis"},
{user_interaction, true},
{user_dir, UserDir}]),
{error, _} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
- {user, "foo"},
- {password, "morot"},
- {user_interaction, true},
- {user_dir, UserDir}]),
+ {user, "foo"},
+ {password, "morot"},
+ {user_interaction, true},
+ {user_dir, UserDir}]),
ssh:close(ConnectionRef0),
ssh:close(ConnectionRef1),
ssh:stop_daemon(Pid0),
diff --git a/lib/ssh/test/ssh_options_SUITE.erl b/lib/ssh/test/ssh_options_SUITE.erl
index 758c20e2b8..344a042d79 100644
--- a/lib/ssh/test/ssh_options_SUITE.erl
+++ b/lib/ssh/test/ssh_options_SUITE.erl
@@ -868,13 +868,13 @@ really_do_hostkey_fingerprint_check(Config, HashAlg) ->
ct:log("Fingerprints(~p) = ~p",[HashAlg,FPs]),
%% Start daemon with the public keys that we got fingerprints from
- {Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
+ {Pid, Host0, Port} = ssh_test_lib:daemon([{system_dir, SysDir},
{user_dir, UserDirServer},
{password, "morot"}]),
-
+ Host = ssh_test_lib:ntoa(Host0),
FP_check_fun = fun(PeerName, FP) ->
- ct:pal("PeerName = ~p, FP = ~p",[PeerName,FP]),
- HostCheck = (Host == PeerName),
+ ct:log("PeerName = ~p, FP = ~p",[PeerName,FP]),
+ HostCheck = ssh_test_lib:match_ip(Host, PeerName),
FPCheck =
if is_atom(HashAlg) -> lists:member(FP, FPs);
is_list(HashAlg) -> lists:all(fun(FP1) -> lists:member(FP1,FPs) end,
@@ -1052,20 +1052,20 @@ id_string_random_client(Config) ->
%%--------------------------------------------------------------------
id_string_no_opt_server(Config) ->
{_Server, Host, Port} = ssh_test_lib:std_daemon(Config, []),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
+ {ok,S1}=ssh_test_lib:gen_tcp_connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-Erlang/"++Vsn} = gen_tcp:recv(S1, 0, 2000),
true = expected_ssh_vsn(Vsn).
%%--------------------------------------------------------------------
id_string_own_string_server(Config) ->
{_Server, Host, Port} = ssh_test_lib:std_daemon(Config, [{id_string,"Olle"}]),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
+ {ok,S1}=ssh_test_lib:gen_tcp_connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-Olle\r\n"} = gen_tcp:recv(S1, 0, 2000).
%%--------------------------------------------------------------------
id_string_random_server(Config) ->
{_Server, Host, Port} = ssh_test_lib:std_daemon(Config, [{id_string,random}]),
- {ok,S1}=gen_tcp:connect(Host,Port,[{active,false},{packet,line}]),
+ {ok,S1}=ssh_test_lib:gen_tcp_connect(Host,Port,[{active,false},{packet,line}]),
{ok,"SSH-2.0-"++Rnd} = gen_tcp:recv(S1, 0, 2000),
case Rnd of
"Erlang"++_ -> ct:log("Id=~p",[Rnd]),
@@ -1086,11 +1086,11 @@ ssh_connect_negtimeout(Config, Parallel) ->
ct:log("Parallel: ~p",[Parallel]),
{_Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},{user_dir, UserDir},
- {parallel_login, Parallel},
- {negotiation_timeout, NegTimeOut},
- {failfun, fun ssh_test_lib:failfun/2}]),
-
- {ok,Socket} = gen_tcp:connect(Host, Port, []),
+ {parallel_login, Parallel},
+ {negotiation_timeout, NegTimeOut},
+ {failfun, fun ssh_test_lib:failfun/2}]),
+
+ {ok,Socket} = ssh_test_lib:gen_tcp_connect(Host, Port, []),
Factor = 2,
ct:log("And now sleeping ~p*NegTimeOut (~p ms)...", [Factor, round(Factor * NegTimeOut)]),
diff --git a/lib/ssh/test/ssh_relay.erl b/lib/ssh/test/ssh_relay.erl
index 28000fbb97..1e3810e9d4 100644
--- a/lib/ssh/test/ssh_relay.erl
+++ b/lib/ssh/test/ssh_relay.erl
@@ -131,7 +131,8 @@ init([ListenAddr, ListenPort, PeerAddr, PeerPort | _Options]) ->
S = #state{local_addr = ListenAddr,
local_port = ListenPort,
lpid = LPid,
- peer_addr = PeerAddr,
+ peer_addr = ssh_test_lib:ntoa(
+ ssh_test_lib:mangle_connect_address(PeerAddr)),
peer_port = PeerPort
},
{ok, S};
diff --git a/lib/ssh/test/ssh_sftp_SUITE.erl b/lib/ssh/test/ssh_sftp_SUITE.erl
index acf76157a2..7efeb3a0ad 100644
--- a/lib/ssh/test/ssh_sftp_SUITE.erl
+++ b/lib/ssh/test/ssh_sftp_SUITE.erl
@@ -660,7 +660,7 @@ start_channel_sock(Config) ->
{Host,Port} = proplists:get_value(peer, Config),
%% Get a tcp socket
- {ok, Sock} = gen_tcp:connect(Host, Port, [{active,false}]),
+ {ok, Sock} = ssh_test_lib:gen_tcp_connect(Host, Port, [{active,false}]),
%% and open one channel on one new Connection
{ok, ChPid1, Conn} = ssh_sftp:start_channel(Sock, Opts),
diff --git a/lib/ssh/test/ssh_sftpd_SUITE.erl b/lib/ssh/test/ssh_sftpd_SUITE.erl
index b167f98ac8..379c0bcb0a 100644
--- a/lib/ssh/test/ssh_sftpd_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_SUITE.erl
@@ -151,8 +151,8 @@ init_per_testcase(TestCase, Config) ->
SubSystems = [ssh_sftpd:subsystem_spec([])],
ssh:daemon(0, [{subsystems, SubSystems}|Options])
end,
- {ok,Dinf} = ssh:daemon_info(Sftpd),
- Port = proplists:get_value(port, Dinf),
+
+ Port = ssh_test_lib:daemon_port(Sftpd),
Cm = ssh_test_lib:connect(Port,
[{user_dir, ClientUserDir},
@@ -187,7 +187,7 @@ init_per_testcase(TestCase, Config) ->
[{sftp, {Cm, Channel}}, {sftpd, Sftpd }| Config].
end_per_testcase(_TestCase, Config) ->
- ssh_sftpd:stop(proplists:get_value(sftpd, Config)),
+ catch ssh:stop_daemon(proplists:get_value(sftpd, Config)),
{Cm, Channel} = proplists:get_value(sftp, Config),
ssh_connection:close(Cm, Channel),
ssh:close(Cm),
@@ -705,10 +705,10 @@ try_access(Path, Cm, Channel, ReqId) ->
{ok, <<?SSH_FXP_STATUS, ?UINT32(ReqId), ?UINT32(Code), Rest/binary>>, <<>>} ->
case Code of
?SSH_FX_FILE_IS_A_DIRECTORY ->
- ct:pal("Got the expected SSH_FX_FILE_IS_A_DIRECTORY status",[]),
+ ct:log("Got the expected SSH_FX_FILE_IS_A_DIRECTORY status",[]),
ok;
?SSH_FX_FAILURE ->
- ct:pal("Got the expected SSH_FX_FAILURE status",[]),
+ ct:log("Got the expected SSH_FX_FAILURE status",[]),
ok;
_ ->
case Rest of
diff --git a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
index b4d7eadfa4..9b5d6b5fae 100644
--- a/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
+++ b/lib/ssh/test/ssh_sftpd_erlclient_SUITE.erl
@@ -138,7 +138,7 @@ init_per_testcase(TestCase, Config) ->
[{port, Port}, {sftp, {ChannelPid, Connection}}, {sftpd, Sftpd} | NewConfig].
end_per_testcase(_TestCase, Config) ->
- catch ssh_sftpd:stop(proplists:get_value(sftpd, Config)),
+ catch ssh:stop_daemon(proplists:get_value(sftpd, Config)),
{Sftp, Connection} = proplists:get_value(sftp, Config),
catch ssh_sftp:stop_channel(Sftp),
catch ssh:close(Connection),
diff --git a/lib/ssh/test/ssh_sup_SUITE.erl b/lib/ssh/test/ssh_sup_SUITE.erl
index ff53e1c4c6..dd7c4b1473 100644
--- a/lib/ssh/test/ssh_sup_SUITE.erl
+++ b/lib/ssh/test/ssh_sup_SUITE.erl
@@ -41,7 +41,8 @@ suite() ->
{timetrap,{seconds,100}}].
all() ->
- [default_tree, sshc_subtree, sshd_subtree, sshd_subtree_profile].
+ [default_tree, sshc_subtree, sshd_subtree, sshd_subtree_profile,
+ killed_acceptor_restarts].
groups() ->
[].
@@ -100,6 +101,7 @@ default_tree(Config) when is_list(Config) ->
?wait_match([], supervisor:which_children(sshc_sup)),
?wait_match([], supervisor:which_children(sshd_sup)).
+%%-------------------------------------------------------------------------
sshc_subtree() ->
[{doc, "Make sure the sshc subtree is correct"}].
sshc_subtree(Config) when is_list(Config) ->
@@ -128,27 +130,31 @@ sshc_subtree(Config) when is_list(Config) ->
ssh:close(Pid2),
?wait_match([], supervisor:which_children(sshc_sup)).
+%%-------------------------------------------------------------------------
sshd_subtree() ->
[{doc, "Make sure the sshd subtree is correct"}].
sshd_subtree(Config) when is_list(Config) ->
HostIP = proplists:get_value(host_ip, Config),
Port = proplists:get_value(port, Config),
SystemDir = proplists:get_value(data_dir, Config),
- ssh:daemon(HostIP, Port, [{system_dir, SystemDir},
- {failfun, fun ssh_test_lib:failfun/2},
- {user_passwords,
- [{?USER, ?PASSWD}]}]),
+ {ok,Daemon} = ssh:daemon(HostIP, Port, [{system_dir, SystemDir},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {user_passwords,
+ [{?USER, ?PASSWD}]}]),
- ?wait_match([{{server,ssh_system_sup, HostIP, Port, ?DEFAULT_PROFILE},
+ ct:log("Expect HostIP=~p, Port=~p, Daemon=~p",[HostIP,Port,Daemon]),
+ ?wait_match([{{server,ssh_system_sup, ListenIP, Port, ?DEFAULT_PROFILE},
Daemon, supervisor,
[ssh_system_sup]}],
supervisor:which_children(sshd_sup),
- Daemon),
+ [ListenIP,Daemon]),
+ true = ssh_test_lib:match_ip(HostIP, ListenIP),
check_sshd_system_tree(Daemon, Config),
ssh:stop_daemon(HostIP, Port),
ct:sleep(?WAIT_FOR_SHUTDOWN),
?wait_match([], supervisor:which_children(sshd_sup)).
+%%-------------------------------------------------------------------------
sshd_subtree_profile() ->
[{doc, "Make sure the sshd subtree using profile option is correct"}].
sshd_subtree_profile(Config) when is_list(Config) ->
@@ -157,34 +163,105 @@ sshd_subtree_profile(Config) when is_list(Config) ->
Profile = proplists:get_value(profile, Config),
SystemDir = proplists:get_value(data_dir, Config),
- {ok, _} = ssh:daemon(HostIP, Port, [{system_dir, SystemDir},
- {failfun, fun ssh_test_lib:failfun/2},
- {user_passwords,
- [{?USER, ?PASSWD}]},
- {profile, Profile}]),
- ?wait_match([{{server,ssh_system_sup, HostIP,Port,Profile},
+ {ok, Daemon} = ssh:daemon(HostIP, Port, [{system_dir, SystemDir},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {user_passwords,
+ [{?USER, ?PASSWD}]},
+ {profile, Profile}]),
+ ct:log("Expect HostIP=~p, Port=~p, Profile=~p, Daemon=~p",[HostIP,Port,Profile,Daemon]),
+ ?wait_match([{{server,ssh_system_sup, ListenIP,Port,Profile},
Daemon, supervisor,
[ssh_system_sup]}],
supervisor:which_children(sshd_sup),
- Daemon),
+ [ListenIP,Daemon]),
+ true = ssh_test_lib:match_ip(HostIP, ListenIP),
check_sshd_system_tree(Daemon, Config),
ssh:stop_daemon(HostIP, Port, Profile),
ct:sleep(?WAIT_FOR_SHUTDOWN),
?wait_match([], supervisor:which_children(sshd_sup)).
+%%-------------------------------------------------------------------------
+killed_acceptor_restarts(Config) ->
+ Profile = proplists:get_value(profile, Config),
+ SystemDir = proplists:get_value(data_dir, Config),
+ UserDir = proplists:get_value(userdir, Config),
+ {ok, DaemonPid} = ssh:daemon(0, [{system_dir, SystemDir},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {user_passwords, [{?USER, ?PASSWD}]},
+ {profile, Profile}]),
+
+ {ok, DaemonPid2} = ssh:daemon(0, [{system_dir, SystemDir},
+ {failfun, fun ssh_test_lib:failfun/2},
+ {user_passwords, [{?USER, ?PASSWD}]},
+ {profile, Profile}]),
+
+ Port = ssh_test_lib:daemon_port(DaemonPid),
+ Port2 = ssh_test_lib:daemon_port(DaemonPid2),
+ true = (Port /= Port2),
+
+ ct:pal("~s",[lists:flatten(ssh_info:string())]),
+
+ {ok,[{AccPid,ListenAddr,Port}]} = acceptor_pid(DaemonPid),
+ {ok,[{AccPid2,ListenAddr,Port2}]} = acceptor_pid(DaemonPid2),
+
+ true = (AccPid /= AccPid2),
+
+ %% Connect first client and check it is alive:
+ {ok,C1} = ssh:connect("localhost", Port, [{silently_accept_hosts, true},
+ {user_interaction, false},
+ {user, ?USER},
+ {password, ?PASSWD},
+ {user_dir, UserDir}]),
+ [{client_version,_}] = ssh:connection_info(C1,[client_version]),
+
+ %% Make acceptor restart:
+ exit(AccPid, kill),
+ %% Check it is a new acceptor:
+ {ok,[{AccPid1,ListenAddr,Port}]} = acceptor_pid(DaemonPid),
+ true = (AccPid /= AccPid1),
+ true = (AccPid2 /= AccPid1),
+
+ %% Connect second client and check it is alive:
+ {ok,C2} = ssh:connect("localhost", Port, [{silently_accept_hosts, true},
+ {user_interaction, false},
+ {user, ?USER},
+ {password, ?PASSWD},
+ {user_dir, UserDir}]),
+ [{client_version,_}] = ssh:connection_info(C2,[client_version]),
+
+ ct:pal("~s",[lists:flatten(ssh_info:string())]),
+
+ %% Check first client is still alive:
+ [{client_version,_}] = ssh:connection_info(C1,[client_version]),
+
+ ok = ssh:stop_daemon(DaemonPid2),
+ timer:sleep(15000),
+ [{client_version,_}] = ssh:connection_info(C1,[client_version]),
+ [{client_version,_}] = ssh:connection_info(C2,[client_version]),
+
+ ok = ssh:stop_daemon(DaemonPid),
+ timer:sleep(15000),
+ {error,closed} = ssh:connection_info(C1,[client_version]),
+ {error,closed} = ssh:connection_info(C2,[client_version]).
+
+%%-------------------------------------------------------------------------
+%% Help functions
+%%-------------------------------------------------------------------------
check_sshd_system_tree(Daemon, Config) ->
Host = proplists:get_value(host, Config),
Port = proplists:get_value(port, Config),
UserDir = proplists:get_value(userdir, Config),
{ok, Client} = ssh:connect(Host, Port, [{silently_accept_hosts, true},
- {user_interaction, false},
- {user, ?USER}, {password, ?PASSWD},{user_dir, UserDir}]),
+ {user_interaction, false},
+ {user, ?USER},
+ {password, ?PASSWD},
+ {user_dir, UserDir}]),
?wait_match([{_,SubSysSup, supervisor,[ssh_subsystem_sup]},
{{ssh_acceptor_sup,_,_,_}, AccSup, supervisor,[ssh_acceptor_sup]}],
supervisor:which_children(Daemon),
- [SubSysSup,AccSup]),
+ [SubSysSup,AccSup]),
?wait_match([{{server,ssh_connection_sup, _,_},
ConnectionSup, supervisor,
@@ -208,4 +285,33 @@ check_sshd_system_tree(Daemon, Config) ->
?wait_match([{_, _,worker,[ssh_channel]}],
supervisor:which_children(ChannelSup)),
ssh:close(Client).
-
+
+acceptor_pid(DaemonPid) ->
+ Parent = self(),
+ Pid = spawn(fun() ->
+ Parent ! {self(), supsearch,
+ [{AccPid,ListenAddr,Port}
+
+ || {{server,ssh_system_sup,ListenAddr,Port,NS},
+ DPid,supervisor,
+ [ssh_system_sup]} <- supervisor:which_children(sshd_sup),
+ DPid == DaemonPid,
+
+ {{ssh_acceptor_sup,L1,P1,NS1},
+ AccSupPid,supervisor,
+ [ssh_acceptor_sup]} <- supervisor:which_children(DaemonPid),
+ L1 == ListenAddr,
+ P1 == Port,
+ NS1 == NS1,
+
+ {{ssh_acceptor_sup,L2,P2,NS2},
+ AccPid,worker,
+ [ssh_acceptor]} <- supervisor:which_children(AccSupPid),
+ L2 == ListenAddr,
+ P2 == Port,
+ NS2 == NS]}
+ end),
+ receive {Pid, supsearch, L} -> {ok,L}
+ after 2000 -> timeout
+ end.
+
diff --git a/lib/ssh/test/ssh_test_lib.erl b/lib/ssh/test/ssh_test_lib.erl
index 1673f52821..6186d44890 100644
--- a/lib/ssh/test/ssh_test_lib.erl
+++ b/lib/ssh/test/ssh_test_lib.erl
@@ -32,15 +32,18 @@
-define(TIMEOUT, 50000).
+%%%----------------------------------------------------------------
connect(Port, Options) when is_integer(Port) ->
connect(hostname(), Port, Options).
connect(any, Port, Options) ->
connect(hostname(), Port, Options);
connect(Host, Port, Options) ->
+ ct:log("~p:~p Calling ssh:connect(~p, ~p, ~p)",[?MODULE,?LINE,Host, Port, Options]),
{ok, ConnectionRef} = ssh:connect(Host, Port, Options),
ConnectionRef.
+%%%----------------------------------------------------------------
daemon(Options) ->
daemon(any, 0, Options).
@@ -53,23 +56,57 @@ daemon(Host, Options) ->
daemon(Host, Port, Options) ->
ct:log("~p:~p Calling ssh:daemon(~p, ~p, ~p)",[?MODULE,?LINE,Host,Port,Options]),
case ssh:daemon(Host, Port, Options) of
- {ok, Pid} when Host == any ->
- ct:log("ssh:daemon ok (1)",[]),
- {Pid, hostname(), daemon_port(Port,Pid)};
{ok, Pid} ->
- ct:log("ssh:daemon ok (2)",[]),
- {Pid, Host, daemon_port(Port,Pid)};
+ {ok,L} = ssh:daemon_info(Pid),
+ ListenPort = proplists:get_value(port, L),
+ ListenIP = proplists:get_value(ip, L),
+ {Pid, ListenIP, ListenPort};
Error ->
ct:log("ssh:daemon error ~p",[Error]),
Error
end.
+%%%----------------------------------------------------------------
+daemon_port(Pid) -> daemon_port(0, Pid).
+
+
daemon_port(0, Pid) -> {ok,Dinf} = ssh:daemon_info(Pid),
proplists:get_value(port, Dinf);
daemon_port(Port, _) -> Port.
-
+%%%----------------------------------------------------------------
+gen_tcp_connect(Host0, Port, Options) ->
+ Host = ssh_test_lib:ntoa(ssh_test_lib:mangle_connect_address(Host0)),
+ ct:log("~p:~p gen_tcp:connect(~p, ~p, ~p)~nHost0 = ~p",
+ [?MODULE,?LINE, Host, Port, Options, Host0]),
+ Result = gen_tcp:connect(Host, Port, Options),
+ ct:log("~p:~p Result = ~p", [?MODULE,?LINE, Result]),
+ Result.
+
+%%%----------------------------------------------------------------
+open_sshc(Host0, Port, OptStr) ->
+ open_sshc(Host0, Port, OptStr, "").
+open_sshc(Host0, Port, OptStr, ExecStr) ->
+ Cmd = open_sshc_cmd(Host0, Port, OptStr, ExecStr),
+ Result = os:cmd(Cmd),
+ ct:log("~p:~p Result = ~p", [?MODULE,?LINE, Result]),
+ Result.
+
+
+open_sshc_cmd(Host, Port, OptStr) ->
+ open_sshc_cmd(Host, Port, OptStr, "").
+
+open_sshc_cmd(Host0, Port, OptStr, ExecStr) ->
+ Host = ssh_test_lib:ntoa(ssh_test_lib:mangle_connect_address(Host0)),
+ Cmd = lists:flatten(["ssh -p ", integer_to_list(Port),
+ " ", OptStr,
+ " ", Host,
+ " ", ExecStr]),
+ ct:log("~p:~p OpenSSH Cmd = ~p", [?MODULE,?LINE, Cmd]),
+ Cmd.
+
+%%%----------------------------------------------------------------
std_daemon(Config, ExtraOpts) ->
PrivDir = proplists:get_value(priv_dir, Config),
UserDir = filename:join(PrivDir, nopubkey), % to make sure we don't use public-key-auth
@@ -85,6 +122,7 @@ std_daemon1(Config, ExtraOpts) ->
{failfun, fun ssh_test_lib:failfun/2}
| ExtraOpts]).
+%%%----------------------------------------------------------------
std_connect(Config, Host, Port, ExtraOpts) ->
UserDir = proplists:get_value(priv_dir, Config),
_ConnectionRef =
@@ -95,6 +133,7 @@ std_connect(Config, Host, Port, ExtraOpts) ->
{user_interaction, false}
| ExtraOpts]).
+%%%----------------------------------------------------------------
std_simple_sftp(Host, Port, Config) ->
std_simple_sftp(Host, Port, Config, []).
@@ -109,6 +148,7 @@ std_simple_sftp(Host, Port, Config, Opts) ->
ok = ssh:close(ConnectionRef),
Data == ReadData.
+%%%----------------------------------------------------------------
std_simple_exec(Host, Port, Config) ->
std_simple_exec(Host, Port, Config, []).
@@ -135,6 +175,7 @@ std_simple_exec(Host, Port, Config, Opts) ->
ct:fail(ExecResult)
end.
+%%%----------------------------------------------------------------
start_shell(Port, IOServer) ->
start_shell(Port, IOServer, []).
@@ -149,6 +190,7 @@ start_shell(Port, IOServer, ExtraOptions) ->
end).
+%%%----------------------------------------------------------------
start_io_server() ->
spawn_link(?MODULE, init_io_server, [self()]).
@@ -207,8 +249,7 @@ reply(TestCase, Result) ->
%%ct:log("reply ~p sending ~p ! ~p",[self(), TestCase, Result]),
TestCase ! Result.
-
-
+%%%----------------------------------------------------------------
rcv_expected(Expect, SshPort, Timeout) ->
receive
{SshPort, Recvd} when is_function(Expect) ->
@@ -862,3 +903,73 @@ create_random_dir(Config) ->
%% The likelyhood of always generating an existing file name is low
create_random_dir(Config)
end.
+
+%%%----------------------------------------------------------------
+match_ip(A, B) ->
+ R = match_ip0(A,B) orelse match_ip0(B,A),
+ ct:log("match_ip(~p, ~p) -> ~p",[A, B, R]),
+ R.
+
+match_ip0(A, A) ->
+ true;
+match_ip0(any, _) ->
+ true;
+match_ip0(A, B) ->
+ case match_ip1(A, B) of
+ true ->
+ true;
+ false when is_list(A) ->
+ case inet:parse_address(A) of
+ {ok,IPa} -> match_ip0(IPa, B);
+ _ -> false
+ end;
+ false when is_list(B) ->
+ case inet:parse_address(B) of
+ {ok,IPb} -> match_ip0(A, IPb);
+ _ -> false
+ end;
+ false ->
+ false
+ end.
+
+match_ip1(any, _) -> true;
+match_ip1(loopback, {127,_,_,_}) -> true;
+match_ip1({0,0,0,0}, {127,_,_,_}) -> true;
+match_ip1(loopback, {0,0,0,0,0,0,0,1}) -> true;
+match_ip1({0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,1}) -> true;
+match_ip1(_, _) -> false.
+
+%%%----------------------------------------------------------------
+mangle_connect_address(A) ->
+ mangle_connect_address(A, []).
+
+mangle_connect_address(A, SockOpts) ->
+ mangle_connect_address1(A, proplists:get_value(inet6,SockOpts,false)).
+
+loopback(true) -> {0,0,0,0,0,0,0,1};
+loopback(false) -> {127,0,0,1}.
+
+mangle_connect_address1( loopback, V6flg) -> loopback(V6flg);
+mangle_connect_address1( any, V6flg) -> loopback(V6flg);
+mangle_connect_address1({0,0,0,0}, _) -> loopback(false);
+mangle_connect_address1({0,0,0,0,0,0,0,0}, _) -> loopback(true);
+mangle_connect_address1( IP, _) when is_tuple(IP) -> IP;
+mangle_connect_address1(A, _) ->
+ case catch inet:parse_address(A) of
+ {ok, {0,0,0,0}} -> loopback(false);
+ {ok, {0,0,0,0,0,0,0,0}} -> loopback(true);
+ _ -> A
+ end.
+
+%%%----------------------------------------------------------------
+ntoa(A) ->
+ try inet:ntoa(A)
+ of
+ {error,_} when is_atom(A) -> atom_to_list(A);
+ {error,_} when is_list(A) -> A;
+ S when is_list(S) -> S
+ catch
+ _:_ when is_atom(A) -> atom_to_list(A);
+ _:_ when is_list(A) -> A
+ end.
+
diff --git a/lib/ssh/test/ssh_to_openssh_SUITE.erl b/lib/ssh/test/ssh_to_openssh_SUITE.erl
index 687e6efaf3..35e3ee3edf 100644
--- a/lib/ssh/test/ssh_to_openssh_SUITE.erl
+++ b/lib/ssh/test/ssh_to_openssh_SUITE.erl
@@ -333,7 +333,7 @@ erlang_client_openssh_server_publickey_rsa(Config) when is_list(Config) ->
[{_,_, not_encrypted}] ->
ConnectionRef =
ssh_test_lib:connect(?SSH_DEFAULT_PORT,
- [{public_key_alg, ssh_rsa},
+ [{pref_public_key_algs, ['ssh-rsa','ssh-dss']},
{user_interaction, false},
silently_accept_hosts]),
{ok, Channel} =
@@ -354,7 +354,7 @@ erlang_client_openssh_server_publickey_dsa() ->
erlang_client_openssh_server_publickey_dsa(Config) when is_list(Config) ->
ConnectionRef =
ssh_test_lib:connect(?SSH_DEFAULT_PORT,
- [{public_key_alg, ssh_dsa},
+ [{pref_public_key_algs, ['ssh-dss','ssh-rsa']},
{user_interaction, false},
silently_accept_hosts]),
{ok, Channel} =
@@ -376,18 +376,18 @@ erlang_server_openssh_client_public_key_rsa(Config) when is_list(Config) ->
erlang_server_openssh_client_public_key_X(Config, ssh_rsa).
-erlang_server_openssh_client_public_key_X(Config, PubKeyAlg) ->
+erlang_server_openssh_client_public_key_X(Config, _PubKeyAlg) ->
SystemDir = proplists:get_value(data_dir, Config),
PrivDir = proplists:get_value(priv_dir, Config),
KnownHosts = filename:join(PrivDir, "known_hosts"),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
{failfun, fun ssh_test_lib:failfun/2}]),
-
ct:sleep(500),
- Cmd = "ssh -p " ++ integer_to_list(Port) ++
- " -o UserKnownHostsFile=" ++ KnownHosts ++
- " " ++ Host ++ " 1+1.",
+ Cmd = ssh_test_lib:open_sshc_cmd(Host, Port,
+ [" -o UserKnownHostsFile=", KnownHosts,
+ " -o StrictHostKeyChecking=no"],
+ "1+1."),
OpenSsh = ssh_test_lib:open_port({spawn, Cmd}),
ssh_test_lib:rcv_expected({data,<<"2\n">>}, OpenSsh, ?TIMEOUT),
ssh:stop_daemon(Pid).
@@ -395,13 +395,13 @@ erlang_server_openssh_client_public_key_X(Config, PubKeyAlg) ->
%%--------------------------------------------------------------------
%% Test that the Erlang/OTP server can renegotiate with openSSH
erlang_server_openssh_client_renegotiate(Config) ->
- PubKeyAlg = ssh_rsa,
+ _PubKeyAlg = ssh_rsa,
SystemDir = proplists:get_value(data_dir, Config),
PrivDir = proplists:get_value(priv_dir, Config),
KnownHosts = filename:join(PrivDir, "known_hosts"),
{Pid, Host, Port} = ssh_test_lib:daemon([{system_dir, SystemDir},
- {failfun, fun ssh_test_lib:failfun/2}]),
+ {failfun, fun ssh_test_lib:failfun/2}]),
ct:sleep(500),
RenegLimitK = 3,
@@ -409,11 +409,13 @@ erlang_server_openssh_client_renegotiate(Config) ->
Data = lists:duplicate(trunc(1.1*RenegLimitK*1024), $a),
ok = file:write_file(DataFile, Data),
- Cmd = "ssh -p " ++ integer_to_list(Port) ++
- " -o UserKnownHostsFile=" ++ KnownHosts ++
- " -o RekeyLimit=" ++ integer_to_list(RenegLimitK) ++"K" ++
- " " ++ Host ++ " < " ++ DataFile,
- OpenSsh = ssh_test_lib:open_port({spawn, Cmd}),
+ Cmd = ssh_test_lib:open_sshc_cmd(Host, Port,
+ [" -o UserKnownHostsFile=", KnownHosts,
+ " -o StrictHostKeyChecking=no",
+ " -o RekeyLimit=",integer_to_list(RenegLimitK),"K"]),
+
+
+ OpenSsh = ssh_test_lib:open_port({spawn, Cmd++" < "++DataFile}),
Expect = fun({data,R}) ->
try
@@ -462,7 +464,7 @@ erlang_client_openssh_server_renegotiate(_Config) ->
{silently_accept_hosts,true}],
group_leader(IO, self()),
{ok, ConnRef} = ssh:connect(Host, ?SSH_DEFAULT_PORT, Options),
- ct:pal("Parent = ~p, IO = ~p, Shell = ~p, ConnRef = ~p~n",[Parent, IO, self(), ConnRef]),
+ ct:log("Parent = ~p, IO = ~p, Shell = ~p, ConnRef = ~p~n",[Parent, IO, self(), ConnRef]),
case ssh_connection:session_channel(ConnRef, infinity) of
{ok,ChannelId} ->
success = ssh_connection:ptty_alloc(ConnRef, ChannelId, []),
diff --git a/lib/ssh/test/ssh_trpt_test_lib.erl b/lib/ssh/test/ssh_trpt_test_lib.erl
index 261239c152..e1f4c65300 100644
--- a/lib/ssh/test/ssh_trpt_test_lib.erl
+++ b/lib/ssh/test/ssh_trpt_test_lib.erl
@@ -314,8 +314,7 @@ mangle_opts(Options) ->
lists:keydelete(K,1,Opts)
end, Options, SysOpts).
-host({0,0,0,0}) -> "localhost";
-host(H) -> H.
+host(H) -> ssh_test_lib:ntoa(ssh_test_lib:mangle_connect_address(H)).
%%%----------------------------------------------------------------
send(S=#s{ssh=C}, hello) ->
diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk
index c6a5990f41..48332d2e5a 100644
--- a/lib/ssh/vsn.mk
+++ b/lib/ssh/vsn.mk
@@ -1,5 +1,5 @@
#-*-makefile-*- ; force emacs to enter makefile-mode
-SSH_VSN = 4.4
+SSH_VSN = 4.4.2
APP_VSN = "ssh-$(SSH_VSN)"
diff --git a/lib/ssl/doc/src/notes.xml b/lib/ssl/doc/src/notes.xml
index 29b8e8ff67..7ffb9c0e88 100644
--- a/lib/ssl/doc/src/notes.xml
+++ b/lib/ssl/doc/src/notes.xml
@@ -28,6 +28,88 @@
<p>This document describes the changes made to the SSL application.</p>
+<section><title>SSL 8.1.2</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Correct active once emulation, for TLS. Now all data
+ received by the connection process will be delivered
+ through active once, even when the active once arrives
+ after that the gen_tcp socket is closed by the peer.</p>
+ <p>
+ Own Id: OTP-14300</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
+<section><title>SSL 8.1.1</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ Corrected termination behavior, that caused a PEM cache
+ bug and sometimes resulted in connection failures.</p>
+ <p>
+ Own Id: OTP-14100</p>
+ </item>
+ <item>
+ <p>
+ Fix bug that could hang ssl connection processes when
+ failing to require more data for very large handshake
+ packages. Add option max_handshake_size to mitigate DoS
+ attacks.</p>
+ <p>
+ Own Id: OTP-14138</p>
+ </item>
+ <item>
+ <p>
+ Improved support for CRL handling that could fail to work
+ as intended when an id-ce-extKeyUsage was present in the
+ certificate. Also improvements where needed to
+ distributionpoint handling so that all revocations
+ actually are found and not deemed to be not determinable.</p>
+ <p>
+ Own Id: OTP-14141</p>
+ </item>
+ <item>
+ <p>
+ A TLS handshake might accidentally match old sslv2 format
+ and ssl application would incorrectly aborted TLS
+ handshake with ssl_v2_client_hello_no_supported. Parsing
+ was altered to avoid this problem.</p>
+ <p>
+ Own Id: OTP-14222</p>
+ </item>
+ <item>
+ <p>
+ Correct default cipher list to prefer AES 128 before 3DES</p>
+ <p>
+ Own Id: OTP-14235</p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Move PEM cache to a dedicated process, to avoid making
+ the SSL manager process a bottleneck. This improves
+ scalability of TLS connections.</p>
+ <p>
+ Own Id: OTP-13874</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>SSL 8.1</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/ssl/doc/src/ssl.xml b/lib/ssl/doc/src/ssl.xml
index 916b41742e..91c590c247 100644
--- a/lib/ssl/doc/src/ssl.xml
+++ b/lib/ssl/doc/src/ssl.xml
@@ -935,13 +935,14 @@ fun(srp, Username :: string(), UserState :: term()) ->
<fsummary>Returns all the connection information.
</fsummary>
<type>
- <v>Item = protocol | cipher_suite | sni_hostname | ecc | atom()</v>
+ <v>Item = protocol | cipher_suite | sni_hostname | ecc | session_id | atom()</v>
<d>Meaningful atoms, not specified above, are the ssl option names.</d>
<v>Result = [{Item::atom(), Value::term()}]</v>
<v>Reason = term()</v>
</type>
- <desc><p>Returns all relevant information about the connection, ssl options that
- are undefined will be filtered out.</p>
+ <desc><p>Returns the most relevant information about the connection, ssl options that
+ are undefined will be filtered out. Note that values that affect the security of the
+ connection will only be returned if explicitly requested by connection_information/2.</p>
</desc>
</func>
@@ -952,8 +953,10 @@ fun(srp, Username :: string(), UserState :: term()) ->
</fsummary>
<type>
<v>Items = [Item]</v>
- <v>Item = protocol | cipher_suite | sni_hostname | atom()</v>
- <d>Meaningful atoms, not specified above, are the ssl option names.</d>
+ <v>Item = protocol | cipher_suite | sni_hostname | ecc | session_id | client_random
+ | server_random | master_secret | atom()</v>
+ <d>Note that client_random, server_random and master_secret are values
+ that affect the security of connection. Meaningful atoms, not specified above, are the ssl option names.</d>
<v>Result = [{Item::atom(), Value::term()}]</v>
<v>Reason = term()</v>
</type>
diff --git a/lib/ssl/src/dtls_connection.erl b/lib/ssl/src/dtls_connection.erl
index 070a90d481..440607e99d 100644
--- a/lib/ssl/src/dtls_connection.erl
+++ b/lib/ssl/src/dtls_connection.erl
@@ -39,7 +39,7 @@
-export([start_fsm/8, start_link/7, init/1]).
%% State transition handling
--export([next_record/1, next_event/3]).
+-export([next_record/1, next_event/3, next_event/4]).
%% Handshake handling
-export([renegotiate/2,
@@ -53,7 +53,7 @@
%% Data handling
-export([encode_data/3, passive_receive/2, next_record_if_active/1, handle_common_event/4,
- send/3]).
+ send/3, socket/5]).
%% gen_statem state functions
-export([init/3, error/3, downgrade/3, %% Initiation and take down states
@@ -77,20 +77,6 @@ start_fsm(Role, Host, Port, Socket, {#ssl_options{erl_dist = false},_, Tracker}
catch
error:{badmatch, {error, _} = Error} ->
Error
- end;
-
-start_fsm(Role, Host, Port, Socket, {#ssl_options{erl_dist = true},_, Tracker} = Opts,
- User, {CbModule, _,_, _} = CbInfo,
- Timeout) ->
- try
- {ok, Pid} = dtls_connection_sup:start_child_dist([Role, Host, Port, Socket,
- Opts, User, CbInfo]),
- {ok, SslSocket} = ssl_connection:socket_control(?MODULE, Socket, Pid, CbModule, Tracker),
- ok = ssl_connection:handshake(SslSocket, Timeout),
- {ok, SslSocket}
- catch
- error:{badmatch, {error, _} = Error} ->
- Error
end.
send_handshake(Handshake, #state{connection_states = ConnectionStates} = States) ->
@@ -201,6 +187,7 @@ reinit_handshake_data(#state{protocol_buffers = Buffers} = State) ->
State#state{premaster_secret = undefined,
public_key_info = undefined,
tls_handshake_history = ssl_handshake:init_handshake_history(),
+ flight_state = {retransmit, ?INITIAL_RETRANSMIT_TIMEOUT},
protocol_buffers =
Buffers#protocol_buffers{
dtls_handshake_next_seq = 0,
@@ -213,6 +200,9 @@ select_sni_extension(#client_hello{extensions = HelloExtensions}) ->
select_sni_extension(_) ->
undefined.
+socket(Pid, Transport, Socket, Connection, _) ->
+ dtls_socket:socket(Pid, Transport, Socket, Connection).
+
%%====================================================================
%% tls_connection_sup API
%%====================================================================
@@ -243,7 +233,7 @@ callback_mode() ->
state_functions.
%%--------------------------------------------------------------------
-%% State functionsconnection/2
+%% State functions
%%--------------------------------------------------------------------
init({call, From}, {start, Timeout},
@@ -262,18 +252,25 @@ init({call, From}, {start, Timeout},
Version = Hello#client_hello.client_version,
HelloVersion = dtls_record:lowest_protocol_version(SslOpts#ssl_options.versions),
State1 = prepare_flight(State0#state{negotiated_version = Version}),
- State2 = send_handshake(Hello, State1#state{negotiated_version = HelloVersion}),
+ {State2, Actions} = send_handshake(Hello, State1#state{negotiated_version = HelloVersion}),
State3 = State2#state{negotiated_version = Version, %% Requested version
session =
Session0#session{session_id = Hello#client_hello.session_id},
start_or_recv_from = From,
- timer = Timer},
+ timer = Timer,
+ flight_state = {retransmit, ?INITIAL_RETRANSMIT_TIMEOUT}
+ },
{Record, State} = next_record(State3),
- next_event(hello, Record, State);
+ next_event(hello, Record, State, Actions);
init({call, _} = Type, Event, #state{role = server, transport_cb = gen_udp} = State) ->
- ssl_connection:init(Type, Event,
- State#state{flight_state = {waiting, undefined, ?INITIAL_RETRANSMIT_TIMEOUT}},
- ?MODULE);
+ Result = ssl_connection:init(Type, Event,
+ State#state{flight_state = {retransmit, ?INITIAL_RETRANSMIT_TIMEOUT},
+ protocol_specific = #{current_cookie_secret => dtls_v1:cookie_secret(),
+ previous_cookie_secret => <<>>}},
+ ?MODULE),
+ erlang:send_after(dtls_v1:cookie_timeout(), self(), new_cookie_secret),
+ Result;
+
init({call, _} = Type, Event, #state{role = server} = State) ->
%% I.E. DTLS over sctp
ssl_connection:init(Type, Event, State#state{flight_state = reliable}, ?MODULE);
@@ -296,26 +293,32 @@ error(_, _, _) ->
hello(internal, #client_hello{cookie = <<>>,
client_version = Version} = Hello, #state{role = server,
transport_cb = Transport,
- socket = Socket} = State0) ->
- %% TODO: not hard code key
+ socket = Socket,
+ protocol_specific = #{current_cookie_secret := Secret}} = State0) ->
{ok, {IP, Port}} = dtls_socket:peername(Transport, Socket),
- Cookie = dtls_handshake:cookie(<<"secret">>, IP, Port, Hello),
+ Cookie = dtls_handshake:cookie(Secret, IP, Port, Hello),
VerifyRequest = dtls_handshake:hello_verify_request(Cookie, Version),
State1 = prepare_flight(State0#state{negotiated_version = Version}),
- State2 = send_handshake(VerifyRequest, State1),
+ {State2, Actions} = send_handshake(VerifyRequest, State1),
{Record, State} = next_record(State2),
- next_event(hello, Record, State#state{tls_handshake_history = ssl_handshake:init_handshake_history()});
+ next_event(hello, Record, State#state{tls_handshake_history = ssl_handshake:init_handshake_history()}, Actions);
hello(internal, #client_hello{cookie = Cookie} = Hello, #state{role = server,
transport_cb = Transport,
- socket = Socket} = State0) ->
+ socket = Socket,
+ protocol_specific = #{current_cookie_secret := Secret,
+ previous_cookie_secret := PSecret}} = State0) ->
{ok, {IP, Port}} = dtls_socket:peername(Transport, Socket),
- %% TODO: not hard code key
- case dtls_handshake:cookie(<<"secret">>, IP, Port, Hello) of
+ case dtls_handshake:cookie(Secret, IP, Port, Hello) of
Cookie ->
handle_client_hello(Hello, State0);
_ ->
- %% Handle bad cookie as new cookie request RFC 6347 4.1.2
- hello(internal, Hello#client_hello{cookie = <<>>}, State0)
+ case dtls_handshake:cookie(PSecret, IP, Port, Hello) of
+ Cookie ->
+ handle_client_hello(Hello, State0);
+ _ ->
+ %% Handle bad cookie as new cookie request RFC 6347 4.1.2
+ hello(internal, Hello#client_hello{cookie = <<>>}, State0)
+ end
end;
hello(internal, #hello_verify_request{cookie = Cookie}, #state{role = client,
host = Host, port = Port,
@@ -333,13 +336,13 @@ hello(internal, #hello_verify_request{cookie = Cookie}, #state{role = client,
Cache, CacheCb, Renegotiation, OwnCert),
Version = Hello#client_hello.client_version,
HelloVersion = dtls_record:lowest_protocol_version(SslOpts#ssl_options.versions),
- State2 = send_handshake(Hello, State1#state{negotiated_version = HelloVersion}),
+ {State2, Actions} = send_handshake(Hello, State1#state{negotiated_version = HelloVersion}),
State3 = State2#state{negotiated_version = Version, %% Requested version
session =
Session0#session{session_id =
Hello#client_hello.session_id}},
{Record, State} = next_record(State3),
- next_event(hello, Record, State);
+ next_event(hello, Record, State, Actions);
hello(internal, #server_hello{} = Hello,
#state{connection_states = ConnectionStates0,
negotiated_version = ReqVersion,
@@ -356,13 +359,13 @@ hello(internal, #server_hello{} = Hello,
hello(internal, {handshake, {#client_hello{cookie = <<>>} = Handshake, _}}, State) ->
%% Initial hello should not be in handshake history
{next_state, hello, State, [{next_event, internal, Handshake}]};
-
hello(internal, {handshake, {#hello_verify_request{} = Handshake, _}}, State) ->
%% hello_verify should not be in handshake history
{next_state, hello, State, [{next_event, internal, Handshake}]};
-
hello(info, Event, State) ->
handle_info(Event, hello, State);
+hello(state_timeout, Event, State) ->
+ handle_state_timeout(Event, hello, State);
hello(Type, Event, State) ->
ssl_connection:hello(Type, Event, State, ?MODULE).
@@ -375,7 +378,11 @@ abbreviated(internal = Type,
ConnectionStates = dtls_record:next_epoch(ConnectionStates1, read),
ssl_connection:abbreviated(Type, Event, State#state{connection_states = ConnectionStates}, ?MODULE);
abbreviated(internal = Type, #finished{} = Event, #state{connection_states = ConnectionStates} = State) ->
- ssl_connection:cipher(Type, Event, prepare_flight(State#state{connection_states = ConnectionStates}), ?MODULE);
+ ssl_connection:abbreviated(Type, Event,
+ prepare_flight(State#state{connection_states = ConnectionStates,
+ flight_state = connection}), ?MODULE);
+abbreviated(state_timeout, Event, State) ->
+ handle_state_timeout(Event, abbreviated, State);
abbreviated(Type, Event, State) ->
ssl_connection:abbreviated(Type, Event, State, ?MODULE).
@@ -383,6 +390,8 @@ certify(info, Event, State) ->
handle_info(Event, certify, State);
certify(internal = Type, #server_hello_done{} = Event, State) ->
ssl_connection:certify(Type, Event, prepare_flight(State), ?MODULE);
+certify(state_timeout, Event, State) ->
+ handle_state_timeout(Event, certify, State);
certify(Type, Event, State) ->
ssl_connection:certify(Type, Event, State, ?MODULE).
@@ -395,7 +404,11 @@ cipher(internal = Type, #change_cipher_spec{type = <<1>>} = Event,
ssl_connection:cipher(Type, Event, State#state{connection_states = ConnectionStates}, ?MODULE);
cipher(internal = Type, #finished{} = Event, #state{connection_states = ConnectionStates} = State) ->
ssl_connection:cipher(Type, Event,
- prepare_flight(State#state{connection_states = ConnectionStates}), ?MODULE);
+ prepare_flight(State#state{connection_states = ConnectionStates,
+ flight_state = connection}),
+ ?MODULE);
+cipher(state_timeout, Event, State) ->
+ handle_state_timeout(Event, cipher, State);
cipher(Type, Event, State) ->
ssl_connection:cipher(Type, Event, State, ?MODULE).
@@ -409,12 +422,12 @@ connection(internal, #hello_request{}, #state{host = Host, port = Port,
renegotiation = {Renegotiation, _}} = State0) ->
Hello = dtls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
Cache, CacheCb, Renegotiation, Cert),
- State1 = send_handshake(Hello, State0),
+ {State1, Actions} = send_handshake(Hello, State0),
{Record, State} =
next_record(
State1#state{session = Session0#session{session_id
= Hello#client_hello.session_id}}),
- next_event(hello, Record, State);
+ next_event(hello, Record, State, Actions);
connection(internal, #client_hello{} = Hello, #state{role = server, allow_renegotiate = true} = State) ->
%% Mitigate Computational DoS attack
%% http://www.educatedguesswork.org/2011/10/ssltls_and_computational_dos.html
@@ -434,7 +447,6 @@ connection(Type, Event, State) ->
downgrade(Type, Event, State) ->
ssl_connection:downgrade(Type, Event, State, ?MODULE).
-
%%--------------------------------------------------------------------
%% Description: This function is called by a gen_fsm when it receives any
%% other message than a synchronous or asynchronous event
@@ -442,16 +454,6 @@ downgrade(Type, Event, State) ->
%%--------------------------------------------------------------------
%% raw data from socket, unpack records
-handle_info({_,flight_retransmission_timeout}, connection, _) ->
- {next_state, keep_state_and_data};
-handle_info({Ref, flight_retransmission_timeout}, StateName,
- #state{flight_state = {waiting, Ref, NextTimeout}} = State0) ->
- State1 = send_handshake_flight(State0#state{flight_state = {retransmit_timer, NextTimeout}},
- retransmit_epoch(StateName, State0)),
- {Record, State} = next_record(State1),
- next_event(StateName, Record, State);
-handle_info({_, flight_retransmission_timeout}, _, _) ->
- {next_state, keep_state_and_data};
handle_info({Protocol, _, _, _, Data}, StateName,
#state{data_tag = Protocol} = State0) ->
case next_dtls_record(Data, State0) of
@@ -462,34 +464,52 @@ handle_info({Protocol, _, _, _, Data}, StateName,
{stop, {shutdown, own_alert}}
end;
handle_info({CloseTag, Socket}, StateName,
- #state{socket = Socket, close_tag = CloseTag,
+ #state{socket = Socket,
+ socket_options = #socket_options{active = Active},
+ protocol_buffers = #protocol_buffers{dtls_cipher_texts = CTs},
+ close_tag = CloseTag,
negotiated_version = Version} = State) ->
%% Note that as of DTLS 1.2 (TLS 1.1),
%% failure to properly close a connection no longer requires that a
%% session not be resumed. This is a change from DTLS 1.0 to conform
%% with widespread implementation practice.
- case Version of
- {254, N} when N =< 253 ->
- ok;
- _ ->
- %% As invalidate_sessions here causes performance issues,
- %% we will conform to the widespread implementation
- %% practice and go aginst the spec
- %%invalidate_session(Role, Host, Port, Session)
- ok
- end,
- ssl_connection:handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
- {stop, {shutdown, transport_closed}};
+ case (Active == false) andalso (CTs =/= []) of
+ false ->
+ case Version of
+ {254, N} when N =< 253 ->
+ ok;
+ _ ->
+ %% As invalidate_sessions here causes performance issues,
+ %% we will conform to the widespread implementation
+ %% practice and go aginst the spec
+ %%invalidate_session(Role, Host, Port, Session)
+ ok
+ end,
+ ssl_connection:handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
+ {stop, {shutdown, transport_closed}};
+ true ->
+ %% Fixes non-delivery of final DTLS record in {active, once}.
+ %% Basically allows the application the opportunity to set {active, once} again
+ %% and then receive the final message.
+ next_event(StateName, no_record, State)
+ end;
+
+handle_info(new_cookie_secret, StateName,
+ #state{protocol_specific = #{current_cookie_secret := Secret} = CookieInfo} = State) ->
+ erlang:send_after(dtls_v1:cookie_timeout(), self(), new_cookie_secret),
+ {next_state, StateName, State#state{protocol_specific =
+ CookieInfo#{current_cookie_secret => dtls_v1:cookie_secret(),
+ previous_cookie_secret => Secret}}};
handle_info(Msg, StateName, State) ->
ssl_connection:handle_info(Msg, StateName, State).
+
handle_call(Event, From, StateName, State) ->
ssl_connection:handle_call(Event, From, StateName, State, ?MODULE).
handle_common_event(internal, #alert{} = Alert, StateName,
#state{negotiated_version = Version} = State) ->
ssl_connection:handle_own_alert(Alert, Version, StateName, State);
-
%%% DTLS record protocol level handshake messages
handle_common_event(internal, #ssl_tls{type = ?HANDSHAKE,
fragment = Data},
@@ -498,19 +518,14 @@ handle_common_event(internal, #ssl_tls{type = ?HANDSHAKE,
negotiated_version = Version} = State0) ->
try
case dtls_handshake:get_dtls_handshake(Version, Data, Buffers0) of
- {more_data, Buffers} ->
+ {[], Buffers} ->
{Record, State} = next_record(State0#state{protocol_buffers = Buffers}),
next_event(StateName, Record, State);
{Packets, Buffers} ->
State = State0#state{protocol_buffers = Buffers},
Events = dtls_handshake_events(Packets),
- case StateName of
- connection ->
- ssl_connection:hibernate_after(StateName, State, Events);
- _ ->
- {next_state, StateName,
- State#state{unprocessed_handshake_events = unprocessed_events(Events)}, Events}
- end
+ {next_state, StateName,
+ State#state{unprocessed_handshake_events = unprocessed_events(Events)}, Events}
end
catch throw:#alert{} = Alert ->
ssl_connection:handle_own_alert(Alert, Version, StateName, State0)
@@ -534,6 +549,13 @@ handle_common_event(internal, #ssl_tls{type = ?ALERT, fragment = EncAlerts}, Sta
handle_common_event(internal, #ssl_tls{type = _Unknown}, StateName, State) ->
{next_state, StateName, State}.
+handle_state_timeout(flight_retransmission_timeout, StateName,
+ #state{flight_state = {retransmit, NextTimeout}} = State0) ->
+ {State1, Actions} = send_handshake_flight(State0#state{flight_state = {retransmit, NextTimeout}},
+ retransmit_epoch(StateName, State0)),
+ {Record, State} = next_record(State1),
+ next_event(StateName, Record, State, Actions).
+
send(Transport, {_, {{_,_}, _} = Socket}, Data) ->
send(Transport, Socket, Data);
send(Transport, Socket, Data) ->
@@ -645,7 +667,8 @@ initial_state(Role, Host, Port, Socket, {SSLOptions, SocketOptions, _}, User,
allow_renegotiate = SSLOptions#ssl_options.client_renegotiation,
start_or_recv_from = undefined,
protocol_cb = ?MODULE,
- flight_buffer = new_flight()
+ flight_buffer = new_flight(),
+ flight_state = {retransmit, ?INITIAL_RETRANSMIT_TIMEOUT}
}.
next_dtls_record(Data, #state{protocol_buffers = #protocol_buffers{
@@ -714,14 +737,14 @@ next_event(connection = StateName, no_record,
#state{connection_states = #{current_read := #{epoch := CurrentEpoch}}} = State0, Actions) ->
case next_record_if_active(State0) of
{no_record, State} ->
- ssl_connection:hibernate_after(StateName, State, Actions);
+ ssl_connection:hibernate_after(StateName, State, Actions);
{#ssl_tls{epoch = CurrentEpoch} = Record, State} ->
{next_state, StateName, State, [{next_event, internal, {protocol_record, Record}} | Actions]};
{#ssl_tls{epoch = Epoch,
type = ?HANDSHAKE,
version = _Version}, State1} = _Record when Epoch == CurrentEpoch-1 ->
- State = send_handshake_flight(State1, Epoch),
- {next_state, StateName, State, Actions};
+ {State, MoreActions} = send_handshake_flight(State1, Epoch),
+ {next_state, StateName, State, Actions ++ MoreActions};
{#ssl_tls{epoch = _Epoch,
version = _Version}, State} ->
%% TODO maybe buffer later epoch
@@ -772,17 +795,20 @@ next_flight(Flight) ->
Flight#{handshakes => [],
change_cipher_spec => undefined,
handshakes_after_change_cipher_spec => []}.
-
start_flight(#state{transport_cb = gen_udp,
- flight_state = {retransmit_timer, Timeout}} = State) ->
- Ref = erlang:make_ref(),
- _ = erlang:send_after(Timeout, self(), {Ref, flight_retransmission_timeout}),
- State#state{flight_state = {waiting, Ref, new_timeout(Timeout)}};
-
+ flight_state = {retransmit, Timeout}} = State) ->
+ start_retransmision_timer(Timeout, State);
+start_flight(#state{transport_cb = gen_udp,
+ flight_state = connection} = State) ->
+ {State, []};
start_flight(State) ->
%% No retransmision needed i.e DTLS over SCTP
- State#state{flight_state = reliable}.
+ {State#state{flight_state = reliable}, []}.
+
+start_retransmision_timer(Timeout, State) ->
+ {State#state{flight_state = {retransmit, new_timeout(Timeout)}},
+ [{state_timeout, Timeout, flight_retransmission_timeout}]}.
new_timeout(N) when N =< 30 ->
N * 2;
@@ -806,13 +832,13 @@ renegotiate(#state{role = server,
connection_states = CS0} = State0, Actions) ->
HelloRequest = ssl_handshake:hello_request(),
CS = CS0#{write_msg_seq => 0},
- State1 = send_handshake(HelloRequest,
- State0#state{connection_states =
- CS}),
+ {State1, MoreActions} = send_handshake(HelloRequest,
+ State0#state{connection_states =
+ CS}),
Hs0 = ssl_handshake:init_handshake_history(),
{Record, State} = next_record(State1#state{tls_handshake_history = Hs0,
protocol_buffers = #protocol_buffers{}}),
- next_event(hello, Record, State, Actions).
+ next_event(hello, Record, State, Actions ++ MoreActions).
handle_alerts([], Result) ->
Result;
@@ -823,15 +849,11 @@ handle_alerts([Alert | Alerts], {next_state, StateName, State}) ->
handle_alerts([Alert | Alerts], {next_state, StateName, State, _Actions}) ->
handle_alerts(Alerts, ssl_connection:handle_alert(Alert, StateName, State)).
-retransmit_epoch(StateName, #state{connection_states = ConnectionStates}) ->
+retransmit_epoch(_StateName, #state{connection_states = ConnectionStates}) ->
#{epoch := Epoch} =
ssl_record:current_connection_state(ConnectionStates, write),
- case StateName of
- connection ->
- Epoch-1;
- _ ->
- Epoch
- end.
+ Epoch.
+
update_handshake_history(#hello_verify_request{}, _, Hist) ->
Hist;
@@ -846,3 +868,4 @@ unprocessed_events(Events) ->
%% handshake events left to process before we should
%% process more TLS-records received on the socket.
erlang:length(Events)-1.
+
diff --git a/lib/ssl/src/dtls_handshake.erl b/lib/ssl/src/dtls_handshake.erl
index af3708ddb7..d3ba90a226 100644
--- a/lib/ssl/src/dtls_handshake.erl
+++ b/lib/ssl/src/dtls_handshake.erl
@@ -136,9 +136,11 @@ handshake_bin([Type, Length, Data], Seq) ->
%%--------------------------------------------------------------------
-spec get_dtls_handshake(dtls_record:dtls_version(), binary(), #protocol_buffers{}) ->
- {[{dtls_handshake(), binary()}], #protocol_buffers{}} | {more_data, #protocol_buffers{}}.
+ {[dtls_handshake()], #protocol_buffers{}}.
%%
-%% Description: ...
+%% Description: Given buffered and new data from dtls_record, collects
+%% and returns it as a list of handshake messages, also returns
+%% possible leftover data in the new "protocol_buffers".
%%--------------------------------------------------------------------
get_dtls_handshake(Version, Fragment, ProtocolBuffers) ->
handle_fragments(Version, Fragment, ProtocolBuffers, []).
@@ -288,8 +290,6 @@ do_handle_fragments(_, [], Buffers, Acc) ->
{lists:reverse(Acc), Buffers};
do_handle_fragments(Version, [Fragment | Fragments], Buffers0, Acc) ->
case reassemble(Version, Fragment, Buffers0) of
- {more_data, _} = More when Acc == []->
- More;
{more_data, Buffers} when Fragments == [] ->
{lists:reverse(Acc), Buffers};
{more_data, Buffers} ->
@@ -455,7 +455,7 @@ merge_fragments(#handshake_fragment{
fragment_offset = PreviousOffSet,
fragment_length = CurrentLen}) when CurrentLen < PreviousLen ->
Previous;
-%% Next fragment
+%% Next fragment, might be overlapping
merge_fragments(#handshake_fragment{
fragment_offset = PreviousOffSet,
fragment_length = PreviousLen,
@@ -464,10 +464,26 @@ merge_fragments(#handshake_fragment{
#handshake_fragment{
fragment_offset = CurrentOffSet,
fragment_length = CurrentLen,
- fragment = CurrentData}) when PreviousOffSet + PreviousLen == CurrentOffSet->
- Previous#handshake_fragment{
- fragment_length = PreviousLen + CurrentLen,
- fragment = <<PreviousData/binary, CurrentData/binary>>};
+ fragment = CurrentData})
+ when PreviousOffSet + PreviousLen >= CurrentOffSet andalso
+ PreviousOffSet + PreviousLen < CurrentOffSet + CurrentLen ->
+ CurrentStart = PreviousOffSet + PreviousLen - CurrentOffSet,
+ <<_:CurrentStart/bytes, Data/binary>> = CurrentData,
+ Previous#handshake_fragment{
+ fragment_length = PreviousLen + CurrentLen - CurrentStart,
+ fragment = <<PreviousData/binary, Data/binary>>};
+%% already fully contained fragment
+merge_fragments(#handshake_fragment{
+ fragment_offset = PreviousOffSet,
+ fragment_length = PreviousLen
+ } = Previous,
+ #handshake_fragment{
+ fragment_offset = CurrentOffSet,
+ fragment_length = CurrentLen})
+ when PreviousOffSet + PreviousLen >= CurrentOffSet andalso
+ PreviousOffSet + PreviousLen >= CurrentOffSet + CurrentLen ->
+ Previous;
+
%% No merge there is a gap
merge_fragments(Previous, Current) ->
[Previous, Current].
diff --git a/lib/ssl/src/dtls_record.erl b/lib/ssl/src/dtls_record.erl
index 0ee51c24b6..049f83e49e 100644
--- a/lib/ssl/src/dtls_record.erl
+++ b/lib/ssl/src/dtls_record.erl
@@ -439,43 +439,59 @@ encode_dtls_cipher_text(Type, {MajVer, MinVer}, Fragment,
encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
epoch := Epoch,
sequence_number := Seq,
+ cipher_state := CipherS0,
security_parameters :=
#security_parameters{
cipher_type = ?AEAD,
+ bulk_cipher_algorithm =
+ BulkCipherAlgo,
compression_algorithm = CompAlg}
} = WriteState0) ->
{Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
- WriteState1 = WriteState0#{compression_state => CompS1},
AAD = calc_aad(Type, Version, Epoch, Seq),
- ssl_record:cipher_aead(dtls_v1:corresponding_tls_version(Version), Comp, WriteState1, AAD);
-encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
+ TLSVersion = dtls_v1:corresponding_tls_version(Version),
+ {CipherFragment, CipherS1} =
+ ssl_cipher:cipher_aead(BulkCipherAlgo, CipherS0, Seq, AAD, Comp, TLSVersion),
+ {CipherFragment, WriteState0#{compression_state => CompS1,
+ cipher_state => CipherS1}};
+encode_plain_text(Type, Version, Fragment, #{compression_state := CompS0,
epoch := Epoch,
sequence_number := Seq,
+ cipher_state := CipherS0,
security_parameters :=
- #security_parameters{compression_algorithm = CompAlg}
+ #security_parameters{compression_algorithm = CompAlg,
+ bulk_cipher_algorithm =
+ BulkCipherAlgo}
}= WriteState0) ->
- {Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
+ {Comp, CompS1} = ssl_record:compress(CompAlg, Fragment, CompS0),
WriteState1 = WriteState0#{compression_state => CompS1},
- MacHash = calc_mac_hash(Type, Version, WriteState1, Epoch, Seq, Comp),
- ssl_record:cipher(dtls_v1:corresponding_tls_version(Version), Comp, WriteState1, MacHash).
+ MAC = calc_mac_hash(Type, Version, WriteState1, Epoch, Seq, Comp),
+ TLSVersion = dtls_v1:corresponding_tls_version(Version),
+ {CipherFragment, CipherS1} =
+ ssl_cipher:cipher(BulkCipherAlgo, CipherS0, MAC, Fragment, TLSVersion),
+ {CipherFragment, WriteState0#{cipher_state => CipherS1}}.
decode_cipher_text(#ssl_tls{type = Type, version = Version,
epoch = Epoch,
sequence_number = Seq,
fragment = CipherFragment} = CipherText,
#{compression_state := CompressionS0,
+ cipher_state := CipherS0,
security_parameters :=
#security_parameters{
cipher_type = ?AEAD,
+ bulk_cipher_algorithm =
+ BulkCipherAlgo,
compression_algorithm = CompAlg}} = ReadState0,
ConnnectionStates0) ->
AAD = calc_aad(Type, Version, Epoch, Seq),
- case ssl_record:decipher_aead(dtls_v1:corresponding_tls_version(Version),
- CipherFragment, ReadState0, AAD) of
- {PlainFragment, ReadState1} ->
+ TLSVersion = dtls_v1:corresponding_tls_version(Version),
+ case ssl_cipher:decipher_aead(BulkCipherAlgo, CipherS0, Seq, AAD, CipherFragment, TLSVersion) of
+ {PlainFragment, CipherState} ->
{Plain, CompressionS1} = ssl_record:uncompress(CompAlg,
PlainFragment, CompressionS0),
- ReadState = ReadState1#{compression_state => CompressionS1},
+ ReadState = ReadState0#{compression_state => CompressionS1,
+ cipher_state => CipherState},
ConnnectionStates = set_connection_state_by_epoch(ReadState, Epoch, ConnnectionStates0, read),
{CipherText#ssl_tls{fragment = Plain}, ConnnectionStates};
#alert{} = Alert ->
@@ -528,5 +544,4 @@ mac_hash(Version, MacAlg, MacSecret, SeqNo, Type, Length, Fragment) ->
Length, Fragment).
calc_aad(Type, {MajVer, MinVer}, Epoch, SeqNo) ->
- NewSeq = (Epoch bsl 48) + SeqNo,
- <<NewSeq:64/integer, ?BYTE(Type), ?BYTE(MajVer), ?BYTE(MinVer)>>.
+ <<?UINT16(Epoch), ?UINT48(SeqNo), ?BYTE(Type), ?BYTE(MajVer), ?BYTE(MinVer)>>.
diff --git a/lib/ssl/src/dtls_socket.erl b/lib/ssl/src/dtls_socket.erl
index 570b3ae83a..ac1a7b37c6 100644
--- a/lib/ssl/src/dtls_socket.erl
+++ b/lib/ssl/src/dtls_socket.erl
@@ -71,11 +71,14 @@ connect(Address, Port, #config{transport_info = {Transport, _, _, _} = CbInfo,
close(gen_udp, {_Client, _Socket}) ->
ok.
+socket(Pid, gen_udp = Transport, {{_, _}, Socket}, ConnectionCb) ->
+ #sslsocket{pid = Pid,
+ %% "The name "fd" is keept for backwards compatibility
+ fd = {Transport, Socket, ConnectionCb}};
socket(Pid, Transport, Socket, ConnectionCb) ->
#sslsocket{pid = Pid,
%% "The name "fd" is keept for backwards compatibility
- fd = {Transport, Socket, ConnectionCb}}.
-
+ fd = {Transport, Socket, ConnectionCb}}.
%% Vad göra med emulerade
setopts(gen_udp, #sslsocket{pid = {Socket, _}}, Options) ->
{SockOpts, _} = tls_socket:split_options(Options),
@@ -108,11 +111,15 @@ getstat(gen_udp, {_,Socket}, Options) ->
inet:getstat(Socket, Options);
getstat(Transport, Socket, Options) ->
Transport:getstat(Socket, Options).
+peername(udp, _) ->
+ {error, enotconn};
peername(gen_udp, {_, {Client, _Socket}}) ->
{ok, Client};
peername(Transport, Socket) ->
Transport:peername(Socket).
-sockname(gen_udp, {_,Socket}) ->
+sockname(gen_udp, {_, {_,Socket}}) ->
+ inet:sockname(Socket);
+sockname(gen_udp, Socket) ->
inet:sockname(Socket);
sockname(Transport, Socket) ->
Transport:sockname(Socket).
diff --git a/lib/ssl/src/dtls_udp_listener.erl b/lib/ssl/src/dtls_udp_listener.erl
index b7f115582e..ab3d0783bd 100644
--- a/lib/ssl/src/dtls_udp_listener.erl
+++ b/lib/ssl/src/dtls_udp_listener.erl
@@ -24,7 +24,8 @@
-behaviour(gen_server).
%% API
--export([start_link/4, active_once/3, accept/2, sockname/1]).
+-export([start_link/4, active_once/3, accept/2, sockname/1, close/1,
+ get_all_opts/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
@@ -39,7 +40,8 @@
clients = set_new(),
dtls_processes = kv_new(),
accepters = queue:new(),
- first
+ first,
+ close
}).
%%%===================================================================
@@ -53,10 +55,14 @@ active_once(UDPConnection, Client, Pid) ->
gen_server:cast(UDPConnection, {active_once, Client, Pid}).
accept(UDPConnection, Accepter) ->
- gen_server:call(UDPConnection, {accept, Accepter}, infinity).
+ call(UDPConnection, {accept, Accepter}).
sockname(UDPConnection) ->
- gen_server:call(UDPConnection, sockname, infinity).
+ call(UDPConnection, sockname).
+close(UDPConnection) ->
+ call(UDPConnection, close).
+get_all_opts(UDPConnection) ->
+ call(UDPConnection, get_all_opts).
%%%===================================================================
%%% gen_server callbacks
@@ -69,10 +75,13 @@ init([Port, EmOpts, InetOptions, DTLSOptions]) ->
first = true,
dtls_options = DTLSOptions,
emulated_options = EmOpts,
- listner = Socket}}
+ listner = Socket,
+ close = false}}
catch _:_ ->
{error, closed}
end.
+handle_call({accept, _}, _, #state{close = true} = State) ->
+ {reply, {error, closed}, State};
handle_call({accept, Accepter}, From, #state{first = true,
accepters = Accepters,
@@ -87,7 +96,21 @@ handle_call({accept, Accepter}, From, #state{accepters = Accepters} = State0) ->
{noreply, State};
handle_call(sockname, _, #state{listner = Socket} = State) ->
Reply = inet:sockname(Socket),
- {reply, Reply, State}.
+ {reply, Reply, State};
+handle_call(close, _, #state{dtls_processes = Processes,
+ accepters = Accepters} = State) ->
+ case kv_empty(Processes) of
+ true ->
+ {stop, normal, ok, State#state{close=true}};
+ false ->
+ lists:foreach(fun({_, From}) ->
+ gen_server:reply(From, {error, closed})
+ end, queue:to_list(Accepters)),
+ {reply, ok, State#state{close = true, accepters = queue:new()}}
+ end;
+handle_call(get_all_opts, _, #state{dtls_options = DTLSOptions,
+ emulated_options = EmOpts} = State) ->
+ {reply, {ok, EmOpts, DTLSOptions}, State}.
handle_cast({active_once, Client, Pid}, State0) ->
State = handle_active_once(Client, Pid, State0),
@@ -99,11 +122,17 @@ handle_info({udp, Socket, IP, InPortNo, _} = Msg, #state{listner = Socket} = Sta
{noreply, State};
handle_info({'DOWN', _, process, Pid, _}, #state{clients = Clients,
- dtls_processes = Processes0} = State) ->
+ dtls_processes = Processes0,
+ close = ListenClosed} = State) ->
Client = kv_get(Pid, Processes0),
Processes = kv_delete(Pid, Processes0),
- {noreply, State#state{clients = set_delete(Client, Clients),
- dtls_processes = Processes}}.
+ case ListenClosed andalso kv_empty(Processes) of
+ true ->
+ {stop, normal, State};
+ false ->
+ {noreply, State#state{clients = set_delete(Client, Clients),
+ dtls_processes = Processes}}
+ end.
terminate(_Reason, _State) ->
ok.
@@ -182,6 +211,7 @@ setup_new_connection(User, From, Client, Msg, #state{dtls_processes = Processes,
gen_server:reply(From, {error, Reason}),
State
end.
+
kv_update(Key, Value, Store) ->
gb_trees:update(Key, Value, Store).
kv_lookup(Key, Store) ->
@@ -194,6 +224,8 @@ kv_delete(Key, Store) ->
gb_trees:delete(Key, Store).
kv_new() ->
gb_trees:empty().
+kv_empty(Store) ->
+ gb_trees:is_empty(Store).
set_new() ->
gb_sets:empty().
@@ -203,3 +235,15 @@ set_delete(Item, Set) ->
gb_sets:delete(Item, Set).
set_is_member(Item, Set) ->
gb_sets:is_member(Item, Set).
+
+call(Server, Msg) ->
+ try
+ gen_server:call(Server, Msg, infinity)
+ catch
+ exit:{noproc, _} ->
+ {error, closed};
+ exit:{normal, _} ->
+ {error, closed};
+ exit:{{shutdown, _},_} ->
+ {error, closed}
+ end.
diff --git a/lib/ssl/src/dtls_v1.erl b/lib/ssl/src/dtls_v1.erl
index ffd3e4b833..4aaf8baa6c 100644
--- a/lib/ssl/src/dtls_v1.erl
+++ b/lib/ssl/src/dtls_v1.erl
@@ -21,12 +21,24 @@
-include("ssl_cipher.hrl").
--export([suites/1, mac_hash/7, ecc_curves/1, corresponding_tls_version/1, corresponding_dtls_version/1]).
+-export([suites/1, all_suites/1, mac_hash/7, ecc_curves/1,
+ corresponding_tls_version/1, corresponding_dtls_version/1,
+ cookie_secret/0, cookie_timeout/0]).
+
+-define(COOKIE_BASE_TIMEOUT, 30000).
-spec suites(Minor:: 253|255) -> [ssl_cipher:cipher_suite()].
suites(Minor) ->
- tls_v1:suites(corresponding_minor_tls_version(Minor)).
+ lists:filter(fun(Cipher) ->
+ is_acceptable_cipher(ssl_cipher:suite_definition(Cipher))
+ end,
+ tls_v1:suites(corresponding_minor_tls_version(Minor))).
+all_suites(Version) ->
+ lists:filter(fun(Cipher) ->
+ is_acceptable_cipher(ssl_cipher:suite_definition(Cipher))
+ end,
+ ssl_cipher:all_suites(corresponding_tls_version(Version))).
mac_hash(Version, MacAlg, MacSecret, SeqNo, Type, Length, Fragment) ->
tls_v1:mac_hash(MacAlg, MacSecret, SeqNo, Type, Version,
@@ -38,6 +50,13 @@ ecc_curves({_Major, Minor}) ->
corresponding_tls_version({254, Minor}) ->
{3, corresponding_minor_tls_version(Minor)}.
+cookie_secret() ->
+ crypto:strong_rand_bytes(32).
+
+cookie_timeout() ->
+ %% Cookie will live for two timeouts periods
+ round(rand:uniform() * ?COOKIE_BASE_TIMEOUT/2).
+
corresponding_minor_tls_version(255) ->
2;
corresponding_minor_tls_version(253) ->
@@ -50,3 +69,5 @@ corresponding_minor_dtls_version(2) ->
255;
corresponding_minor_dtls_version(3) ->
253.
+is_acceptable_cipher(Suite) ->
+ not ssl_cipher:is_stream_ciphersuite(Suite).
diff --git a/lib/ssl/src/ssl.app.src b/lib/ssl/src/ssl.app.src
index 148989174d..064dcd6892 100644
--- a/lib/ssl/src/ssl.app.src
+++ b/lib/ssl/src/ssl.app.src
@@ -63,7 +63,7 @@
{applications, [crypto, public_key, kernel, stdlib]},
{env, []},
{mod, {ssl_app, []}},
- {runtime_dependencies, ["stdlib-3.1","public_key-1.2","kernel-3.0",
+ {runtime_dependencies, ["stdlib-3.2","public_key-1.2","kernel-3.0",
"erts-7.0","crypto-3.3", "inets-5.10.7"]}]}.
diff --git a/lib/ssl/src/ssl.appup.src b/lib/ssl/src/ssl.appup.src
index 32252386b4..2eda9d9491 100644
--- a/lib/ssl/src/ssl.appup.src
+++ b/lib/ssl/src/ssl.appup.src
@@ -1,11 +1,21 @@
%% -*- erlang -*-
{"%VSN%",
[
- {<<"^8[.]0([.][0-9]+)?$">>, [{restart_application, ssl}]},
- {<<"^[3-7][.][^.].*">>, [{restart_application, ssl}]}
+ {<<"8.1.1">>, [{load_module, tls_connection, soft_purge, soft_purge, []}]},
+ {<<"8\\..*">>, [{restart_application, ssl}]},
+ {<<"7\\..*">>, [{restart_application, ssl}]},
+ {<<"6\\..*">>, [{restart_application, ssl}]},
+ {<<"5\\..*">>, [{restart_application, ssl}]},
+ {<<"4\\..*">>, [{restart_application, ssl}]},
+ {<<"3\\..*">>, [{restart_application, ssl}]}
],
[
- {<<"^8[.]0([.][0-9]+)?$">>, [{restart_application, ssl}]},
- {<<"^[3-7][.][^.].*">>, [{restart_application, ssl}]}
- ]
+ {<<"8.1.1">>, [{load_module, tls_connection, soft_purge, soft_purge, []}]},
+ {<<"8\\..*">>, [{restart_application, ssl}]},
+ {<<"7\\..*">>, [{restart_application, ssl}]},
+ {<<"6\\..*">>, [{restart_application, ssl}]},
+ {<<"5\\..*">>, [{restart_application, ssl}]},
+ {<<"4\\..*">>, [{restart_application, ssl}]},
+ {<<"3\\..*">>, [{restart_application, ssl}]}
+ ]
}.
diff --git a/lib/ssl/src/ssl.erl b/lib/ssl/src/ssl.erl
index 4a5a7e25ea..b3d08bdfbe 100644
--- a/lib/ssl/src/ssl.erl
+++ b/lib/ssl/src/ssl.erl
@@ -38,16 +38,13 @@
getopts/2, setopts/2, getstat/1, getstat/2
]).
%% SSL/TLS protocol handling
--export([cipher_suites/0, cipher_suites/1, eccs/0, eccs/1,
- connection_info/1, versions/0, session_info/1, format_error/1,
- renegotiate/1, prf/5, negotiated_protocol/1, negotiated_next_protocol/1,
+
+-export([cipher_suites/0, cipher_suites/1, eccs/0, eccs/1, versions/0,
+ format_error/1, renegotiate/1, prf/5, negotiated_protocol/1,
connection_information/1, connection_information/2]).
%% Misc
-export([handle_options/2, tls_version/1]).
--deprecated({negotiated_next_protocol, 1, next_major_release}).
--deprecated({connection_info, 1, next_major_release}).
-
-include("ssl_api.hrl").
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
@@ -187,16 +184,24 @@ ssl_accept(ListenSocket, SslOptions) when is_port(ListenSocket) ->
ssl_accept(#sslsocket{} = Socket, [], Timeout) when (is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity)->
ssl_accept(Socket, Timeout);
-ssl_accept(#sslsocket{fd = {_, _, _, Tracker}} = Socket, SslOpts0, Timeout) when
+ssl_accept(#sslsocket{fd = {_, _, _, Tracker}} = Socket, SslOpts, Timeout) when
(is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity)->
try
- {ok, EmOpts, InheritedSslOpts} = tls_socket:get_all_opts(Tracker),
- SslOpts = handle_options(SslOpts0, InheritedSslOpts),
+ {ok, EmOpts, _} = tls_socket:get_all_opts(Tracker),
ssl_connection:handshake(Socket, {SslOpts,
tls_socket:emulated_socket_options(EmOpts, #socket_options{})}, Timeout)
catch
Error = {error, _Reason} -> Error
end;
+ssl_accept(#sslsocket{pid = Pid, fd = {_, _, _}} = Socket, SslOpts, Timeout) when
+ (is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity)->
+ try
+ {ok, EmOpts, _} = dtls_udp_listener:get_all_opts(Pid),
+ ssl_connection:handshake(Socket, {SslOpts,
+ tls_socket:emulated_socket_options(EmOpts, #socket_options{})}, Timeout)
+ catch
+ Error = {error, _Reason} -> Error
+ end;
ssl_accept(Socket, SslOptions, Timeout) when is_port(Socket),
(is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity) ->
{Transport,_,_,_} =
@@ -215,7 +220,6 @@ ssl_accept(Socket, SslOptions, Timeout) when is_port(Socket),
catch
Error = {error, _Reason} -> Error
end.
-
%%--------------------------------------------------------------------
-spec close(#sslsocket{}) -> term().
%%
@@ -223,6 +227,8 @@ ssl_accept(Socket, SslOptions, Timeout) when is_port(Socket),
%%--------------------------------------------------------------------
close(#sslsocket{pid = Pid}) when is_pid(Pid) ->
ssl_connection:close(Pid, {close, ?DEFAULT_TIMEOUT});
+close(#sslsocket{pid = {udp, #config{udp_handler = {Pid, _}}}}) ->
+ dtls_udp_listener:close(Pid);
close(#sslsocket{pid = {ListenSocket, #config{transport_info={Transport,_, _, _}}}}) ->
Transport:close(ListenSocket).
@@ -251,6 +257,8 @@ send(#sslsocket{pid = Pid}, Data) when is_pid(Pid) ->
ssl_connection:send(Pid, Data);
send(#sslsocket{pid = {_, #config{transport_info={gen_udp, _, _, _}}}}, _) ->
{error,enotconn}; %% Emulate connection behaviour
+send(#sslsocket{pid = {udp,_}}, _) ->
+ {error,enotconn};
send(#sslsocket{pid = {ListenSocket, #config{transport_info={Transport, _, _, _}}}}, Data) ->
Transport:send(ListenSocket, Data). %% {error,enotconn}
@@ -265,6 +273,8 @@ recv(Socket, Length) ->
recv(#sslsocket{pid = Pid}, Length, Timeout) when is_pid(Pid),
(is_integer(Timeout) andalso Timeout >= 0) or (Timeout == infinity)->
ssl_connection:recv(Pid, Length, Timeout);
+recv(#sslsocket{pid = {udp,_}}, _, _) ->
+ {error,enotconn};
recv(#sslsocket{pid = {Listen,
#config{transport_info = {Transport, _, _, _}}}}, _,_) when is_port(Listen)->
Transport:recv(Listen, 0). %% {error,enotconn}
@@ -277,10 +287,14 @@ recv(#sslsocket{pid = {Listen,
%%--------------------------------------------------------------------
controlling_process(#sslsocket{pid = Pid}, NewOwner) when is_pid(Pid), is_pid(NewOwner) ->
ssl_connection:new_user(Pid, NewOwner);
+controlling_process(#sslsocket{pid = {udp, _}},
+ NewOwner) when is_pid(NewOwner) ->
+ ok; %% Meaningless but let it be allowed to conform with TLS
controlling_process(#sslsocket{pid = {Listen,
#config{transport_info = {Transport, _, _, _}}}},
NewOwner) when is_port(Listen),
is_pid(NewOwner) ->
+ %% Meaningless but let it be allowed to conform with normal sockets
Transport:controlling_process(Listen, NewOwner).
@@ -290,22 +304,24 @@ controlling_process(#sslsocket{pid = {Listen,
%% Description: Return SSL information for the connection
%%--------------------------------------------------------------------
connection_information(#sslsocket{pid = Pid}) when is_pid(Pid) ->
- case ssl_connection:connection_information(Pid) of
+ case ssl_connection:connection_information(Pid, false) of
{ok, Info} ->
{ok, [Item || Item = {_Key, Value} <- Info, Value =/= undefined]};
Error ->
Error
end;
connection_information(#sslsocket{pid = {Listen, _}}) when is_port(Listen) ->
- {error, enotconn}.
+ {error, enotconn};
+connection_information(#sslsocket{pid = {udp,_}}) ->
+ {error,enotconn}.
%%--------------------------------------------------------------------
-spec connection_information(#sslsocket{}, [atom()]) -> {ok, list()} | {error, reason()}.
%%
%% Description: Return SSL information for the connection
%%--------------------------------------------------------------------
-connection_information(#sslsocket{} = SSLSocket, Items) ->
- case connection_information(SSLSocket) of
+connection_information(#sslsocket{pid = Pid}, Items) when is_pid(Pid) ->
+ case ssl_connection:connection_information(Pid, include_security_info(Items)) of
{ok, Info} ->
{ok, [Item || Item = {Key, Value} <- Info, lists:member(Key, Items),
Value =/= undefined]};
@@ -314,29 +330,22 @@ connection_information(#sslsocket{} = SSLSocket, Items) ->
end.
%%--------------------------------------------------------------------
-%% Deprecated
--spec connection_info(#sslsocket{}) -> {ok, {tls_record:tls_atom_version(), ssl_cipher:erl_cipher_suite()}} |
- {error, reason()}.
-%%
-%% Description: Returns ssl protocol and cipher used for the connection
-%%--------------------------------------------------------------------
-connection_info(#sslsocket{} = SSLSocket) ->
- case connection_information(SSLSocket) of
- {ok, Result} ->
- {ok, {proplists:get_value(protocol, Result), proplists:get_value(cipher_suite, Result)}};
- Error ->
- Error
- end.
-
-%%--------------------------------------------------------------------
-spec peername(#sslsocket{}) -> {ok, {inet:ip_address(), inet:port_number()}} | {error, reason()}.
%%
%% Description: same as inet:peername/1.
%%--------------------------------------------------------------------
+peername(#sslsocket{pid = Pid, fd = {Transport, Socket, _}}) when is_pid(Pid)->
+ dtls_socket:peername(Transport, Socket);
peername(#sslsocket{pid = Pid, fd = {Transport, Socket, _, _}}) when is_pid(Pid)->
tls_socket:peername(Transport, Socket);
+peername(#sslsocket{pid = {udp = Transport, #config{udp_handler = {_Pid, _}}}}) ->
+ dtls_socket:peername(Transport, undefined);
+peername(#sslsocket{pid = Pid, fd = {gen_udp= Transport, Socket, _, _}}) when is_pid(Pid) ->
+ dtls_socket:peername(Transport, Socket);
peername(#sslsocket{pid = {ListenSocket, #config{transport_info = {Transport,_,_,_}}}}) ->
- tls_socket:peername(Transport, ListenSocket). %% Will return {error, enotconn}
+ tls_socket:peername(Transport, ListenSocket); %% Will return {error, enotconn}
+peername(#sslsocket{pid = {udp,_}}) ->
+ {error,enotconn}.
%%--------------------------------------------------------------------
-spec peercert(#sslsocket{}) ->{ok, DerCert::binary()} | {error, reason()}.
@@ -350,6 +359,8 @@ peercert(#sslsocket{pid = Pid}) when is_pid(Pid) ->
Result ->
Result
end;
+peercert(#sslsocket{pid = {udp, _}}) ->
+ {error, enotconn};
peercert(#sslsocket{pid = {Listen, _}}) when is_port(Listen) ->
{error, enotconn}.
@@ -363,20 +374,6 @@ negotiated_protocol(#sslsocket{pid = Pid}) ->
ssl_connection:negotiated_protocol(Pid).
%%--------------------------------------------------------------------
--spec negotiated_next_protocol(#sslsocket{}) -> {ok, binary()} | {error, reason()}.
-%%
-%% Description: Returns the next protocol that has been negotiated. If no
-%% protocol has been negotiated will return {error, next_protocol_not_negotiated}
-%%--------------------------------------------------------------------
-negotiated_next_protocol(Socket) ->
- case negotiated_protocol(Socket) of
- {error, protocol_not_negotiated} ->
- {error, next_protocol_not_negotiated};
- Res ->
- Res
- end.
-
-%%--------------------------------------------------------------------
-spec cipher_suites() -> [ssl_cipher:erl_cipher_suite()] | [string()].
%%--------------------------------------------------------------------
cipher_suites() ->
@@ -506,6 +503,8 @@ getstat(#sslsocket{pid = Pid, fd = {Transport, Socket, _, _}}, Options) when is_
shutdown(#sslsocket{pid = {Listen, #config{transport_info = {Transport,_, _, _}}}},
How) when is_port(Listen) ->
Transport:shutdown(Listen, How);
+shutdown(#sslsocket{pid = {udp,_}},_) ->
+ {error, enotconn};
shutdown(#sslsocket{pid = Pid}, How) ->
ssl_connection:shutdown(Pid, How).
@@ -518,23 +517,12 @@ sockname(#sslsocket{pid = {Listen, #config{transport_info = {Transport, _, _, _
tls_socket:sockname(Transport, Listen);
sockname(#sslsocket{pid = {udp, #config{udp_handler = {Pid, _}}}}) ->
dtls_udp_listener:sockname(Pid);
-sockname(#sslsocket{pid = Pid, fd = {gen_udp= Transport, Socket, _, _}}) when is_pid(Pid) ->
+sockname(#sslsocket{pid = Pid, fd = {Transport, Socket, _}}) when is_pid(Pid) ->
dtls_socket:sockname(Transport, Socket);
sockname(#sslsocket{pid = Pid, fd = {Transport, Socket, _, _}}) when is_pid(Pid) ->
tls_socket:sockname(Transport, Socket).
%%---------------------------------------------------------------
--spec session_info(#sslsocket{}) -> {ok, list()} | {error, reason()}.
-%%
-%% Description: Returns list of session info currently [{session_id, session_id(),
-%% {cipher_suite, cipher_suite()}]
-%%--------------------------------------------------------------------
-session_info(#sslsocket{pid = Pid}) when is_pid(Pid) ->
- ssl_connection:session_info(Pid);
-session_info(#sslsocket{pid = {Listen,_}}) when is_port(Listen) ->
- {error, enotconn}.
-
-%%---------------------------------------------------------------
-spec versions() -> [{ssl_app, string()} | {supported, [tls_record:tls_atom_version()]} |
{available, [tls_record:tls_atom_version()]}].
%%
@@ -555,6 +543,8 @@ versions() ->
%%--------------------------------------------------------------------
renegotiate(#sslsocket{pid = Pid}) when is_pid(Pid) ->
ssl_connection:renegotiation(Pid);
+renegotiate(#sslsocket{pid = {udp,_}}) ->
+ {error, enotconn};
renegotiate(#sslsocket{pid = {Listen,_}}) when is_port(Listen) ->
{error, enotconn}.
@@ -568,6 +558,8 @@ renegotiate(#sslsocket{pid = {Listen,_}}) when is_port(Listen) ->
prf(#sslsocket{pid = Pid},
Secret, Label, Seed, WantedLength) when is_pid(Pid) ->
ssl_connection:prf(Pid, Secret, Label, Seed, WantedLength);
+prf(#sslsocket{pid = {udp,_}}, _,_,_,_) ->
+ {error, enotconn};
prf(#sslsocket{pid = {Listen,_}}, _,_,_,_) when is_port(Listen) ->
{error, enotconn}.
@@ -696,7 +688,7 @@ handle_options(Opts0, Role) ->
[RecordCb:protocol_version(Vsn) || Vsn <- Vsns]
end,
- Protocol = proplists:get_value(protocol, Opts, tls),
+ Protocol = handle_option(protocol, Opts, tls),
SSLOptions = #ssl_options{
versions = Versions,
@@ -755,7 +747,7 @@ handle_options(Opts0, Role) ->
honor_ecc_order = handle_option(honor_ecc_order, Opts,
default_option_role(server, false, Role),
server, Role),
- protocol = Protocol,
+ protocol = Protocol,
padding_check = proplists:get_value(padding_check, Opts, true),
beast_mitigation = handle_option(beast_mitigation, Opts, one_n_minus_one),
fallback = handle_option(fallback, Opts,
@@ -1032,6 +1024,10 @@ validate_option(v2_hello_compatible, Value) when is_boolean(Value) ->
Value;
validate_option(max_handshake_size, Value) when is_integer(Value) andalso Value =< ?MAX_UNIT24 ->
Value;
+validate_option(protocol, Value = tls) ->
+ Value;
+validate_option(protocol, Value = dtls) ->
+ Value;
validate_option(Opt, Value) ->
throw({error, {options, {Opt, Value}}}).
@@ -1069,17 +1065,37 @@ validate_binary_list(Opt, List) ->
(Bin) ->
throw({error, {options, {Opt, {invalid_protocol, Bin}}}})
end, List).
-
validate_versions([], Versions) ->
Versions;
validate_versions([Version | Rest], Versions) when Version == 'tlsv1.2';
Version == 'tlsv1.1';
Version == tlsv1;
Version == sslv3 ->
- validate_versions(Rest, Versions);
+ tls_validate_versions(Rest, Versions);
+validate_versions([Version | Rest], Versions) when Version == 'dtlsv1';
+ Version == 'dtlsv1.2'->
+ dtls_validate_versions(Rest, Versions);
validate_versions([Ver| _], Versions) ->
throw({error, {options, {Ver, {versions, Versions}}}}).
+tls_validate_versions([], Versions) ->
+ Versions;
+tls_validate_versions([Version | Rest], Versions) when Version == 'tlsv1.2';
+ Version == 'tlsv1.1';
+ Version == tlsv1;
+ Version == sslv3 ->
+ tls_validate_versions(Rest, Versions);
+tls_validate_versions([Ver| _], Versions) ->
+ throw({error, {options, {Ver, {versions, Versions}}}}).
+
+dtls_validate_versions([], Versions) ->
+ Versions;
+dtls_validate_versions([Version | Rest], Versions) when Version == 'dtlsv1';
+ Version == 'dtlsv1.2'->
+ dtls_validate_versions(Rest, Versions);
+dtls_validate_versions([Ver| _], Versions) ->
+ throw({error, {options, {Ver, {versions, Versions}}}}).
+
validate_inet_option(mode, Value)
when Value =/= list, Value =/= binary ->
throw({error, {options, {mode,Value}}});
@@ -1151,18 +1167,18 @@ handle_cipher_option(Value, Version) when is_list(Value) ->
binary_cipher_suites(Version, []) ->
%% Defaults to all supported suites that does
%% not require explicit configuration
- ssl_cipher:filter_suites(ssl_cipher:suites(Version));
+ ssl_cipher:filter_suites(ssl_cipher:suites(tls_version(Version)));
binary_cipher_suites(Version, [Tuple|_] = Ciphers0) when is_tuple(Tuple) ->
Ciphers = [ssl_cipher:suite(C) || C <- Ciphers0],
binary_cipher_suites(Version, Ciphers);
binary_cipher_suites(Version, [Cipher0 | _] = Ciphers0) when is_binary(Cipher0) ->
- All = ssl_cipher:all_suites(Version),
+ All = ssl_cipher:all_suites(tls_version(Version)),
case [Cipher || Cipher <- Ciphers0, lists:member(Cipher, All)] of
[] ->
%% Defaults to all supported suites that does
%% not require explicit configuration
- ssl_cipher:filter_suites(ssl_cipher:suites(Version));
+ ssl_cipher:filter_suites(ssl_cipher:suites(tls_version(Version)));
Ciphers ->
Ciphers
end;
@@ -1175,7 +1191,8 @@ binary_cipher_suites(Version, Ciphers0) ->
Ciphers = [ssl_cipher:openssl_suite(C) || C <- string:tokens(Ciphers0, ":")],
binary_cipher_suites(Version, Ciphers).
-handle_eccs_option(Value, {_Major, Minor}) when is_list(Value) ->
+handle_eccs_option(Value, Version) when is_list(Value) ->
+ {_Major, Minor} = tls_version(Version),
try tls_v1:ecc_curves(Minor, Value) of
Curves -> #elliptic_curves{elliptic_curve_list = Curves}
catch
@@ -1348,7 +1365,10 @@ new_ssl_options([{signature_algs, Value} | Rest], #ssl_options{} = Opts, RecordC
handle_hashsigns_option(Value,
tls_version(RecordCB:highest_protocol_version()))},
RecordCB);
-
+new_ssl_options([{protocol, dtls = Value} | Rest], #ssl_options{} = Opts, dtls_record = RecordCB) ->
+ new_ssl_options(Rest, Opts#ssl_options{protocol = Value}, RecordCB);
+new_ssl_options([{protocol, tls = Value} | Rest], #ssl_options{} = Opts, tls_record = RecordCB) ->
+ new_ssl_options(Rest, Opts#ssl_options{protocol = Value}, RecordCB);
new_ssl_options([{Key, Value} | _Rest], #ssl_options{}, _) ->
throw({error, {options, {Key, Value}}}).
@@ -1415,3 +1435,13 @@ default_cb_info(tls) ->
{gen_tcp, tcp, tcp_closed, tcp_error};
default_cb_info(dtls) ->
{gen_udp, udp, udp_closed, udp_error}.
+
+include_security_info([]) ->
+ false;
+include_security_info([Item | Items]) ->
+ case lists:member(Item, [client_random, server_random, master_secret]) of
+ true ->
+ true;
+ false ->
+ include_security_info(Items)
+ end.
diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl
index 32fec03b8e..d04f09efdc 100644
--- a/lib/ssl/src/ssl_cipher.erl
+++ b/lib/ssl/src/ssl_cipher.erl
@@ -40,7 +40,8 @@
ec_keyed_suites/0, anonymous_suites/1, psk_suites/1, srp_suites/0,
rc4_suites/1, des_suites/1, openssl_suite/1, openssl_suite_name/1, filter/2, filter_suites/1,
hash_algorithm/1, sign_algorithm/1, is_acceptable_hash/2, is_fallback/1,
- random_bytes/1, calc_aad/3, calc_mac_hash/4]).
+ random_bytes/1, calc_mac_hash/4,
+ is_stream_ciphersuite/1]).
-export_type([cipher_suite/0,
erl_cipher_suite/0, openssl_cipher_suite/0,
@@ -156,7 +157,7 @@ cipher_aead(?CHACHA20_POLY1305, CipherState, SeqNo, AAD, Fragment, Version) ->
aead_cipher(chacha20_poly1305, #cipher_state{key=Key} = CipherState, SeqNo, AAD0, Fragment, _Version) ->
CipherLen = erlang:iolist_size(Fragment),
AAD = <<AAD0/binary, ?UINT16(CipherLen)>>,
- Nonce = <<SeqNo:64/integer>>,
+ Nonce = ?uint64(SeqNo),
{Content, CipherTag} = crypto:block_encrypt(chacha20_poly1305, Key, Nonce, {AAD, Fragment}),
{<<Content/binary, CipherTag/binary>>, CipherState};
aead_cipher(Type, #cipher_state{key=Key, iv = IV0, nonce = Nonce} = CipherState, _SeqNo, AAD0, Fragment, _Version) ->
@@ -279,7 +280,7 @@ aead_ciphertext_to_state(chacha20_poly1305, SeqNo, _IV, AAD0, Fragment, _Version
CipherLen = size(Fragment) - 16,
<<CipherText:CipherLen/bytes, CipherTag:16/bytes>> = Fragment,
AAD = <<AAD0/binary, ?UINT16(CipherLen)>>,
- Nonce = <<SeqNo:64/integer>>,
+ Nonce = ?uint64(SeqNo),
{Nonce, AAD, CipherText, CipherTag};
aead_ciphertext_to_state(_, _SeqNo, <<Salt:4/bytes, _/binary>>, AAD0, Fragment, _Version) ->
CipherLen = size(Fragment) - 24,
@@ -310,18 +311,21 @@ aead_decipher(Type, #cipher_state{key = Key, iv = IV} = CipherState,
%%--------------------------------------------------------------------
suites({3, 0}) ->
ssl_v3:suites();
-suites({3, N}) ->
- tls_v1:suites(N);
-suites(Version) ->
- suites(dtls_v1:corresponding_tls_version(Version)).
+suites({3, Minor}) ->
+ tls_v1:suites(Minor);
+suites({_, Minor}) ->
+ dtls_v1:suites(Minor).
-all_suites(Version) ->
+all_suites({3, _} = Version) ->
suites(Version)
++ anonymous_suites(Version)
++ psk_suites(Version)
++ srp_suites()
++ rc4_suites(Version)
- ++ des_suites(Version).
+ ++ des_suites(Version);
+all_suites(Version) ->
+ dtls_v1:all_suites(Version).
+
%%--------------------------------------------------------------------
-spec anonymous_suites(ssl_record:ssl_version() | integer()) -> [cipher_suite()].
%%
@@ -1527,10 +1531,6 @@ is_fallback(CipherSuites)->
random_bytes(N) ->
crypto:strong_rand_bytes(N).
-calc_aad(Type, {MajVer, MinVer},
- #{sequence_number := SeqNo}) ->
- <<SeqNo:64/integer, ?BYTE(Type), ?BYTE(MajVer), ?BYTE(MinVer)>>.
-
calc_mac_hash(Type, Version,
PlainFragment, #{sequence_number := SeqNo,
mac_secret := MacSecret,
@@ -1541,6 +1541,10 @@ calc_mac_hash(Type, Version,
MacSecret, SeqNo, Type,
Length, PlainFragment).
+is_stream_ciphersuite({_, rc4_128, _, _}) ->
+ true;
+is_stream_ciphersuite(_) ->
+ false.
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
diff --git a/lib/ssl/src/ssl_connection.erl b/lib/ssl/src/ssl_connection.erl
index 0c17891fbc..df9b9e8a63 100644
--- a/lib/ssl/src/ssl_connection.erl
+++ b/lib/ssl/src/ssl_connection.erl
@@ -42,9 +42,9 @@
%% User Events
-export([send/2, recv/3, close/2, shutdown/2,
- new_user/2, get_opts/2, set_opts/2, session_info/1,
+ new_user/2, get_opts/2, set_opts/2,
peer_certificate/1, renegotiation/1, negotiated_protocol/1, prf/5,
- connection_information/1, handle_common_event/5
+ connection_information/2, handle_common_event/5
]).
%% General gen_statem state functions with extra callback argument
@@ -148,19 +148,19 @@ socket_control(Connection, Socket, Pid, Transport) ->
%%--------------------------------------------------------------------
socket_control(Connection, Socket, Pid, Transport, udp_listner) ->
%% dtls listner process must have the socket control
- {ok, dtls_socket:socket(Pid, Transport, Socket, Connection)};
+ {ok, Connection:socket(Pid, Transport, Socket, Connection, undefined)};
socket_control(tls_connection = Connection, Socket, Pid, Transport, ListenTracker) ->
case Transport:controlling_process(Socket, Pid) of
ok ->
- {ok, tls_socket:socket(Pid, Transport, Socket, Connection, ListenTracker)};
+ {ok, Connection:socket(Pid, Transport, Socket, Connection, ListenTracker)};
{error, Reason} ->
{error, Reason}
end;
socket_control(dtls_connection = Connection, {_, Socket}, Pid, Transport, ListenTracker) ->
case Transport:controlling_process(Socket, Pid) of
ok ->
- {ok, tls_socket:socket(Pid, Transport, Socket, Connection, ListenTracker)};
+ {ok, Connection:socket(Pid, Transport, Socket, Connection, ListenTracker)};
{error, Reason} ->
{error, Reason}
end.
@@ -185,12 +185,12 @@ recv(Pid, Length, Timeout) ->
call(Pid, {recv, Length, Timeout}).
%%--------------------------------------------------------------------
--spec connection_information(pid()) -> {ok, list()} | {error, reason()}.
+-spec connection_information(pid(), boolean()) -> {ok, list()} | {error, reason()}.
%%
%% Description: Get the SNI hostname
%%--------------------------------------------------------------------
-connection_information(Pid) when is_pid(Pid) ->
- call(Pid, connection_information).
+connection_information(Pid, IncludeSecrityInfo) when is_pid(Pid) ->
+ call(Pid, {connection_information, IncludeSecrityInfo}).
%%--------------------------------------------------------------------
-spec close(pid(), {close, Timeout::integer() |
@@ -247,14 +247,6 @@ set_opts(ConnectionPid, Options) ->
call(ConnectionPid, {set_opts, Options}).
%%--------------------------------------------------------------------
--spec session_info(pid()) -> {ok, list()} | {error, reason()}.
-%%
-%% Description: Returns info about the ssl session
-%%--------------------------------------------------------------------
-session_info(ConnectionPid) ->
- call(ConnectionPid, session_info).
-
-%%--------------------------------------------------------------------
-spec peer_certificate(pid()) -> {ok, binary()| undefined} | {error, reason()}.
%%
%% Description: Returns the peer cert
@@ -363,11 +355,13 @@ init({call, From}, {start, Timeout}, State0, Connection) ->
timer = Timer}),
Connection:next_event(hello, Record, State);
init({call, From}, {start, {Opts, EmOpts}, Timeout},
- #state{role = Role} = State0, Connection) ->
+ #state{role = Role, ssl_options = OrigSSLOptions,
+ socket_options = SockOpts} = State0, Connection) ->
try
- State = ssl_config(Opts, Role, State0),
+ SslOpts = ssl:handle_options(Opts, OrigSSLOptions),
+ State = ssl_config(SslOpts, Role, State0),
init({call, From}, {start, Timeout},
- State#state{ssl_options = Opts, socket_options = EmOpts}, Connection)
+ State#state{ssl_options = SslOpts, socket_options = new_emulated(EmOpts, SockOpts)}, Connection)
catch throw:Error ->
{stop_and_reply, normal, {reply, From, {error, Error}}}
end;
@@ -432,11 +426,11 @@ abbreviated(internal, #finished{verify_data = Data} = Finished,
verified ->
ConnectionStates1 =
ssl_record:set_server_verify_data(current_read, Data, ConnectionStates0),
- State1 =
+ {State1, Actions} =
finalize_handshake(State0#state{connection_states = ConnectionStates1},
abbreviated, Connection),
{Record, State} = prepare_connection(State1#state{expecting_finished = false}, Connection),
- Connection:next_event(connection, Record, State);
+ Connection:next_event(connection, Record, State, Actions);
#alert{} = Alert ->
handle_own_alert(Alert, Version, abbreviated, State0)
end;
@@ -773,14 +767,12 @@ connection({call, From}, renegotiate, #state{protocol_cb = Connection} = State,
connection({call, From}, peer_certificate,
#state{session = #session{peer_certificate = Cert}} = State, _) ->
hibernate_after(connection, State, [{reply, From, {ok, Cert}}]);
-connection({call, From}, connection_information, State, _) ->
+connection({call, From}, {connection_information, true}, State, _) ->
+ Info = connection_info(State) ++ security_info(State),
+ hibernate_after(connection, State, [{reply, From, {ok, Info}}]);
+connection({call, From}, {connection_information, false}, State, _) ->
Info = connection_info(State),
hibernate_after(connection, State, [{reply, From, {ok, Info}}]);
-connection({call, From}, session_info, #state{session = #session{session_id = Id,
- cipher_suite = Suite}} = State, _) ->
- SessionInfo = [{session_id, Id},
- {cipher_suite, ssl_cipher:erl_suite_definition(Suite)}],
- hibernate_after(connection, State, [{reply, From, SessionInfo}]);
connection({call, From}, negotiated_protocol,
#state{negotiated_protocol = undefined} = State, _) ->
hibernate_after(connection, State, [{reply, From, {error, protocol_not_negotiated}}]);
@@ -856,6 +848,7 @@ handle_common_event(internal, #change_cipher_spec{type = <<1>>}, StateName,
StateName, State);
handle_common_event(_Type, Msg, StateName, #state{negotiated_version = Version} = State,
_) ->
+ ct:pal("Unexpected msg ~p", [Msg]),
Alert = ?ALERT_REC(?FATAL,?UNEXPECTED_MESSAGE),
handle_own_alert(Alert, Version, {StateName, Msg}, State).
@@ -1192,7 +1185,8 @@ handle_alert(#alert{level = ?WARNING} = Alert, StateName,
%%% Internal functions
%%--------------------------------------------------------------------
connection_info(#state{sni_hostname = SNIHostname,
- session = #session{cipher_suite = CipherSuite, ecc = ECCCurve},
+ session = #session{session_id = SessionId,
+ cipher_suite = CipherSuite, ecc = ECCCurve},
protocol_cb = Connection,
negotiated_version = {_,_} = Version,
ssl_options = Opts}) ->
@@ -1207,9 +1201,18 @@ connection_info(#state{sni_hostname = SNIHostname,
[]
end,
[{protocol, RecordCB:protocol_version(Version)},
+ {session_id, SessionId},
{cipher_suite, CipherSuiteDef},
{sni_hostname, SNIHostname} | CurveInfo] ++ ssl_options_list(Opts).
+security_info(#state{connection_states = ConnectionStates}) ->
+ #{security_parameters :=
+ #security_parameters{client_random = ClientRand,
+ server_random = ServerRand,
+ master_secret = MasterSecret}} =
+ ssl_record:current_connection_state(ConnectionStates, read),
+ [{client_random, ClientRand}, {server_random, ServerRand}, {master_secret, MasterSecret}].
+
do_server_hello(Type, #hello_extensions{next_protocol_negotiation = NextProtocols} =
ServerHelloExt,
#state{negotiated_version = Version,
@@ -1236,13 +1239,13 @@ new_server_hello(#server_hello{cipher_suite = CipherSuite,
negotiated_version = Version} = State0, Connection) ->
try server_certify_and_key_exchange(State0, Connection) of
#state{} = State1 ->
- State2 = server_hello_done(State1, Connection),
+ {State2, Actions} = server_hello_done(State1, Connection),
Session =
Session0#session{session_id = SessionId,
cipher_suite = CipherSuite,
compression_method = Compression},
{Record, State} = Connection:next_record(State2#state{session = Session}),
- Connection:next_event(certify, Record, State)
+ Connection:next_event(certify, Record, State, Actions)
catch
#alert{} = Alert ->
handle_own_alert(Alert, Version, hello, State0)
@@ -1257,10 +1260,10 @@ resumed_server_hello(#state{session = Session,
{_, ConnectionStates1} ->
State1 = State0#state{connection_states = ConnectionStates1,
session = Session},
- State2 =
+ {State2, Actions} =
finalize_handshake(State1, abbreviated, Connection),
{Record, State} = Connection:next_record(State2),
- Connection:next_event(abbreviated, Record, State);
+ Connection:next_event(abbreviated, Record, State, Actions);
#alert{} = Alert ->
handle_own_alert(Alert, Version, hello, State0)
end.
@@ -1343,12 +1346,12 @@ client_certify_and_key_exchange(#state{negotiated_version = Version} =
State0, Connection) ->
try do_client_certify_and_key_exchange(State0, Connection) of
State1 = #state{} ->
- State2 = finalize_handshake(State1, certify, Connection),
+ {State2, Actions} = finalize_handshake(State1, certify, Connection),
State3 = State2#state{
%% Reinitialize
client_certificate_requested = false},
{Record, State} = Connection:next_record(State3),
- Connection:next_event(cipher, Record, State)
+ Connection:next_event(cipher, Record, State, Actions)
catch
throw:#alert{} = Alert ->
handle_own_alert(Alert, Version, certify, State0)
@@ -1870,11 +1873,11 @@ cipher_role(server, Data, Session, #state{connection_states = ConnectionStates0
Connection) ->
ConnectionStates1 = ssl_record:set_client_verify_data(current_read, Data,
ConnectionStates0),
- State1 =
+ {State1, Actions} =
finalize_handshake(State0#state{connection_states = ConnectionStates1,
session = Session}, cipher, Connection),
{Record, State} = prepare_connection(State1, Connection),
- Connection:next_event(connection, Record, State).
+ Connection:next_event(connection, Record, State, Actions).
is_anonymous(Algo) when Algo == dh_anon;
Algo == ecdh_anon;
@@ -2305,7 +2308,7 @@ format_reply(_, _,#socket_options{active = false, mode = Mode, packet = Packet,
{ok, do_format_reply(Mode, Packet, Header, Data)};
format_reply(Transport, Socket, #socket_options{active = _, mode = Mode, packet = Packet,
header = Header}, Data, Tracker, Connection) ->
- {ssl, tls_socket:socket(self(), Transport, Socket, Connection, Tracker),
+ {ssl, Connection:socket(self(), Transport, Socket, Connection, Tracker),
do_format_reply(Mode, Packet, Header, Data)}.
deliver_packet_error(Transport, Socket, SO= #socket_options{active = Active}, Data, Pid, From, Tracker, Connection) ->
@@ -2314,7 +2317,7 @@ deliver_packet_error(Transport, Socket, SO= #socket_options{active = Active}, Da
format_packet_error(_, _,#socket_options{active = false, mode = Mode}, Data, _, _) ->
{error, {invalid_packet, do_format_reply(Mode, raw, 0, Data)}};
format_packet_error(Transport, Socket, #socket_options{active = _, mode = Mode}, Data, Tracker, Connection) ->
- {ssl_error, tls_socket:socket(self(), Transport, Socket, Connection, Tracker),
+ {ssl_error, Connection:socket(self(), Transport, Socket, Connection, Tracker),
{invalid_packet, do_format_reply(Mode, raw, 0, Data)}}.
do_format_reply(binary, _, N, Data) when N > 0 -> % Header mode
@@ -2369,11 +2372,11 @@ alert_user(Transport, Tracker, Socket, Active, Pid, From, Alert, Role, Connectio
case ssl_alert:reason_code(Alert, Role) of
closed ->
send_or_reply(Active, Pid, From,
- {ssl_closed, tls_socket:socket(self(),
+ {ssl_closed, Connection:socket(self(),
Transport, Socket, Connection, Tracker)});
ReasonCode ->
send_or_reply(Active, Pid, From,
- {ssl_error, tls_socket:socket(self(),
+ {ssl_error, Connection:socket(self(),
Transport, Socket, Connection, Tracker), ReasonCode})
end.
@@ -2472,3 +2475,8 @@ update_ssl_options_from_sni(OrigSSLOptions, SNIHostname) ->
_ ->
ssl:handle_options(SSLOption, OrigSSLOptions)
end.
+
+new_emulated([], EmOpts) ->
+ EmOpts;
+new_emulated(NewEmOpts, _) ->
+ NewEmOpts.
diff --git a/lib/ssl/src/ssl_connection.hrl b/lib/ssl/src/ssl_connection.hrl
index b597c059af..368eaf6090 100644
--- a/lib/ssl/src/ssl_connection.hrl
+++ b/lib/ssl/src/ssl_connection.hrl
@@ -91,7 +91,8 @@
%% underlaying packet format. Introduced by DTLS - RFC 4347.
%% The mecahnism is also usefull in TLS although we do not
%% need to worry about packet loss in TLS. In DTLS we need to track DTLS handshake seqnr
- flight_state = reliable %% reliable | {retransmit, integer()}| {waiting, ref(), integer()} - last two is used in DTLS over udp.
+ flight_state = reliable, %% reliable | {retransmit, integer()}| {waiting, ref(), integer()} - last two is used in DTLS over udp.
+ protocol_specific = #{} :: map()
}).
-define(DEFAULT_DIFFIE_HELLMAN_PARAMS,
#'DHParameter'{prime = ?DEFAULT_DIFFIE_HELLMAN_PRIME,
diff --git a/lib/ssl/src/ssl_internal.hrl b/lib/ssl/src/ssl_internal.hrl
index c34af9f82c..0fbaa82b6a 100644
--- a/lib/ssl/src/ssl_internal.hrl
+++ b/lib/ssl/src/ssl_internal.hrl
@@ -76,7 +76,7 @@
-define(ALL_SUPPORTED_VERSIONS, ['tlsv1.2', 'tlsv1.1', tlsv1]).
-define(MIN_SUPPORTED_VERSIONS, ['tlsv1.1', tlsv1]).
-define(ALL_DATAGRAM_SUPPORTED_VERSIONS, ['dtlsv1.2', dtlsv1]).
--define(MIN_DATAGRAM_SUPPORTED_VERSIONS, ['dtlsv1.2', dtlsv1]).
+-define(MIN_DATAGRAM_SUPPORTED_VERSIONS, [dtlsv1]).
-define('24H_in_msec', 86400000).
-define('24H_in_sec', 86400).
@@ -144,7 +144,7 @@
honor_ecc_order :: boolean(),
v2_hello_compatible :: boolean(),
max_handshake_size :: integer()
- }).
+ }).
-record(socket_options,
{
diff --git a/lib/ssl/src/ssl_record.erl b/lib/ssl/src/ssl_record.erl
index 539e189c4f..24e52655b0 100644
--- a/lib/ssl/src/ssl_record.erl
+++ b/lib/ssl/src/ssl_record.erl
@@ -45,11 +45,7 @@
-export([compress/3, uncompress/3, compressions/0]).
%% Payload encryption/decryption
--export([cipher/4, decipher/4, is_correct_mac/2,
- cipher_aead/4, decipher_aead/4]).
-
-%% Encoding
--export([encode_plain_text/4]).
+-export([cipher/4, decipher/4, cipher_aead/4, is_correct_mac/2]).
-export_type([ssl_version/0, ssl_atom_version/0, connection_states/0, connection_state/0]).
@@ -271,26 +267,6 @@ set_pending_cipher_state(#{pending_read := Read,
pending_read => Read#{cipher_state => ServerState},
pending_write => Write#{cipher_state => ClientState}}.
-encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
- security_parameters :=
- #security_parameters{
- cipher_type = ?AEAD,
- compression_algorithm = CompAlg}
- } = WriteState0) ->
- {Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
- WriteState1 = WriteState0#{compression_state => CompS1},
- AAD = ssl_cipher:calc_aad(Type, Version, WriteState1),
- ssl_record:cipher_aead(Version, Comp, WriteState1, AAD);
-encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
- security_parameters :=
- #security_parameters{compression_algorithm = CompAlg}
- }= WriteState0) ->
- {Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
- WriteState1 = WriteState0#{compression_state => CompS1},
- MacHash = ssl_cipher:calc_mac_hash(Type, Version, Comp, WriteState1),
- ssl_record:cipher(Version, Comp, WriteState1, MacHash);
-encode_plain_text(_,_,_,CS) ->
- exit({cs, CS}).
uncompress(?NULL, Data, CS) ->
{Data, CS}.
@@ -322,12 +298,12 @@ cipher(Version, Fragment,
{CipherFragment, CipherS1} =
ssl_cipher:cipher(BulkCipherAlgo, CipherS0, MacHash, Fragment, Version),
{CipherFragment, WriteState0#{cipher_state => CipherS1}}.
-%%--------------------------------------------------------------------
--spec cipher_aead(ssl_version(), iodata(), connection_state(), MacHash::binary()) ->
- {CipherFragment::binary(), connection_state()}.
-%%
-%% Description: Payload encryption
-%%--------------------------------------------------------------------
+%% %%--------------------------------------------------------------------
+%% -spec cipher_aead(ssl_version(), iodata(), connection_state(), MacHash::binary()) ->
+%% {CipherFragment::binary(), connection_state()}.
+%% %%
+%% %% Description: Payload encryption
+%% %%--------------------------------------------------------------------
cipher_aead(Version, Fragment,
#{cipher_state := CipherS0,
sequence_number := SeqNo,
@@ -341,7 +317,8 @@ cipher_aead(Version, Fragment,
{CipherFragment, WriteState0#{cipher_state => CipherS1}}.
%%--------------------------------------------------------------------
--spec decipher(ssl_version(), binary(), connection_state(), boolean()) -> {binary(), binary(), connection_state} | #alert{}.
+-spec decipher(ssl_version(), binary(), connection_state(), boolean()) ->
+ {binary(), binary(), connection_state} | #alert{}.
%%
%% Description: Payload decryption
%%--------------------------------------------------------------------
@@ -359,26 +336,7 @@ decipher(Version, CipherFragment,
#alert{} = Alert ->
Alert
end.
-%%--------------------------------------------------------------------
--spec decipher_aead(ssl_version(), binary(), connection_state(), binary()) ->
- {binary(), binary(), connection_state()} | #alert{}.
-%%
-%% Description: Payload decryption
-%%--------------------------------------------------------------------
-decipher_aead(Version, CipherFragment,
- #{sequence_number := SeqNo,
- security_parameters :=
- #security_parameters{bulk_cipher_algorithm =
- BulkCipherAlgo},
- cipher_state := CipherS0
- } = ReadState, AAD) ->
- case ssl_cipher:decipher_aead(BulkCipherAlgo, CipherS0, SeqNo, AAD, CipherFragment, Version) of
- {PlainFragment, CipherS1} ->
- CS1 = ReadState#{cipher_state => CipherS1},
- {PlainFragment, CS1};
- #alert{} = Alert ->
- Alert
- end.
+
%%--------------------------------------------------------------------
%%% Internal functions
%%--------------------------------------------------------------------
diff --git a/lib/ssl/src/tls_connection.erl b/lib/ssl/src/tls_connection.erl
index 77606911be..bda6bf0349 100644
--- a/lib/ssl/src/tls_connection.erl
+++ b/lib/ssl/src/tls_connection.erl
@@ -48,7 +48,7 @@
-export([encode_data/3, encode_alert/3]).
%% State transition handling
--export([next_record/1, next_event/3]).
+-export([next_record/1, next_event/3, next_event/4]).
%% Handshake handling
-export([renegotiate/2, send_handshake/2,
@@ -59,7 +59,8 @@
-export([send_alert/2, close/5]).
%% Data handling
--export([passive_receive/2, next_record_if_active/1, handle_common_event/4, send/3]).
+-export([passive_receive/2, next_record_if_active/1, handle_common_event/4, send/3,
+ socket/5]).
%% gen_statem state functions
-export([init/3, error/3, downgrade/3, %% Initiation and take down states
@@ -117,7 +118,7 @@ send_handshake_flight(#state{socket = Socket,
transport_cb = Transport,
flight_buffer = Flight} = State0) ->
send(Transport, Socket, Flight),
- State0#state{flight_buffer = []}.
+ {State0#state{flight_buffer = []}, []}.
queue_change_cipher(Msg, #state{negotiated_version = Version,
flight_buffer = Flight0,
@@ -191,6 +192,10 @@ init([Role, Host, Port, Socket, Options, User, CbInfo]) ->
callback_mode() ->
state_functions.
+socket(Pid, Transport, Socket, Connection, Tracker) ->
+ tls_socket:socket(Pid, Transport, Socket, Connection, Tracker).
+
+
%%--------------------------------------------------------------------
%% State functions
%%--------------------------------------------------------------------
@@ -340,12 +345,12 @@ connection(internal, #hello_request{},
renegotiation = {Renegotiation, _}} = State0) ->
Hello = tls_handshake:client_hello(Host, Port, ConnectionStates0, SslOpts,
Cache, CacheCb, Renegotiation, Cert),
- State1 = send_handshake(Hello, State0),
+ {State1, Actions} = send_handshake(Hello, State0),
{Record, State} =
next_record(
State1#state{session = Session0#session{session_id
= Hello#client_hello.session_id}}),
- next_event(hello, Record, State);
+ next_event(hello, Record, State, Actions);
connection(internal, #client_hello{} = Hello,
#state{role = server, allow_renegotiate = true} = State0) ->
%% Mitigate Computational DoS attack
@@ -392,23 +397,36 @@ handle_info({Protocol, _, Data}, StateName,
end;
handle_info({CloseTag, Socket}, StateName,
#state{socket = Socket, close_tag = CloseTag,
+ socket_options = #socket_options{active = Active},
+ protocol_buffers = #protocol_buffers{tls_cipher_texts = CTs},
negotiated_version = Version} = State) ->
+
%% Note that as of TLS 1.1,
%% failure to properly close a connection no longer requires that a
%% session not be resumed. This is a change from TLS 1.0 to conform
%% with widespread implementation practice.
- case Version of
- {1, N} when N >= 1 ->
- ok;
- _ ->
- %% As invalidate_sessions here causes performance issues,
- %% we will conform to the widespread implementation
- %% practice and go aginst the spec
- %%invalidate_session(Role, Host, Port, Session)
- ok
- end,
- ssl_connection:handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
- {stop, {shutdown, transport_closed}};
+
+ case (Active == false) andalso (CTs =/= []) of
+ false ->
+ case Version of
+ {1, N} when N >= 1 ->
+ ok;
+ _ ->
+ %% As invalidate_sessions here causes performance issues,
+ %% we will conform to the widespread implementation
+ %% practice and go aginst the spec
+ %%invalidate_session(Role, Host, Port, Session)
+ ok
+ end,
+
+ ssl_connection:handle_normal_shutdown(?ALERT_REC(?FATAL, ?CLOSE_NOTIFY), StateName, State),
+ {stop, {shutdown, transport_closed}};
+ true ->
+ %% Fixes non-delivery of final TLS record in {active, once}.
+ %% Basically allows the application the opportunity to set {active, once} again
+ %% and then receive the final message.
+ next_event(StateName, no_record, State)
+ end;
handle_info(Msg, StateName, State) ->
ssl_connection:handle_info(Msg, StateName, State).
diff --git a/lib/ssl/src/tls_record.erl b/lib/ssl/src/tls_record.erl
index 993a1622fe..065c6dc8a7 100644
--- a/lib/ssl/src/tls_record.erl
+++ b/lib/ssl/src/tls_record.erl
@@ -372,7 +372,7 @@ get_tls_records_aux(Data, Acc) ->
end.
encode_plain_text(Type, Version, Data, #{current_write := Write0} = ConnectionStates) ->
- {CipherFragment, Write1} = ssl_record:encode_plain_text(Type, Version, Data, Write0),
+ {CipherFragment, Write1} = do_encode_plain_text(Type, Version, Data, Write0),
{CipherText, Write} = encode_tls_cipher_text(Type, Version, CipherFragment, Write1),
{CipherText, ConnectionStates#{current_write => Write}}.
@@ -446,19 +446,24 @@ decode_cipher_text(#ssl_tls{type = Type, version = Version,
#{current_read :=
#{compression_state := CompressionS0,
sequence_number := Seq,
+ cipher_state := CipherS0,
security_parameters :=
#security_parameters{
cipher_type = ?AEAD,
+ bulk_cipher_algorithm =
+ BulkCipherAlgo,
compression_algorithm = CompAlg}
} = ReadState0} = ConnnectionStates0, _) ->
- AAD = ssl_cipher:calc_aad(Type, Version, ReadState0),
- case ssl_record:decipher_aead(Version, CipherFragment, ReadState0, AAD) of
- {PlainFragment, ReadState1} ->
+ AAD = calc_aad(Type, Version, ReadState0),
+ case ssl_cipher:decipher_aead(BulkCipherAlgo, CipherS0, Seq, AAD, CipherFragment, Version) of
+ {PlainFragment, CipherS1} ->
{Plain, CompressionS1} = ssl_record:uncompress(CompAlg,
PlainFragment, CompressionS0),
ConnnectionStates = ConnnectionStates0#{
- current_read => ReadState1#{sequence_number => Seq + 1,
- compression_state => CompressionS1}},
+ current_read => ReadState0#{
+ cipher_state => CipherS1,
+ sequence_number => Seq + 1,
+ compression_state => CompressionS1}},
{CipherText#ssl_tls{fragment = Plain}, ConnnectionStates};
#alert{} = Alert ->
Alert
@@ -489,4 +494,29 @@ decode_cipher_text(#ssl_tls{type = Type, version = Version,
end;
#alert{} = Alert ->
Alert
- end.
+ end.
+
+do_encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
+ security_parameters :=
+ #security_parameters{
+ cipher_type = ?AEAD,
+ compression_algorithm = CompAlg}
+ } = WriteState0) ->
+ {Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
+ WriteState1 = WriteState0#{compression_state => CompS1},
+ AAD = calc_aad(Type, Version, WriteState1),
+ ssl_record:cipher_aead(Version, Comp, WriteState1, AAD);
+do_encode_plain_text(Type, Version, Data, #{compression_state := CompS0,
+ security_parameters :=
+ #security_parameters{compression_algorithm = CompAlg}
+ }= WriteState0) ->
+ {Comp, CompS1} = ssl_record:compress(CompAlg, Data, CompS0),
+ WriteState1 = WriteState0#{compression_state => CompS1},
+ MacHash = ssl_cipher:calc_mac_hash(Type, Version, Comp, WriteState1),
+ ssl_record:cipher(Version, Comp, WriteState1, MacHash);
+do_encode_plain_text(_,_,_,CS) ->
+ exit({cs, CS}).
+
+calc_aad(Type, {MajVer, MinVer},
+ #{sequence_number := SeqNo}) ->
+ <<?UINT64(SeqNo), ?BYTE(Type), ?BYTE(MajVer), ?BYTE(MinVer)>>.
diff --git a/lib/ssl/test/Makefile b/lib/ssl/test/Makefile
index a2eb4ce449..55d45c98f6 100644
--- a/lib/ssl/test/Makefile
+++ b/lib/ssl/test/Makefile
@@ -56,7 +56,8 @@ MODULES = \
ssl_upgrade_SUITE\
ssl_sni_SUITE \
make_certs\
- erl_make_certs
+ erl_make_certs\
+ x509_test
ERL_FILES = $(MODULES:%=%.erl)
diff --git a/lib/ssl/test/erl_make_certs.erl b/lib/ssl/test/erl_make_certs.erl
index a6657be995..af217efc11 100644
--- a/lib/ssl/test/erl_make_certs.erl
+++ b/lib/ssl/test/erl_make_certs.erl
@@ -179,7 +179,7 @@ make_tbs(SubjectKey, Opts) ->
subject(proplists:get_value(subject, Opts),false)
end,
- {#'OTPTBSCertificate'{serialNumber = trunc(random:uniform()*100000000)*10000 + 1,
+ {#'OTPTBSCertificate'{serialNumber = trunc(rand:uniform()*100000000)*10000 + 1,
signature = SignAlgo,
issuer = Issuer,
validity = validity(Opts),
diff --git a/lib/ssl/test/ssl_ECC_SUITE.erl b/lib/ssl/test/ssl_ECC_SUITE.erl
index f779765b18..b05e2c74db 100644
--- a/lib/ssl/test/ssl_ECC_SUITE.erl
+++ b/lib/ssl/test/ssl_ECC_SUITE.erl
@@ -46,7 +46,8 @@ groups() ->
{'tlsv1', [], all_versions_groups()},
{'erlang_server', [], key_cert_combinations()},
{'erlang_client', [], key_cert_combinations()},
- {'erlang', [], key_cert_combinations() ++ misc() ++ ecc_negotiation()}
+ {'erlang', [], key_cert_combinations() ++ misc()
+ ++ ecc_negotiation()}
].
all_versions_groups ()->
@@ -56,13 +57,13 @@ all_versions_groups ()->
].
key_cert_combinations() ->
- [client_ecdh_server_ecdh,
- client_rsa_server_ecdh,
- client_ecdh_server_rsa,
- client_rsa_server_rsa,
- client_ecdsa_server_ecdsa,
- client_ecdsa_server_rsa,
- client_rsa_server_ecdsa
+ [client_ecdh_rsa_server_ecdh_rsa,
+ client_ecdhe_rsa_server_ecdh_rsa,
+ client_ecdh_rsa_server_ecdhe_rsa,
+ client_ecdhe_rsa_server_ecdhe_rsa,
+ client_ecdhe_ecdsa_server_ecdhe_rsa,
+ client_ecdhe_ecdsa_server_ecdhe_ecdsa,
+ client_ecdh_rsa_server_ecdhe_ecdsa
].
misc()->
@@ -74,15 +75,15 @@ ecc_negotiation() ->
ecc_client_order,
ecc_client_order_custom_curves,
ecc_unknown_curve,
- client_ecdh_server_ecdh_ecc_server_custom,
- client_rsa_server_ecdh_ecc_server_custom,
- client_ecdh_server_rsa_ecc_server_custom,
- client_rsa_server_rsa_ecc_server_custom,
- client_ecdsa_server_ecdsa_ecc_server_custom,
- client_ecdsa_server_rsa_ecc_server_custom,
- client_rsa_server_ecdsa_ecc_server_custom,
- client_ecdsa_server_ecdsa_ecc_client_custom,
- client_rsa_server_ecdsa_ecc_client_custom
+ client_ecdh_rsa_server_ecdhe_ecdsa_server_custom,
+ client_ecdh_rsa_server_ecdhe_rsa_server_custom,
+ client_ecdhe_rsa_server_ecdhe_ecdsa_server_custom,
+ client_ecdhe_rsa_server_ecdhe_rsa_server_custom,
+ client_ecdhe_rsa_server_ecdh_rsa_server_custom,
+ client_ecdhe_ecdsa_server_ecdhe_ecdsa_server_custom,
+ client_ecdhe_ecdsa_server_ecdhe_rsa_server_custom,
+ client_ecdhe_ecdsa_server_ecdhe_ecdsa_client_custom,
+ client_ecdhe_rsa_server_ecdhe_ecdsa_client_custom
].
%%--------------------------------------------------------------------
@@ -90,12 +91,7 @@ init_per_suite(Config0) ->
end_per_suite(Config0),
try crypto:start() of
ok ->
- %% make rsa certs using oppenssl
- {ok, _} = make_certs:all(proplists:get_value(data_dir, Config0),
- proplists:get_value(priv_dir, Config0)),
- Config1 = ssl_test_lib:make_ecdsa_cert(Config0),
- Config2 = ssl_test_lib:make_ecdh_rsa_cert(Config1),
- ssl_test_lib:cert_options(Config2)
+ Config0
catch _:_ ->
{skip, "Crypto did not start"}
end.
@@ -174,70 +170,58 @@ end_per_testcase(_TestCase, Config) ->
%% Test Cases --------------------------------------------------------
%%--------------------------------------------------------------------
-client_ecdh_server_ecdh(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_ecdh_rsa_opts, Config),
- SOpts = proplists:get_value(server_ecdh_rsa_opts, Config),
- basic_test(COpts, SOpts, Config).
-
-client_ecdh_server_rsa(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_ecdh_rsa_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+%% Test diffrent certificate chain types, note that it is the servers
+%% chain that affect what cipher suit that will be choosen
+
+%% ECDH_RSA
+client_ecdh_rsa_server_ecdh_rsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_rsa, ecdh_rsa, Config),
basic_test(COpts, SOpts, Config).
-
-client_rsa_server_ecdh(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_ecdh_rsa_opts, Config),
+
+client_ecdhe_rsa_server_ecdh_rsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdh_rsa, Config),
basic_test(COpts, SOpts, Config).
-client_rsa_server_rsa(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+%% ECDHE_RSA
+client_ecdh_rsa_server_ecdhe_rsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_rsa, ecdhe_rsa, Config),
basic_test(COpts, SOpts, Config).
-
-client_ecdsa_server_ecdsa(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+
+client_ecdhe_rsa_server_ecdhe_rsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdhe_rsa, Config),
basic_test(COpts, SOpts, Config).
-client_ecdsa_server_rsa(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+client_ecdhe_ecdsa_server_ecdhe_rsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_ecdsa, ecdhe_rsa, Config),
+ basic_test(COpts, SOpts, Config).
+
+%% ECDHE_ECDSA
+client_ecdhe_ecdsa_server_ecdhe_ecdsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
basic_test(COpts, SOpts, Config).
-client_rsa_server_ecdsa(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+client_ecdh_rsa_server_ecdhe_ecdsa(Config) when is_list(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_rsa, ecdhe_ecdsa, Config),
basic_test(COpts, SOpts, Config).
client_ecdsa_server_ecdsa_with_raw_key(Config) when is_list(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
- ServerCert = proplists:get_value(certfile, SOpts),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ServerKeyFile = proplists:get_value(keyfile, SOpts),
{ok, PemBin} = file:read_file(ServerKeyFile),
PemEntries = public_key:pem_decode(PemBin),
{'ECPrivateKey', Key, not_encrypted} = proplists:lookup('ECPrivateKey', PemEntries),
ServerKey = {'ECPrivateKey', Key},
- ServerCA = proplists:get_value(cacertfile, SOpts),
- ClientCert = proplists:get_value(certfile, COpts),
- ClientKey = proplists:get_value(keyfile, COpts),
- ClientCA = proplists:get_value(cacertfile, COpts),
SType = proplists:get_value(server_type, Config),
CType = proplists:get_value(client_type, Config),
{Server, Port} = start_server_with_raw_key(SType,
- ClientCA, ServerCA,
- ServerCert,
- ServerKey,
- Config),
- Client = start_client(CType, Port, ServerCA, ClientCA,
- ClientCert,
- ClientKey, Config),
+ [{key, ServerKey} | proplists:delete(keyfile, SOpts)],
+ Config),
+ Client = start_client(CType, Port, COpts, Config),
check_result(Server, SType, Client, CType),
close(Server, Client).
ecc_default_order(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [],
case supported_eccs([{eccs, [sect571r1]}]) of
true -> ecc_test(sect571r1, COpts, SOpts, [], ECCOpts, Config);
@@ -245,8 +229,7 @@ ecc_default_order(Config) ->
end.
ecc_default_order_custom_curves(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(sect571r1, COpts, SOpts, [], ECCOpts, Config);
@@ -254,8 +237,7 @@ ecc_default_order_custom_curves(Config) ->
end.
ecc_client_order(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{honor_ecc_order, false}],
case supported_eccs([{eccs, [sect571r1]}]) of
true -> ecc_test(sect571r1, COpts, SOpts, [], ECCOpts, Config);
@@ -263,8 +245,7 @@ ecc_client_order(Config) ->
end.
ecc_client_order_custom_curves(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{honor_ecc_order, false}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(sect571r1, COpts, SOpts, [], ECCOpts, Config);
@@ -272,89 +253,75 @@ ecc_client_order_custom_curves(Config) ->
end.
ecc_unknown_curve(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{eccs, ['123_fake_curve']}],
ecc_test_error(COpts, SOpts, [], ECCOpts, Config).
-%% We can only expect to see a named curve on a conn with
-%% a server supporting ecdsa. Otherwise the curve is selected
-%% but not used and communicated to the client?
-client_ecdh_server_ecdh_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_ecdh_rsa_opts, Config),
- SOpts = proplists:get_value(server_ecdh_rsa_opts, Config),
+client_ecdh_rsa_server_ecdhe_ecdsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_rsa, ecdhe_ecdsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
- true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
+ true -> ecc_test(secp256r1, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_ecdh_server_rsa_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_ecdh_rsa_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+client_ecdh_rsa_server_ecdhe_rsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdh_rsa, ecdhe_rsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_rsa_server_ecdh_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_ecdh_rsa_opts, Config),
+client_ecdhe_rsa_server_ecdhe_ecdsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdhe_ecdsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
- true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
+ true -> ecc_test(secp256r1, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_rsa_server_rsa_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+client_ecdhe_rsa_server_ecdhe_rsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdhe_rsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-
-client_ecdsa_server_ecdsa_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+client_ecdhe_rsa_server_ecdh_rsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdh_rsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
- true -> ecc_test(secp256r1, COpts, SOpts, [], ECCOpts, Config);
+ true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_ecdsa_server_rsa_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_opts, Config),
+client_ecdhe_ecdsa_server_ecdhe_ecdsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
- true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
+ true -> ecc_test(secp256r1, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_rsa_server_ecdsa_ecc_server_custom(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+client_ecdhe_ecdsa_server_ecdhe_rsa_server_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_rsa, Config),
ECCOpts = [{honor_ecc_order, true}, {eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
- true -> ecc_test(secp256r1, COpts, SOpts, [], ECCOpts, Config);
+ true -> ecc_test(undefined, COpts, SOpts, [], ECCOpts, Config);
false -> {skip, "unsupported named curves"}
end.
-client_ecdsa_server_ecdsa_ecc_client_custom(Config) ->
- COpts = proplists:get_value(client_ecdsa_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+client_ecdhe_ecdsa_server_ecdhe_ecdsa_client_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_ecdsa, ecdhe_ecdsa, Config),
ECCOpts = [{eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(secp256r1, COpts, SOpts, ECCOpts, [], Config);
false -> {skip, "unsupported named curves"}
end.
-client_rsa_server_ecdsa_ecc_client_custom(Config) ->
- COpts = proplists:get_value(client_opts, Config),
- SOpts = proplists:get_value(server_ecdsa_opts, Config),
+client_ecdhe_rsa_server_ecdhe_ecdsa_client_custom(Config) ->
+ {COpts, SOpts} = ssl_test_lib:make_ec_cert_chains(ecdhe_rsa, ecdhe_ecdsa, Config),
ECCOpts = [{eccs, [secp256r1, sect571r1]}],
case supported_eccs(ECCOpts) of
true -> ecc_test(secp256r1, COpts, SOpts, ECCOpts, [], Config);
@@ -365,57 +332,31 @@ client_rsa_server_ecdsa_ecc_client_custom(Config) ->
%% Internal functions ------------------------------------------------
%%--------------------------------------------------------------------
basic_test(COpts, SOpts, Config) ->
- basic_test(proplists:get_value(certfile, COpts),
- proplists:get_value(keyfile, COpts),
- proplists:get_value(cacertfile, COpts),
- proplists:get_value(certfile, SOpts),
- proplists:get_value(keyfile, SOpts),
- proplists:get_value(cacertfile, SOpts),
- Config).
-
-basic_test(ClientCert, ClientKey, ClientCA, ServerCert, ServerKey, ServerCA, Config) ->
SType = proplists:get_value(server_type, Config),
CType = proplists:get_value(client_type, Config),
- {Server, Port} = start_server(SType,
- ClientCA, ServerCA,
- ServerCert,
- ServerKey,
- Config),
- Client = start_client(CType, Port, ServerCA, ClientCA,
- ClientCert,
- ClientKey, Config),
+ {Server, Port} = start_server(SType, SOpts, Config),
+ Client = start_client(CType, Port, COpts, Config),
check_result(Server, SType, Client, CType),
close(Server, Client).
ecc_test(Expect, COpts, SOpts, CECCOpts, SECCOpts, Config) ->
- CCA = proplists:get_value(cacertfile, COpts),
- CCert = proplists:get_value(certfile, COpts),
- CKey = proplists:get_value(keyfile, COpts),
- SCA = proplists:get_value(cacertfile, SOpts),
- SCert = proplists:get_value(certfile, SOpts),
- SKey = proplists:get_value(keyfile, SOpts),
- {Server, Port} = start_server_ecc(erlang, CCA, SCA, SCert, SKey, Expect, SECCOpts, Config),
- Client = start_client_ecc(erlang, Port, SCA, CCA, CCert, CKey, Expect, CECCOpts, Config),
+ {Server, Port} = start_server_ecc(erlang, SOpts, Expect, SECCOpts, Config),
+ Client = start_client_ecc(erlang, Port, COpts, Expect, CECCOpts, Config),
ssl_test_lib:check_result(Server, ok, Client, ok),
close(Server, Client).
ecc_test_error(COpts, SOpts, CECCOpts, SECCOpts, Config) ->
- CCA = proplists:get_value(cacertfile, COpts),
- CCert = proplists:get_value(certfile, COpts),
- CKey = proplists:get_value(keyfile, COpts),
- SCA = proplists:get_value(cacertfile, SOpts),
- SCert = proplists:get_value(certfile, SOpts),
- SKey = proplists:get_value(keyfile, SOpts),
- {Server, Port} = start_server_ecc_error(erlang, CCA, SCA, SCert, SKey, SECCOpts, Config),
- Client = start_client_ecc_error(erlang, Port, SCA, CCA, CCert, CKey, CECCOpts, Config),
+ {Server, Port} = start_server_ecc_error(erlang, SOpts, SECCOpts, Config),
+ Client = start_client_ecc_error(erlang, Port, COpts, CECCOpts, Config),
Error = {error, {tls_alert, "insufficient security"}},
ssl_test_lib:check_result(Server, Error, Client, Error).
-start_client(openssl, Port, PeerCA, OwnCa, Cert, Key, Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- CA = new_openssl_ca(filename:join(PrivDir, "openssl_client_ca.pem"), PeerCA, OwnCa),
+start_client(openssl, Port, ClientOpts, _Config) ->
+ Cert = proplists:get_value(certfile, ClientOpts),
+ Key = proplists:get_value(keyfile, ClientOpts),
+ CA = proplists:get_value(cacertfile, ClientOpts),
Version = tls_record:protocol_version(tls_record:highest_protocol_version([])),
Exe = "openssl",
Args = ["s_client", "-verify", "2", "-port", integer_to_list(Port),
@@ -426,21 +367,17 @@ start_client(openssl, Port, PeerCA, OwnCa, Cert, Key, Config) ->
OpenSslPort = ssl_test_lib:portable_open_port(Exe, Args),
true = port_command(OpenSslPort, "Hello world"),
OpenSslPort;
-start_client(erlang, Port, PeerCA, OwnCa, Cert, Key, Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- CA = new_ca(filename:join(PrivDir,"erlang_client_ca.pem"), PeerCA, OwnCa),
+
+start_client(erlang, Port, ClientOpts, Config) ->
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, send_recv_result_active, []}},
- {options, [{verify, verify_peer},
- {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]).
+ {options, [{verify, verify_peer} | ClientOpts]}]).
-start_client_ecc(erlang, Port, PeerCA, OwnCa, Cert, Key, Expect, ECCOpts, Config) ->
- CA = new_ca("erlang_client_ca", PeerCA, OwnCa),
+start_client_ecc(erlang, Port, ClientOpts, Expect, ECCOpts, Config) ->
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -448,26 +385,22 @@ start_client_ecc(erlang, Port, PeerCA, OwnCa, Cert, Key, Expect, ECCOpts, Config
{mfa, {?MODULE, check_ecc, [client, Expect]}},
{options,
ECCOpts ++
- [{verify, verify_peer},
- {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]).
+ [{verify, verify_peer} | ClientOpts]}]).
-start_client_ecc_error(erlang, Port, PeerCA, OwnCa, Cert, Key, ECCOpts, Config) ->
- CA = new_ca("erlang_client_ca", PeerCA, OwnCa),
+start_client_ecc_error(erlang, Port, ClientOpts, ECCOpts, Config) ->
{ClientNode, _, Hostname} = ssl_test_lib:run_where(Config),
ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{options,
ECCOpts ++
- [{verify, verify_peer},
- {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]).
+ [{verify, verify_peer} | ClientOpts]}]).
-start_server(openssl, PeerCA, OwnCa, Cert, Key, Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- CA = new_openssl_ca(filename:join(PrivDir,"openssl_server_ca.pem"), PeerCA, OwnCa),
+start_server(openssl, ServerOpts, _Config) ->
+ Cert = proplists:get_value(certfile, ServerOpts),
+ Key = proplists:get_value(keyfile, ServerOpts),
+ CA = proplists:get_value(cacertfile, ServerOpts),
Port = ssl_test_lib:inet_port(node()),
Version = tls_record:protocol_version(tls_record:highest_protocol_version([])),
Exe = "openssl",
@@ -477,23 +410,17 @@ start_server(openssl, PeerCA, OwnCa, Cert, Key, Config) ->
OpenSslPort = ssl_test_lib:portable_open_port(Exe, Args),
true = port_command(OpenSslPort, "Hello world"),
{OpenSslPort, Port};
-start_server(erlang, PeerCA, OwnCa, Cert, Key, Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- CA = new_ca(filename:join(PrivDir,"erlang_server_ca.pem"), PeerCA, OwnCa),
+start_server(erlang, ServerOpts, Config) ->
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
- {from, self()},
- {mfa, {ssl_test_lib,
- send_recv_result_active,
- []}},
- {options,
- [{verify, verify_peer}, {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]),
+ {from, self()},
+ {mfa, {ssl_test_lib,
+ send_recv_result_active,
+ []}},
+ {options, [{verify, verify_peer} | ServerOpts]}]),
{Server, ssl_test_lib:inet_port(Server)}.
-start_server_with_raw_key(erlang, PeerCA, OwnCa, Cert, Key, Config) ->
- PrivDir = proplists:get_value(priv_dir, Config),
- CA = new_ca(filename:join(PrivDir, "erlang_server_ca.pem"), PeerCA, OwnCa),
+start_server_with_raw_key(erlang, ServerOpts, Config) ->
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
@@ -501,31 +428,26 @@ start_server_with_raw_key(erlang, PeerCA, OwnCa, Cert, Key, Config) ->
send_recv_result_active,
[]}},
{options,
- [{verify, verify_peer}, {cacertfile, CA},
- {certfile, Cert}, {key, Key}]}]),
+ [{verify, verify_peer} | ServerOpts]}]),
{Server, ssl_test_lib:inet_port(Server)}.
-start_server_ecc(erlang, PeerCA, OwnCa, Cert, Key, Expect, ECCOpts, Config) ->
- CA = new_ca("erlang_server_ca", PeerCA, OwnCa),
+start_server_ecc(erlang, ServerOpts, Expect, ECCOpts, Config) ->
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {?MODULE, check_ecc, [server, Expect]}},
{options,
ECCOpts ++
- [{verify, verify_peer}, {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]),
+ [{verify, verify_peer} | ServerOpts]}]),
{Server, ssl_test_lib:inet_port(Server)}.
-start_server_ecc_error(erlang, PeerCA, OwnCa, Cert, Key, ECCOpts, Config) ->
- CA = new_ca("erlang_server_ca", PeerCA, OwnCa),
+start_server_ecc_error(erlang, ServerOpts, ECCOpts, Config) ->
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
{options,
ECCOpts ++
- [{verify, verify_peer}, {cacertfile, CA},
- {certfile, Cert}, {keyfile, Key}]}]),
+ [{verify, verify_peer} | ServerOpts]}]),
{Server, ssl_test_lib:inet_port(Server)}.
check_result(Server, erlang, Client, erlang) ->
@@ -561,24 +483,6 @@ close(Client, Server) ->
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
-new_ca(FileName, CA, OwnCa) ->
- {ok, P1} = file:read_file(CA),
- E1 = public_key:pem_decode(P1),
- {ok, P2} = file:read_file(OwnCa),
- E2 = public_key:pem_decode(P2),
- Pem = public_key:pem_encode(E1 ++E2),
- file:write_file(FileName, Pem),
- FileName.
-
-new_openssl_ca(FileName, CA, OwnCa) ->
- {ok, P1} = file:read_file(CA),
- E1 = public_key:pem_decode(P1),
- {ok, P2} = file:read_file(OwnCa),
- E2 = public_key:pem_decode(P2),
- Pem = public_key:pem_encode(E2 ++E1),
- file:write_file(FileName, Pem),
- FileName.
-
supported_eccs(Opts) ->
ToCheck = proplists:get_value(eccs, Opts, []),
Supported = ssl:eccs(),
diff --git a/lib/ssl/test/ssl_basic_SUITE.erl b/lib/ssl/test/ssl_basic_SUITE.erl
index f0a3c42e8d..4eabe544d7 100644
--- a/lib/ssl/test/ssl_basic_SUITE.erl
+++ b/lib/ssl/test/ssl_basic_SUITE.erl
@@ -53,7 +53,8 @@ all() ->
{group, options_tls},
{group, session},
{group, 'dtlsv1.2'},
- %%{group, 'dtlsv1'},
+ %% {group, 'dtlsv1'}, Breaks dtls in cert_verify_SUITE enable later when
+ %% problem is identified and fixed
{group, 'tlsv1.2'},
{group, 'tlsv1.1'},
{group, 'tlsv1'},
@@ -65,15 +66,15 @@ groups() ->
{basic_tls, [], basic_tests_tls()},
{options, [], options_tests()},
{options_tls, [], options_tests_tls()},
- %%{'dtlsv1.2', [], all_versions_groups()},
- {'dtlsv1.2', [], [connection_information]},
- %%{'dtlsv1', [], all_versions_groups()},
+ {'dtlsv1.2', [], all_versions_groups()},
+ {'dtlsv1', [], all_versions_groups()},
{'tlsv1.2', [], all_versions_groups() ++ tls_versions_groups() ++ [conf_signature_algs, no_common_signature_algs]},
{'tlsv1.1', [], all_versions_groups() ++ tls_versions_groups()},
{'tlsv1', [], all_versions_groups() ++ tls_versions_groups() ++ rizzo_tests()},
{'sslv3', [], all_versions_groups() ++ tls_versions_groups() ++ rizzo_tests() ++ [tls_ciphersuite_vs_version]},
{api,[], api_tests()},
{api_tls,[], api_tests_tls()},
+ {tls_ciphers,[], tls_cipher_tests()},
{session, [], session_tests()},
{renegotiate, [], renegotiate_tests()},
{ciphers, [], cipher_tests()},
@@ -83,12 +84,13 @@ groups() ->
].
tls_versions_groups ()->
- [{group, api_tls},
+ [{group, renegotiate}, %% Should be in all_versions_groups not fixed for DTLS yet
+ {group, api_tls},
+ {group, tls_ciphers},
{group, error_handling_tests_tls}].
all_versions_groups ()->
[{group, api},
- {group, renegotiate},
{group, ciphers},
{group, ciphers_ec},
{group, error_handling_tests}].
@@ -146,11 +148,10 @@ options_tests_tls() ->
api_tests() ->
[connection_info,
+ secret_connection_info,
connection_information,
- peername,
peercert,
peercert_with_client_cert,
- sockname,
versions,
eccs,
controlling_process,
@@ -162,7 +163,6 @@ api_tests() ->
ssl_recv_timeout,
server_name_indication_option,
accept_pool,
- new_options_in_accept,
prf
].
@@ -175,7 +175,10 @@ api_tests_tls() ->
tls_shutdown,
tls_shutdown_write,
tls_shutdown_both,
- tls_shutdown_error
+ tls_shutdown_error,
+ peername,
+ sockname,
+ new_options_in_accept
].
session_tests() ->
@@ -197,6 +200,11 @@ renegotiate_tests() ->
renegotiate_dos_mitigate_passive,
renegotiate_dos_mitigate_absolute].
+tls_cipher_tests() ->
+ [rc4_rsa_cipher_suites,
+ rc4_ecdh_rsa_cipher_suites,
+ rc4_ecdsa_cipher_suites].
+
cipher_tests() ->
[cipher_suites,
cipher_suites_mix,
@@ -212,9 +220,6 @@ cipher_tests() ->
srp_cipher_suites,
srp_anon_cipher_suites,
srp_dsa_cipher_suites,
- rc4_rsa_cipher_suites,
- rc4_ecdh_rsa_cipher_suites,
- rc4_ecdsa_cipher_suites,
des_rsa_cipher_suites,
des_ecdh_rsa_cipher_suites,
default_reject_anonymous].
@@ -226,15 +231,15 @@ cipher_tests_ec() ->
ciphers_ecdh_rsa_signed_certs_openssl_names].
error_handling_tests()->
- [controller_dies,
- close_transport_accept,
+ [close_transport_accept,
recv_active,
recv_active_once,
recv_error_handling
].
error_handling_tests_tls()->
- [tls_client_closes_socket,
+ [controller_dies,
+ tls_client_closes_socket,
tls_tcp_error_propagation_in_active_mode,
tls_tcp_connect,
tls_tcp_connect_big,
@@ -607,7 +612,7 @@ prf(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
connection_info() ->
- [{doc,"Test the API function ssl:connection_information/1"}].
+ [{doc,"Test the API function ssl:connection_information/2"}].
connection_info(Config) when is_list(Config) ->
ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
@@ -641,6 +646,38 @@ connection_info(Config) when is_list(Config) ->
%%--------------------------------------------------------------------
+secret_connection_info() ->
+ [{doc,"Test the API function ssl:connection_information/2"}].
+secret_connection_info(Config) when is_list(Config) ->
+ ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ {ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
+
+ Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
+ {from, self()},
+ {mfa, {?MODULE, secret_connection_info_result, []}},
+ {options, ServerOpts}]),
+
+ Port = ssl_test_lib:inet_port(Server),
+ Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
+ {host, Hostname},
+ {from, self()},
+ {mfa, {?MODULE, secret_connection_info_result, []}},
+ {options, ClientOpts}]),
+
+ ct:log("Testcase ~p, Client ~p Server ~p ~n",
+ [self(), Client, Server]),
+
+ Version = ssl_test_lib:protocol_version(Config),
+
+ ssl_test_lib:check_result(Server, true, Client, true),
+
+ ssl_test_lib:close(Server),
+ ssl_test_lib:close(Client).
+
+
+%%--------------------------------------------------------------------
+
connection_information() ->
[{doc,"Test the API function ssl:connection_information/1"}].
connection_information(Config) when is_list(Config) ->
@@ -843,8 +880,7 @@ controller_dies(Config) when is_list(Config) ->
Server ! listen,
Tester = self(),
Connect = fun(Pid) ->
- {ok, Socket} = ssl:connect(Hostname, Port,
- [{reuseaddr,true},{ssl_imp,new}]),
+ {ok, Socket} = ssl:connect(Hostname, Port, ClientOpts),
%% Make sure server finishes and verification
%% and is in coonection state before
%% killing client
@@ -2194,8 +2230,9 @@ ciphers_dsa_signed_certs() ->
[{doc,"Test all dsa ssl cipher suites in highest support ssl/tls version"}].
ciphers_dsa_signed_certs(Config) when is_list(Config) ->
+ NVersion = ssl_test_lib:protocol_version(Config, tuple),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:dsa_suites(tls_record:protocol_version(Version)),
+ Ciphers = ssl_test_lib:dsa_suites(NVersion),
ct:log("~p erlang cipher suites ~p~n", [Version, Ciphers]),
run_suites(Ciphers, Version, Config, dsa).
%%-------------------------------------------------------------------
@@ -2218,29 +2255,33 @@ anonymous_cipher_suites(Config) when is_list(Config) ->
psk_cipher_suites() ->
[{doc, "Test the PSK ciphersuites WITHOUT server supplied identity hint"}].
psk_cipher_suites(Config) when is_list(Config) ->
+ NVersion = tls_record:highest_protocol_version([]),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:psk_suites(),
+ Ciphers = ssl_test_lib:psk_suites(NVersion),
run_suites(Ciphers, Version, Config, psk).
%%-------------------------------------------------------------------
psk_with_hint_cipher_suites()->
[{doc, "Test the PSK ciphersuites WITH server supplied identity hint"}].
psk_with_hint_cipher_suites(Config) when is_list(Config) ->
+ NVersion = tls_record:highest_protocol_version([]),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:psk_suites(),
+ Ciphers = ssl_test_lib:psk_suites(NVersion),
run_suites(Ciphers, Version, Config, psk_with_hint).
%%-------------------------------------------------------------------
psk_anon_cipher_suites() ->
[{doc, "Test the anonymous PSK ciphersuites WITHOUT server supplied identity hint"}].
psk_anon_cipher_suites(Config) when is_list(Config) ->
+ NVersion = tls_record:highest_protocol_version([]),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:psk_anon_suites(),
+ Ciphers = ssl_test_lib:psk_anon_suites(NVersion),
run_suites(Ciphers, Version, Config, psk_anon).
%%-------------------------------------------------------------------
psk_anon_with_hint_cipher_suites()->
[{doc, "Test the anonymous PSK ciphersuites WITH server supplied identity hint"}].
psk_anon_with_hint_cipher_suites(Config) when is_list(Config) ->
+ NVersion = tls_record:highest_protocol_version([]),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:psk_anon_suites(),
+ Ciphers = ssl_test_lib:psk_anon_suites(NVersion),
run_suites(Ciphers, Version, Config, psk_anon_with_hint).
%%-------------------------------------------------------------------
srp_cipher_suites()->
@@ -2291,18 +2332,17 @@ rc4_ecdsa_cipher_suites(Config) when is_list(Config) ->
%%-------------------------------------------------------------------
des_rsa_cipher_suites()->
- [{doc, "Test the RC4 ciphersuites"}].
+ [{doc, "Test the des_rsa ciphersuites"}].
des_rsa_cipher_suites(Config) when is_list(Config) ->
- NVersion = tls_record:highest_protocol_version([]),
- Version = tls_record:protocol_version(NVersion),
- Ciphers = ssl_test_lib:des_suites(NVersion),
+ Version = ssl_test_lib:protocol_version(Config),
+ Ciphers = ssl_test_lib:des_suites(Config),
run_suites(Ciphers, Version, Config, des_rsa).
%-------------------------------------------------------------------
des_ecdh_rsa_cipher_suites()->
- [{doc, "Test the RC4 ciphersuites"}].
+ [{doc, "Test ECDH rsa signed ciphersuites"}].
des_ecdh_rsa_cipher_suites(Config) when is_list(Config) ->
- NVersion = tls_record:highest_protocol_version([]),
- Version = tls_record:protocol_version(NVersion),
+ NVersion = ssl_test_lib:protocol_version(Config, tuple),
+ Version = ssl_test_lib:protocol_version(Config),
Ciphers = ssl_test_lib:des_suites(NVersion),
run_suites(Ciphers, Version, Config, des_dhe_rsa).
@@ -2313,9 +2353,11 @@ default_reject_anonymous(Config) when is_list(Config) ->
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
- Version = tls_record:highest_protocol_version(tls_record:supported_protocol_versions()),
- [CipherSuite | _] = ssl_test_lib:anonymous_suites(Version),
-
+ Version = ssl_test_lib:protocol_version(Config),
+ TLSVersion = ssl_test_lib:tls_version(Version),
+
+ [CipherSuite | _] = ssl_test_lib:anonymous_suites(TLSVersion),
+
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
{options, ServerOpts}]),
@@ -2335,8 +2377,9 @@ ciphers_ecdsa_signed_certs() ->
[{doc, "Test all ecdsa ssl cipher suites in highest support ssl/tls version"}].
ciphers_ecdsa_signed_certs(Config) when is_list(Config) ->
+ NVersion = ssl_test_lib:protocol_version(Config, tuple),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:ecdsa_suites(tls_record:protocol_version(Version)),
+ Ciphers = ssl_test_lib:ecdsa_suites(NVersion),
ct:log("~p erlang cipher suites ~p~n", [Version, Ciphers]),
run_suites(Ciphers, Version, Config, ecdsa).
%%--------------------------------------------------------------------
@@ -2353,8 +2396,9 @@ ciphers_ecdh_rsa_signed_certs() ->
[{doc, "Test all ecdh_rsa ssl cipher suites in highest support ssl/tls version"}].
ciphers_ecdh_rsa_signed_certs(Config) when is_list(Config) ->
+ NVersion = ssl_test_lib:protocol_version(Config, tuple),
Version = ssl_test_lib:protocol_version(Config),
- Ciphers = ssl_test_lib:ecdh_rsa_suites(tls_record:protocol_version(Version)),
+ Ciphers = ssl_test_lib:ecdh_rsa_suites(NVersion),
ct:log("~p erlang cipher suites ~p~n", [Version, Ciphers]),
run_suites(Ciphers, Version, Config, ecdh_rsa).
%%--------------------------------------------------------------------
@@ -3326,11 +3370,11 @@ hibernate(Config) ->
process_info(Pid, current_function),
ssl_test_lib:check_result(Server, ok, Client, ok),
- timer:sleep(1100),
-
+
+ timer:sleep(1500),
{current_function, {erlang, hibernate, 3}} =
process_info(Pid, current_function),
-
+
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
@@ -3363,13 +3407,12 @@ hibernate_right_away(Config) ->
[{port, Port1}, {options, [{hibernate_after, 0}|ClientOpts]}]),
ssl_test_lib:check_result(Server1, ok, Client1, ok),
-
- {current_function, {erlang, hibernate, 3}} =
+
+ {current_function, {erlang, hibernate, 3}} =
process_info(Pid1, current_function),
-
ssl_test_lib:close(Server1),
ssl_test_lib:close(Client1),
-
+
Server2 = ssl_test_lib:start_server(StartServerOpts),
Port2 = ssl_test_lib:inet_port(Server2),
{Client2, #sslsocket{pid = Pid2}} = ssl_test_lib:start_client(StartClientOpts ++
@@ -3377,8 +3420,8 @@ hibernate_right_away(Config) ->
ssl_test_lib:check_result(Server2, ok, Client2, ok),
- ct:sleep(100), %% Schedule out
-
+ ct:sleep(1000), %% Schedule out
+
{current_function, {erlang, hibernate, 3}} =
process_info(Pid2, current_function),
@@ -3404,7 +3447,6 @@ listen_socket(Config) ->
{error, enotconn} = ssl:connection_information(ListenSocket),
{error, enotconn} = ssl:peername(ListenSocket),
{error, enotconn} = ssl:peercert(ListenSocket),
- {error, enotconn} = ssl:session_info(ListenSocket),
{error, enotconn} = ssl:renegotiate(ListenSocket),
{error, enotconn} = ssl:prf(ListenSocket, 'master_secret', <<"Label">>, client_random, 256),
{error, enotconn} = ssl:shutdown(ListenSocket, read_write),
@@ -4030,11 +4072,11 @@ prf_create_plan(TlsVersions, PRFs, Results) ->
prf_ciphers_and_expected(TlsVer, PRFs, Results) ->
case TlsVer of
TlsVer when TlsVer == sslv3 orelse TlsVer == tlsv1
- orelse TlsVer == 'tlsv1.1' ->
+ orelse TlsVer == 'tlsv1.1' orelse TlsVer == 'dtlsv1' ->
Ciphers = ssl:cipher_suites(),
{_, Expected} = lists:keyfind(md5sha, 1, Results),
[[{tls_ver, TlsVer}, {ciphers, Ciphers}, {expected, Expected}, {prf, md5sha}]];
- 'tlsv1.2' ->
+ TlsVer when TlsVer == 'tlsv1.2' orelse TlsVer == 'dtlsv1.2'->
lists:foldl(
fun(PRF, Acc) ->
Ciphers = prf_get_ciphers(TlsVer, PRF),
@@ -4049,21 +4091,20 @@ prf_ciphers_and_expected(TlsVer, PRFs, Results) ->
end
end, [], PRFs)
end.
-prf_get_ciphers(TlsVer, PRF) ->
- case TlsVer of
- 'tlsv1.2' ->
- lists:filter(
- fun(C) when tuple_size(C) == 4 andalso
- element(4, C) == PRF ->
- true;
- (_) -> false
- end, ssl:cipher_suites())
- end.
+prf_get_ciphers(_, PRF) ->
+ lists:filter(
+ fun(C) when tuple_size(C) == 4 andalso
+ element(4, C) == PRF ->
+ true;
+ (_) ->
+ false
+ end,
+ ssl:cipher_suites()).
prf_run_test(_, TlsVer, [], _, Prf) ->
ct:fail({error, cipher_list_empty, TlsVer, Prf});
prf_run_test(Config, TlsVer, Ciphers, Expected, Prf) ->
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
- BaseOpts = [{active, true}, {versions, [TlsVer]}, {ciphers, Ciphers}],
+ BaseOpts = [{active, true}, {versions, [TlsVer]}, {ciphers, Ciphers}, {protocol, tls_or_dtls(TlsVer)}],
ServerOpts = BaseOpts ++ proplists:get_value(server_opts, Config),
ClientOpts = BaseOpts ++ proplists:get_value(client_opts, Config),
Server = ssl_test_lib:start_server(
@@ -4507,16 +4548,21 @@ run_suites(Ciphers, Version, Config, Type) ->
[{reuseaddr, true}, {ciphers, ssl_test_lib:anonymous_suites(Version)}]};
psk ->
{ssl_test_lib:ssl_options(client_psk, Config),
- ssl_test_lib:ssl_options(server_psk, Config)};
+ [{ciphers, ssl_test_lib:psk_suites(Version)} |
+ ssl_test_lib:ssl_options(server_psk, Config)]};
psk_with_hint ->
{ssl_test_lib:ssl_options(client_psk, Config),
- ssl_test_lib:ssl_options(server_psk_hint, Config)};
+ [{ciphers, ssl_test_lib:psk_suites(Version)} |
+ ssl_test_lib:ssl_options(server_psk_hint, Config)
+ ]};
psk_anon ->
{ssl_test_lib:ssl_options(client_psk, Config),
- ssl_test_lib:ssl_options(server_psk_anon, Config)};
+ [{ciphers, ssl_test_lib:psk_anon_suites(Version)} |
+ ssl_test_lib:ssl_options(server_psk_anon, Config)]};
psk_anon_with_hint ->
{ssl_test_lib:ssl_options(client_psk, Config),
- ssl_test_lib:ssl_options(server_psk_anon_hint, Config)};
+ [{ciphers, ssl_test_lib:psk_anon_suites(Version)} |
+ ssl_test_lib:ssl_options(server_psk_anon_hint, Config)]};
srp ->
{ssl_test_lib:ssl_options(client_srp, Config),
ssl_test_lib:ssl_options(server_srp, Config)};
@@ -4556,7 +4602,7 @@ run_suites(Ciphers, Version, Config, Type) ->
Result = lists:map(fun(Cipher) ->
cipher(Cipher, Version, Config, ClientOpts, ServerOpts) end,
- ssl_test_lib:filter_suites(Ciphers)),
+ ssl_test_lib:filter_suites(Ciphers, Version)),
case lists:flatten(Result) of
[] ->
ok;
@@ -4624,6 +4670,11 @@ version_info_result(Socket) ->
{ok, [{version, Version}]} = ssl:connection_information(Socket, [version]),
{ok, Version}.
+secret_connection_info_result(Socket) ->
+ {ok, [{client_random, ClientRand}, {server_random, ServerRand}, {master_secret, MasterSecret}]}
+ = ssl:connection_information(Socket, [client_random, server_random, master_secret]),
+ is_binary(ClientRand) andalso is_binary(ServerRand) andalso is_binary(MasterSecret).
+
connect_dist_s(S) ->
Msg = term_to_binary({erlang,term}),
ok = ssl:send(S, Msg).
@@ -4756,3 +4807,9 @@ wait_for_send(Socket) ->
%% Make sure TLS process processed send message event
_ = ssl:connection_information(Socket).
+tls_or_dtls('dtlsv1') ->
+ dtls;
+tls_or_dtls('dtlsv1.2') ->
+ dtls;
+tls_or_dtls(_) ->
+ tls.
diff --git a/lib/ssl/test/ssl_certificate_verify_SUITE.erl b/lib/ssl/test/ssl_certificate_verify_SUITE.erl
index 5265c87e29..45bcdf1f78 100644
--- a/lib/ssl/test/ssl_certificate_verify_SUITE.erl
+++ b/lib/ssl/test/ssl_certificate_verify_SUITE.erl
@@ -39,17 +39,26 @@
%% Common Test interface functions -----------------------------------
%%--------------------------------------------------------------------
all() ->
- [{group, active},
- {group, passive},
- {group, active_once},
- {group, error_handling}].
-
+ [
+ {group, tls},
+ {group, dtls}
+ ].
groups() ->
- [{active, [], tests()},
+ [
+ {tls, [], all_protocol_groups()},
+ {dtls, [], all_protocol_groups()},
+ {active, [], tests()},
{active_once, [], tests()},
{passive, [], tests()},
- {error_handling, [],error_handling_tests()}].
+ {error_handling, [],error_handling_tests()}
+ ].
+
+all_protocol_groups() ->
+ [{group, active},
+ {group, passive},
+ {group, active_once},
+ {group, error_handling}].
tests() ->
[verify_peer,
@@ -65,7 +74,7 @@ tests() ->
cert_expired,
invalid_signature_client,
invalid_signature_server,
- extended_key_usage_verify_client,
+ extended_key_usage_verify_both,
extended_key_usage_verify_server,
critical_extension_verify_client,
critical_extension_verify_server,
@@ -79,18 +88,14 @@ error_handling_tests()->
unknown_server_ca_accept_verify_peer,
unknown_server_ca_accept_backwardscompatibility,
no_authority_key_identifier,
- no_authority_key_identifier_and_nonstandard_encoding].
+ no_authority_key_identifier_keyEncipherment].
-init_per_suite(Config0) ->
+init_per_suite(Config) ->
catch crypto:stop(),
try crypto:start() of
ok ->
- ssl_test_lib:clean_start(),
- %% make rsa certs using oppenssl
- {ok, _} = make_certs:all(proplists:get_value(data_dir, Config0),
- proplists:get_value(priv_dir, Config0)),
- Config = ssl_test_lib:make_dsa_cert(Config0),
- ssl_test_lib:cert_options(Config)
+ ssl_test_lib:clean_start(),
+ ssl_test_lib:make_rsa_cert(Config)
catch _:_ ->
{skip, "Crypto did not start"}
end.
@@ -99,34 +104,44 @@ end_per_suite(_Config) ->
ssl:stop(),
application:stop(crypto).
+init_per_group(tls, Config0) ->
+ Version = tls_record:protocol_version(tls_record:highest_protocol_version([])),
+ ssl:stop(),
+ application:load(ssl),
+ application:set_env(ssl, protocol_version, Version),
+ ssl:start(),
+ Config = proplists:delete(protocol, Config0),
+ [{protocol, tls}, {version, tls_record:protocol_version(Version)} | Config];
+
+init_per_group(dtls, Config0) ->
+ Version = dtls_record:protocol_version(dtls_record:highest_protocol_version([])),
+ ssl:stop(),
+ application:load(ssl),
+ application:set_env(ssl, protocol_version, Version),
+ ssl:start(),
+ Config = proplists:delete(protocol_opts, proplists:delete(protocol, Config0)),
+ [{protocol, dtls}, {protocol_opts, [{protocol, dtls}]}, {version, dtls_record:protocol_version(Version)} | Config];
+
init_per_group(active, Config) ->
- [{active, true}, {receive_function, send_recv_result_active} | Config];
+ [{active, true}, {receive_function, send_recv_result_active} | Config];
init_per_group(active_once, Config) ->
- [{active, once}, {receive_function, send_recv_result_active_once} | Config];
+ [{active, once}, {receive_function, send_recv_result_active_once} | Config];
init_per_group(passive, Config) ->
- [{active, false}, {receive_function, send_recv_result} | Config];
+ [{active, false}, {receive_function, send_recv_result} | Config];
+init_per_group(error_handling, Config) ->
+ [{active, false}, {receive_function, send_recv_result} | Config];
+
init_per_group(_, Config) ->
Config.
end_per_group(_GroupName, Config) ->
Config.
-init_per_testcase(TestCase, Config) when TestCase == cert_expired;
- TestCase == invalid_signature_client;
- TestCase == invalid_signature_server;
- TestCase == extended_key_usage_verify_none;
- TestCase == extended_key_usage_verify_peer;
- TestCase == critical_extension_verify_none;
- TestCase == critical_extension_verify_peer;
- TestCase == no_authority_key_identifier;
- TestCase == no_authority_key_identifier_and_nonstandard_encoding->
- ssl:clear_pem_cache(),
- init_per_testcase(common, Config);
init_per_testcase(_TestCase, Config) ->
ssl:stop(),
ssl:start(),
ssl_test_lib:ct_log_supported_protocol_versions(Config),
- ct:timetrap({seconds, 5}),
+ ct:timetrap({seconds, 10}),
Config.
end_per_testcase(_TestCase, Config) ->
@@ -139,23 +154,23 @@ end_per_testcase(_TestCase, Config) ->
verify_peer() ->
[{doc,"Test option verify_peer"}].
verify_peer(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
- {mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{active, Active}, {verify, verify_peer}
- | ServerOpts]}]),
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active}, {verify, verify_peer}
+ | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
- {from, self()},
- {mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{active, Active} | ClientOpts]}]),
-
+ {from, self()},
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active}, {verify, verify_peer} | ClientOpts]}]),
+
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
@@ -165,23 +180,24 @@ verify_none() ->
[{doc,"Test option verify_none"}].
verify_none(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
- {mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{active, Active}, {verify, verify_none}
- | ServerOpts]}]),
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active}, {verify, verify_none}
+ | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
- {from, self()},
- {mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{active, Active} | ClientOpts]}]),
+ {from, self()},
+ {mfa, {ssl_test_lib, ReceiveFunction, []}},
+ {options, [{active, Active},
+ {verify, verify_none} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
@@ -193,8 +209,8 @@ server_verify_client_once() ->
[{doc,"Test server option verify_client_once"}].
server_verify_client_once(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, []),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, []),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
@@ -210,7 +226,7 @@ server_verify_client_once(Config) when is_list(Config) ->
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{active, Active} | ClientOpts]}]),
+ {options, [{active, Active} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client0, ok),
Server ! {listen, {mfa, {ssl_test_lib, no_result, []}}},
@@ -232,8 +248,8 @@ server_require_peer_cert_ok() ->
server_require_peer_cert_ok(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
@@ -261,20 +277,21 @@ server_require_peer_cert_fail() ->
server_require_peer_cert_fail(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- BadClientOpts = ssl_test_lib:ssl_options(client_opts, []),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ BadClientOpts = ssl_test_lib:ssl_options(empty_client_opts, Config),
+ Active = proplists:get_value(active, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
- {options, [{active, false} | ServerOpts]}]),
+ {options, [{active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
- {options, [{active, false} | BadClientOpts]}]),
+ {options, [{active, Active} | BadClientOpts]}]),
receive
{Server, {error, {tls_alert, "handshake failure"}}} ->
receive
@@ -292,24 +309,25 @@ server_require_peer_cert_partial_chain() ->
server_require_peer_cert_partial_chain(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ Active = proplists:get_value(active, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
{ok, ClientCAs} = file:read_file(proplists:get_value(cacertfile, ClientOpts)),
- [{_,RootCA,_}, {_, _, _}] = public_key:pem_decode(ClientCAs),
+ [{_,RootCA,_} | _] = public_key:pem_decode(ClientCAs),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, no_result, []}},
- {options, [{active, false} | ServerOpts]}]),
+ {options, [{active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, no_result, []}},
- {options, [{active, false},
+ {options, [{active, Active},
{cacerts, [RootCA]} |
proplists:delete(cacertfile, ClientOpts)]}]),
receive
@@ -327,14 +345,14 @@ server_require_peer_cert_allow_partial_chain() ->
server_require_peer_cert_allow_partial_chain(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
{ok, ClientCAs} = file:read_file(proplists:get_value(cacertfile, ClientOpts)),
- [{_,_,_}, {_, IntermidiateCA, _}] = public_key:pem_decode(ClientCAs),
+ [{_,_,_}, {_, IntermidiateCA, _} | _] = public_key:pem_decode(ClientCAs),
PartialChain = fun(CertChain) ->
case lists:member(IntermidiateCA, CertChain) of
@@ -369,12 +387,12 @@ server_require_peer_cert_do_not_allow_partial_chain() ->
server_require_peer_cert_do_not_allow_partial_chain(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
{ok, ServerCAs} = file:read_file(proplists:get_value(cacertfile, ServerOpts)),
- [{_,_,_}, {_, IntermidiateCA, _}] = public_key:pem_decode(ServerCAs),
+ [{_,_,_}, {_, IntermidiateCA, _} | _] = public_key:pem_decode(ServerCAs),
PartialChain = fun(_CertChain) ->
unknown_ca
@@ -410,12 +428,12 @@ server_require_peer_cert_partial_chain_fun_fail() ->
server_require_peer_cert_partial_chain_fun_fail(Config) when is_list(Config) ->
ServerOpts = [{verify, verify_peer}, {fail_if_no_peer_cert, true}
- | ssl_test_lib:ssl_options(server_verification_opts, Config)],
- ClientOpts = proplists:get_value(client_opts, Config),
+ | ssl_test_lib:ssl_options(server_rsa_opts, Config)],
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
{ok, ServerCAs} = file:read_file(proplists:get_value(cacertfile, ServerOpts)),
- [{_,_,_}, {_, IntermidiateCA, _}] = public_key:pem_decode(ServerCAs),
+ [{_,_,_}, {_, IntermidiateCA, _} | _] = public_key:pem_decode(ServerCAs),
PartialChain = fun(_CertChain) ->
ture = false %% crash on purpose
@@ -450,8 +468,8 @@ verify_fun_always_run_client() ->
[{doc,"Verify that user verify_fun is always run (for valid and valid_peer not only unknown_extension)"}].
verify_fun_always_run_client(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
@@ -495,8 +513,8 @@ verify_fun_always_run_client(Config) when is_list(Config) ->
verify_fun_always_run_server() ->
[{doc,"Verify that user verify_fun is always run (for valid and valid_peer not only unknown_extension)"}].
verify_fun_always_run_server(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
%% If user verify fun is called correctly we fail the connection.
@@ -544,63 +562,28 @@ cert_expired() ->
[{doc,"Test server with expired certificate"}].
cert_expired(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
-
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join(PrivDir, "server/expired_cert.pem"),
- [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile),
- OTPCert = public_key:pkix_decode_cert(DerCert, otp),
- OTPTbsCert = OTPCert#'OTPCertificate'.tbsCertificate,
-
{Year, Month, Day} = date(),
- {Hours, Min, Sec} = time(),
- NotBeforeStr = lists:flatten(io_lib:format("~p~s~s~s~s~sZ",[Year-2,
- two_digits_str(Month),
- two_digits_str(Day),
- two_digits_str(Hours),
- two_digits_str(Min),
- two_digits_str(Sec)])),
- NotAfterStr = lists:flatten(io_lib:format("~p~s~s~s~s~sZ",[Year-1,
- two_digits_str(Month),
- two_digits_str(Day),
- two_digits_str(Hours),
- two_digits_str(Min),
- two_digits_str(Sec)])),
- NewValidity = {'Validity', {generalTime, NotBeforeStr}, {generalTime, NotAfterStr}},
-
- ct:log("Validity: ~p ~n NewValidity: ~p ~n",
- [OTPTbsCert#'OTPTBSCertificate'.validity, NewValidity]),
-
- NewOTPTbsCert = OTPTbsCert#'OTPTBSCertificate'{validity = NewValidity},
- NewServerDerCert = public_key:pkix_sign(NewOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
+ Active = proplists:get_value(active, Config),
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_ca_0,
+ [{validity, {{Year-2, Month, Day},
+ {Year-1, Month, Day}}}]}],
+ Config, "_expired"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
+
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
- {options, NewServerOpts}]),
+ {options, [{active, Active}| ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client_error([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
- {options, [{verify, verify_peer} | ClientOpts]}]),
- receive
- {Client, {error, {tls_alert, "certificate expired"}}} ->
- receive
- {Server, {error, {tls_alert, "certificate expired"}}} ->
- ok;
- {Server, {error, closed}} ->
- ok
- end
- end.
+ {options, [{verify, verify_peer}, {active, Active} | ClientOpts]}]),
+
+ tcp_delivery_workaround(Server, {error, {tls_alert, "certificate expired"}},
+ Client, {error, {tls_alert, "certificate expired"}}).
two_digits_str(N) when N < 10 ->
lists:flatten(io_lib:format("0~p", [N]));
@@ -609,60 +592,32 @@ two_digits_str(N) ->
%%--------------------------------------------------------------------
extended_key_usage_verify_server() ->
- [{doc,"Test cert that has a critical extended_key_usage extension in verify_peer mode for server"}].
-
-extended_key_usage_verify_server(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
+ [{doc,"Test cert that has a critical extended_key_usage extension in server cert"}].
+
+extended_key_usage_verify_server(Config) when is_list(Config) ->
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_peer_opts,
+ [{extensions,
+ [{?'id-ce-extKeyUsage',
+ [?'id-kp-serverAuth'], true}]
+ }]}], Config, "_keyusage_server"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join(PrivDir, "server/new_cert.pem"),
- [{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile),
- ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp),
- ServerExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-serverAuth']},
- ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate,
- ServerExtensions = ServerOTPTbsCert#'OTPTBSCertificate'.extensions,
- NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions =
- [ServerExtKeyUsageExt |
- ServerExtensions]},
- NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
- ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join(PrivDir, "client/new_cert.pem"),
- [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile),
- ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp),
- ClientExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-clientAuth']},
- ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate,
- ClientExtensions = ClientOTPTbsCert#'OTPTBSCertificate'.extensions,
- NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions =
- [ClientExtKeyUsageExt |
- ClientExtensions]},
- NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]),
- NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)],
-
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_peer}, {active, Active} | NewServerOpts]}]),
+ {options, [{verify, verify_none}, {active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} |
- NewClientOpts]}]),
+ {options, [{verify, verify_peer}, {active, Active} |
+ ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
@@ -670,60 +625,35 @@ extended_key_usage_verify_server(Config) when is_list(Config) ->
ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
-extended_key_usage_verify_client() ->
+extended_key_usage_verify_both() ->
[{doc,"Test cert that has a critical extended_key_usage extension in client verify_peer mode"}].
-extended_key_usage_verify_client(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
+extended_key_usage_verify_both(Config) when is_list(Config) ->
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_peer_opts,
+ [{extensions, [{?'id-ce-extKeyUsage',
+ [?'id-kp-serverAuth'], true}]
+ }]},
+ {client_peer_opts,
+ [{extensions, [{?'id-ce-extKeyUsage',
+ [?'id-kp-clientAuth'], true}]
+ }]}], Config, "_keyusage_both"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join(PrivDir, "server/new_cert.pem"),
- [{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile),
- ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp),
- ServerExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-serverAuth']},
- ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate,
- ServerExtensions = ServerOTPTbsCert#'OTPTBSCertificate'.extensions,
- NewServerOTPTbsCert = ServerOTPTbsCert#'OTPTBSCertificate'{extensions =
- [ServerExtKeyUsageExt |
- ServerExtensions]},
- NewServerDerCert = public_key:pkix_sign(NewServerOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewServerCertFile, [{'Certificate', NewServerDerCert, not_encrypted}]),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
- ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join(PrivDir, "client/new_cert.pem"),
- [{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile),
- ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp),
- ClientExtKeyUsageExt = {'Extension', ?'id-ce-extKeyUsage', true, [?'id-kp-clientAuth']},
- ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate,
- ClientExtensions = ClientOTPTbsCert#'OTPTBSCertificate'.extensions,
- NewClientOTPTbsCert = ClientOTPTbsCert#'OTPTBSCertificate'{extensions =
- [ClientExtKeyUsageExt |
- ClientExtensions]},
- NewClientDerCert = public_key:pkix_sign(NewClientOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewClientCertFile, [{'Certificate', NewClientDerCert, not_encrypted}]),
- NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)],
-
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewServerOpts]}]),
+ {options, [{verify, verify_peer}, {active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewClientOpts]}]),
+ {options, [{verify, verify_peer}, {active, Active} | ClientOpts]}]),
ssl_test_lib:check_result(Server, ok, Client, ok),
@@ -735,132 +665,103 @@ critical_extension_verify_server() ->
[{doc,"Test cert that has a critical unknown extension in verify_peer mode"}].
critical_extension_verify_server(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{client_peer_opts,
+ [{extensions, [{{2,16,840,1,113730,1,1},
+ <<3,2,6,192>>, true}]
+ }]}], Config, "_client_unknown_extension"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- NewCertName = integer_to_list(erlang:unique_integer()) ++ ".pem",
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join([PrivDir, "server", NewCertName]),
- add_critical_netscape_cert_type(ServerCertFile, NewServerCertFile, KeyFile),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
- ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join([PrivDir, "client", NewCertName]),
- add_critical_netscape_cert_type(ClientCertFile, NewClientCertFile, KeyFile),
- NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)],
-
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error(
[{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_peer}, {active, Active} | NewServerOpts]}]),
+ {options, [{verify, verify_peer}, {active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client_error(
[{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewClientOpts]}]),
+ {options, [{verify, verify_none}, {active, Active} | ClientOpts]}]),
%% This certificate has a critical extension that we don't
- %% understand. Therefore, verification should fail.
- tcp_delivery_workaround(Server, {error, {tls_alert, "unsupported certificate"}},
- Client, {error, {tls_alert, "unsupported certificate"}}),
+ %% understand. Therefore, verification should fail.
- ssl_test_lib:close(Server),
- ok.
+ tcp_delivery_workaround(Server, {error, {tls_alert, "unsupported certificate"}},
+ Client, {error, {tls_alert, "unsupported certificate"}}),
+
+ ssl_test_lib:close(Server).
%%--------------------------------------------------------------------
critical_extension_verify_client() ->
[{doc,"Test cert that has a critical unknown extension in verify_peer mode"}].
critical_extension_verify_client(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_peer_opts,
+ [{extensions, [{{2,16,840,1,113730,1,1},
+ <<3,2,6,192>>, true}]
+ }]}], Config, "_server_unknown_extensions"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- NewCertName = integer_to_list(erlang:unique_integer()) ++ ".pem",
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join([PrivDir, "server", NewCertName]),
- add_critical_netscape_cert_type(ServerCertFile, NewServerCertFile, KeyFile),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
- ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join([PrivDir, "client", NewCertName]),
- add_critical_netscape_cert_type(ClientCertFile, NewClientCertFile, KeyFile),
- NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)],
-
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error(
[{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewServerOpts]}]),
+ {options, [{verify, verify_none}, {active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client_error(
[{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_peer}, {active, Active} | NewClientOpts]}]),
+ {options, [{verify, verify_peer}, {active, Active} | ClientOpts]}]),
%% This certificate has a critical extension that we don't
%% understand. Therefore, verification should fail.
- tcp_delivery_workaround(Server, {error, {tls_alert, "unsupported certificate"}},
- Client, {error, {tls_alert, "unsupported certificate"}}),
+ ssl_test_lib:check_result(Server, {error, {tls_alert, "unsupported certificate"}},
+ Client, {error, {tls_alert, "unsupported certificate"}}),
+
+ ssl_test_lib:close(Server).
- ssl_test_lib:close(Server),
- ok.
%%--------------------------------------------------------------------
critical_extension_verify_none() ->
[{doc,"Test cert that has a critical unknown extension in verify_none mode"}].
critical_extension_verify_none(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{client_peer_opts,
+ [{extensions,
+ [{{2,16,840,1,113730,1,1},
+ <<3,2,6,192>>, true}]
+ }]}], Config, "_unknown_extensions"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
Active = proplists:get_value(active, Config),
ReceiveFunction = proplists:get_value(receive_function, Config),
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- NewCertName = integer_to_list(erlang:unique_integer()) ++ ".pem",
-
- ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join([PrivDir, "server", NewCertName]),
- add_critical_netscape_cert_type(ServerCertFile, NewServerCertFile, KeyFile),
- NewServerOpts = [{certfile, NewServerCertFile} | proplists:delete(certfile, ServerOpts)],
-
- ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join([PrivDir, "client", NewCertName]),
- add_critical_netscape_cert_type(ClientCertFile, NewClientCertFile, KeyFile),
- NewClientOpts = [{certfile, NewClientCertFile} | proplists:delete(certfile, ClientOpts)],
-
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server(
[{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewServerOpts]}]),
+ {options, [{verify, verify_none}, {active, Active} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client(
[{node, ClientNode}, {port, Port},
{host, Hostname},
{from, self()},
{mfa, {ssl_test_lib, ReceiveFunction, []}},
- {options, [{verify, verify_none}, {active, Active} | NewClientOpts]}]),
+ {options, [{verify, verify_none}, {active, Active} | ClientOpts]}]),
%% This certificate has a critical extension that we don't
%% understand. But we're using `verify_none', so verification
@@ -868,28 +769,7 @@ critical_extension_verify_none(Config) when is_list(Config) ->
ssl_test_lib:check_result(Server, ok, Client, ok),
ssl_test_lib:close(Server),
- ssl_test_lib:close(Client),
- ok.
-
-add_critical_netscape_cert_type(CertFile, NewCertFile, KeyFile) ->
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(CertFile),
- OTPCert = public_key:pkix_decode_cert(DerCert, otp),
- %% This is the "Netscape Cert Type" extension, telling us that the
- %% certificate can be used for SSL clients and SSL servers.
- NetscapeCertTypeExt = #'Extension'{
- extnID = {2,16,840,1,113730,1,1},
- critical = true,
- extnValue = <<3,2,6,192>>},
- OTPTbsCert = OTPCert#'OTPCertificate'.tbsCertificate,
- Extensions = OTPTbsCert#'OTPTBSCertificate'.extensions,
- NewOTPTbsCert = OTPTbsCert#'OTPTBSCertificate'{
- extensions = [NetscapeCertTypeExt] ++ Extensions},
- NewDerCert = public_key:pkix_sign(NewOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewCertFile, [{'Certificate', NewDerCert, not_encrypted}]),
- ok.
+ ssl_test_lib:close(Client).
%%--------------------------------------------------------------------
no_authority_key_identifier() ->
@@ -897,35 +777,21 @@ no_authority_key_identifier() ->
" but are present in trusted certs db."}].
no_authority_key_identifier(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
-
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- CertFile = proplists:get_value(certfile, ServerOpts),
- NewCertFile = filename:join(PrivDir, "server/new_cert.pem"),
- [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(CertFile),
- OTPCert = public_key:pkix_decode_cert(DerCert, otp),
- OTPTbsCert = OTPCert#'OTPCertificate'.tbsCertificate,
- Extensions = OTPTbsCert#'OTPTBSCertificate'.extensions,
- NewExtensions = delete_authority_key_extension(Extensions, []),
- NewOTPTbsCert = OTPTbsCert#'OTPTBSCertificate'{extensions = NewExtensions},
-
- ct:log("Extensions ~p~n, NewExtensions: ~p~n", [Extensions, NewExtensions]),
-
- NewDerCert = public_key:pkix_sign(NewOTPTbsCert, Key),
- ssl_test_lib:der_to_pem(NewCertFile, [{'Certificate', NewDerCert, not_encrypted}]),
- NewServerOpts = [{certfile, NewCertFile} | proplists:delete(certfile, ServerOpts)],
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_peer_opts,
+ [{extensions, [{auth_key_id, undefined}]
+ }]},
+ {client_peer_opts,
+ [{extensions, [{auth_key_id, undefined}]
+ }]}], Config, "_peer_no_auth_key_id"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib, send_recv_result_active, []}},
- {options, NewServerOpts}]),
+ {options, ServerOpts}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -941,53 +807,35 @@ no_authority_key_identifier(Config) when is_list(Config) ->
delete_authority_key_extension([], Acc) ->
lists:reverse(Acc);
delete_authority_key_extension([#'Extension'{extnID = ?'id-ce-authorityKeyIdentifier'} | Rest],
- Acc) ->
+ Acc) ->
delete_authority_key_extension(Rest, Acc);
delete_authority_key_extension([Head | Rest], Acc) ->
delete_authority_key_extension(Rest, [Head | Acc]).
%%--------------------------------------------------------------------
-no_authority_key_identifier_and_nonstandard_encoding() ->
- [{doc, "Test cert with nonstandard encoding that does not have"
- " authorityKeyIdentifier extension but are present in trusted certs db."}].
-
-no_authority_key_identifier_and_nonstandard_encoding(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
- PrivDir = proplists:get_value(priv_dir, Config),
-
- KeyFile = filename:join(PrivDir, "otpCA/private/key.pem"),
- [KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
- Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
-
- CertFile = proplists:get_value(certfile, ServerOpts),
- NewCertFile = filename:join(PrivDir, "server/new_cert.pem"),
- [{'Certificate', DerCert, _}] = ssl_test_lib:pem_to_der(CertFile),
- ServerCert = public_key:pkix_decode_cert(DerCert, plain),
- ServerTbsCert = ServerCert#'Certificate'.tbsCertificate,
- Extensions0 = ServerTbsCert#'TBSCertificate'.extensions,
- %% need to remove authorityKeyIdentifier extension to cause DB lookup by signature
- Extensions = delete_authority_key_extension(Extensions0, []),
- NewExtensions = replace_key_usage_extension(Extensions, []),
- NewServerTbsCert = ServerTbsCert#'TBSCertificate'{extensions = NewExtensions},
-
- ct:log("Extensions ~p~n, NewExtensions: ~p~n", [Extensions, NewExtensions]),
-
- TbsDer = public_key:pkix_encode('TBSCertificate', NewServerTbsCert, plain),
- Sig = public_key:sign(TbsDer, md5, Key),
- NewServerCert = ServerCert#'Certificate'{tbsCertificate = NewServerTbsCert, signature = Sig},
- NewDerCert = public_key:pkix_encode('Certificate', NewServerCert, plain),
- ssl_test_lib:der_to_pem(NewCertFile, [{'Certificate', NewDerCert, not_encrypted}]),
- NewServerOpts = [{certfile, NewCertFile} | proplists:delete(certfile, ServerOpts)],
-
+no_authority_key_identifier_keyEncipherment() ->
+ [{doc, "Test cert with keyEncipherment key_usage an no"
+ " authorityKeyIdentifier extension, but are present in trusted certs db."}].
+
+no_authority_key_identifier_keyEncipherment(Config) when is_list(Config) ->
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{server_peer_opts,
+ [{extensions, [{auth_key_id, undefined},
+ {key_usage, [digitalSignature,
+ keyEncipherment]}]
+ }]},
+ {client_peer_opts,
+ [{extensions, [{auth_key_id, undefined}]
+ }]}], Config, "_peer_keyEncipherment"),
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
{mfa, {ssl_test_lib,
send_recv_result_active, []}},
- {options, [{active, true} | NewServerOpts]}]),
+ {options, [{active, true} | ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -999,14 +847,6 @@ no_authority_key_identifier_and_nonstandard_encoding(Config) when is_list(Config
ssl_test_lib:close(Server),
ssl_test_lib:close(Client).
-replace_key_usage_extension([], Acc) ->
- lists:reverse(Acc);
-replace_key_usage_extension([#'Extension'{extnID = ?'id-ce-keyUsage'} = E | Rest], Acc) ->
- %% A nonstandard DER encoding of [digitalSignature, keyEncipherment]
- Val = <<3, 2, 0, 16#A0>>,
- replace_key_usage_extension(Rest, [E#'Extension'{extnValue = Val} | Acc]);
-replace_key_usage_extension([Head | Rest], Acc) ->
- replace_key_usage_extension(Rest, [Head | Acc]).
%%--------------------------------------------------------------------
@@ -1014,16 +854,16 @@ invalid_signature_server() ->
[{doc,"Test client with invalid signature"}].
invalid_signature_server(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
PrivDir = proplists:get_value(priv_dir, Config),
- KeyFile = filename:join(PrivDir, "server/key.pem"),
+ KeyFile = proplists:get_value(keyfile, ServerOpts),
[KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
ServerCertFile = proplists:get_value(certfile, ServerOpts),
- NewServerCertFile = filename:join(PrivDir, "server/invalid_cert.pem"),
+ NewServerCertFile = filename:join(PrivDir, "server_invalid_cert.pem"),
[{'Certificate', ServerDerCert, _}] = ssl_test_lib:pem_to_der(ServerCertFile),
ServerOTPCert = public_key:pkix_decode_cert(ServerDerCert, otp),
ServerOTPTbsCert = ServerOTPCert#'OTPCertificate'.tbsCertificate,
@@ -1042,8 +882,8 @@ invalid_signature_server(Config) when is_list(Config) ->
{from, self()},
{options, [{verify, verify_peer} | ClientOpts]}]),
- tcp_delivery_workaround(Server, {error, {tls_alert, "bad certificate"}},
- Client, {error, {tls_alert, "bad certificate"}}).
+ tcp_delivery_workaround(Server, {error, {tls_alert, "unknown ca"}},
+ Client, {error, {tls_alert, "unknown ca"}}).
%%--------------------------------------------------------------------
@@ -1051,16 +891,16 @@ invalid_signature_client() ->
[{doc,"Test server with invalid signature"}].
invalid_signature_client(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(client_rsa_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_opts, Config),
PrivDir = proplists:get_value(priv_dir, Config),
- KeyFile = filename:join(PrivDir, "client/key.pem"),
+ KeyFile = proplists:get_value(keyfile, ClientOpts),
[KeyEntry] = ssl_test_lib:pem_to_der(KeyFile),
Key = ssl_test_lib:public_key(public_key:pem_entry_decode(KeyEntry)),
ClientCertFile = proplists:get_value(certfile, ClientOpts),
- NewClientCertFile = filename:join(PrivDir, "client/invalid_cert.pem"),
+ NewClientCertFile = filename:join(PrivDir, "client_invalid_cert.pem"),
[{'Certificate', ClientDerCert, _}] = ssl_test_lib:pem_to_der(ClientCertFile),
ClientOTPCert = public_key:pkix_decode_cert(ClientDerCert, otp),
ClientOTPTbsCert = ClientOTPCert#'OTPCertificate'.tbsCertificate,
@@ -1079,8 +919,8 @@ invalid_signature_client(Config) when is_list(Config) ->
{from, self()},
{options, NewClientOpts}]),
- tcp_delivery_workaround(Server, {error, {tls_alert, "bad certificate"}},
- Client, {error, {tls_alert, "bad certificate"}}).
+ tcp_delivery_workaround(Server, {error, {tls_alert, "unknown ca"}},
+ Client, {error, {tls_alert, "unknown ca"}}).
%%--------------------------------------------------------------------
@@ -1089,8 +929,15 @@ client_with_cert_cipher_suites_handshake() ->
[{doc, "Test that client with a certificate without keyEncipherment usage "
" extension can connect to a server with restricted cipher suites "}].
client_with_cert_cipher_suites_handshake(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_verification_opts_digital_signature_only, Config),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ {ClientOpts0, ServerOpts0} = ssl_test_lib:make_rsa_cert_chains([{client_peer_opts,
+ [{extensions,
+ [{key_usage, [digitalSignature]}]
+ }]}], Config, "_sign_only_extensions"),
+
+
+ ClientOpts = ssl_test_lib:ssl_options(ClientOpts0, Config),
+ ServerOpts = ssl_test_lib:ssl_options(ServerOpts0, Config),
+
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
@@ -1098,7 +945,7 @@ client_with_cert_cipher_suites_handshake(Config) when is_list(Config) ->
send_recv_result_active, []}},
{options, [{active, true},
{ciphers,
- ssl_test_lib:rsa_non_signed_suites(tls_record:highest_protocol_version([]))}
+ ssl_test_lib:rsa_non_signed_suites(proplists:get_value(version, Config))}
| ServerOpts]}]),
Port = ssl_test_lib:inet_port(Server),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
@@ -1118,7 +965,7 @@ client_with_cert_cipher_suites_handshake(Config) when is_list(Config) ->
server_verify_no_cacerts() ->
[{doc,"Test server must have cacerts if it wants to verify client"}].
server_verify_no_cacerts(Config) when is_list(Config) ->
- ServerOpts = proplists:delete(cacertfile, ssl_test_lib:ssl_options(server_opts, Config)),
+ ServerOpts = proplists:delete(cacertfile, ssl_test_lib:ssl_options(server_rsa_opts, Config)),
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
@@ -1132,8 +979,8 @@ server_verify_no_cacerts(Config) when is_list(Config) ->
unknown_server_ca_fail() ->
[{doc,"Test that the client fails if the ca is unknown in verify_peer mode"}].
unknown_server_ca_fail(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, []),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(empty_client_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
@@ -1176,8 +1023,8 @@ unknown_server_ca_fail(Config) when is_list(Config) ->
unknown_server_ca_accept_verify_none() ->
[{doc,"Test that the client succeds if the ca is unknown in verify_none mode"}].
unknown_server_ca_accept_verify_none(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, []),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(empty_client_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
@@ -1201,8 +1048,8 @@ unknown_server_ca_accept_verify_peer() ->
[{doc, "Test that the client succeds if the ca is unknown in verify_peer mode"
" with a verify_fun that accepts the unknown ca error"}].
unknown_server_ca_accept_verify_peer(Config) when is_list(Config) ->
- ClientOpts =ssl_test_lib:ssl_options(client_opts, []),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(empty_client_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
@@ -1240,8 +1087,8 @@ unknown_server_ca_accept_verify_peer(Config) when is_list(Config) ->
unknown_server_ca_accept_backwardscompatibility() ->
[{doc,"Test that old style verify_funs will work"}].
unknown_server_ca_accept_backwardscompatibility(Config) when is_list(Config) ->
- ClientOpts = ssl_test_lib:ssl_options(client_opts, []),
- ServerOpts = ssl_test_lib:ssl_options(server_verification_opts, Config),
+ ClientOpts = ssl_test_lib:ssl_options(empty_client_opts, Config),
+ ServerOpts = ssl_test_lib:ssl_options(server_rsa_verify_opts, Config),
{ClientNode, ServerNode, Hostname} = ssl_test_lib:run_where(Config),
Server = ssl_test_lib:start_server([{node, ServerNode}, {port, 0},
{from, self()},
diff --git a/lib/ssl/test/ssl_packet_SUITE.erl b/lib/ssl/test/ssl_packet_SUITE.erl
index 3446a566c4..c8caa9c11a 100644
--- a/lib/ssl/test/ssl_packet_SUITE.erl
+++ b/lib/ssl/test/ssl_packet_SUITE.erl
@@ -1973,14 +1973,14 @@ passive_recv_packet(Socket, _, 0) ->
{error, timeout} = ssl:recv(Socket, 0, 500),
ok;
Other ->
- {other, Other, ssl:session_info(Socket), 0}
+ {other, Other, ssl:connection_information(Socket, [session_id, cipher_suite]), 0}
end;
passive_recv_packet(Socket, Data, N) ->
case ssl:recv(Socket, 0) of
{ok, Data} ->
passive_recv_packet(Socket, Data, N-1);
Other ->
- {other, Other, ssl:session_info(Socket), N}
+ {other, Other, ssl:connection_information(Socket, [session_id, cipher_suite]), N}
end.
send(Socket,_, 0) ->
@@ -2032,7 +2032,7 @@ active_once_packet(Socket,_, 0) ->
{ssl, Socket, []} ->
ok;
{ssl, Socket, Other} ->
- {other, Other, ssl:session_info(Socket), 0}
+ {other, Other, ssl:connection_information(Socket, [session_id, cipher_suite]), 0}
end;
active_once_packet(Socket, Data, N) ->
receive
@@ -2077,7 +2077,7 @@ active_packet(Socket, _, 0) ->
{ssl, Socket, []} ->
ok;
Other ->
- {other, Other, ssl:session_info(Socket), 0}
+ {other, Other, ssl:connection_information(Socket, [session_id, cipher_suite]), 0}
end;
active_packet(Socket, Data, N) ->
receive
@@ -2089,7 +2089,7 @@ active_packet(Socket, Data, N) ->
{ssl, Socket, Data} ->
active_packet(Socket, Data, N -1);
Other ->
- {other, Other, ssl:session_info(Socket),N}
+ {other, Other, ssl:connection_information(Socket, [session_id, cipher_suite]),N}
end.
assert_packet_opt(Socket, Type) ->
diff --git a/lib/ssl/test/ssl_test_lib.erl b/lib/ssl/test/ssl_test_lib.erl
index 49d2b5c1b8..b8fd5dc975 100644
--- a/lib/ssl/test/ssl_test_lib.erl
+++ b/lib/ssl/test/ssl_test_lib.erl
@@ -401,27 +401,22 @@ cert_options(Config) ->
{ssl_imp, new}]},
{server_opts, [{ssl_imp, new},{reuseaddr, true}, {cacertfile, ServerCaCertFile},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile}]},
- %%{server_anon, [{ssl_imp, new},{reuseaddr, true}, {ciphers, anonymous_suites()}]},
- {client_psk, [{ssl_imp, new},{reuseaddr, true},
+ {client_psk, [{ssl_imp, new},
{psk_identity, "Test-User"},
{user_lookup_fun, {fun user_lookup/3, PskSharedSecret}}]},
{server_psk, [{ssl_imp, new},{reuseaddr, true},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
- {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}},
- {ciphers, psk_suites()}]},
+ {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}}]},
{server_psk_hint, [{ssl_imp, new},{reuseaddr, true},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
{psk_identity, "HINT"},
- {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}},
- {ciphers, psk_suites()}]},
+ {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}}]},
{server_psk_anon, [{ssl_imp, new},{reuseaddr, true},
- {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}},
- {ciphers, psk_anon_suites()}]},
+ {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}}]},
{server_psk_anon_hint, [{ssl_imp, new},{reuseaddr, true},
{psk_identity, "HINT"},
- {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}},
- {ciphers, psk_anon_suites()}]},
- {client_srp, [{ssl_imp, new},{reuseaddr, true},
+ {user_lookup_fun, {fun user_lookup/3, PskSharedSecret}}]},
+ {client_srp, [{ssl_imp, new},
{srp_identity, {"Test-User", "secret"}}]},
{server_srp, [{ssl_imp, new},{reuseaddr, true},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
@@ -476,7 +471,7 @@ make_dsa_cert(Config) ->
{cacertfile, ClientCaCertFile},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
{verify, verify_peer}]},
- {client_dsa_opts, [{ssl_imp, new},{reuseaddr, true},
+ {client_dsa_opts, [{ssl_imp, new},
{cacertfile, ClientCaCertFile},
{certfile, ClientCertFile}, {keyfile, ClientKeyFile}]},
{server_srp_dsa, [{ssl_imp, new},{reuseaddr, true},
@@ -484,35 +479,121 @@ make_dsa_cert(Config) ->
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
{user_lookup_fun, {fun user_lookup/3, undefined}},
{ciphers, srp_dss_suites()}]},
- {client_srp_dsa, [{ssl_imp, new},{reuseaddr, true},
+ {client_srp_dsa, [{ssl_imp, new},
{srp_identity, {"Test-User", "secret"}},
{cacertfile, ClientCaCertFile},
{certfile, ClientCertFile}, {keyfile, ClientKeyFile}]}
| Config].
+make_rsa_cert_chains(ChainConf, Config, Suffix) ->
+ CryptoSupport = crypto:supports(),
+ KeyGenSpec = key_gen_info(rsa, rsa),
+ ClientFileBase = filename:join([proplists:get_value(priv_dir, Config), "rsa" ++ Suffix]),
+ ServerFileBase = filename:join([proplists:get_value(priv_dir, Config), "rsa" ++ Suffix]),
+ GenCertData = x509_test:gen_test_certs([{digest, appropriate_sha(CryptoSupport)} | KeyGenSpec] ++ ChainConf),
+ [{server_config, ServerConf},
+ {client_config, ClientConf}] =
+ x509_test:gen_pem_config_files(GenCertData, ClientFileBase, ServerFileBase),
+ {[{verify, verify_peer} | ClientConf],
+ [{reuseaddr, true}, {verify, verify_peer} | ServerConf]
+ }.
+
+make_ec_cert_chains(ClientChainType, ServerChainType, Config) ->
+ CryptoSupport = crypto:supports(),
+ KeyGenSpec = key_gen_info(ClientChainType, ServerChainType),
+ ClientFileBase = filename:join([proplists:get_value(priv_dir, Config), atom_to_list(ClientChainType)]),
+ ServerFileBase = filename:join([proplists:get_value(priv_dir, Config), atom_to_list(ServerChainType)]),
+ GenCertData = x509_test:gen_test_certs([{digest, appropriate_sha(CryptoSupport)} | KeyGenSpec]),
+ [{server_config, ServerConf},
+ {client_config, ClientConf}] =
+ x509_test:gen_pem_config_files(GenCertData, ClientFileBase, ServerFileBase),
+ {[{verify, verify_peer} | ClientConf],
+ [{reuseaddr, true}, {verify, verify_peer} | ServerConf]
+ }.
+
+key_gen_info(ClientChainType, ServerChainType) ->
+ key_gen_spec("client", ClientChainType) ++ key_gen_spec("server", ServerChainType).
+
+key_gen_spec(Role, ecdh_rsa) ->
+ CurveOid = hd(tls_v1:ecc_curves(0)),
+ [{list_to_atom(Role ++ "_key_gen"), {namedCurve, CurveOid}},
+ {list_to_atom(Role ++ "_key_gen_chain"), [hardcode_rsa_key(1),
+ {namedCurve, CurveOid}]}
+ ];
+key_gen_spec(Role, ecdhe_ecdsa) ->
+ CurveOid = hd(tls_v1:ecc_curves(0)),
+ [{list_to_atom(Role ++ "_key_gen"), {namedCurve, CurveOid}},
+ {list_to_atom(Role ++ "_key_gen_chain"), [{namedCurve, CurveOid},
+ {namedCurve, CurveOid}]}
+ ];
+key_gen_spec(Role, ecdh_ecdsa) ->
+ CurveOid = hd(tls_v1:ecc_curves(0)),
+ [{list_to_atom(Role ++ "_key_gen"), {namedCurve, CurveOid}},
+ {list_to_atom(Role ++ "_key_gen_chain"), [{namedCurve, CurveOid},
+ {namedCurve, CurveOid}]}
+ ];
+key_gen_spec(Role, ecdhe_rsa) ->
+ [{list_to_atom(Role ++ "_key_gen"), hardcode_rsa_key(1)},
+ {list_to_atom(Role ++ "_key_gen_chain"), [hardcode_rsa_key(2),
+ hardcode_rsa_key(3)]}
+ ];
+key_gen_spec(Role, rsa) ->
+ [{list_to_atom(Role ++ "_key_gen"), hardcode_rsa_key(1)},
+ {list_to_atom(Role ++ "_key_gen_chain"), [hardcode_rsa_key(2),
+ hardcode_rsa_key(3)]}
+ ].
make_ecdsa_cert(Config) ->
CryptoSupport = crypto:supports(),
case proplists:get_bool(ecdsa, proplists:get_value(public_keys, CryptoSupport)) of
- true ->
- {ServerCaCertFile, ServerCertFile, ServerKeyFile} =
- make_cert_files("server", Config, ec, ec, "", [{digest, appropriate_sha(CryptoSupport)}]),
- {ClientCaCertFile, ClientCertFile, ClientKeyFile} =
- make_cert_files("client", Config, ec, ec, "", [{digest, appropriate_sha(CryptoSupport)}]),
- [{server_ecdsa_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ServerCaCertFile},
- {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]},
- {server_ecdsa_verify_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ClientCaCertFile},
- {certfile, ServerCertFile}, {keyfile, ServerKeyFile},
- {verify, verify_peer}]},
- {client_ecdsa_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ClientCaCertFile},
- {certfile, ClientCertFile}, {keyfile, ClientKeyFile}]}
+ true ->
+ ClientFileBase = filename:join([proplists:get_value(priv_dir, Config), "ecdsa"]),
+ ServerFileBase = filename:join([proplists:get_value(priv_dir, Config), "ecdsa"]),
+ CurveOid = hd(tls_v1:ecc_curves(0)),
+ GenCertData = x509_test:gen_test_certs([{server_key_gen, {namedCurve, CurveOid}},
+ {client_key_gen, {namedCurve, CurveOid}},
+ {server_key_gen_chain, [{namedCurve, CurveOid},
+ {namedCurve, CurveOid}]},
+ {client_key_gen_chain, [{namedCurve, CurveOid},
+ {namedCurve, CurveOid}]},
+ {digest, appropriate_sha(CryptoSupport)}]),
+ [{server_config, ServerConf},
+ {client_config, ClientConf}] =
+ x509_test:gen_pem_config_files(GenCertData, ClientFileBase, ServerFileBase),
+ [{server_ecdsa_opts, [{ssl_imp, new},{reuseaddr, true} | ServerConf]},
+
+ {server_ecdsa_verify_opts, [{ssl_imp, new}, {reuseaddr, true},
+ {verify, verify_peer} | ServerConf]},
+ {client_ecdsa_opts, ClientConf}
| Config];
- _ ->
+ false ->
+ Config
+ end.
+make_rsa_cert(Config) ->
+ CryptoSupport = crypto:supports(),
+ case proplists:get_bool(rsa, proplists:get_value(public_keys, CryptoSupport)) of
+ true ->
+ ClientFileBase = filename:join([proplists:get_value(priv_dir, Config), "rsa"]),
+ ServerFileBase = filename:join([proplists:get_value(priv_dir, Config), "rsa"]),
+ GenCertData = x509_test:gen_test_certs([{server_key_gen, hardcode_rsa_key(1)},
+ {client_key_gen, hardcode_rsa_key(2)},
+ {server_key_gen_chain, [hardcode_rsa_key(3),
+ hardcode_rsa_key(4)]},
+ {client_key_gen_chain, [hardcode_rsa_key(5),
+ hardcode_rsa_key(6)]},
+ {digest, appropriate_sha(CryptoSupport)}]),
+ [{server_config, ServerConf},
+ {client_config, ClientConf}] =
+ x509_test:gen_pem_config_files(GenCertData, ClientFileBase, ServerFileBase),
+ [{server_rsa_opts, [{ssl_imp, new},{reuseaddr, true} | ServerConf]},
+
+ {server_rsa_verify_opts, [{ssl_imp, new}, {reuseaddr, true},
+ {verify, verify_peer} | ServerConf]},
+ {client_rsa_opts, ClientConf},
+ {client_rsa_verify_opts, [{verify, verify_peer} |ClientConf]}
+ | Config];
+ false ->
Config
end.
-
appropriate_sha(CryptoSupport) ->
case proplists:get_bool(sha256, CryptoSupport) of
true ->
@@ -529,21 +610,30 @@ make_ecdh_rsa_cert(Config) ->
CryptoSupport = crypto:supports(),
case proplists:get_bool(ecdh, proplists:get_value(public_keys, CryptoSupport)) of
true ->
- {ServerCaCertFile, ServerCertFile, ServerKeyFile} =
- make_cert_files("server", Config, rsa, ec, "rsa_", []),
- {ClientCaCertFile, ClientCertFile, ClientKeyFile} =
- make_cert_files("client", Config, rsa, ec, "rsa_",[]),
- [{server_ecdh_rsa_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ServerCaCertFile},
- {certfile, ServerCertFile}, {keyfile, ServerKeyFile}]},
- {server_ecdh_rsa_verify_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ClientCaCertFile},
- {certfile, ServerCertFile}, {keyfile, ServerKeyFile},
- {verify, verify_peer}]},
- {client_ecdh_rsa_opts, [{ssl_imp, new},{reuseaddr, true},
- {cacertfile, ClientCaCertFile},
- {certfile, ClientCertFile}, {keyfile, ClientKeyFile}]}
- | Config];
+ ClientFileBase = filename:join([proplists:get_value(priv_dir, Config), "ecdh_rsa"]),
+ ServerFileBase = filename:join([proplists:get_value(priv_dir, Config), "ecdh_rsa"]),
+ CurveOid = hd(tls_v1:ecc_curves(0)),
+ GenCertData = x509_test:gen_test_certs([{server_key_gen, {namedCurve, CurveOid}},
+ {client_key_gen, {namedCurve, CurveOid}},
+ {server_key_gen_chain, [hardcode_rsa_key(1),
+ {namedCurve, CurveOid}
+ ]},
+ {client_key_gen_chain, [hardcode_rsa_key(2),
+ {namedCurve, CurveOid}
+ ]},
+ {digest, appropriate_sha(CryptoSupport)}]),
+ [{server_config, ServerConf},
+ {client_config, ClientConf}] =
+ x509_test:gen_pem_config_files(GenCertData, ClientFileBase, ServerFileBase),
+
+ [{server_ecdh_rsa_opts, [{ssl_imp, new},{reuseaddr, true} | ServerConf]},
+
+ {server_ecdh_rsa_verify_opts, [{ssl_imp, new},{reuseaddr, true},
+ {verify, verify_peer} | ServerConf]},
+
+ {client_ecdh_rsa_opts, ClientConf}
+
+ | Config];
_ ->
Config
end.
@@ -560,7 +650,7 @@ make_mix_cert(Config) ->
{cacertfile, ClientCaCertFile},
{certfile, ServerCertFile}, {keyfile, ServerKeyFile},
{verify, verify_peer}]},
- {client_mix_opts, [{ssl_imp, new},{reuseaddr, true},
+ {client_mix_opts, [{ssl_imp, new},
{cacertfile, ClientCaCertFile},
{certfile, ClientCertFile}, {keyfile, ClientKeyFile}]}
| Config].
@@ -787,18 +877,18 @@ no_result(_) ->
no_result_msg.
trigger_renegotiate(Socket, [ErlData, N]) ->
- [{session_id, Id} | _ ] = ssl:session_info(Socket),
+ {ok, [{session_id, Id}]} = ssl:connection_information(Socket, [session_id]),
trigger_renegotiate(Socket, ErlData, N, Id).
trigger_renegotiate(Socket, _, 0, Id) ->
ct:sleep(1000),
- case ssl:session_info(Socket) of
- [{session_id, Id} | _ ] ->
+ case ssl:connection_information(Socket, [session_id]) of
+ {ok, [{session_id, Id}]} ->
fail_session_not_renegotiated;
%% Tests that uses this function will not reuse
%% sessions so if we get a new session id the
%% renegotiation has succeeded.
- [{session_id, _} | _ ] ->
+ {ok, [{session_id, _}]} ->
ok;
{error, closed} ->
fail_session_fatal_alert_during_renegotiation;
@@ -830,17 +920,17 @@ rsa_suites(CounterPart) ->
({dhe_rsa, des_cbc, sha}) when FIPS == true ->
false;
({rsa, Cipher, _}) ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
({dhe_rsa, Cipher, _}) ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
({ecdhe_rsa, Cipher, _}) when ECC == true ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
({rsa, Cipher, _, _}) ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
({dhe_rsa, Cipher, _,_}) ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
({ecdhe_rsa, Cipher, _,_}) when ECC == true ->
- lists:member(Cipher, Ciphers);
+ lists:member(cipher_atom(Cipher), Ciphers);
(_) ->
false
end,
@@ -863,9 +953,9 @@ available_suites(Version) ->
rsa_non_signed_suites(Version) ->
lists:filter(fun({rsa, _, _}) ->
- true;
+ false;
(_) ->
- false
+ true
end,
available_suites(Version)).
@@ -933,44 +1023,12 @@ anonymous_suites(Version) ->
Suites = ssl_cipher:anonymous_suites(Version),
ssl_cipher:filter_suites(Suites).
-psk_suites() ->
- Suites =
- [{psk, rc4_128, sha},
- {psk, '3des_ede_cbc', sha},
- {psk, aes_128_cbc, sha},
- {psk, aes_256_cbc, sha},
- {psk, aes_128_cbc, sha256},
- {psk, aes_256_cbc, sha384},
- {dhe_psk, rc4_128, sha},
- {dhe_psk, '3des_ede_cbc', sha},
- {dhe_psk, aes_128_cbc, sha},
- {dhe_psk, aes_256_cbc, sha},
- {dhe_psk, aes_128_cbc, sha256},
- {dhe_psk, aes_256_cbc, sha384},
- {rsa_psk, rc4_128, sha},
- {rsa_psk, '3des_ede_cbc', sha},
- {rsa_psk, aes_128_cbc, sha},
- {rsa_psk, aes_256_cbc, sha},
- {rsa_psk, aes_128_cbc, sha256},
- {rsa_psk, aes_256_cbc, sha384},
- {psk, aes_128_gcm, null, sha256},
- {psk, aes_256_gcm, null, sha384},
- {dhe_psk, aes_128_gcm, null, sha256},
- {dhe_psk, aes_256_gcm, null, sha384},
- {rsa_psk, aes_128_gcm, null, sha256},
- {rsa_psk, aes_256_gcm, null, sha384}],
+psk_suites(Version) ->
+ Suites = ssl_cipher:psk_suites(Version),
ssl_cipher:filter_suites(Suites).
-psk_anon_suites() ->
- Suites =
- [{psk, rc4_128, sha},
- {psk, '3des_ede_cbc', sha},
- {psk, aes_128_cbc, sha},
- {psk, aes_256_cbc, sha},
- {dhe_psk, rc4_128, sha},
- {dhe_psk, '3des_ede_cbc', sha},
- {dhe_psk, aes_128_cbc, sha},
- {dhe_psk, aes_256_cbc, sha}],
+psk_anon_suites(Version) ->
+ Suites = [Suite || Suite <- psk_suites(Version), is_psk_anon_suite(Suite)],
ssl_cipher:filter_suites(Suites).
srp_suites() ->
@@ -1035,8 +1093,8 @@ cipher_result(Socket, Result) ->
end.
session_info_result(Socket) ->
- ssl:session_info(Socket).
-
+ {ok, Info} = ssl:connection_information(Socket, [session_id, cipher_suite]),
+ Info.
public_key(#'PrivateKeyInfo'{privateKeyAlgorithm =
#'PrivateKeyInfo_privateKeyAlgorithm'{algorithm = ?rsaEncryption},
@@ -1092,14 +1150,16 @@ init_tls_version(Version, Config)
application:load(ssl),
application:set_env(ssl, dtls_protocol_version, Version),
ssl:start(),
- [{protocol, dtls}, {protocol_opts, [{protocol, dtls}]}|Config];
+ NewConfig = proplists:delete(protocol_opts, proplists:delete(protocol, Config)),
+ [{protocol, dtls}, {protocol_opts, [{protocol, dtls}]} | NewConfig];
init_tls_version(Version, Config) ->
ssl:stop(),
application:load(ssl),
application:set_env(ssl, protocol_version, Version),
ssl:start(),
- [{protocol, tls}|Config].
+ NewConfig = proplists:delete(protocol_opts, proplists:delete(protocol, Config)),
+ [{protocol, tls} | NewConfig].
sufficient_crypto_support(Version)
when Version == 'tlsv1.2'; Version == 'dtlsv1.2' ->
@@ -1225,6 +1285,10 @@ check_sane_openssl_version(Version) ->
false;
{'tlsv1.1', "OpenSSL 0" ++ _} ->
false;
+ {'dtlsv1', "OpenSSL 0" ++ _} ->
+ false;
+ {'dtlsv1.2', "OpenSSL 0" ++ _} ->
+ false;
{_, _} ->
true
end;
@@ -1234,19 +1298,37 @@ check_sane_openssl_version(Version) ->
enough_openssl_crl_support("OpenSSL 0." ++ _) -> false;
enough_openssl_crl_support(_) -> true.
-wait_for_openssl_server(Port) ->
- wait_for_openssl_server(Port, 10).
-wait_for_openssl_server(_, 0) ->
+wait_for_openssl_server(Port, tls) ->
+ do_wait_for_openssl_tls_server(Port, 10);
+wait_for_openssl_server(Port, dtls) ->
+ do_wait_for_openssl_dtls_server(Port, 10).
+
+do_wait_for_openssl_tls_server(_, 0) ->
exit(failed_to_connect_to_openssl);
-wait_for_openssl_server(Port, N) ->
+do_wait_for_openssl_tls_server(Port, N) ->
case gen_tcp:connect("localhost", Port, []) of
{ok, S} ->
gen_tcp:close(S);
_ ->
ct:sleep(?SLEEP),
- wait_for_openssl_server(Port, N-1)
+ do_wait_for_openssl_tls_server(Port, N-1)
end.
+do_wait_for_openssl_dtls_server(_, 0) ->
+ %%exit(failed_to_connect_to_openssl);
+ ok;
+do_wait_for_openssl_dtls_server(Port, N) ->
+ %% case gen_udp:open(0) of
+ %% {ok, S} ->
+ %% gen_udp:connect(S, "localhost", Port),
+ %% gen_udp:close(S);
+ %% _ ->
+ %% ct:sleep(?SLEEP),
+ %% do_wait_for_openssl_dtls_server(Port, N-1)
+ %% end.
+ ct:sleep(500),
+ do_wait_for_openssl_dtls_server(Port, N-1).
+
version_flag(tlsv1) ->
"-tls1";
version_flag('tlsv1.1') ->
@@ -1256,10 +1338,14 @@ version_flag('tlsv1.2') ->
version_flag(sslv3) ->
"-ssl3";
version_flag(sslv2) ->
- "-ssl2".
-
-filter_suites(Ciphers0) ->
- Version = tls_record:highest_protocol_version([]),
+ "-ssl2";
+version_flag('dtlsv1.2') ->
+ "-dtls1_2";
+version_flag('dtlsv1') ->
+ "-dtls1".
+
+filter_suites(Ciphers0, AtomVersion) ->
+ Version = tls_version(AtomVersion),
Supported0 = ssl_cipher:suites(Version)
++ ssl_cipher:anonymous_suites(Version)
++ ssl_cipher:psk_suites(Version)
@@ -1326,14 +1412,17 @@ do_supports_ssl_tls_version(Port) ->
false ->
do_supports_ssl_tls_version(Port)
end
- after 500 ->
+ after 1000 ->
true
end.
-ssl_options(Option, Config) ->
+ssl_options(Option, Config) when is_atom(Option) ->
ProtocolOpts = proplists:get_value(protocol_opts, Config, []),
Opts = proplists:get_value(Option, Config, []),
- Opts ++ ProtocolOpts.
+ Opts ++ ProtocolOpts;
+ssl_options(Options, Config) ->
+ ProtocolOpts = proplists:get_value(protocol_opts, Config, []),
+ Options ++ ProtocolOpts.
protocol_version(Config) ->
protocol_version(Config, atom).
@@ -1341,7 +1430,7 @@ protocol_version(Config) ->
protocol_version(Config, tuple) ->
case proplists:get_value(protocol, Config) of
dtls ->
- dtls_record:protocol_version(dtls_record:highest_protocol_version([]));
+ dtls_record:highest_protocol_version(dtls_record:supported_protocol_versions());
_ ->
tls_record:highest_protocol_version(tls_record:supported_protocol_versions())
end;
@@ -1375,6 +1464,7 @@ clean_env() ->
application:unset_env(ssl, session_cache_client_max),
application:unset_env(ssl, session_cache_server_max),
application:unset_env(ssl, ssl_pem_cache_clean),
+ application:unset_env(ssl, bypass_pem_cache),
application:unset_env(ssl, alert_timeout).
clean_start() ->
@@ -1382,3 +1472,175 @@ clean_start() ->
application:load(ssl),
clean_env(),
ssl:start().
+
+is_psk_anon_suite({psk, _,_}) ->
+ true;
+is_psk_anon_suite({dhe_psk,_,_}) ->
+ true;
+is_psk_anon_suite({psk, _,_,_}) ->
+ true;
+is_psk_anon_suite({dhe_psk, _,_,_}) ->
+ true;
+is_psk_anon_suite(_) ->
+ false.
+
+cipher_atom(aes_256_cbc) ->
+ aes_cbc256;
+cipher_atom(aes_128_cbc) ->
+ aes_cbc128;
+cipher_atom('3des_ede_cbc') ->
+ des_ede3;
+cipher_atom(Atom) ->
+ Atom.
+tls_version('dtlsv1' = Atom) ->
+ dtls_v1:corresponding_tls_version(dtls_record:protocol_version(Atom));
+tls_version('dtlsv1.2' = Atom) ->
+ dtls_v1:corresponding_tls_version(dtls_record:protocol_version(Atom));
+tls_version(Atom) ->
+ tls_record:protocol_version(Atom).
+
+hardcode_rsa_key(1) ->
+ {'RSAPrivateKey',0,
+ 23995666614853919027835084074500048897452890537492185072956789802729257783422306095699263934587064480357348855732149402060270996295002843755712064937715826848741191927820899197493902093529581182351132392364214171173881547273475904587683433713767834856230531387991145055273426806331200574039205571401702219159773947658558490957010003143162250693492642996408861265758000254664396313741422909188635443907373976005987612936763564996605457102336549804831742940035613780926178523017685712710473543251580072875247250504243621640157403744718833162626193206685233710319205099867303242759099560438381385658382486042995679707669,
+ 17,
+ 11292078406990079542510627799764728892919007311761028269626724613049062486316379339152594792746853873109340637991599718616598115903530750002688030558925094987642913848386305504703012749896273497577003478759630198199473669305165131570674557041773098755873191241407597673069847908861741446606684974777271632545629600685952292605647052193819136445675100211504432575554351515262198132231537860917084269870590492135731720141577986787033006338680118008484613510063003323516659048210893001173583018220214626635609151105287049126443102976056146630518124476470236027123782297108342869049542023328584384300970694412006494684657,
+ 169371138592582642967021557955633494538845517070305333860805485424261447791289944610138334410987654265476540480228705481960508520379619587635662291973699651583489223555422528867090299996446070521801757353675026048850480903160224210802452555900007597342687137394192939372218903554801584969667104937092080815197,
+ 141675062317286527042995673340952251894209529891636708844197799307963834958115010129693036021381525952081167155681637592199810112261679449166276939178032066869788822014115556349519329537177920752776047051833616197615329017439297361972726138285974555338480581117881706656603857310337984049152655480389797687577,
+ 119556097830058336212015217380447172615655659108450823901745048534772786676204666783627059584226579481512852103690850928442711896738555003036938088452023283470698275450886490965004917644550167427154181661417665446247398284583687678213495921811770068712485038160606780733330990744565824684470897602653233516609,
+ 41669135975672507953822256864985956439473391144599032012999352737636422046504414744027363535700448809435637398729893409470532385959317485048904982111185902020526124121798693043976273393287623750816484427009887116945685005129205106462566511260580751570141347387612266663707016855981760014456663376585234613993,
+ 76837684977089699359024365285678488693966186052769523357232308621548155587515525857011429902602352279058920284048929101483304120686557782043616693940283344235057989514310975192908256494992960578961614059245280827077951132083993754797053182279229469590276271658395444955906108899267024101096069475145863928441,
+ asn1_NOVALUE};
+
+hardcode_rsa_key(2) ->
+{'RSAPrivateKey',0,
+ 21343679768589700771839799834197557895311746244621307033143551583788179817796325695589283169969489517156931770973490560582341832744966317712674900833543896521418422508485833901274928542544381247956820115082240721897193055368570146764204557110415281995205343662628196075590438954399631753508888358737971039058298703003743872818150364935790613286541190842600031570570099801682794056444451081563070538409720109449780410837763602317050353477918147758267825417201591905091231778937606362076129350476690460157227101296599527319242747999737801698427160817755293383890373574621116766934110792127739174475029121017282777887777,
+ 17,
+ 18832658619343853622211588088997845201745658451136447382185486691577805721584993260814073385267196632785528033211903435807948675951440868570007265441362261636545666919252206383477878125774454042314841278013741813438699754736973658909592256273895837054592950290554290654932740253882028017801960316533503857992358685308186680144968293076156011747178275038098868263178095174694099811498968993700538293188879611375604635940554394589807673542938082281934965292051746326331046224291377703201248790910007232374006151098976879987912446997911775904329728563222485791845480864283470332826504617837402078265424772379987120023773,
+ 146807662748886761089048448970170315054939768171908279335181627815919052012991509112344782731265837727551849787333310044397991034789843793140419387740928103541736452627413492093463231242466386868459637115999163097726153692593711599245170083315894262154838974616739452594203727376460632750934355508361223110419,
+ 145385325050081892763917667176962991350872697916072592966410309213561884732628046256782356731057378829876640317801978404203665761131810712267778698468684631707642938779964806354584156202882543264893826268426566901882487709510744074274965029453915224310656287149777603803201831202222853023280023478269485417083,
+ 51814469205489445090252393754177758254684624060673510353593515699736136004585238510239335081623236845018299924941168250963996835808180162284853901555621683602965806809675350150634081614988136541809283687999704622726877773856604093851236499993845033701707873394143336209718962603456693912094478414715725803677,
+ 51312467664734785681382706062457526359131540440966797517556579722433606376221663384746714140373192528191755406283051201483646739222992016094510128871300458249756331334105225772206172777487956446433115153562317730076172132768497908567634716277852432109643395464627389577600646306666889302334125933506877206029,
+ 30504662229874176232343608562807118278893368758027179776313787938167236952567905398252901545019583024374163153775359371298239336609182249464886717948407152570850677549297935773605431024166978281486607154204888016179709037883348099374995148481968169438302456074511782717758301581202874062062542434218011141540,
+ asn1_NOVALUE};
+
+hardcode_rsa_key(3) ->
+{'RSAPrivateKey',0,
+ 25089040456112869869472694987833070928503703615633809313972554887193090845137746668197820419383804666271752525807484521370419854590682661809972833718476098189250708650325307850184923546875260207894844301992963978994451844985784504212035958130279304082438876764367292331581532569155681984449177635856426023931875082020262146075451989132180409962870105455517050416234175675478291534563995772675388370042873175344937421148321291640477650173765084699931690748536036544188863178325887393475703801759010864779559318631816411493486934507417755306337476945299570726975433250753415110141783026008347194577506976486290259135429,
+ 17,
+ 8854955455098659953931539407470495621824836570223697404931489960185796768872145882893348383311931058684147950284994536954265831032005645344696294253579799360912014817761873358888796545955974191021709753644575521998041827642041589721895044045980930852625485916835514940558187965584358347452650930302268008446431977397918214293502821599497633970075862760001650736520566952260001423171553461362588848929781360590057040212831994258783694027013289053834376791974167294527043946669963760259975273650548116897900664646809242902841107022557239712438496384819445301703021164043324282687280801738470244471443835900160721870265,
+ 171641816401041100605063917111691927706183918906535463031548413586331728772311589438043965564336865070070922328258143588739626712299625805650832695450270566547004154065267940032684307994238248203186986569945677705100224518137694769557564475390859269797990555863306972197736879644001860925483629009305104925823,
+ 146170909759497809922264016492088453282310383272504533061020897155289106805616042710009332510822455269704884883705830985184223718261139908416790475825625309815234508695722132706422885088219618698987115562577878897003573425367881351537506046253616435685549396767356003663417208105346307649599145759863108910523,
+ 60579464612132153154728441333538327425711971378777222246428851853999433684345266860486105493295364142377972586444050678378691780811632637288529186629507258781295583787741625893888579292084087601124818789392592131211843947578009918667375697196773859928702549128225990187436545756706539150170692591519448797349,
+ 137572620950115585809189662580789132500998007785886619351549079675566218169991569609420548245479957900898715184664311515467504676010484619686391036071176762179044243478326713135456833024206699951987873470661533079532774988581535389682358631768109586527575902839864474036157372334443583670210960715165278974609,
+ 15068630434698373319269196003209754243798959461311186548759287649485250508074064775263867418602372588394608558985183294561315208336731894947137343239541687540387209051236354318837334154993136528453613256169847839789803932725339395739618592522865156272771578671216082079933457043120923342632744996962853951612,
+ asn1_NOVALUE};
+hardcode_rsa_key(4) ->
+{'RSAPrivateKey',0,
+ 28617237755030755643854803617273584643843067580642149032833640135949799721163782522787597288521902619948688786051081993247908700824196122780349730169173433743054172191054872553484065655968335396052034378669869864779940355219732200954630251223541048434478476115391643898092650304645086338265930608997389611376417609043761464100338332976874588396803891301015812818307951159858145399281035705713082131199940309445719678087542976246147777388465712394062188801177717719764254900022006288880246925156931391594131839991579403409541227225173269459173129377291869028712271737734702830877034334838181789916127814298794576266389,
+ 17,
+ 26933870828264240605980991639786903194205240075898493207372837775011576208154148256741268036255908348187001210401018346586267012540419880263858569570986761169933338532757527109161473558558433313931326474042230460969355628442100895016122589386862163232450330461545076609969553227901257730132640573174013751883368376011370428995523268034111482031427024082719896108094847702954695363285832195666458915142143884210891427766607838346722974883433132513540317964796373298134261669479023445911856492129270184781873446960437310543998533283339488055776892320162032014809906169940882070478200435536171854883284366514852906334641,
+ 177342190816702392178883147766999616783253285436834252111702533617098994535049411784501174309695427674025956656849179054202187436663487378682303508229883753383891163725167367039879190685255046547908384208614573353917213168937832054054779266431207529839577747601879940934691505396807977946728204814969824442867,
+ 161367340863680900415977542864139121629424927689088951345472941851682581254789586032968359551717004797621579428672968948552429138154521719743297455351687337112710712475376510559020211584326773715482918387500187602625572442687231345855402020688502483137168684570635690059254866684191216155909970061793538842967,
+ 62591361464718491357252875682470452982324688977706206627659717747211409835899792394529826226951327414362102349476180842659595565881230839534930649963488383547255704844176717778780890830090016428673547367746320007264898765507470136725216211681602657590439205035957626212244060728285168687080542875871702744541,
+ 28476589564178982426348978152495139111074987239250991413906989738532220221433456358759122273832412611344984605059935696803369847909621479954699550944415412431654831613301737157474154985469430655673456186029444871051571607533040825739188591886206320553618003159523945304574388238386685203984112363845918619347,
+ 34340318160575773065401929915821192439103777558577109939078671096408836197675640654693301707202885840826672396546056002756167635035389371579540325327619480512374920136684787633921441576901246290213545161954865184290700344352088099063404416346968182170720521708773285279884132629954461545103181082503707725012,
+ asn1_NOVALUE};
+hardcode_rsa_key(5) ->
+{'RSAPrivateKey',0,
+ 26363170152814518327068346871197765236382539835597898797762992537312221863402655353436079974302838986536256364057947538018476963115004626096654613827403121905035011992899481598437933532388248462251770039307078647864188314916665766359828262009578648593031111569685489178543405615478739906285223620987558499488359880003693226535420421293716164794046859453204135383236667988765227190694994861629971618548127529849059769249520775574008363789050621665120207265361610436965088511042779948238320901918522125988916609088415989475825860046571847719492980547438560049874493788767083330042728150253120940100665370844282489982633,
+ 17,
+ 10855423004100095781734025182257903332628104638187370093196526338893267826106975733767797636477639582691399679317978398007608161282648963686857782164224814902073240232370374775827384395689278778574258251479385325591136364965685903795223402003944149420659869469870495544106108194608892902588033255700759382142132115013969680562678811046675523365751498355532768935784747314021422035957153013494814430893022253205880275287307995039363642554998244274484818208792520243113824379110193356010059999642946040953102866271737127640405568982049887176990990501963784502429481034227543991366980671390566584211881030995602076468001,
+ 163564135568104310461344551909369650951960301778977149705601170951529791054750122905880591964737953456660497440730575925978769763154927541340839715938951226089095007207042122512586007411328664679011914120351043948122025612160733403945093961374276707993674792189646478659304624413958625254578122842556295400709,
+ 161179405627326572739107057023381254841260287988433675196680483761672455172873134522398837271764104320975746111042211695289319249471386600030523328069395763313848583139553961129874895374324504709512019736703349829576024049432816885712623938437949550266365056310544300920756181033500610331519029869549723159637,
+ 115457036871603042678596154288966812436677860079277988027483179495197499568058910286503947269226790675289762899339230065396778656344654735064122152427494983121714122734382674714766593466820233891067233496718383963380253373289929461608301619793607087995535147427985749641862087821617853120878674947686796753441,
+ 142217122612346975946270932667689342506994371754500301644129838613240401623123353990351915239791856753802128921507833848784693455415929352968108818884760967629866396887841730408713142977345151214275311532385308673155315337734838428569962298621720191411498579097539089047726042088382891468987379296661520434973,
+ 40624877259097915043489529504071755460170951428490878553842519165800720914888257733191322215286203357356050737713125202129282154441426952501134581314792133018830748896123382106683994268028624341502298766844710276939303555637478596035491641473828661569958212421472263269629366559343208764012473880251174832392,
+ asn1_NOVALUE};
+hardcode_rsa_key(6) ->
+{'RSAPrivateKey',0,
+ 22748888494866396715768692484866595111939200209856056370972713870125588774286266397044592487895293134537316190976192161177144143633669641697309689280475257429554879273045671863645233402796222694405634510241820106743648116753479926387434021380537483429927516962909367257212902212159798399531316965145618774905828756510318897899298783143203190245236381440043169622358239226123652592179006905016804587837199618842875361941208299410035232803124113612082221121192550063791073372276763648926636149384299189072950588522522800393261949880796214514243704858378436010975184294077063518776479282353562934591448646412389762167039,
+ 17,
+ 6690849557313646092873144848490175032923294179369428344403739373566349639495960705013115437616262686628622409110644753287395336362844012263914614494257428655751435080307550548130951000822418439531068973600535325512837681398082331290421770994275730420566916753796872722709677121223470117509210872101652580854566448661533030419787125312956120661097410038933324613372774190658239039998357548275441758790939430824924502690997433186652165055694361752689819209062683281242276039100201318203707142383491769671330743466041394101421674581185260900666085723130684175548215193875544802254923825103844262661010117443222587769713,
+ 164748737139489923768181260808494855987398781964531448608652166632780898215212977127034263859971474195908846263894581556691971503119888726148555271179103885786024920582830105413607436718060544856016793981261118694063993837665813285582095833772675610567592660039821387740255651489996976698808018635344299728063,
+ 138082323967104548254375818343885141517788525705334488282154811252858957969378263753268344088034079842223206527922445018725900110643394926788280539200323021781309918753249061620424428562366627334409266756720941754364262467100514166396917565961434203543659974860389803369482625510495464845206228470088664021953,
+ 19382204369351755737433089506881747763223386113474288071606137250915399790025056132592266336467232258342217207517009594904937823896457497193947678962247515974826461245038835931012639613889475865413740468383661022831058098548919210068481862796785365949128548239978986792971253116470232552800943368864035262125,
+ 48734937870742781736838524121371226418043009072470995864289933383361985165662916618800592031070851709019955245149098241903258862580021738866451955011878713569874088971734962924855680669070574353320917678842685325069739694270769705787147376221682660074232932303666989424523279591939575827719845342384234360689,
+ 81173034184183681160439870161505779100040258708276674532866007896310418779840630960490793104541748007902477778658270784073595697910785917474138815202903114440800310078464142273778315781957021015333260021813037604142367434117205299831740956310682461174553260184078272196958146289378701001596552915990080834227,
+ asn1_NOVALUE}.
+
+
+dtls_hello() ->
+ [1,
+ <<0,1,4>>,
+ <<0,0>>,
+ <<0,0,0>>,
+ <<0,1,4>>,
+ <<254,253,88,
+ 156,129,61,
+ 131,216,15,
+ 131,194,242,
+ 46,154,190,
+ 20,228,234,
+ 234,150,44,
+ 62,96,96,103,
+ 127,95,103,
+ 23,24,42,138,
+ 13,142,32,57,
+ 230,177,32,
+ 210,154,152,
+ 188,121,134,
+ 136,53,105,
+ 118,96,106,
+ 103,231,223,
+ 133,10,165,
+ 50,32,211,
+ 227,193,14,
+ 181,143,48,
+ 66,0,0,100,0,
+ 255,192,44,
+ 192,48,192,
+ 36,192,40,
+ 192,46,192,
+ 50,192,38,
+ 192,42,0,159,
+ 0,163,0,107,
+ 0,106,0,157,
+ 0,61,192,43,
+ 192,47,192,
+ 35,192,39,
+ 192,45,192,
+ 49,192,37,
+ 192,41,0,158,
+ 0,162,0,103,
+ 0,64,0,156,0,
+ 60,192,10,
+ 192,20,0,57,
+ 0,56,192,5,
+ 192,15,0,53,
+ 192,8,192,18,
+ 0,22,0,19,
+ 192,3,192,13,
+ 0,10,192,9,
+ 192,19,0,51,
+ 0,50,192,4,
+ 192,14,0,47,
+ 1,0,0,86,0,0,
+ 0,14,0,12,0,
+ 0,9,108,111,
+ 99,97,108,
+ 104,111,115,
+ 116,0,10,0,
+ 58,0,56,0,14,
+ 0,13,0,25,0,
+ 28,0,11,0,12,
+ 0,27,0,24,0,
+ 9,0,10,0,26,
+ 0,22,0,23,0,
+ 8,0,6,0,7,0,
+ 20,0,21,0,4,
+ 0,5,0,18,0,
+ 19,0,1,0,2,0,
+ 3,0,15,0,16,
+ 0,17,0,11,0,
+ 2,1,0>>].
+
diff --git a/lib/ssl/test/ssl_to_openssl_SUITE.erl b/lib/ssl/test/ssl_to_openssl_SUITE.erl
index e99340822d..60faad3fe1 100644
--- a/lib/ssl/test/ssl_to_openssl_SUITE.erl
+++ b/lib/ssl/test/ssl_to_openssl_SUITE.erl
@@ -42,7 +42,9 @@ all() ->
{group, 'tlsv1.2'},
{group, 'tlsv1.1'},
{group, 'tlsv1'},
- {group, 'sslv3'}
+ {group, 'sslv3'},
+ {group, 'dtlsv1.2'},
+ {group, 'dtlsv1'}
].
groups() ->
@@ -50,7 +52,10 @@ groups() ->
{'tlsv1.2', [], all_versions_tests() ++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
{'tlsv1.1', [], all_versions_tests() ++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
{'tlsv1', [], all_versions_tests()++ alpn_tests() ++ npn_tests() ++ sni_server_tests()},
- {'sslv3', [], all_versions_tests()}].
+ {'sslv3', [], all_versions_tests()},
+ {'dtlsv1.2', [], dtls_all_versions_tests()},
+ {'dtlsv1', [], dtls_all_versions_tests()}
+ ].
basic_tests() ->
[basic_erlang_client_openssl_server,
@@ -78,6 +83,24 @@ all_versions_tests() ->
expired_session,
ssl2_erlang_server_openssl_client
].
+dtls_all_versions_tests() ->
+ [
+ %%erlang_client_openssl_server,
+ erlang_server_openssl_client,
+ %%erlang_client_openssl_server_dsa_cert,
+ erlang_server_openssl_client_dsa_cert,
+ erlang_server_openssl_client_reuse_session
+ %%erlang_client_openssl_server_renegotiate,
+ %%erlang_client_openssl_server_nowrap_seqnum,
+ %%erlang_server_openssl_client_nowrap_seqnum,
+ %%erlang_client_openssl_server_no_server_ca_cert,
+ %%erlang_client_openssl_server_client_cert,
+ %%erlang_server_openssl_client_client_cert
+ %%ciphers_rsa_signed_certs,
+ %%ciphers_dsa_signed_certs,
+ %%erlang_client_bad_openssl_server,
+ %%expired_session
+ ].
alpn_tests() ->
[erlang_client_alpn_openssl_server_alpn,
@@ -144,13 +167,18 @@ init_per_group(basic, Config) ->
init_per_group(GroupName, Config) ->
case ssl_test_lib:is_tls_version(GroupName) of
true ->
- case ssl_test_lib:check_sane_openssl_version(GroupName) of
- true ->
- ssl_test_lib:init_tls_version(GroupName, Config);
- false ->
- {skip, openssl_does_not_support_version}
- end;
- _ ->
+ case ssl_test_lib:supports_ssl_tls_version(GroupName) of
+ true ->
+ case ssl_test_lib:check_sane_openssl_version(GroupName) of
+ true ->
+ ssl_test_lib:init_tls_version(GroupName, Config);
+ false ->
+ {skip, openssl_does_not_support_version}
+ end;
+ false ->
+ {skip, openssl_does_not_support_version}
+ end;
+ _ ->
ssl:start(),
Config
end.
@@ -284,7 +312,8 @@ basic_erlang_client_openssl_server(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+
+ ssl_test_lib:wait_for_openssl_server(Port, tls),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -357,7 +386,7 @@ erlang_client_openssl_server(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -431,7 +460,7 @@ erlang_client_openssl_server_dsa_cert(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -551,7 +580,7 @@ erlang_client_openssl_server_renegotiate(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -600,7 +629,7 @@ erlang_client_openssl_server_nowrap_seqnum(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -681,7 +710,7 @@ erlang_client_openssl_server_no_server_ca_cert(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -724,7 +753,7 @@ erlang_client_openssl_server_client_cert(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -856,7 +885,7 @@ erlang_client_bad_openssl_server(Config) when is_list(Config) ->
"-cert", CertFile, "-key", KeyFile],
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client0 = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -911,7 +940,7 @@ expired_session(Config) when is_list(Config) ->
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, tls),
Client0 =
ssl_test_lib:start_client([{node, ClientNode},
@@ -955,8 +984,6 @@ ssl2_erlang_server_openssl_client(Config) when is_list(Config) ->
{_, ServerNode, _} = ssl_test_lib:run_where(Config),
- Data = "From openssl to erlang",
-
Server = ssl_test_lib:start_server_error([{node, ServerNode}, {port, 0},
{from, self()},
{options, ServerOpts}]),
@@ -967,23 +994,9 @@ ssl2_erlang_server_openssl_client(Config) when is_list(Config) ->
"-ssl2", "-msg"],
OpenSslPort = ssl_test_lib:portable_open_port(Exe, Args),
- true = port_command(OpenSslPort, Data),
ct:log("Ports ~p~n", [[erlang:port_info(P) || P <- erlang:ports()]]),
- receive
- {'EXIT', OpenSslPort, _} = Exit ->
- ct:log("Received: ~p ~n", [Exit]),
- ok
- end,
- receive
- {'EXIT', _, _} = UnkownExit ->
- Msg = lists:flatten(io_lib:format("Received: ~p ~n", [UnkownExit])),
- ct:log(Msg),
- ct:comment(Msg),
- ok
- after 0 ->
- ok
- end,
+ consume_port_exit(OpenSslPort),
ssl_test_lib:check_result(Server, {error, {tls_alert, "handshake failure"}}),
process_flag(trap_exit, false).
%%--------------------------------------------------------------------
@@ -1014,20 +1027,7 @@ ssl2_erlang_server_openssl_client_comp(Config) when is_list(Config) ->
true = port_command(OpenSslPort, Data),
ct:log("Ports ~p~n", [[erlang:port_info(P) || P <- erlang:ports()]]),
- receive
- {'EXIT', OpenSslPort, _} = Exit ->
- ct:log("Received: ~p ~n", [Exit]),
- ok
- end,
- receive
- {'EXIT', _, _} = UnkownExit ->
- Msg = lists:flatten(io_lib:format("Received: ~p ~n", [UnkownExit])),
- ct:log(Msg),
- ct:comment(Msg),
- ok
- after 0 ->
- ok
- end,
+ consume_port_exit(OpenSslPort),
ssl_test_lib:check_result(Server, {error, {tls_alert, "protocol version"}}),
process_flag(trap_exit, false).
@@ -1399,7 +1399,7 @@ cipher(CipherSuite, Version, Config, ClientOpts, ServerOpts) ->
OpenSslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
ConnectionInfo = {ok, {Version, CipherSuite}},
@@ -1469,7 +1469,7 @@ start_erlang_client_and_openssl_server_with_opts(Config, ErlangClientOpts, Opens
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -1505,7 +1505,7 @@ start_erlang_client_and_openssl_server_for_alpn_negotiation(Config, Data, Callba
Args = ["s_server", "-msg", "-alpn", "http/1.1,spdy/2", "-accept", integer_to_list(Port), ssl_test_lib:version_flag(Version),
"-cert", CertFile, "-key", KeyFile],
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -1574,7 +1574,7 @@ start_erlang_client_and_openssl_server_for_alpn_npn_negotiation(Config, Data, Ca
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -1639,7 +1639,7 @@ start_erlang_client_and_openssl_server_for_npn_negotiation(Config, Data, Callbac
"-cert", CertFile, "-key", KeyFile],
OpensslPort = ssl_test_lib:portable_open_port(Exe, Args),
- ssl_test_lib:wait_for_openssl_server(Port),
+ ssl_test_lib:wait_for_openssl_server(Port, proplists:get_value(protocol, Config)),
Client = ssl_test_lib:start_client([{node, ClientNode}, {port, Port},
{host, Hostname},
@@ -1848,3 +1848,9 @@ openssl_client_args(false, Hostname, Port, ServerName) ->
openssl_client_args(true, Hostname, Port, ServerName) ->
["s_client", "-no_ssl2", "-connect", Hostname ++ ":" ++
integer_to_list(Port), "-servername", ServerName].
+
+consume_port_exit(OpenSSLPort) ->
+ receive
+ {'EXIT', OpenSSLPort, _} ->
+ ok
+ end.
diff --git a/lib/ssl/test/x509_test.erl b/lib/ssl/test/x509_test.erl
new file mode 100644
index 0000000000..c36e96013b
--- /dev/null
+++ b/lib/ssl/test/x509_test.erl
@@ -0,0 +1,343 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2017-2017. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%%
+
+%%
+
+ -module(x509_test).
+
+ -include_lib("public_key/include/public_key.hrl").
+
+ -export([gen_test_certs/1, gen_pem_config_files/3]).
+
+ gen_test_certs(Opts) ->
+ SRootKey = gen_key(proplists:get_value(server_key_gen, Opts)),
+ CRootKey = gen_key(proplists:get_value(client_key_gen, Opts)),
+ ServerRoot = root_cert("server", SRootKey, Opts),
+ ClientRoot = root_cert("client", CRootKey, Opts),
+ [{ServerCert, ServerKey} | ServerCAsKeys] = config(server, ServerRoot, SRootKey, Opts),
+ [{ClientCert, ClientKey} | ClientCAsKeys] = config(client, ClientRoot, CRootKey, Opts),
+ ServerCAs = ca_config(ClientRoot, ServerCAsKeys),
+ ClientCAs = ca_config(ServerRoot, ClientCAsKeys),
+ [{server_config, [{cert, ServerCert}, {key, ServerKey}, {cacerts, ServerCAs}]},
+ {client_config, [{cert, ClientCert}, {key, ClientKey}, {cacerts, ClientCAs}]}].
+
+gen_pem_config_files(GenCertData, ClientBase, ServerBase) ->
+ ServerConf = proplists:get_value(server_config, GenCertData),
+ ClientConf = proplists:get_value(client_config, GenCertData),
+
+ ServerCaCertFile = ServerBase ++ "_server_cacerts.pem",
+ ServerCertFile = ServerBase ++ "_server_cert.pem",
+ ServerKeyFile = ServerBase ++ "_server_key.pem",
+
+ ClientCaCertFile = ClientBase ++ "_client_cacerts.pem",
+ ClientCertFile = ClientBase ++ "_client_cert.pem",
+ ClientKeyFile = ClientBase ++ "_client_key.pem",
+
+ do_gen_pem_config_files(ServerConf,
+ ServerCertFile,
+ ServerKeyFile,
+ ServerCaCertFile),
+ do_gen_pem_config_files(ClientConf,
+ ClientCertFile,
+ ClientKeyFile,
+ ClientCaCertFile),
+ [{server_config, [{certfile, ServerCertFile},
+ {keyfile, ServerKeyFile}, {cacertfile, ServerCaCertFile}]},
+ {client_config, [{certfile, ClientCertFile},
+ {keyfile, ClientKeyFile}, {cacertfile, ClientCaCertFile}]}].
+
+
+ do_gen_pem_config_files(Config, CertFile, KeyFile, CAFile) ->
+ CAs = proplists:get_value(cacerts, Config),
+ Cert = proplists:get_value(cert, Config),
+ Key = proplists:get_value(key, Config),
+ der_to_pem(CertFile, [cert_entry(Cert)]),
+ der_to_pem(KeyFile, [key_entry(Key)]),
+ der_to_pem(CAFile, ca_entries(CAs)).
+
+ cert_entry(Cert) ->
+ {'Certificate', Cert, not_encrypted}.
+
+ key_entry(Key = #'RSAPrivateKey'{}) ->
+ Der = public_key:der_encode('RSAPrivateKey', Key),
+ {'RSAPrivateKey', Der, not_encrypted};
+ key_entry(Key = #'DSAPrivateKey'{}) ->
+ Der = public_key:der_encode('DSAPrivateKey', Key),
+ {'DSAPrivateKey', Der, not_encrypted};
+ key_entry(Key = #'ECPrivateKey'{}) ->
+ Der = public_key:der_encode('ECPrivateKey', Key),
+ {'ECPrivateKey', Der, not_encrypted}.
+
+ ca_entries(CAs) ->
+ [{'Certificate', CACert, not_encrypted} || CACert <- CAs].
+
+ gen_key(KeyGen) ->
+ case is_key(KeyGen) of
+ true ->
+ KeyGen;
+ false ->
+ public_key:generate_key(KeyGen)
+ end.
+
+root_cert(Role, PrivKey, Opts) ->
+ TBS = cert_template(),
+ Issuer = issuer("root", Role, " ROOT CA"),
+ OTPTBS = TBS#'OTPTBSCertificate'{
+ signature = sign_algorithm(PrivKey, Opts),
+ issuer = Issuer,
+ validity = validity(Opts),
+ subject = Issuer,
+ subjectPublicKeyInfo = public_key(PrivKey),
+ extensions = extensions(ca, Opts)
+ },
+ public_key:pkix_sign(OTPTBS, PrivKey).
+
+config(Role, Root, Key, Opts) ->
+ KeyGenOpt = list_to_atom(atom_to_list(Role) ++ "_key_gen_chain"),
+ KeyGens = proplists:get_value(KeyGenOpt, Opts, default_key_gen()),
+ Keys = lists:map(fun gen_key/1, KeyGens),
+ cert_chain(Role, Root, Key, Opts, Keys).
+
+cert_template() ->
+ #'OTPTBSCertificate'{
+ version = v3,
+ serialNumber = trunc(rand:uniform()*100000000)*10000 + 1,
+ issuerUniqueID = asn1_NOVALUE,
+ subjectUniqueID = asn1_NOVALUE
+ }.
+
+issuer(Contact, Role, Name) ->
+ subject(Contact, Role ++ Name).
+
+subject(Contact, Name) ->
+ Opts = [{email, Contact ++ "@erlang.org"},
+ {name, Name},
+ {city, "Stockholm"},
+ {country, "SE"},
+ {org, "erlang"},
+ {org_unit, "automated testing"}],
+ subject(Opts).
+
+subject(SubjectOpts) when is_list(SubjectOpts) ->
+ Encode = fun(Opt) ->
+ {Type,Value} = subject_enc(Opt),
+ [#'AttributeTypeAndValue'{type=Type, value=Value}]
+ end,
+ {rdnSequence, [Encode(Opt) || Opt <- SubjectOpts]}.
+
+subject_enc({name, Name}) ->
+ {?'id-at-commonName', {printableString, Name}};
+subject_enc({email, Email}) ->
+ {?'id-emailAddress', Email};
+subject_enc({city, City}) ->
+ {?'id-at-localityName', {printableString, City}};
+subject_enc({state, State}) ->
+ {?'id-at-stateOrProvinceName', {printableString, State}};
+subject_enc({org, Org}) ->
+ {?'id-at-organizationName', {printableString, Org}};
+subject_enc({org_unit, OrgUnit}) ->
+ {?'id-at-organizationalUnitName', {printableString, OrgUnit}};
+subject_enc({country, Country}) ->
+ {?'id-at-countryName', Country};
+subject_enc({serial, Serial}) ->
+ {?'id-at-serialNumber', Serial};
+subject_enc({title, Title}) ->
+ {?'id-at-title', {printableString, Title}};
+subject_enc({dnQualifer, DnQ}) ->
+ {?'id-at-dnQualifier', DnQ};
+subject_enc(Other) ->
+ Other.
+
+validity(Opts) ->
+ DefFrom0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())-1),
+ DefTo0 = calendar:gregorian_days_to_date(calendar:date_to_gregorian_days(date())+7),
+ {DefFrom, DefTo} = proplists:get_value(validity, Opts, {DefFrom0, DefTo0}),
+ Format = fun({Y,M,D}) ->
+ lists:flatten(io_lib:format("~w~2..0w~2..0w000000Z",[Y,M,D]))
+ end,
+ #'Validity'{notBefore={generalTime, Format(DefFrom)},
+ notAfter ={generalTime, Format(DefTo)}}.
+
+extensions(Type, Opts) ->
+ Exts = proplists:get_value(extensions, Opts, []),
+ lists:flatten([extension(Ext) || Ext <- default_extensions(Type, Exts)]).
+
+%% Common extension: name_constraints, policy_constraints, ext_key_usage, inhibit_any,
+%% auth_key_id, subject_key_id, policy_mapping,
+
+default_extensions(ca, Exts) ->
+ Def = [{key_usage, [keyCertSign, cRLSign]},
+ {basic_constraints, default}],
+ add_default_extensions(Def, Exts);
+
+default_extensions(peer, Exts) ->
+ Def = [{key_usage, [digitalSignature, keyAgreement]}],
+ add_default_extensions(Def, Exts).
+
+add_default_extensions(Def, Exts) ->
+ Filter = fun({Key, _}, D) ->
+ lists:keydelete(Key, 1, D);
+ ({Key, _, _}, D) ->
+ lists:keydelete(Key, 1, D)
+ end,
+ Exts ++ lists:foldl(Filter, Def, Exts).
+
+extension({_, undefined}) ->
+ [];
+extension({basic_constraints, Data}) ->
+ case Data of
+ default ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = #'BasicConstraints'{cA=true},
+ critical=true};
+ false ->
+ [];
+ Len when is_integer(Len) ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = #'BasicConstraints'{cA=true, pathLenConstraint = Len},
+ critical = true};
+ _ ->
+ #'Extension'{extnID = ?'id-ce-basicConstraints',
+ extnValue = Data}
+ end;
+extension({auth_key_id, {Oid, Issuer, SNr}}) ->
+ #'Extension'{extnID = ?'id-ce-authorityKeyIdentifier',
+ extnValue = #'AuthorityKeyIdentifier'{
+ keyIdentifier = Oid,
+ authorityCertIssuer = Issuer,
+ authorityCertSerialNumber = SNr},
+ critical = false};
+extension({key_usage, Value}) ->
+ #'Extension'{extnID = ?'id-ce-keyUsage',
+ extnValue = Value,
+ critical = false};
+extension({Id, Data, Critical}) ->
+ #'Extension'{extnID = Id, extnValue = Data, critical = Critical}.
+
+public_key(#'RSAPrivateKey'{modulus=N, publicExponent=E}) ->
+ Public = #'RSAPublicKey'{modulus=N, publicExponent=E},
+ Algo = #'PublicKeyAlgorithm'{algorithm= ?rsaEncryption, parameters='NULL'},
+ #'OTPSubjectPublicKeyInfo'{algorithm = Algo,
+ subjectPublicKey = Public};
+public_key(#'DSAPrivateKey'{p=P, q=Q, g=G, y=Y}) ->
+ Algo = #'PublicKeyAlgorithm'{algorithm= ?'id-dsa',
+ parameters={params, #'Dss-Parms'{p=P, q=Q, g=G}}},
+ #'OTPSubjectPublicKeyInfo'{algorithm = Algo, subjectPublicKey = Y};
+public_key(#'ECPrivateKey'{version = _Version,
+ privateKey = _PrivKey,
+ parameters = Params,
+ publicKey = PubKey}) ->
+ Algo = #'PublicKeyAlgorithm'{algorithm= ?'id-ecPublicKey', parameters=Params},
+ #'OTPSubjectPublicKeyInfo'{algorithm = Algo,
+ subjectPublicKey = #'ECPoint'{point = PubKey}}.
+
+sign_algorithm(#'RSAPrivateKey'{}, Opts) ->
+ Type = rsa_digest_oid(proplists:get_value(digest, Opts, sha1)),
+ #'SignatureAlgorithm'{algorithm = Type,
+ parameters = 'NULL'};
+sign_algorithm(#'DSAPrivateKey'{p=P, q=Q, g=G}, _Opts) ->
+ #'SignatureAlgorithm'{algorithm = ?'id-dsa-with-sha1',
+ parameters = {params,#'Dss-Parms'{p=P, q=Q, g=G}}};
+sign_algorithm(#'ECPrivateKey'{parameters = Parms}, Opts) ->
+ Type = ecdsa_digest_oid(proplists:get_value(digest, Opts, sha1)),
+ #'SignatureAlgorithm'{algorithm = Type,
+ parameters = Parms}.
+
+rsa_digest_oid(sha1) ->
+ ?'sha1WithRSAEncryption';
+rsa_digest_oid(sha512) ->
+ ?'sha512WithRSAEncryption';
+rsa_digest_oid(sha384) ->
+ ?'sha384WithRSAEncryption';
+rsa_digest_oid(sha256) ->
+ ?'sha256WithRSAEncryption';
+rsa_digest_oid(md5) ->
+ ?'md5WithRSAEncryption'.
+
+ecdsa_digest_oid(sha1) ->
+ ?'ecdsa-with-SHA1';
+ecdsa_digest_oid(sha512) ->
+ ?'ecdsa-with-SHA512';
+ecdsa_digest_oid(sha384) ->
+ ?'ecdsa-with-SHA384';
+ecdsa_digest_oid(sha256) ->
+ ?'ecdsa-with-SHA256'.
+
+ca_config(Root, CAsKeys) ->
+ [Root | [CA || {CA, _} <- CAsKeys]].
+
+cert_chain(Role, Root, RootKey, Opts, Keys) ->
+ cert_chain(Role, Root, RootKey, Opts, Keys, 0, []).
+
+cert_chain(Role, IssuerCert, IssuerKey, Opts, [Key], _, Acc) ->
+ PeerOpts = list_to_atom(atom_to_list(Role) ++ "_peer_opts"),
+ Cert = cert(Role, public_key:pkix_decode_cert(IssuerCert, otp),
+ IssuerKey, Key, "admin", " Peer cert", Opts, PeerOpts, peer),
+ [{Cert, Key}, {IssuerCert, IssuerKey} | Acc];
+cert_chain(Role, IssuerCert, IssuerKey, Opts, [Key | Keys], N, Acc) ->
+ CAOpts = list_to_atom(atom_to_list(Role) ++ "_ca_" ++ integer_to_list(N)),
+ Cert = cert(Role, public_key:pkix_decode_cert(IssuerCert, otp), IssuerKey, Key, "webadmin",
+ " Intermidiate CA " ++ integer_to_list(N), Opts, CAOpts, ca),
+ cert_chain(Role, Cert, Key, Opts, Keys, N+1, [{IssuerCert, IssuerKey} | Acc]).
+
+cert(Role, #'OTPCertificate'{tbsCertificate = #'OTPTBSCertificate'{subject = Issuer,
+ serialNumber = SNr
+ }},
+ PrivKey, Key, Contact, Name, Opts, CertOptsName, Type) ->
+ CertOpts = proplists:get_value(CertOptsName, Opts, []),
+ TBS = cert_template(),
+ OTPTBS = TBS#'OTPTBSCertificate'{
+ signature = sign_algorithm(PrivKey, Opts),
+ issuer = Issuer,
+ validity = validity(CertOpts),
+ subject = subject(Contact, atom_to_list(Role) ++ Name),
+ subjectPublicKeyInfo = public_key(Key),
+ extensions = extensions(Type,
+ add_default_extensions([{auth_key_id, {auth_key_oid(Role), Issuer, SNr}}],
+ CertOpts))
+ },
+ public_key:pkix_sign(OTPTBS, PrivKey).
+
+is_key(#'DSAPrivateKey'{}) ->
+ true;
+is_key(#'RSAPrivateKey'{}) ->
+ true;
+is_key(#'ECPrivateKey'{}) ->
+ true;
+is_key(_) ->
+ false.
+
+der_to_pem(File, Entries) ->
+ PemBin = public_key:pem_encode(Entries),
+ file:write_file(File, PemBin).
+
+default_key_gen() ->
+ case tls_v1:ecc_curves(0) of
+ [] ->
+ [{rsa, 2048, 17}, {rsa, 2048, 17}];
+ [_|_] ->
+ [{namedCurve, hd(tls_v1:ecc_curves(0))},
+ {namedCurve, hd(tls_v1:ecc_curves(0))}]
+ end.
+
+auth_key_oid(server) ->
+ ?'id-kp-serverAuth';
+auth_key_oid(client) ->
+ ?'id-kp-clientAuth'.
diff --git a/lib/ssl/vsn.mk b/lib/ssl/vsn.mk
index 2cdb825d75..82184f5c74 100644
--- a/lib/ssl/vsn.mk
+++ b/lib/ssl/vsn.mk
@@ -1 +1 @@
-SSL_VSN = 8.1
+SSL_VSN = 8.1.2
diff --git a/lib/stdlib/doc/src/assert_hrl.xml b/lib/stdlib/doc/src/assert_hrl.xml
index 57bb5207df..ea23cca2ee 100644
--- a/lib/stdlib/doc/src/assert_hrl.xml
+++ b/lib/stdlib/doc/src/assert_hrl.xml
@@ -4,7 +4,7 @@
<fileref>
<header>
<copyright>
- <year>2012</year><year>2016</year>
+ <year>2012</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -92,18 +92,21 @@ erlc -DNOASSERT=true *.erl</code>
<title>Macros</title>
<taglist>
<tag><c>assert(BoolExpr)</c></tag>
- <tag><c>assert(BoolExpr, Comment)</c></tag>
+ <item></item>
+ <tag><c>URKAassert(BoolExpr, Comment)</c></tag>
<item>
<p>Tests that <c>BoolExpr</c> completes normally returning
<c>true</c>.</p>
</item>
<tag><c>assertNot(BoolExpr)</c></tag>
+ <item></item>
<tag><c>assertNot(BoolExpr, Comment)</c></tag>
<item>
<p>Tests that <c>BoolExpr</c> completes normally returning
<c>false</c>.</p>
</item>
<tag><c>assertMatch(GuardedPattern, Expr)</c></tag>
+ <item></item>
<tag><c>assertMatch(GuardedPattern, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> completes normally yielding a value that
@@ -115,6 +118,7 @@ erlc -DNOASSERT=true *.erl</code>
?assertMatch({bork, X} when X > 0, f())</code>
</item>
<tag><c>assertNotMatch(GuardedPattern, Expr)</c></tag>
+ <item></item>
<tag><c>assertNotMatch(GuardedPattern, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> completes normally yielding a value that does
@@ -123,18 +127,21 @@ erlc -DNOASSERT=true *.erl</code>
<c>when</c> part.</p>
</item>
<tag><c>assertEqual(ExpectedValue, Expr)</c></tag>
+ <item></item>
<tag><c>assertEqual(ExpectedValue, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> completes normally yielding a value that is
exactly equal to <c>ExpectedValue</c>.</p>
</item>
<tag><c>assertNotEqual(ExpectedValue, Expr)</c></tag>
+ <item></item>
<tag><c>assertNotEqual(ExpectedValue, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> completes normally yielding a value that is
not exactly equal to <c>ExpectedValue</c>.</p>
</item>
<tag><c>assertException(Class, Term, Expr)</c></tag>
+ <item></item>
<tag><c>assertException(Class, Term, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> completes abnormally with an exception of type
@@ -145,6 +152,7 @@ erlc -DNOASSERT=true *.erl</code>
patterns, as in <c>assertMatch</c>.</p>
</item>
<tag><c>assertNotException(Class, Term, Expr)</c></tag>
+ <item></item>
<tag><c>assertNotException(Class, Term, Expr, Comment)</c></tag>
<item>
<p>Tests that <c>Expr</c> does not evaluate abnormally with an
@@ -155,16 +163,19 @@ erlc -DNOASSERT=true *.erl</code>
be guarded patterns.</p>
</item>
<tag><c>assertError(Term, Expr)</c></tag>
+ <item></item>
<tag><c>assertError(Term, Expr, Comment)</c></tag>
<item>
<p>Equivalent to <c>assertException(error, Term, Expr)</c></p>
</item>
<tag><c>assertExit(Term, Expr)</c></tag>
+ <item></item>
<tag><c>assertExit(Term, Expr, Comment)</c></tag>
<item>
<p>Equivalent to <c>assertException(exit, Term, Expr)</c></p>
</item>
<tag><c>assertThrow(Term, Expr)</c></tag>
+ <item></item>
<tag><c>assertThrow(Term, Expr, Comment)</c></tag>
<item>
<p>Equivalent to <c>assertException(throw, Term, Expr)</c></p>
diff --git a/lib/stdlib/doc/src/erl_tar.xml b/lib/stdlib/doc/src/erl_tar.xml
index f28d8b425b..fab7c832d5 100644
--- a/lib/stdlib/doc/src/erl_tar.xml
+++ b/lib/stdlib/doc/src/erl_tar.xml
@@ -292,6 +292,10 @@
<c>Fd</c> is assumed to be a file descriptor returned from function
<c>file:open/2</c>.</p>
<p>Otherwise, <c>Name</c> is to be a filename.</p>
+ <note><p>Leading slashes in tar member names will be removed before
+ writing the file. That is, absolute paths will be turned into
+ relative paths. There will be an info message written to the error
+ logger when paths are changed in this way.</p></note>
</desc>
</func>
diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml
index 05401a2d40..d1ec176f81 100644
--- a/lib/stdlib/doc/src/ets.xml
+++ b/lib/stdlib/doc/src/ets.xml
@@ -1491,6 +1491,25 @@ is_integer(X), is_integer(Y), X + Y < 4711]]></code>
</func>
<func>
+ <name name="select_replace" arity="2"/>
+ <fsummary>Match and replace objects atomically in an ETS table</fsummary>
+ <desc>
+ <p>Matches the objects in the table <c><anno>Tab</anno></c> using a
+ <seealso marker="#match_spec">match specification</seealso>. If
+ an object is matched, the existing object is replaced with
+ the match specification result, which <em>must</em> retain
+ the original key or the operation will fail with <c>badarg</c>.</p>
+ <p>For the moment, due to performance and semantic constraints,
+ tables of type <c>bag</c> are not yet supported.</p>
+ <p>The function returns the total number of replaced objects.</p>
+ <note>
+ <p>The match/replacement operation atomicity scope is limited
+ to each individual object.</p>
+ </note>
+ </desc>
+ </func>
+
+ <func>
<name name="select_reverse" arity="1"/>
<fsummary>Continue matching objects in an ETS table.</fsummary>
<desc>
diff --git a/lib/stdlib/doc/src/io_lib.xml b/lib/stdlib/doc/src/io_lib.xml
index 931e50f6f2..5ae400da62 100644
--- a/lib/stdlib/doc/src/io_lib.xml
+++ b/lib/stdlib/doc/src/io_lib.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2016</year>
+ <year>1996</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -147,7 +147,7 @@
format string (that is, <c>~ts</c> or <c>~tc</c>), the resulting list
can contain characters beyond the ISO Latin-1 character range
(that is, numbers &gt; 255). If so, the
- result is not an ordinary Erlang <c>string()</c>, but can well be
+ result is still an ordinary Erlang <c>string()</c>, and can well be
used in any context where Unicode data is allowed.</p>
</desc>
</func>
@@ -384,6 +384,16 @@
</func>
<func>
+ <name name="write_atom_as_latin1" arity="1"/>
+ <fsummary>Write an atom.</fsummary>
+ <desc>
+ <p>Returns the list of characters needed to print atom
+ <c><anno>Atom</anno></c>. Non-Latin-1 characters
+ are escaped.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="write_char" arity="1"/>
<fsummary>Write a character.</fsummary>
<desc>
diff --git a/lib/stdlib/doc/src/notes.xml b/lib/stdlib/doc/src/notes.xml
index 0e8bf3d27c..428d8a6e70 100644
--- a/lib/stdlib/doc/src/notes.xml
+++ b/lib/stdlib/doc/src/notes.xml
@@ -31,6 +31,110 @@
</header>
<p>This document describes the changes made to the STDLIB application.</p>
+<section><title>STDLIB 3.3</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>An escript with only two lines would not work.</p>
+ <p>
+ Own Id: OTP-14098</p>
+ </item>
+ <item>
+ <p> Characters (<c>$char</c>) can be used in constant
+ pattern expressions. They can also be used in types and
+ contracts. </p>
+ <p>
+ Own Id: OTP-14103 Aux Id: ERL-313 </p>
+ </item>
+ <item>
+ <p> The signatures of <c>erl_parse:anno_to_term/1</c> and
+ <c>erl_parse:anno_from_term/1</c> are corrected. Using
+ these functions no longer results in false Dialyzer
+ warnings. </p>
+ <p>
+ Own Id: OTP-14131</p>
+ </item>
+ <item>
+ <p>Pretty-printing of maps is improved. </p>
+ <p>
+ Own Id: OTP-14175 Aux Id: seq13277 </p>
+ </item>
+ <item>
+ <p>If any of the following functions in the <c>zip</c>
+ module crashed, a file would be left open:
+ <c>extract()</c>, <c>unzip()</c>, <c>create()</c>, or
+ <c>zip()</c>. This has been corrected.</p>
+ <p>A <c>zip</c> file having a "Unix header" could not be
+ unpacked.</p>
+ <p>
+ Own Id: OTP-14189 Aux Id: ERL-348, ERL-349 </p>
+ </item>
+ <item>
+ <p> Improve the Erlang shell's tab-completion of long
+ names. </p>
+ <p>
+ Own Id: OTP-14200 Aux Id: ERL-352 </p>
+ </item>
+ <item>
+ <p>
+ The reference manual for <c>sys</c> had some faulty
+ information about the 'get_modules' message used by
+ processes where modules change dynamically during
+ runtime. The documentation is now corrected.</p>
+ <p>
+ Own Id: OTP-14248 Aux Id: ERL-367 </p>
+ </item>
+ </list>
+ </section>
+
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Bug fixes, new features and improvements to gen_statem:</p>
+ <p>
+ A new type init_result/1 has replaced the old
+ init_result/0, so if you used that old type (that was
+ never documented) you have to change your code, which may
+ be regarded as a potential incompatibility.</p>
+ <p>
+ Changing callback modes after code change did not work
+ since the new callback mode was not recorded. This bug
+ has been fixed.</p>
+ <p>
+ The event types state_timeout and {call,From} could not
+ be generated with a {next_event,EventType,EventContent}
+ action since they did not pass the runtime type check.
+ This bug has now been corrected.</p>
+ <p>
+ State entry calls can now be repeated using (new) state
+ callback returns {repeat_state,...},
+ {repeat_state_and_data,_} and repeat_state_and_data.</p>
+ <p>
+ There have been lots of code cleanup in particular
+ regarding timer handling. For example is async
+ cancel_timer now used. Error handling has also been
+ cleaned up.</p>
+ <p>
+ To align with probable future changes to the rest of
+ gen_*, terminate/3 has now got a fallback and
+ code_change/4 is not mandatory.</p>
+ <p>
+ Own Id: OTP-14114</p>
+ </item>
+ <item>
+ <p><c>filename:safe_relative_path/1</c> to sanitize a
+ relative path has been added.</p>
+ <p>
+ Own Id: OTP-14215</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>STDLIB 3.2</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/stdlib/doc/src/proplists.xml b/lib/stdlib/doc/src/proplists.xml
index fe6b8cc3bf..990d47b313 100644
--- a/lib/stdlib/doc/src/proplists.xml
+++ b/lib/stdlib/doc/src/proplists.xml
@@ -344,7 +344,7 @@ split([{c, 2}, {e, 1}, a, {c, 3, 4}, d, {b, 5}, b], [a, b, c])</code>
with <c>{K2, true}</c>, thus changing the name of the option and
simultaneously negating the value specified by
<seealso marker="#get_bool/2">
- <c>get_bool(Key, <anno>ListIn</anno></c></seealso>.
+ <c>get_bool(Key, <anno>ListIn</anno>)</c></seealso>.
If the same <c>K1</c> occurs more than once in
<c><anno>Negations</anno></c>, only the first occurrence is used.</p>
<p>For example, <c>substitute_negations([{no_foo, foo}], L)</c>
diff --git a/lib/stdlib/doc/src/rand.xml b/lib/stdlib/doc/src/rand.xml
index 8745e16908..e06d7e467d 100644
--- a/lib/stdlib/doc/src/rand.xml
+++ b/lib/stdlib/doc/src/rand.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>2015</year><year>2016</year>
+ <year>2015</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -50,26 +50,73 @@
<p>The following algorithms are provided:</p>
<taglist>
- <tag><c>exsplus</c></tag>
+ <tag><c>exrop</c></tag>
<item>
- <p>Xorshift116+, 58 bits precision and period of 2^116-1</p>
+ <p>Xoroshiro116+, 58 bits precision and period of 2^116-1</p>
<p>Jump function: equivalent to 2^64 calls</p>
</item>
- <tag><c>exs64</c></tag>
- <item>
- <p>Xorshift64*, 64 bits precision and a period of 2^64-1</p>
- <p>Jump function: not available</p>
- </item>
- <tag><c>exs1024</c></tag>
+ <tag><c>exs1024s</c></tag>
<item>
<p>Xorshift1024*, 64 bits precision and a period of 2^1024-1</p>
<p>Jump function: equivalent to 2^512 calls</p>
</item>
+ <tag><c>exsp</c></tag>
+ <item>
+ <p>Xorshift116+, 58 bits precision and period of 2^116-1</p>
+ <p>Jump function: equivalent to 2^64 calls</p>
+ <p>
+ This is a corrected version of the previous default algorithm,
+ that now has been superseeded by Xoroshiro116+ (<c>exrop</c>).
+ Since there is no native 58 bit rotate instruction this
+ algorithm executes a little (say &lt; 15%) faster than <c>exrop</c>.
+ See the
+ <url href="http://xorshift.di.unimi.it">algorithms' homepage</url>.
+ </p>
+ </item>
</taglist>
- <p>The default algorithm is <c>exsplus</c>. If a specific algorithm is
+ <p>
+ The default algorithm is <c>exrop</c> (Xoroshiro116+).
+ If a specific algorithm is
required, ensure to always use <seealso marker="#seed-1">
- <c>seed/1</c></seealso> to initialize the state.</p>
+ <c>seed/1</c></seealso> to initialize the state.
+ </p>
+
+ <p>
+ Undocumented (old) algorithms are deprecated but still implemented
+ so old code relying on them will produce
+ the same pseudo random sequences as before.
+ </p>
+
+ <note>
+ <p>
+ There were a number of problems in the implementation
+ of the now undocumented algorithms, which is why
+ they are deprecated. The new algorithms are a bit slower
+ but do not have these problems:
+ </p>
+ <p>
+ Uniform integer ranges had a skew in the probability distribution
+ that was not noticable for small ranges but for large ranges
+ less than the generator's precision the probability to produce
+ a low number could be twice the probability for a high.
+ </p>
+ <p>
+ Uniform integer ranges larger than or equal to the generator's
+ precision used a floating point fallback that only calculated
+ with 52 bits which is smaller than the requested range
+ and therefore were not all numbers in the requested range
+ even possible to produce.
+ </p>
+ <p>
+ Uniform floats had a non-uniform density so small values
+ i.e less than 0.5 had got smaller intervals decreasing
+ as the generated value approached 0.0 although still uniformly
+ distributed for sufficiently large subranges. The new algorithms
+ produces uniformly distributed floats on the form N * 2.0^(-53)
+ hence equally spaced.
+ </p>
+ </note>
<p>Every time a random number is requested, a state is used to
calculate it and a new state is produced. The state can either be
@@ -99,19 +146,19 @@ R1 = rand:uniform(),</pre>
<p>Use a specified algorithm:</p>
<pre>
-_ = rand:seed(exs1024),
+_ = rand:seed(exs1024s),
R2 = rand:uniform(),</pre>
<p>Use a specified algorithm with a constant seed:</p>
<pre>
-_ = rand:seed(exs1024, {123, 123534, 345345}),
+_ = rand:seed(exs1024s, {123, 123534, 345345}),
R3 = rand:uniform(),</pre>
<p>Use the functional API with a non-constant seed:</p>
<pre>
-S0 = rand:seed_s(exsplus),
+S0 = rand:seed_s(exrop),
{R4, S1} = rand:uniform_s(S0),</pre>
<p>Create a standard normal deviate:</p>
@@ -119,28 +166,93 @@ S0 = rand:seed_s(exsplus),
<pre>
{SND0, S2} = rand:normal_s(S1),</pre>
+ <p>Create a normal deviate with mean -3 and variance 0.5:</p>
+
+ <pre>
+{ND0, S3} = rand:normal_s(-3, 0.5, S2),</pre>
+
<note>
- <p>This random number generator is not cryptographically
- strong. If a strong cryptographic random number generator is
- needed, use one of functions in the
- <seealso marker="crypto:crypto"><c>crypto</c></seealso>
- module, for example, <seealso marker="crypto:crypto">
- <c>crypto:strong_rand_bytes/1</c></seealso>.</p>
+ <p>The builtin random number generator algorithms are not
+ cryptographically strong. If a cryptographically strong
+ random number generator is needed, use something like
+ <seealso marker="crypto:crypto#rand_seed-0"><c>crypto:rand_seed/0</c></seealso>.
+ </p>
</note>
+ <p>
+ For all these generators the lowest bit(s) has got
+ a slightly less random behaviour than all other bits.
+ 1 bit for <c>exrop</c> (and <c>exsp</c>),
+ and 3 bits for <c>exs1024s</c>.
+ See for example the explanation in the
+ <url href="http://xoroshiro.di.unimi.it/xoroshiro128plus.c">
+ Xoroshiro128+
+ </url>
+ generator source code:
+ </p>
+ <pre>
+Beside passing BigCrush, this generator passes the PractRand test suite
+up to (and included) 16TB, with the exception of binary rank tests,
+which fail due to the lowest bit being an LFSR; all other bits pass all
+tests. We suggest to use a sign test to extract a random Boolean value.</pre>
+ <p>
+ If this is a problem; to generate a boolean
+ use something like this:
+ </p>
+ <pre>(rand:uniform(16) > 8)</pre>
+ <p>
+ And for a general range, with <c>N = 1</c> for <c>exrop</c>,
+ and <c>N = 3</c> for <c>exs1024s</c>:
+ </p>
+ <pre>(((rand:uniform(Range bsl N) - 1) bsr N) + 1)</pre>
+ <p>
+ The floating point generating functions in this module
+ waste the lowest bits when converting from an integer
+ so they avoid this snag.
+ </p>
+
+
</description>
<datatypes>
<datatype>
+ <name name="builtin_alg"/>
+ </datatype>
+ <datatype>
<name name="alg"/>
</datatype>
<datatype>
+ <name name="alg_handler"/>
+ </datatype>
+ <datatype>
+ <name name="alg_state"/>
+ </datatype>
+ <datatype>
<name name="state"/>
<desc><p>Algorithm-dependent state.</p></desc>
</datatype>
<datatype>
<name name="export_state"/>
- <desc><p>Algorithm-dependent state that can be printed or saved to
- file.</p></desc>
+ <desc>
+ <p>
+ Algorithm-dependent state that can be printed or saved to file.
+ </p>
+ </desc>
+ </datatype>
+ <datatype>
+ <name name="exs64_state"/>
+ <desc><p>Algorithm specific internal state</p></desc>
+ </datatype>
+ <datatype>
+ <name name="exsplus_state"/>
+ <desc><p>Algorithm specific internal state</p></desc>
+ </datatype>
+ <datatype>
+ <name name="exs1024_state"/>
+ <desc><p>Algorithm specific internal state</p></desc>
+ </datatype>
+ <datatype>
+ <name name="exrop_state"/>
+ <desc><p>Algorithm specific internal state</p></desc>
</datatype>
</datatypes>
@@ -201,6 +313,15 @@ S0 = rand:seed_s(exsplus),
</func>
<func>
+ <name name="normal" arity="2"/>
+ <fsummary>Return a normal distributed random float.</fsummary>
+ <desc>
+ <p>Returns a normal N(Mean, Variance) deviate float
+ and updates the state in the process dictionary.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="normal_s" arity="1"/>
<fsummary>Return a standard normal distributed random float.</fsummary>
<desc>
@@ -211,12 +332,24 @@ S0 = rand:seed_s(exsplus),
</func>
<func>
+ <name name="normal_s" arity="3"/>
+ <fsummary>Return a normal distributed random float.</fsummary>
+ <desc>
+ <p>Returns, for a specified state, a normal N(Mean, Variance)
+ deviate float and a new state.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="seed" arity="1"/>
<fsummary>Seed random number generator.</fsummary>
<desc>
<marker id="seed-1"/>
- <p>Seeds random number generation with the specifed algorithm and
- time-dependent data if <anno>AlgOrExpState</anno> is an algorithm.</p>
+ <p>
+ Seeds random number generation with the specifed algorithm and
+ time-dependent data if <c><anno>AlgOrStateOrExpState</anno></c>
+ is an algorithm.
+ </p>
<p>Otherwise recreates the exported seed in the process dictionary,
and returns the state. See also
<seealso marker="#export_seed-0"><c>export_seed/0</c></seealso>.</p>
@@ -236,8 +369,11 @@ S0 = rand:seed_s(exsplus),
<name name="seed_s" arity="1"/>
<fsummary>Seed random number generator.</fsummary>
<desc>
- <p>Seeds random number generation with the specifed algorithm and
- time-dependent data if <anno>AlgOrExpState</anno> is an algorithm.</p>
+ <p>
+ Seeds random number generation with the specifed algorithm and
+ time-dependent data if <c><anno>AlgOrStateOrExpState</anno></c>
+ is an algorithm.
+ </p>
<p>Otherwise recreates the exported seed and returns the state.
See also <seealso marker="#export_seed-0">
<c>export_seed/0</c></seealso>.</p>
@@ -258,7 +394,7 @@ S0 = rand:seed_s(exsplus),
<fsummary>Return a random float.</fsummary>
<desc><marker id="uniform-0"/>
<p>Returns a random float uniformly distributed in the value
- range <c>0.0 &lt; <anno>X</anno> &lt; 1.0</c> and
+ range <c>0.0 =&lt; <anno>X</anno> &lt; 1.0</c> and
updates the state in the process dictionary.</p>
</desc>
</func>
@@ -269,7 +405,7 @@ S0 = rand:seed_s(exsplus),
<desc><marker id="uniform-1"/>
<p>Returns, for a specified integer <c><anno>N</anno> >= 1</c>,
a random integer uniformly distributed in the value range
- <c>1 &lt;= <anno>X</anno> &lt;= <anno>N</anno></c> and
+ <c>1 =&lt; <anno>X</anno> =&lt; <anno>N</anno></c> and
updates the state in the process dictionary.</p>
</desc>
</func>
@@ -279,7 +415,7 @@ S0 = rand:seed_s(exsplus),
<fsummary>Return a random float.</fsummary>
<desc>
<p>Returns, for a specified state, random float
- uniformly distributed in the value range <c>0.0 &lt;
+ uniformly distributed in the value range <c>0.0 =&lt;
<anno>X</anno> &lt; 1.0</c> and a new state.</p>
</desc>
</func>
@@ -290,7 +426,7 @@ S0 = rand:seed_s(exsplus),
<desc>
<p>Returns, for a specified integer <c><anno>N</anno> >= 1</c>
and a state, a random integer uniformly distributed in the value
- range <c>1 &lt;= <anno>X</anno> &lt;= <anno>N</anno></c> and a
+ range <c>1 =&lt; <anno>X</anno> =&lt; <anno>N</anno></c> and a
new state.</p>
</desc>
</func>
diff --git a/lib/stdlib/doc/src/re.xml b/lib/stdlib/doc/src/re.xml
index 7f4f0aa18c..078ca0e38c 100644
--- a/lib/stdlib/doc/src/re.xml
+++ b/lib/stdlib/doc/src/re.xml
@@ -5,7 +5,7 @@
<header>
<copyright>
<year>2007</year>
- <year>2016</year>
+ <year>2017</year>
<holder>Ericsson AB, All Rights Reserved</holder>
</copyright>
<legalnotice>
@@ -45,9 +45,10 @@
<p>The matching algorithms of the library are based on the
PCRE library, but not all of the PCRE library is interfaced and
- some parts of the library go beyond what PCRE offers. The sections of
- the PCRE documentation that are relevant to this module are included
- here.</p>
+ some parts of the library go beyond what PCRE offers. Currently
+ PCRE version 8.40 (release date 2017-01-11) is used. The sections
+ of the PCRE documentation that are relevant to this module are
+ included here.</p>
<note>
<p>The Erlang literal syntax for strings uses the &quot;\&quot;
@@ -78,6 +79,14 @@
<funcs>
<func>
+ <name name="version" arity="0"/>
+ <fsummary>Gives the PCRE version of the system in a string format</fsummary>
+ <desc>
+ <p>The return of this function is a string with the PCRE version of the system that was used in the Erlang/OTP compilation.</p>
+ </desc>
+ </func>
+
+ <func>
<name name="compile" arity="1"/>
<fsummary>Compile a regular expression into a match program</fsummary>
<desc>
@@ -149,13 +158,25 @@
</item>
<tag><c>extended</c></tag>
<item>
- <p>Whitespace data characters in the pattern are ignored except
- when escaped or inside a character class. Whitespace does not
- include character 'vt' (ASCII 11). Characters between an
- unescaped <c>#</c> outside a character class and the next newline,
- inclusive, are also ignored. This is equivalent to Perl option
- <c>/x</c> and can be changed within a pattern by a <c>(?x)</c>
- option setting.</p>
+ <p>If this option is set, most white space characters in the
+ pattern are totally ignored except when escaped or inside a
+ character class. However, white space is not allowed within
+ sequences such as <c>(?&#62;</c> that introduce various
+ parenthesized subpatterns, nor within a numerical quantifier
+ such as <c>{1,3}</c>. However, ignorable white space is permitted
+ between an item and a following quantifier and between a
+ quantifier and a following + that indicates possessiveness.
+ </p>
+ <p>White space did not used to include the VT character (code
+ 11), because Perl did not treat this character as white space.
+ However, Perl changed at release 5.18, so PCRE followed at
+ release 8.34, and VT is now treated as white space.
+ </p>
+ <p>This also causes characters between an unescaped #
+ outside a character class and the next newline, inclusive, to
+ be ignored. This is equivalent to Perl's <c>/x</c> option, and it
+ can be changed within a pattern by a <c>(?x)</c> option setting.
+ </p>
<p>With this option, comments inside complicated patterns can be
included. However, notice that this applies only to data
characters. Whitespace characters can never appear within special
@@ -1321,6 +1342,8 @@ re:split("Erlang","[lg]",[{return,list},{parts,4}]).</code>
VM. Notice that the recursion limit does not affect the stack depth of the
VM, as PCRE for Erlang is compiled in such a way that the match function
never does recursion on the C stack.</p>
+ <p>Note that <c>LIMIT_MATCH</c> and <c>LIMIT_RECURSION</c> can only reduce
+ the value of the limits set by the caller, not increase them.</p>
</section>
<section>
@@ -1444,12 +1467,17 @@ Pattern PCRE matches Perl matches
<tag>\n</tag><item>Line feed (hex 0A)</item>
<tag>\r</tag><item>Carriage return (hex 0D)</item>
<tag>\t</tag><item>Tab (hex 09)</item>
+ <tag>\0dd</tag><item>Character with octal code 0dd</item>
<tag>\ddd</tag><item>Character with octal code ddd, or back reference
</item>
+ <tag>\o{ddd..}</tag><item>character with octal code ddd..</item>
<tag>\xhh</tag><item>Character with hex code hh</item>
<tag>\x{hhh..}</tag><item>Character with hex code hhh..</item>
</taglist>
+ <note><p>Note that \0dd is always an octal code, and that \8 and \9 are
+ the literal characters "8" and "9".</p></note>
+
<p>The precise effect of \cx on ASCII characters is as follows: if x is a
lowercase letter, it is converted to upper case. Then bit 6 of the
character (hex 40) is inverted. Thus \cA to \cZ become hex 01 to hex 1A
@@ -1461,50 +1489,38 @@ Pattern PCRE matches Perl matches
<p>The \c facility was designed for use with ASCII characters, but with the
extension to Unicode it is even less useful than it once was.</p>
- <p>By default, after \x, from zero to two hexadecimal digits are read
- (letters can be in upper or lower case). Any number of hexadecimal digits
- can appear between \x{ and }, but the character code is constrained as
- follows:</p>
-
- <taglist>
- <tag>8-bit non-Unicode mode</tag>
- <item>&lt; 0x100</item>
- <tag>8-bit UTF-8 mode</tag>
- <item>&lt; 0x10ffff and a valid code point</item>
- </taglist>
-
- <p>Invalid Unicode code points are the range 0xd800 to 0xdfff (the so-called
- "surrogate" code points), and 0xffef.</p>
-
- <p>If characters other than hexadecimal digits appear between \x{ and },
- or if there is no terminating }, this form of escape is not recognized.
- Instead, the initial \x is interpreted as a basic hexadecimal escape,
- with no following digits, giving a character whose value is zero.</p>
-
- <p>Characters whose value is &lt; 256 can be defined by either of the two
- syntaxes for \x. There is no difference in the way they are handled. For
- example, \xdc is the same as \x{dc}.</p>
-
<p>After \0 up to two further octal digits are read. If there are fewer than
- two digits, only those that are present are used. Thus the sequence
- \0\x\07 specifies two binary zeros followed by a BEL character (code value
- 7). Ensure to supply two digits after the initial zero if the pattern
- character that follows is itself an octal digit.</p>
+ two digits, just those that are present are used. Thus the sequence
+ \0\x\015 specifies two binary zeros followed by a CR character (code value
+ 13). Make sure you supply two digits after the initial zero if the pattern
+ character that follows is itself an octal digit.</p>
+
+ <p>The escape \o must be followed by a sequence of octal digits, enclosed
+ in braces. An error occurs if this is not the case. This escape is a recent
+ addition to Perl; it provides way of specifying character code points as
+ octal numbers greater than 0777, and it also allows octal numbers and back
+ references to be unambiguously specified.</p>
+
+ <p>For greater clarity and unambiguity, it is best to avoid following \ by
+ a digit greater than zero. Instead, use \o{} or \x{} to specify character
+ numbers, and \g{} to specify back references. The following paragraphs
+ describe the old, ambiguous syntax.</p>
<p>The handling of a backslash followed by a digit other than 0 is
- complicated. Outside a character class, PCRE reads it and any following
- digits as a decimal number. If the number is &lt; 10, or if there have
+ complicated, and Perl has changed in recent releases, causing PCRE also
+ to change. Outside a character class, PCRE reads the digit and any following
+ digits as a decimal number. If the number is &lt; 8, or if there have
been at least that many previous capturing left parentheses in the
expression, the entire sequence is taken as a <em>back reference</em>. A
description of how this works is provided later, following the discussion
of parenthesized subpatterns.</p>
- <p>Inside a character class, or if the decimal number is &gt; 9 and there
- have not been that many capturing subpatterns, PCRE re-reads up to three
- octal digits following the backslash, and uses them to generate a data
- character. Any subsequent digits stand for themselves. The value of the
- character is constrained in the same way as characters specified in
- hexadecimal. For example:</p>
+ <p>Inside a character class, or if the decimal number following \ is &gt;
+ 7 and there have not been that many capturing subpatterns, PCRE handles
+ \8 and \9 as the literal characters "8" and "9", and otherwise re-reads
+ up to three octal digits following the backslash, and using them to
+ generate a data character. Any subsequent digits stand for themselves.
+ For example:</p>
<taglist>
<tag>\040</tag>
@@ -1526,12 +1542,38 @@ Pattern PCRE matches Perl matches
<tag>\377</tag>
<item>Can be a back reference, otherwise value 255 (decimal)</item>
<tag>\81</tag>
- <item>Either a back reference, or a binary zero followed by the two
- characters "8" and "1"</item>
+ <item>Either a back reference, or the two characters "8" and "1"</item>
</taglist>
- <p>Notice that octal values &gt;= 100 must not be introduced by a leading
- zero, as no more than three octal digits are ever read.</p>
+ <p>Notice that octal values &gt;= 100 that are specified using this syntax
+ must not be introduced by a leading zero, as no more than three octal digits
+ are ever read.</p>
+
+ <p>By default, after \x that is not followed by {, from zero to two
+ hexadecimal digits are read (letters can be in upper or lower case). Any
+ number of hexadecimal digits may appear between \x{ and }. If a character
+ other than a hexadecimal digit appears between \x{ and }, or if there is no
+ terminating }, an error occurs.
+ </p>
+
+ <p>Characters whose value is less than 256 can be defined by either of the
+ two syntaxes for \x. There is no difference in the way they are handled. For
+ example, \xdc is exactly the same as \x{dc}.</p>
+
+ <p><em>Constraints on character values</em></p>
+
+ <p>Characters that are specified using octal or hexadecimal numbers are
+ limited to certain values, as follows:</p>
+ <taglist>
+ <tag>8-bit non-UTF mode</tag>
+ <item><p>&lt; 0x100</p></item>
+ <tag>8-bit UTF-8 mode</tag>
+ <item><p>&lt; 0x10ffff and a valid codepoint</p></item>
+ </taglist>
+ <p>Invalid Unicode codepoints are the range 0xd800 to 0xdfff (the
+ so-called "surrogate" codepoints), and 0xffef.</p>
+
+ <p><em>Escape sequences in character classes</em></p>
<p>All the sequences that define a single character value can be used both
inside and outside character classes. Also, inside a character class, \b
@@ -1597,11 +1639,14 @@ Pattern PCRE matches Perl matches
appropriate type. If the current matching point is at the end of the
subject string, all fail, as there is no character to match.</p>
- <p>For compatibility with Perl, \s does not match the VT character
- (code 11). This makes it different from the Posix "space" class. The \s
- characters are HT (9), LF (10), FF (12), CR (13), and space (32). If "use
- locale;" is included in a Perl script, \s can match the VT character. In
- PCRE, it never does.</p>
+ <p>For compatibility with Perl, \s did not used to match the VT character (code
+ 11), which made it different from the the POSIX "space" class. However, Perl
+ added VT at release 5.18, and PCRE followed suit at release 8.34. The default
+ \s characters are now HT (9), LF (10), VT (11), FF (12), CR (13), and space
+ (32), which are defined as white space in the "C" locale. This list may vary if
+ locale-specific matching is taking place. For example, in some locales the
+ "non-breaking space" character (\xA0) is recognized as white space, and in
+ others the VT character is not.</p>
<p>A "word" character is an underscore or any character that is a letter or
a digit. By default, the definition of letters and digits is controlled by
@@ -1619,9 +1664,9 @@ Pattern PCRE matches Perl matches
<taglist>
<tag>\d</tag><item>Any character that \p{Nd} matches (decimal digit)
</item>
- <tag>\s</tag><item>Any character that \p{Z} matches, plus HT, LF, FF, CR
+ <tag>\s</tag><item>Any character that \p{Z} or \h or \v
</item>
- <tag>\w</tag><item>Any character that \p{L} or \p{N} matches, plus
+ <tag>\w</tag><item>Any character that matches \p{L} or \p{N} matches, plus
underscore</item>
</taglist>
@@ -1769,6 +1814,7 @@ Pattern PCRE matches Perl matches
<item>Avestan</item>
<item>Balinese</item>
<item>Bamum</item>
+ <item>Bassa_Vah</item>
<item>Batak</item>
<item>Bengali</item>
<item>Bopomofo</item>
@@ -1777,6 +1823,7 @@ Pattern PCRE matches Perl matches
<item>Buhid</item>
<item>Canadian_Aboriginal</item>
<item>Carian</item>
+ <item>Caucasian_Albanian</item>
<item>Chakma</item>
<item>Cham</item>
<item>Cherokee</item>
@@ -1787,11 +1834,14 @@ Pattern PCRE matches Perl matches
<item>Cyrillic</item>
<item>Deseret</item>
<item>Devanagari</item>
+ <item>Duployan</item>
<item>Egyptian_Hieroglyphs</item>
+ <item>Elbasan</item>
<item>Ethiopic</item>
<item>Georgian</item>
<item>Glagolitic</item>
<item>Gothic</item>
+ <item>Grantha</item>
<item>Greek</item>
<item>Gujarati</item>
<item>Gurmukhi</item>
@@ -1811,40 +1861,56 @@ Pattern PCRE matches Perl matches
<item>Kayah_Li</item>
<item>Kharoshthi</item>
<item>Khmer</item>
+ <item>Khojki</item>
+ <item>Khudawadi</item>
<item>Lao</item>
<item>Latin</item>
<item>Lepcha</item>
<item>Limbu</item>
+ <item>Linear_A</item>
<item>Linear_B</item>
<item>Lisu</item>
<item>Lycian</item>
<item>Lydian</item>
+ <item>Mahajani</item>
<item>Malayalam</item>
<item>Mandaic</item>
+ <item>Manichaean</item>
<item>Meetei_Mayek</item>
+ <item>Mende_Kikakui</item>
<item>Meroitic_Cursive</item>
<item>Meroitic_Hieroglyphs</item>
<item>Miao</item>
+ <item>Modi</item>
<item>Mongolian</item>
+ <item>Mro</item>
<item>Myanmar</item>
+ <item>Nabataean</item>
<item>New_Tai_Lue</item>
<item>Nko</item>
<item>Ogham</item>
+ <item>Ol_Chiki</item>
<item>Old_Italic</item>
+ <item>Old_North_Arabian</item>
+ <item>Old_Permic</item>
<item>Old_Persian</item>
<item>Oriya</item>
<item>Old_South_Arabian</item>
<item>Old_Turkic</item>
- <item>Ol_Chiki</item>
<item>Osmanya</item>
+ <item>Pahawh_Hmong</item>
+ <item>Palmyrene</item>
+ <item>Pau_Cin_Hau</item>
<item>Phags_Pa</item>
<item>Phoenician</item>
+ <item>Psalter_Pahlavi</item>
<item>Rejang</item>
<item>Runic</item>
<item>Samaritan</item>
<item>Saurashtra</item>
<item>Sharada</item>
<item>Shavian</item>
+ <item>Siddham</item>
<item>Sinhala</item>
<item>Sora_Sompeng</item>
<item>Sundanese</item>
@@ -1862,8 +1928,10 @@ Pattern PCRE matches Perl matches
<item>Thai</item>
<item>Tibetan</item>
<item>Tifinagh</item>
+ <item>Tirhuta</item>
<item>Ugaritic</item>
<item>Vai</item>
+ <item>Warang_Citi</item>
<item>Yi</item>
</list>
@@ -2001,10 +2069,10 @@ Pattern PCRE matches Perl matches
<p>In addition to the standard Unicode properties described earlier, PCRE
supports four more that make it possible to convert traditional escape
- sequences, such as \w and \s, and Posix character classes to use Unicode
+ sequences, such as \w and \s to use Unicode
properties. PCRE uses these non-standard, non-Perl properties internally
- when <c>PCRE_UCP</c> is set. However, they can also be used explicitly.
- The properties are as follows:</p>
+ when the <c>ucp</c> option is passed. However, they can also be used
+ explicitly. The properties are as follows:</p>
<taglist>
<tag>Xan</tag>
@@ -2030,6 +2098,16 @@ Pattern PCRE matches Perl matches
</item>
</taglist>
+ <p>Perl and POSIX space are now the same. Perl added VT to its space
+ character set at release 5.18 and PCRE changed at release 8.34.</p>
+
+ <p>Xan matches characters that have either the L (letter) or the N (number)
+ property. Xps matches the characters tab, linefeed, vertical tab, form feed,
+ or carriage return, and any other character that has the Z (separator)
+ property. Xsp is the same as Xps; it used to exclude vertical tab, for Perl
+ compatibility, but Perl changed, and so PCRE followed at release 8.34. Xwd
+ matches the same characters as Xan, plus underscore.
+ </p>
<p>There is another non-standard property, Xuc, which matches any character
that can be represented by a Universal Character Name in C++ and other
programming languages. These are the characters $, @, ` (grave accent),
@@ -2062,7 +2140,9 @@ foo\Kbar</code>
<p>Perl documents that the use of \K within assertions is "not well
defined". In PCRE, \K is acted upon when it occurs inside positive
- assertions, but is ignored in negative assertions.</p>
+ assertions, but is ignored in negative assertions. Note that when a
+ pattern such as (?=ab\K) matches, the reported start of the match can
+ be greater than the end of the match.</p>
<p><em>Simple Assertions</em></p>
@@ -2301,7 +2381,8 @@ foo\Kbar</code>
m, inclusive. If a minus character is required in a class, it must be
escaped with a backslash or appear in a position where it cannot be
interpreted as indicating a range, typically as the first or last
- character in the class.</p>
+ character in the class, or immediately after a range. For example, [b-d-z]
+ matches letters in the range b to d, a hyphen character, or z.</p>
<p>The literal character "]" cannot be the end character of a range. A
pattern such as [W-]46] is interpreted as a class of two characters ("W"
@@ -2311,6 +2392,11 @@ foo\Kbar</code>
followed by two other characters. The octal or hexadecimal representation
of "]" can also be used to end a range.</p>
+ <p>An error is generated if a POSIX character class (see below) or an
+ escape sequence other than one that defines a single character appears at
+ a point where a range ending character is expected. For example, [z-\xff]
+ is valid, but [A-\d] and [A-[:digit:]] are not.</p>
+
<p>Ranges operate in the collating sequence of character values. They can
also be used for characters specified numerically, for example,
[\000-\037]. Ranges can include any characters that are valid for the
@@ -2353,7 +2439,8 @@ foo\Kbar</code>
range)</item>
<item>Circumflex (only at the start)</item>
<item>Opening square bracket (only when it can be interpreted as
- introducing a Posix class name; see the next section)</item>
+ introducing a Posix class name, or for a special compatibility
+ feature; see the next two sections)</item>
<item>Terminating closing square bracket</item>
</list>
@@ -2385,16 +2472,18 @@ foo\Kbar</code>
<tag>print</tag><item>Printing characters, including space</item>
<tag>punct</tag><item>Printing characters, excluding letters, digits, and
space</item>
- <tag>space</tag><item>Whitespace (not quite the same as \s)</item>
+ <tag>space</tag><item>Whitespace (the same as \s from PCRE 8.34)</item>
<tag>upper</tag><item>Uppercase letters</item>
<tag>word</tag><item>"Word" characters (same as \w)</item>
<tag>xdigit</tag><item>Hexadecimal digits</item>
</taglist>
- <p>The "space" characters are HT (9), LF (10), VT (11), FF (12), CR (13),
- and space (32). Notice that this list includes the VT character (code 11).
- This makes "space" different to \s, which does not include VT (for Perl
- compatibility).</p>
+ <p>The default "space" characters are HT (9), LF (10), VT (11), FF (12),
+ CR (13), and space (32). If locale-specific matching is taking place, the
+ list of space characters may be different; there may be fewer or more of
+ them. "Space" used to be different to \s, which did not include VT, for
+ Perl compatibility. However, Perl changed at release 5.18, and PCRE followed
+ at release 8.34. "Space" and \s now match the same set of characters.</p>
<p>The name "word" is a Perl extension, and "blank" is a GNU extension from
Perl 5.8. Another Perl extension is negation, which is indicated by a ^
@@ -2408,11 +2497,11 @@ foo\Kbar</code>
"ch" is a "collating element", but these are not supported, and an error
is given if they are encountered.</p>
- <p>By default, in UTF modes, characters with values &gt; 255 do not match
+ <p>By default, characters with values &gt; 255 do not match
any of the Posix character classes. However, if option <c>PCRE_UCP</c> is
passed to <c>pcre_compile()</c>, some of the classes are changed so that
- Unicode character properties are used. This is achieved by replacing the
- Posix classes by other sequences, as follows:</p>
+ Unicode character properties are used. This is achieved by replacing
+ certain Posix classes by other sequences, as follows:</p>
<taglist>
<tag>[:alnum:]</tag><item>Becomes <em>\p{Xan}</em></item>
@@ -2425,9 +2514,49 @@ foo\Kbar</code>
<tag>[:word:]</tag><item>Becomes <em>\p{Xwd}</em></item>
</taglist>
- <p>Negated versions, such as [:^alpha:], use \P instead of \p. The other
- Posix classes are unchanged, and match only characters with code points
- &lt; 256.</p>
+ <p>Negated versions, such as [:^alpha:], use \P instead of \p. Three other
+ POSIX classes are handled specially in UCP mode:</p>
+ <taglist>
+ <tag>[:graph:]</tag>
+ <item><p>This matches characters that have glyphs that mark the page
+ when printed. In Unicode property terms, it matches all characters with
+ the L, M, N, P, S, or Cf properties, except for:</p>
+ <taglist>
+ <tag>U+061C</tag><item><p>Arabic Letter Mark</p></item>
+ <tag>U+180E</tag><item><p>Mongolian Vowel Separator</p></item>
+ <tag>U+2066 - U+2069</tag><item><p>Various "isolate"s</p></item>
+ </taglist>
+ </item>
+ <tag>[:print:]</tag>
+ <item><p>This matches the same characters as [:graph:] plus space
+ characters that are not controls, that is, characters with the Zs
+ property.</p></item>
+ <tag>[:punct:]</tag><item><p>This matches all characters that have
+ the Unicode P (punctuation) property, plus those characters whose code
+ points are less than 128 that have the S (Symbol) property.</p></item>
+ </taglist>
+ <p>The other POSIX classes are unchanged, and match only characters with
+ code points less than 128.
+ </p>
+
+ <p><em>Compatibility Feature for Word Boundaries</em></p>
+
+ <p>In the POSIX.2 compliant library that was included in 4.4BSD Unix,
+ the ugly syntax [[:&#60;:]] and [[:&#62;:]] is used for matching "start
+ of word" and "end of word". PCRE treats these items as follows:</p>
+ <taglist>
+ <tag>[[:&#60;:]]</tag><item><p>is converted to \b(?=\w)</p></item>
+ <tag>[[:&#62;:]]</tag><item><p>is converted to \b(?&#60;=\w)</p></item>
+ </taglist>
+ <p>Only these exact character sequences are recognized. A sequence such as
+ [a[:&#60;:]b] provokes error for an unrecognized POSIX class name. This
+ support is not compatible with Perl. It is provided to help migrations from
+ other environments, and is best not used in any new patterns. Note that \b
+ matches at the start and the end of a word (see "Simple assertions" above),
+ and in a Perl-style pattern the preceding or following character normally
+ shows which is wanted, without the need for the assertions that are used
+ above in order to give exactly the POSIX behaviour.</p>
+
</section>
<section>
@@ -2476,8 +2605,7 @@ gilbert|sullivan</code>
<p>When one of these option changes occurs at top-level (that is, not inside
subpattern parentheses), the change applies to the remainder of the
- pattern that follows. If the change is placed right at the start of a
- pattern, PCRE extracts it into the global options.</p>
+ pattern that follows.</p>
<p>An option change within a subpattern (see section
<seealso marker="#sect11">Subpatterns</seealso>) affects only that part of
the subpattern that follows it. So, the following matches abc and aBc and
@@ -2645,9 +2773,9 @@ the ((?:red|white) (king|queen))</code>
parentheses from other parts of the pattern, such as back references,
recursion, and conditions, can be made by name and by number.</p>
- <p>Names consist of up to 32 alphanumeric characters and underscores. Named
- capturing parentheses are still allocated numbers as well as names,
- exactly as if the names were not present.
+ <p>Names consist of up to 32 alphanumeric characters and underscores, but
+ must start with a non-digit. Named capturing parentheses are still allocated
+ numbers as well as names, exactly as if the names were not present.
The <c>capture</c> specification to <seealso marker="#run/3">
<c>run/3</c></seealso> can use named values if they are present in the
regular expression.</p>
@@ -3118,7 +3246,14 @@ aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</code>
purposes of numbering the capturing subpatterns in the whole pattern.
However, substring capturing is done only for positive assertions. (Perl
sometimes, but not always, performs capturing in negative assertions.)</p>
-
+ <warning>
+ <p>If a positive assertion containing one or more capturing subpatterns
+ succeeds, but failure to match later in the pattern causes backtracking over
+ this assertion, the captures within the assertion are reset only if no higher
+ numbered captures are already set. This is, unfortunately, a fundamental
+ limitation of the current implementation, and as PCRE1 is now in
+ maintenance-only status, it is unlikely ever to change.</p>
+ </warning>
<p>For compatibility with Perl, assertion subpatterns can be repeated.
However, it makes no sense to assert the same thing many times, the side
effect of capturing parentheses can occasionally be useful. In practice,
@@ -3371,12 +3506,7 @@ abcd$</code>
<p>Perl uses the syntax (?(&lt;name&gt;)...) or (?('name')...) to test for a
used subpattern by name. For compatibility with earlier versions of PCRE,
which had this facility before Perl, the syntax (?(name)...) is also
- recognized. However, there is a possible ambiguity with this syntax, as
- subpattern names can consist entirely of digits. PCRE looks first for a
- named subpattern; if it cannot find one and the name consists entirely of
- digits, PCRE looks for a subpattern of that number, which must be &gt; 0.
- Using subpattern names that consist entirely of digits is not
- recommended.</p>
+ recognized.</p>
<p>Rewriting the previous example to use a named subpattern gives:</p>
@@ -3958,11 +4088,13 @@ a+(*COMMIT)b</code>
2&gt; re:run("xyzabc","(*COMMIT)abc",[{capture,all,list},no_start_optimize]).
nomatch</code>
- <p>PCRE knows that any match must start with "a", so the optimization skips
- along the subject to "a" before running the first match attempt, which
- succeeds. When the optimization is disabled by option
- <c>no_start_optimize</c>, the match starts at "x" and so the (*COMMIT)
- causes it to fail without trying any other starting points.</p>
+ <p>For this pattern, PCRE knows that any match must start with "a", so the
+ optimization skips along the subject to "a" before applying the pattern to the
+ first set of data. The match attempt then succeeds. In the second call the
+ <c>no_start_optimize</c> disables the optimization that skips along to the
+ first character. The pattern is now applied starting at "x", and so the
+ (*COMMIT) causes the match to fail without trying any other starting
+ points.</p>
<p>The following verb causes the match to fail at the current starting
position in the subject if there is a later matching failure that causes
@@ -4138,7 +4270,7 @@ A (B(*THEN)C | (*FAIL)) | D</code>
...(*COMMIT)(*PRUNE)...</code>
<p>If there is a matching failure to the right, backtracking onto (*PRUNE)
- cases it to be triggered, and its action is taken. There can never be a
+ causes it to be triggered, and its action is taken. There can never be a
backtrack onto (*COMMIT).</p>
<p><em>Backtracking Verbs in Repeated Groups</em></p>
diff --git a/lib/stdlib/doc/src/shell.xml b/lib/stdlib/doc/src/shell.xml
index f52bc39deb..ab62c2fcdd 100644
--- a/lib/stdlib/doc/src/shell.xml
+++ b/lib/stdlib/doc/src/shell.xml
@@ -4,7 +4,7 @@
<erlref>
<header>
<copyright>
- <year>1996</year><year>2016</year>
+ <year>1996</year><year>2017</year>
<holder>Ericsson AB. All Rights Reserved.</holder>
</copyright>
<legalnotice>
@@ -854,7 +854,7 @@ q - quit erlang
<c>{history, N}</c>, where <c>N</c> is the current command number. The
function is to return a list of characters or an atom. This
constraint is because of the Erlang I/O protocol. Unicode characters
- beyond code point 255 are allowed in the list. Notice
+ beyond code point 255 are allowed in the list and the atom. Notice
that in restricted mode the call <c>Mod:Func(L)</c> must be
allowed or the default shell prompt function is called.</p>
</section>
diff --git a/lib/stdlib/doc/src/unicode_usage.xml b/lib/stdlib/doc/src/unicode_usage.xml
index efc8b75075..a8ef8ff5c5 100644
--- a/lib/stdlib/doc/src/unicode_usage.xml
+++ b/lib/stdlib/doc/src/unicode_usage.xml
@@ -62,6 +62,10 @@
<item><p>In Erlang/OTP 17.0, the encoding default for Erlang
source files was switched to UTF-8.</p></item>
+
+ <item><p>In Erlang/OTP 20.0, atoms and function can contain
+ Unicode characters. Module names are still restricted to
+ the ISO-Latin-1 range.</p></item>
</list>
<p>This section outlines the current Unicode support and gives some
@@ -339,9 +343,10 @@
<tag>The language</tag>
<item>
<p>Having the source code in UTF-8 also allows you to write string
- literals containing Unicode characters with code points &gt; 255,
- although atoms, module names, and function names are restricted to
- the ISO Latin-1 range. Binary literals, where you use type
+ literals, function names, and atoms containing Unicode
+ characters with code points &gt; 255.
+ Module names are still restricted to the ISO Latin-1 range.
+ Binary literals, where you use type
<c>/utf8</c>, can also be expressed using Unicode characters &gt; 255.
Having module names using characters other than 7-bit ASCII can cause
trouble on operating systems with inconsistent file naming schemes,
@@ -432,15 +437,17 @@ external_charlist() = maybe_improper_list(char() | external_unicode_binary() |
<section>
<title>Basic Language Support</title>
- <p><marker id="unicode_in_erlang"/>As from Erlang/OTP R16, Erlang source
- files can be written in UTF-8 or bytewise (<c>latin1</c>) encoding. For
- information about how to state the encoding of an Erlang source file, see
- the <seealso marker="stdlib:epp#encoding"><c>epp(3)</c></seealso> module.
- Strings and comments can be written using Unicode, but functions must
- still be named using characters from the ISO Latin-1 character set, and
- atoms are restricted to the same ISO Latin-1 range. These restrictions in
- the language are of course independent of the encoding of the source
- file.</p>
+ <p><marker id="unicode_in_erlang"/>As from Erlang/OTP R16, Erlang
+ source files can be written in UTF-8 or bytewise (<c>latin1</c>)
+ encoding. For information about how to state the encoding of an
+ Erlang source file, see the <seealso
+ marker="stdlib:epp#encoding"><c>epp(3)</c></seealso> module. As
+ from Erlang/OTP R16, strings and comments can be written using
+ Unicode. As from Erlang/OTP 20, also atoms and functions can be
+ written using Unicode. Modules names must still be named using
+ characters from the ISO Latin-1 character set. (These
+ restrictions in the language are independent of the encoding of
+ the source file.)</p>
<section>
<title>Bit Syntax</title>
diff --git a/lib/stdlib/src/c.erl b/lib/stdlib/src/c.erl
index 52df2319dd..bb7b485490 100644
--- a/lib/stdlib/src/c.erl
+++ b/lib/stdlib/src/c.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -400,7 +400,7 @@ split_def([], Res) -> {d, list_to_atom(reverse(Res))}.
make_term(Str) ->
case erl_scan:string(Str) of
{ok, Tokens, _} ->
- case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of
+ case erl_parse:parse_term(Tokens ++ [{dot, erl_anno:new(1)}]) of
{ok, Term} -> Term;
{error, {_,_,Reason}} ->
io:format("~ts: ~ts~n", [Reason, Str]),
diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl
index 40eba4ad67..61d755ba55 100644
--- a/lib/stdlib/src/epp.erl
+++ b/lib/stdlib/src/epp.erl
@@ -286,7 +286,7 @@ parse_file(Epp) ->
{warning,W} ->
[{warning,W}|parse_file(Epp)];
{eof,Location} ->
- [{eof,erl_anno:new(Location)}]
+ [{eof,Location}]
end.
-spec default_encoding() -> source_encoding().
diff --git a/lib/stdlib/src/erl_anno.erl b/lib/stdlib/src/erl_anno.erl
index d32c34dabd..d0310f52e2 100644
--- a/lib/stdlib/src/erl_anno.erl
+++ b/lib/stdlib/src/erl_anno.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -42,7 +42,7 @@
%% Debug: define DEBUG to make sure that annotations are handled as an
%% opaque type. Note that all abstract code need to be compiled with
-%% DEBUG=true. See also ./erl_pp.erl.
+%% DEBUG=true. See also ./erl_pp.erl and ./erl_parse.yrl.
%-define(DEBUG, true).
@@ -52,7 +52,11 @@
| {'record', record()}
| {'text', string()}.
+-ifdef(DEBUG).
+-opaque anno() :: [annotation(), ...].
+-else.
-opaque anno() :: location() | [annotation(), ...].
+-endif.
-type anno_term() :: term().
-type column() :: pos_integer().
diff --git a/lib/stdlib/src/erl_compile.erl b/lib/stdlib/src/erl_compile.erl
index a6ae398d03..76db2eeacd 100644
--- a/lib/stdlib/src/erl_compile.erl
+++ b/lib/stdlib/src/erl_compile.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1997-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1997-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -337,7 +337,7 @@ file_or_directory(Name) ->
make_term(Str) ->
case erl_scan:string(Str) of
{ok, Tokens, _} ->
- case erl_parse:parse_term(Tokens ++ [{dot, 1}]) of
+ case erl_parse:parse_term(Tokens ++ [{dot, erl_anno:new(1)}]) of
{ok, Term} -> Term;
{error, {_,_,Reason}} ->
io:format(?STDERR, "~ts: ~ts~n", [Reason, Str]),
diff --git a/lib/stdlib/src/erl_lint.erl b/lib/stdlib/src/erl_lint.erl
index 1b84234fac..78b7a0e751 100644
--- a/lib/stdlib/src/erl_lint.erl
+++ b/lib/stdlib/src/erl_lint.erl
@@ -2,7 +2,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -156,6 +156,8 @@ format_error(pmod_unsupported) ->
"parameterized modules are no longer supported";
%% format_error({redefine_mod_import, M, P}) ->
%% io_lib:format("module '~s' already imported from package '~s'", [M, P]);
+format_error(non_latin1_module_unsupported) ->
+ "module names with non-latin1 characters are not supported";
format_error(invalid_call) ->
"invalid function call";
@@ -402,6 +404,10 @@ format_error({not_exported_opaque, {TypeName, Arity}}) ->
format_error({underspecified_opaque, {TypeName, Arity}}) ->
io_lib:format("opaque type ~w~s is underspecified and therefore meaningless",
[TypeName, gen_type_paren(Arity)]);
+format_error({bad_dialyzer_attribute,Term}) ->
+ io_lib:format("badly formed dialyzer attribute: ~w", [Term]);
+format_error({bad_dialyzer_option,Term}) ->
+ io_lib:format("unknown dialyzer warning option: ~w", [Term]);
%% --- obsolete? unused? ---
format_error({format_error, {Fmt, Args}}) ->
io_lib:format(Fmt, Args).
@@ -733,13 +739,27 @@ form(Form, #lint{state=State}=St) ->
start_state({attribute,Line,module,{_,_}}=Form, St0) ->
St1 = add_error(Line, pmod_unsupported, St0),
attribute_state(Form, St1#lint{state=attribute});
-start_state({attribute,_,module,M}, St0) ->
+start_state({attribute,Line,module,M}, St0) ->
St1 = St0#lint{module=M},
- St1#lint{state=attribute};
+ St2 = St1#lint{state=attribute},
+ case is_non_latin1_name(M) of
+ true ->
+ add_error(Line, non_latin1_module_unsupported, St2);
+ false ->
+ St2
+ end;
start_state(Form, St) ->
- St1 = add_error(element(2, Form), undefined_module, St),
+ Anno = case Form of
+ {eof, L} -> erl_anno:new(L);
+ %% {warning, Warning} and {error, Error} not possible here.
+ _ -> element(2, Form)
+ end,
+ St1 = add_error(Anno, undefined_module, St),
attribute_state(Form, St1#lint{state=attribute}).
+is_non_latin1_name(Name) ->
+ lists:any(fun(C) -> C > 255 end, atom_to_list(Name)).
+
%% attribute_state(Form, State) ->
%% State'
@@ -780,8 +800,7 @@ attribute_state(Form, St) ->
%% State'
%% Allow for record, type and opaque type definitions and spec
%% declarations to be intersperced within function definitions.
-%% Dialyzer attributes are also allowed everywhere, but are not
-%% checked at all.
+%% Dialyzer attributes are also allowed everywhere.
function_state({attribute,L,record,{Name,Fields}}, St) ->
record_def(L, Name, Fields, St);
@@ -867,7 +886,8 @@ post_traversal_check(Forms, St0) ->
StD = check_on_load(StC),
StE = check_unused_records(Forms, StD),
StF = check_local_opaque_types(StE),
- check_callback_information(StF).
+ StG = check_dialyzer_attribute(Forms, StF),
+ check_callback_information(StG).
%% check_behaviour(State0) -> State
%% Check that the behaviour attribute is valid.
@@ -3100,6 +3120,59 @@ check_local_opaque_types(St) ->
end,
dict:fold(FoldFun, St, Ts).
+check_dialyzer_attribute(Forms, St0) ->
+ Vals = [{L,V} ||
+ {attribute,L,dialyzer,Val} <- Forms,
+ V0 <- lists:flatten([Val]),
+ V <- case V0 of
+ {O,F} ->
+ [{A,B} ||
+ A <- lists:flatten([O]),
+ B <- lists:flatten([F])];
+ T -> [T]
+ end],
+ {Wellformed, Bad} =
+ lists:partition(fun ({_,{Option,FA}}) when is_atom(Option) ->
+ is_fa(FA);
+ ({_,Option}) when is_atom(Option) -> true;
+ (_) -> false
+ end, Vals),
+ St1 = foldl(fun ({L,Term}, St) ->
+ add_error(L, {bad_dialyzer_attribute,Term}, St)
+ end, St0, Bad),
+ DefFunctions = (gb_sets:to_list(St0#lint.defined) -- pseudolocals()),
+ Fun = fun ({L,{Option,FA}}, St) ->
+ case is_function_dialyzer_option(Option) of
+ true ->
+ case lists:member(FA, DefFunctions) of
+ true -> St;
+ false ->
+ add_error(L, {undefined_function,FA}, St)
+ end;
+ false ->
+ add_error(L, {bad_dialyzer_option,Option}, St)
+ end;
+ ({L,Option}, St) ->
+ case is_module_dialyzer_option(Option) of
+ true -> St;
+ false ->
+ add_error(L, {bad_dialyzer_option,Option}, St)
+ end
+ end,
+ foldl(Fun, St1, Wellformed).
+
+is_function_dialyzer_option(nowarn_function) -> true;
+is_function_dialyzer_option(Option) ->
+ is_module_dialyzer_option(Option).
+
+is_module_dialyzer_option(Option) ->
+ lists:member(Option,
+ [no_return,no_unused,no_improper_lists,no_fun_app,
+ no_match,no_opaque,no_fail_call,no_contracts,
+ no_behaviours,no_undefined_callbacks,unmatched_returns,
+ error_handling,race_conditions,no_missing_calls,
+ specdiffs,overspecs,underspecs,unknown]).
+
%% icrt_clauses(Clauses, In, ImportVarTable, State) ->
%% {UpdVt,State}.
diff --git a/lib/stdlib/src/erl_parse.yrl b/lib/stdlib/src/erl_parse.yrl
index 922455a6f2..2dcddeb8c2 100644
--- a/lib/stdlib/src/erl_parse.yrl
+++ b/lib/stdlib/src/erl_parse.yrl
@@ -981,6 +981,16 @@ Erlang code.
%% keep track of annotation info in tokens
-define(anno(Tup), element(2, Tup)).
+%-define(DEBUG, true).
+
+-ifdef(DEBUG).
+%% Assumes that erl_anno has been compiled with DEBUG=true.
+-define(ANNO_CHECK(Tokens),
+ [] = [T || T <- Tokens, not is_list(element(2, T))]).
+-else.
+-define(ANNO_CHECK(Tokens), ok).
+-endif.
+
%% Entry points compatible to old erl_parse.
%% These really suck and are only here until Calle gets multiple
%% entry points working.
@@ -990,10 +1000,15 @@ Erlang code.
AbsForm :: abstract_form(),
ErrorInfo :: error_info().
parse_form([{'-',A1},{atom,A2,spec}|Tokens]) ->
- parse([{'-',A1},{'spec',A2}|Tokens]);
+ NewTokens = [{'-',A1},{'spec',A2}|Tokens],
+ ?ANNO_CHECK(NewTokens),
+ parse(NewTokens);
parse_form([{'-',A1},{atom,A2,callback}|Tokens]) ->
- parse([{'-',A1},{'callback',A2}|Tokens]);
+ NewTokens = [{'-',A1},{'callback',A2}|Tokens],
+ ?ANNO_CHECK(NewTokens),
+ parse(NewTokens);
parse_form(Tokens) ->
+ ?ANNO_CHECK(Tokens),
parse(Tokens).
-spec parse_exprs(Tokens) -> {ok, ExprList} | {error, ErrorInfo} when
@@ -1001,6 +1016,7 @@ parse_form(Tokens) ->
ExprList :: [abstract_expr()],
ErrorInfo :: error_info().
parse_exprs(Tokens) ->
+ ?ANNO_CHECK(Tokens),
A = erl_anno:new(0),
case parse([{atom,A,f},{'(',A},{')',A},{'->',A}|Tokens]) of
{ok,{function,_Lf,f,0,[{clause,_Lc,[],[],Exprs}]}} ->
@@ -1013,6 +1029,7 @@ parse_exprs(Tokens) ->
Term :: term(),
ErrorInfo :: error_info().
parse_term(Tokens) ->
+ ?ANNO_CHECK(Tokens),
A = erl_anno:new(0),
case parse([{atom,A,f},{'(',A},{')',A},{'->',A}|Tokens]) of
{ok,{function,_Af,f,0,[{clause,_Ac,[],[],[Expr]}]}} ->
@@ -1531,8 +1548,8 @@ type_preop_prec('#') -> {700,800}.
Fun :: fun((Anno) -> NewAnno),
Anno :: erl_anno:anno(),
NewAnno :: erl_anno:anno(),
- Abstr :: erl_parse_tree(),
- NewAbstr :: erl_parse_tree().
+ Abstr :: erl_parse_tree() | form_info(),
+ NewAbstr :: erl_parse_tree() | form_info().
map_anno(F0, Abstr) ->
F = fun(A, Acc) -> {F0(A), Acc} end,
@@ -1546,7 +1563,7 @@ map_anno(F0, Abstr) ->
Acc1 :: term(),
AccIn :: term(),
AccOut :: term(),
- Abstr :: erl_parse_tree().
+ Abstr :: erl_parse_tree() | form_info().
fold_anno(F0, Acc0, Abstr) ->
F = fun(A, Acc) -> {A, F0(A, Acc)} end,
@@ -1561,15 +1578,15 @@ fold_anno(F0, Acc0, Abstr) ->
Acc1 :: term(),
AccIn :: term(),
AccOut :: term(),
- Abstr :: erl_parse_tree(),
- NewAbstr :: erl_parse_tree().
+ Abstr :: erl_parse_tree() | form_info(),
+ NewAbstr :: erl_parse_tree() | form_info().
mapfold_anno(F, Acc0, Abstr) ->
modify_anno1(Abstr, Acc0, F).
-spec new_anno(Term) -> Abstr when
Term :: term(),
- Abstr :: erl_parse_tree().
+ Abstr :: erl_parse_tree() | form_info().
new_anno(Term) ->
F = fun(L, Acc) -> {erl_anno:new(L), Acc} end,
@@ -1577,14 +1594,14 @@ new_anno(Term) ->
NewAbstr.
-spec anno_to_term(Abstr) -> term() when
- Abstr :: erl_parse_tree().
+ Abstr :: erl_parse_tree() | form_info().
anno_to_term(Abstract) ->
F = fun(Anno, Acc) -> {erl_anno:to_term(Anno), Acc} end,
{NewAbstract, []} = modify_anno1(Abstract, [], F),
NewAbstract.
--spec anno_from_term(Term) -> erl_parse_tree() when
+-spec anno_from_term(Term) -> erl_parse_tree() | form_info() when
Term :: term().
anno_from_term(Term) ->
@@ -1629,6 +1646,8 @@ modify_anno1({warning,W}, Ac, _Mf) ->
{{warning,W},Ac};
modify_anno1({error,W}, Ac, _Mf) ->
{{error,W},Ac};
+modify_anno1({eof,L}, Ac, _Mf) ->
+ {{eof,L},Ac};
%% Expressions.
modify_anno1({clauses,Cs}, Ac, Mf) ->
{Cs1,Ac1} = modify_anno1(Cs, Ac, Mf),
diff --git a/lib/stdlib/src/erl_pp.erl b/lib/stdlib/src/erl_pp.erl
index d30cd508c1..ee5e7a11bf 100644
--- a/lib/stdlib/src/erl_pp.erl
+++ b/lib/stdlib/src/erl_pp.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -44,13 +44,22 @@
| {encoding, latin1 | unicode | utf8}).
-type(options() :: hook_function() | [option()]).
--record(pp, {string_fun, char_fun}).
+-record(pp, {value_fun, string_fun, char_fun}).
-record(options, {hook, encoding, opts}).
%-define(DEBUG, true).
-ifdef(DEBUG).
+-define(FORM_TEST(T),
+ _ = case T of
+ {eof, _Line} -> ok;
+ {warning, _W} -> ok;
+ {error, _E} -> ok;
+ _ -> ?TEST(T)
+ end).
+-define(EXPRS_TEST(L),
+ [?TEST(E) || E <- L]).
-define(TEST(T),
%% Assumes that erl_anno has been compiled with DEBUG=true.
%% erl_pp does not use the annoations, but test it anyway.
@@ -62,6 +71,8 @@
erlang:error(badarg, [T])
end).
-else.
+-define(FORM_TEST(T), ok).
+-define(EXPRS_TEST(T), ok).
-define(TEST(T), ok).
-endif.
@@ -80,7 +91,7 @@ form(Thing) ->
Options :: options()).
form(Thing, Options) ->
- ?TEST(Thing),
+ ?FORM_TEST(Thing),
State = state(Options),
frmt(lform(Thing, options(Options)), State).
@@ -124,7 +135,7 @@ guard(Gs) ->
Options :: options()).
guard(Gs, Options) ->
- ?TEST(Gs),
+ ?EXPRS_TEST(Gs),
frmt(lguard(Gs, options(Options)), state(Options)).
-spec(exprs(Expressions) -> io_lib:chars() when
@@ -146,7 +157,7 @@ exprs(Es, Options) ->
Options :: options()).
exprs(Es, I, Options) ->
- ?TEST(Es),
+ ?EXPRS_TEST(Es),
frmt({seq,[],[],[$,],lexprs(Es, options(Options))}, I, state(Options)).
-spec(expr(Expression) -> io_lib:chars() when
@@ -203,11 +214,15 @@ state(_Hook) ->
state().
state() ->
- #pp{string_fun = fun io_lib:write_string_as_latin1/1,
+ Options = [{encoding,latin1}],
+ #pp{value_fun = fun(V) -> io_lib_pretty:print(V, Options) end,
+ string_fun = fun io_lib:write_string_as_latin1/1,
char_fun = fun io_lib:write_char_as_latin1/1}.
unicode_state() ->
- #pp{string_fun = fun io_lib:write_string/1,
+ Options = [{encoding,unicode}],
+ #pp{value_fun = fun(V) -> io_lib_pretty:print(V, Options) end,
+ string_fun = fun io_lib:write_string/1,
char_fun = fun io_lib:write_char/1}.
encoding(Options) ->
@@ -242,31 +257,30 @@ lattribute({attribute,_Line,Name,Arg}, Opts) ->
lattribute(module, {M,Vs}, _Opts) ->
A = a0(),
- attr("module",[{var,A,pname(M)},
- foldr(fun(V, C) -> {cons,A,{var,A,V},C}
- end, {nil,A}, Vs)]);
+ attr(module,[{var,A,pname(M)},
+ foldr(fun(V, C) -> {cons,A,{var,A,V},C}
+ end, {nil,A}, Vs)]);
lattribute(module, M, _Opts) ->
- attr("module", [{var,a0(),pname(M)}]);
+ attr(module, [{var,a0(),pname(M)}]);
lattribute(export, Falist, _Opts) ->
- call({var,a0(),"-export"}, [falist(Falist)], 0, options(none));
+ attrib(export, falist(Falist));
lattribute(import, Name, _Opts) when is_list(Name) ->
- attr("import", [{var,a0(),pname(Name)}]);
+ attr(import, [{var,a0(),pname(Name)}]);
lattribute(import, {From,Falist}, _Opts) ->
- attr("import",[{var,a0(),pname(From)},falist(Falist)]);
+ attrib(import, [leaf(pname(From)),falist(Falist)]);
lattribute(export_type, Talist, _Opts) ->
- call({var,a0(),"-export_type"}, [falist(Talist)], 0, options(none));
+ attrib(export_type, falist(Talist));
lattribute(optional_callbacks, Falist, Opts) ->
- ArgL = try falist(Falist)
- catch _:_ -> abstract(Falist, Opts)
- end,
- call({var,a0(),"-optional_callbacks"}, [ArgL], 0, options(none));
+ try attrib(optional_callbacks, falist(Falist))
+ catch _:_ -> attr(optional_callbacks, [abstract(Falist, Opts)])
+ end;
lattribute(file, {Name,Line}, _Opts) ->
- attr("file", [{string,a0(),Name},{integer,a0(),Line}]);
+ attr(file, [{string,a0(),Name},{integer,a0(),Line}]);
lattribute(record, {Name,Is}, Opts) ->
- Nl = leaf(format("-record(~w,", [Name])),
+ Nl = [leaf("-record("),{atom,Name},$,],
[{first,Nl,record_fields(Is, Opts)},$)];
lattribute(Name, Arg, Options) ->
- attr(write(Name), [abstract(Arg, Options)]).
+ attr(Name, [abstract(Arg, Options)]).
abstract(Arg, #options{encoding = Encoding}) ->
erl_parse:abstract(Arg, [{encoding,Encoding}]).
@@ -329,7 +343,7 @@ ltype({user_type,Line,T,Ts}, _) ->
ltype({remote_type,Line,[M,F,Ts]}, _) ->
simple_type({remote,Line,M,F}, Ts);
ltype({atom,_,T}, _) ->
- leaf(write(T));
+ {atom,T};
ltype(E, P) ->
lexpr(E, P, options(none)).
@@ -371,12 +385,12 @@ tuple_type(Ts, F) ->
specattr(SpecKind, {FuncSpec,TypeSpecs}) ->
Func = case FuncSpec of
{F,_A} ->
- format("~w", [F]);
+ {atom,F};
{M,F,_A} ->
- format("~w:~w", [M, F])
+ [{atom,M},$:,{atom,F}]
end,
{first,leaf(lists:concat(["-", SpecKind, " "])),
- {list,[{first,leaf(Func),spec_clauses(TypeSpecs)}]}}.
+ {list,[{first,Func,spec_clauses(TypeSpecs)}]}}.
spec_clauses(TypeSpecs) ->
{prefer_nl,[$;],[sig_type(T) || T <- TypeSpecs]}.
@@ -418,7 +432,10 @@ ltypes(Ts, F, Prec) ->
[F(T, Prec) || T <- Ts].
attr(Name, Args) ->
- call({var,a0(),format("-~s", [Name])}, Args, 0, options(none)).
+ {first,[$-,{atom,Name}],args(Args, options(none))}.
+
+attrib(Name, Args) ->
+ {first,[$-,{atom,Name}],[{seq,$(,$),[$,],Args}]}.
pname(['' | As]) ->
[$. | pname(As)];
@@ -430,10 +447,13 @@ pname(A) when is_atom(A) ->
write(A).
falist([]) ->
- {nil,a0()};
-falist([{Name,Arity}|Falist]) ->
- A = a0(),
- {cons,A,{var,A,format("~w/~w", [Name,Arity])},falist(Falist)}.
+ [leaf("[]")];
+falist(Falist) ->
+ L = [begin
+ {Name,Arity} = Fa,
+ [{atom,Name},leaf(format("/~w", [Arity]))]
+ end || Fa <- Falist],
+ [{seq,$[,$],$,,L}].
lfunction({function,_Line,Name,_Arity,Cs}, Opts) ->
Cll = nl_clauses(fun (C, H) -> func_clause(Name, C, H) end, $;, Opts, Cs),
@@ -478,7 +498,7 @@ lexpr({var,_,V}, _, _) -> leaf(format("~ts", [V]));
lexpr({char,_,C}, _, _) -> {char,C};
lexpr({integer,_,N}, _, _) -> leaf(write(N));
lexpr({float,_,F}, _, _) -> leaf(write(F));
-lexpr({atom,_,A}, _, _) -> leaf(write(A));
+lexpr({atom,_,A}, _, _) -> {atom,A};
lexpr({string,_,S}, _, _) -> {string,S};
lexpr({nil,_}, _, _) -> '[]';
lexpr({cons,_,H,T}, _, Opts) ->
@@ -508,7 +528,7 @@ lexpr({record, _, Name, Fs}, Prec, Opts) ->
lexpr({record_field, _, Rec, Name, F}, Prec, Opts) ->
{L,P,R} = inop_prec('#'),
Rl = lexpr(Rec, L, Opts),
- Nl = leaf(format("#~w.", [Name])),
+ Nl = [$#,{atom,Name},$.],
El = [Rl,Nl,lexpr(F, R, Opts)],
maybe_paren(P, Prec, El);
lexpr({record, _, Rec, Name, Fs}, Prec, Opts) ->
@@ -527,12 +547,12 @@ lexpr({record_field, _, Rec, F}, Prec, Opts) ->
maybe_paren(P, Prec, El);
lexpr({map, _, Fs}, Prec, Opts) ->
{P,_R} = preop_prec('#'),
- El = {first,leaf("#"),map_fields(Fs, Opts)},
+ El = {first,$#,map_fields(Fs, Opts)},
maybe_paren(P, Prec, El);
lexpr({map, _, Map, Fs}, Prec, Opts) ->
{L,P,_R} = inop_prec('#'),
Rl = lexpr(Map, L, Opts),
- El = {first,[Rl,leaf("#")],map_fields(Fs, Opts)},
+ El = {first,[Rl,$#],map_fields(Fs, Opts)},
maybe_paren(P, Prec, El);
lexpr({block,_,Es}, _, Opts) ->
{list,[{step,'begin',body(Es, Opts)},'end']};
@@ -552,13 +572,16 @@ lexpr({'receive',_,Cs,To,ToOpt}, _, Opts) ->
{step,'after',Al},
'end']};
lexpr({'fun',_,{function,F,A}}, _Prec, _Opts) ->
- leaf(format("fun ~w/~w", [F,A]));
-lexpr({'fun',_,{function,F,A},Extra}, _Prec, _Opts) ->
- {force_nl,fun_info(Extra),leaf(format("fun ~w/~w", [F,A]))};
-lexpr({'fun',_,{function,M,F,A}}, _Prec, _Opts)
+ [leaf("fun "),{atom,F},leaf(format("/~w", [A]))];
+lexpr({'fun',L,{function,_,_}=Func,Extra}, Prec, Opts) ->
+ {force_nl,fun_info(Extra),lexpr({'fun',L,Func}, Prec, Opts)};
+lexpr({'fun',L,{function,M,F,A}}, Prec, Opts)
when is_atom(M), is_atom(F), is_integer(A) ->
%% For backward compatibility with pre-R15 abstract format.
- leaf(format("fun ~w:~w/~w", [M,F,A]));
+ Mod = erl_parse:abstract(M),
+ Fun = erl_parse:abstract(F),
+ Arity = erl_parse:abstract(A),
+ lexpr({'fun',L,{function,Mod,Fun,Arity}}, Prec, Opts);
lexpr({'fun',_,{function,M,F,A}}, _Prec, Opts) ->
%% New format in R15.
NameItem = lexpr(M, Opts),
@@ -649,7 +672,7 @@ lexpr({bin,_,Fs}, _, Opts) ->
bit_grp(Fs, Opts);
%% Special case for straight values.
lexpr({value,_,Val}, _,_) ->
- leaf(write(Val));
+ {value,Val};
%% Now do the hook.
lexpr(Other, _Precedence, #options{hook = none}) ->
leaf(format("INVALID-FORM:~w:",[Other]));
@@ -665,7 +688,7 @@ call(Name, Args, Prec, Opts) ->
maybe_paren(P, Prec, Item).
fun_info(Extra) ->
- leaf(format("% fun-info: ~w", [Extra])).
+ [leaf("% fun-info: "),{value,Extra}].
%% BITS:
@@ -706,7 +729,7 @@ bit_elem_type(T) ->
%% end of BITS
record_name(Name) ->
- leaf(format("#~w", [Name])).
+ [$#,{atom,Name}].
record_fields(Fs, Opts) ->
tuple(Fs, fun record_field/2, Opts).
@@ -908,8 +931,10 @@ frmt(Item, I, PP) ->
%%% - {force_nl,ExtraInfo,I}: fun-info (a comment) forces linebreak before I.
%%% - {prefer_nl,Sep,IPs}: forces linebreak between Is unlesss negative
%%% indentation.
+%%% - {atom,A}: an atom
%%% - {char,C}: a character
%%% - {string,S}: a string.
+%%% - {value,T}: a term.
%%% - {hook,...}, {ehook,...}: hook expressions.
%%%
%%% list, first, seq, force_nl, and prefer_nl all accept IPs, where each
@@ -970,6 +995,10 @@ f({prefer_nl,Sep,LItems}, I0, ST, WT, PP) ->
true ->
{insert_newlines(CharsSize2L, I0, ST),nsz(lists:last(Sizes), I0)}
end;
+f({value,V}, I, ST, WT, PP) ->
+ f(write_a_value(V, PP), I, ST, WT, PP);
+f({atom,A}, I, ST, WT, PP) ->
+ f(write_an_atom(A, PP), I, ST, WT, PP);
f({char,C}, I, ST, WT, PP) ->
f(write_a_char(C, PP), I, ST, WT, PP);
f({string,S}, I, ST, WT, PP) ->
@@ -1108,6 +1137,12 @@ has_nl([C|Cs]) ->
has_nl([]) ->
false.
+write_a_value(V, PP) ->
+ flat_leaf(write_value(V, PP)).
+
+write_an_atom(A, PP) ->
+ flat_leaf(write_atom(A, PP)).
+
write_a_char(C, PP) ->
flat_leaf(write_char(C, PP)).
@@ -1124,7 +1159,7 @@ write_a_string([], _N, _Len, _PP) ->
write_a_string(S, N, Len, PP) ->
SS = string:sub_string(S, 1, N),
Sl = write_string(SS, PP),
- case (length(Sl) > Len) and (N > ?MIN_SUBSTRING) of
+ case (chars_size(Sl) > Len) and (N > ?MIN_SUBSTRING) of
true ->
write_a_string(S, N-1, Len, PP);
false ->
@@ -1136,11 +1171,17 @@ flat_leaf(S) ->
L = lists:flatten(S),
{leaf,length(L),L}.
+write_value(V, PP) ->
+ (PP#pp.value_fun)(V).
+
+write_atom(A, PP) ->
+ (PP#pp.value_fun)(A).
+
write_string(S, PP) ->
- lists:flatten((PP#pp.string_fun)(S)).
+ (PP#pp.string_fun)(S).
write_char(C, PP) ->
- lists:flatten((PP#pp.char_fun)(C)).
+ (PP#pp.char_fun)(C).
%%
%% Utilities
diff --git a/lib/stdlib/src/erl_tar.erl b/lib/stdlib/src/erl_tar.erl
index 086e77cd28..168ea4002c 100644
--- a/lib/stdlib/src/erl_tar.erl
+++ b/lib/stdlib/src/erl_tar.erl
@@ -69,6 +69,8 @@ format_error(invalid_gnu_1_0_sparsemap) ->
"Invalid GNU sparse map (version 1.0)";
format_error({invalid_gnu_0_1_sparsemap, Format}) ->
lists:flatten(io_lib:format("Invalid GNU sparse map (version ~s)", [Format]));
+format_error(unsafe_path) ->
+ "The path points above the current working directory";
format_error({Name,Reason}) ->
lists:flatten(io_lib:format("~ts: ~ts", [Name,format_error(Reason)]));
format_error(Atom) when is_atom(Atom) ->
@@ -120,26 +122,38 @@ do_extract(Handle, Opts) when is_list(Opts) ->
extract1(eof, Reader, _, Acc) when is_list(Acc) ->
{ok, {ok, lists:reverse(Acc)}, Reader};
+extract1(eof, Reader, _, leading_slash) ->
+ error_logger:info_msg("erl_tar: removed leading '/' from member names\n"),
+ {ok, ok, Reader};
extract1(eof, Reader, _, Acc) ->
{ok, Acc, Reader};
-extract1(#tar_header{name=Name,size=Size}=Header, Reader, Opts, Acc) ->
+extract1(#tar_header{name=Name,size=Size}=Header, Reader0, Opts, Acc0) ->
case check_extract(Name, Opts) of
true ->
- case do_read(Reader, Size) of
- {ok, Bin, Reader2} ->
- case write_extracted_element(Header, Bin, Opts) of
- ok ->
- {ok, Acc, Reader2};
- {ok, NameBin} when is_list(Acc) ->
- {ok, [NameBin | Acc], Reader2};
- {error, _} = Err ->
- throw(Err)
- end;
+ case do_read(Reader0, Size) of
+ {ok, Bin, Reader1} ->
+ Acc = extract2(Header, Bin, Opts, Acc0),
+ {ok, Acc, Reader1};
{error, _} = Err ->
throw(Err)
end;
false ->
- {ok, Acc, skip_file(Reader)}
+ {ok, Acc0, skip_file(Reader0)}
+ end.
+
+extract2(Header, Bin, Opts, Acc) ->
+ case write_extracted_element(Header, Bin, Opts) of
+ ok ->
+ case Header of
+ #tar_header{name="/"++_} ->
+ leading_slash;
+ #tar_header{} ->
+ Acc
+ end;
+ {ok, NameBin} when is_list(Acc) ->
+ [NameBin | Acc];
+ {error, _} = Err ->
+ throw(Err)
end.
%% Checks if the file Name should be extracted.
@@ -1052,14 +1066,11 @@ unpack_modern(Format, #header_v7{}=V7, Bin, #tar_header{}=Header0)
safe_join_path([], Name) ->
- strip_slashes(Name, both);
+ filename:join([Name]);
safe_join_path(Prefix, []) ->
- strip_slashes(Prefix, right);
+ filename:join([Prefix]);
safe_join_path(Prefix, Name) ->
- filename:join(strip_slashes(Prefix, right), strip_slashes(Name, both)).
-
-strip_slashes(Str, Direction) ->
- string:strip(Str, Direction, $/).
+ filename:join(Prefix, Name).
new_sparse_file_reader(Reader, Sparsemap, RealSize) ->
true = validate_sparse_entries(Sparsemap, RealSize),
@@ -1321,7 +1332,11 @@ foldl_read(TarName, Fun, Accu, #read_opts{}=Opts)
when is_function(Fun,4) ->
try open(TarName, [read|Opts#read_opts.open_mode]) of
{ok, #reader{access=read}=Reader} ->
- foldl_read(Reader, Fun, Accu, Opts);
+ try
+ foldl_read(Reader, Fun, Accu, Opts)
+ after
+ _ = close(Reader)
+ end;
{error, _} = Err ->
Err
catch
@@ -1553,7 +1568,7 @@ write_extracted_element(#tar_header{name=Name,typeflag=Type},
ok
end;
write_extracted_element(#tar_header{name=Name0}=Header, Bin, Opts) ->
- Name1 = filename:absname(Name0, Opts#read_opts.cwd),
+ Name1 = make_safe_path(Name0, Opts),
Created =
case typeflag(Header#tar_header.typeflag) of
regular ->
@@ -1581,6 +1596,16 @@ write_extracted_element(#tar_header{name=Name0}=Header, Bin, Opts) ->
not_written -> ok
end.
+make_safe_path([$/|Path], Opts) ->
+ make_safe_path(Path, Opts);
+make_safe_path(Path, #read_opts{cwd=Cwd}) ->
+ case filename:safe_relative_path(Path) of
+ unsafe ->
+ throw({error,{Path,unsafe_path}});
+ SafePath ->
+ filename:absname(SafePath, Cwd)
+ end.
+
create_regular(Name, NameInArchive, Bin, Opts) ->
case write_extracted_file(Name, Bin, Opts) of
not_written ->
diff --git a/lib/stdlib/src/escript.erl b/lib/stdlib/src/escript.erl
index c42ae981e7..6e8f780f7c 100644
--- a/lib/stdlib/src/escript.erl
+++ b/lib/stdlib/src/escript.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2007-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2007-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -629,8 +629,7 @@ parse_source(S, File, Fd, StartLine, HeaderSz, CheckOnly) ->
{error, _} ->
epp_parse_file2(Epp, S2, [FileForm], OptModRes);
{eof, LastLine} ->
- Anno = anno(LastLine),
- S#state{forms_or_bin = [FileForm, {eof, Anno}]}
+ S#state{forms_or_bin = [FileForm, {eof, LastLine}]}
end,
ok = epp:close(Epp),
ok = file:close(Fd),
@@ -728,8 +727,7 @@ epp_parse_file2(Epp, S, Forms, Parsed) ->
[S#state.file,Ln,Mod:format_error(Args)]),
epp_parse_file(Epp, S#state{n_errors = S#state.n_errors + 1}, [Form | Forms]);
{eof, LastLine} ->
- Anno = anno(LastLine),
- S#state{forms_or_bin = lists:reverse([{eof, Anno} | Forms])}
+ S#state{forms_or_bin = lists:reverse([{eof, LastLine} | Forms])}
end.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/lib/stdlib/src/ets.erl b/lib/stdlib/src/ets.erl
index d6fd1e3ea1..195a407570 100644
--- a/lib/stdlib/src/ets.erl
+++ b/lib/stdlib/src/ets.erl
@@ -70,15 +70,33 @@
match_object/2, match_object/3, match_spec_compile/1,
match_spec_run_r/3, member/2, new/2, next/2, prev/2,
rename/2, safe_fixtable/2, select/1, select/2, select/3,
- select_count/2, select_delete/2, select_reverse/1,
+ select_count/2, select_delete/2, select_replace/2, select_reverse/1,
select_reverse/2, select_reverse/3, setopts/2, slot/2,
take/2,
update_counter/3, update_counter/4, update_element/3]).
+%% internal exports
+-export([internal_request_all/0]).
+
-spec all() -> [Tab] when
Tab :: tab().
all() ->
+ receive_all(ets:internal_request_all(),
+ erlang:system_info(schedulers),
+ []).
+
+receive_all(_Ref, 0, All) ->
+ All;
+receive_all(Ref, N, All) ->
+ receive
+ {Ref, SchedAll} ->
+ receive_all(Ref, N-1, SchedAll ++ All)
+ end.
+
+-spec internal_request_all() -> reference().
+
+internal_request_all() ->
erlang:nif_error(undef).
-spec delete(Tab) -> true when
@@ -361,6 +379,14 @@ select_count(_, _) ->
select_delete(_, _) ->
erlang:nif_error(undef).
+-spec select_replace(Tab, MatchSpec) -> NumReplaced when
+ Tab :: tab(),
+ MatchSpec :: match_spec(),
+ NumReplaced :: non_neg_integer().
+
+select_replace(_, _) ->
+ erlang:nif_error(undef).
+
-spec select_reverse(Tab, MatchSpec) -> [Match] when
Tab :: tab(),
MatchSpec :: match_spec(),
diff --git a/lib/stdlib/src/io_lib.erl b/lib/stdlib/src/io_lib.erl
index a91143a764..28e5007e5a 100644
--- a/lib/stdlib/src/io_lib.erl
+++ b/lib/stdlib/src/io_lib.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -68,8 +68,8 @@
-export([write_atom/1,write_string/1,write_string/2,write_latin1_string/1,
write_latin1_string/2, write_char/1, write_latin1_char/1]).
--export([write_string_as_latin1/1, write_string_as_latin1/2,
- write_char_as_latin1/1]).
+-export([write_atom_as_latin1/1, write_string_as_latin1/1,
+ write_string_as_latin1/2, write_char_as_latin1/1]).
-export([quote_atom/2, char_list/1, latin1_char_list/1,
deep_char_list/1, deep_latin1_char_list/1,
@@ -344,6 +344,11 @@ write_binary_body(B, _D) ->
<<X:L>> = B,
[integer_to_list(X),$:,integer_to_list(L)].
+%%% There are two functions to write Unicode atoms:
+%%% - they both escape control characters < 160;
+%%% - write_atom() never escapes characters >= 160;
+%%% - write_atom_as_latin1() also escapes characters >= 255.
+
%% write_atom(Atom) -> [Char]
%% Generate the list of characters needed to print an atom.
@@ -351,17 +356,26 @@ write_binary_body(B, _D) ->
Atom :: atom().
write_atom(Atom) ->
+ write_possibly_quoted_atom(Atom, fun write_string/2).
+
+-spec write_atom_as_latin1(Atom) -> latin1_string() when
+ Atom :: atom().
+
+write_atom_as_latin1(Atom) ->
+ write_possibly_quoted_atom(Atom, fun write_string_as_latin1/2).
+
+write_possibly_quoted_atom(Atom, PFun) ->
Chars = atom_to_list(Atom),
case quote_atom(Atom, Chars) of
true ->
- write_string(Chars, $'); %'
+ PFun(Chars, $'); %'
false ->
Chars
end.
%% quote_atom(Atom, CharList)
%% Return 'true' if atom with chars in CharList needs to be quoted, else
-%% return 'false'.
+%% return 'false'. Notice that characters >= 160 are always quoted.
-spec quote_atom(atom(), chars()) -> boolean().
diff --git a/lib/stdlib/src/io_lib_pretty.erl b/lib/stdlib/src/io_lib_pretty.erl
index aabccfc5d9..ff368d02da 100644
--- a/lib/stdlib/src/io_lib_pretty.erl
+++ b/lib/stdlib/src/io_lib_pretty.erl
@@ -105,6 +105,8 @@ print(_, _, _, 0, _M, _RF, _Enc, _Str) -> "...";
print(Term, Col, Ll, D, M, RecDefFun, Enc, Str) when Col =< 0 ->
%% ensure Col is at least 1
print(Term, 1, Ll, D, M, RecDefFun, Enc, Str);
+print(Atom, _Col, _Ll, _D, _M, _RF, Enc, _Str) when is_atom(Atom) ->
+ write_atom(Atom, Enc);
print(Term, Col, Ll, D, M0, RecDefFun, Enc, Str) when is_tuple(Term);
is_list(Term);
is_map(Term);
@@ -407,6 +409,9 @@ print_length({}, _D, _RF, _Enc, _Str) ->
{"{}", 2};
print_length(#{}=M, _D, _RF, _Enc, _Str) when map_size(M) =:= 0 ->
{"#{}", 3};
+print_length(Atom, _D, _RF, Enc, _Str) when is_atom(Atom) ->
+ S = write_atom(Atom, Enc),
+ {S, lists:flatlength(S)};
print_length(List, D, RF, Enc, Str) when is_list(List) ->
%% only flat lists are "printable"
case Str andalso printable_list(List, D, Enc) of
@@ -500,7 +505,7 @@ print_length_tuple(Tuple, D, RF, Enc, Str) ->
print_length_record(_Tuple, 1, _RF, _RDefs, _Enc, _Str) ->
{"{...}", 5};
print_length_record(Tuple, D, RF, RDefs, Enc, Str) ->
- Name = [$# | io_lib:write_atom(element(1, Tuple))],
+ Name = [$# | write_atom(element(1, Tuple), Enc)],
NameL = length(Name),
Elements = tl(tuple_to_list(Tuple)),
L = print_length_fields(RDefs, D - 1, Elements, RF, Enc, Str),
@@ -515,7 +520,7 @@ print_length_fields([Def | Defs], D, [E | Es], RF, Enc, Str) ->
print_length_fields(Defs, D - 1, Es, RF, Enc, Str)].
print_length_field(Def, D, E, RF, Enc, Str) ->
- Name = io_lib:write_atom(Def),
+ Name = write_atom(Def, Enc),
{S, L} = print_length(E, D, RF, Enc, Str),
NameL = length(Name) + 3,
{{field, Name, NameL, {S, L}}, NameL + L}.
@@ -664,6 +669,11 @@ printable_char(C,unicode) ->
C > 16#DFFF andalso C < 16#FFFE orelse
C > 16#FFFF andalso C =< 16#10FFFF.
+write_atom(A, latin1) ->
+ io_lib:write_atom_as_latin1(A);
+write_atom(A, _Uni) ->
+ io_lib:write_atom(A).
+
write_string(S, latin1) ->
io_lib:write_latin1_string(S, $"); %"
write_string(S, _Uni) ->
diff --git a/lib/stdlib/src/otp_internal.erl b/lib/stdlib/src/otp_internal.erl
index 2a0e3118d0..d89ff4a624 100644
--- a/lib/stdlib/src/otp_internal.erl
+++ b/lib/stdlib/src/otp_internal.erl
@@ -55,6 +55,11 @@ obsolete_1(erlang, now, 0) ->
obsolete_1(calendar, local_time_to_universal_time, 1) ->
{deprecated, {calendar, local_time_to_universal_time_dst, 1}};
+%% *** CRYPTO added in OTP 20 ***
+
+obsolete_1(crypto, rand_uniform, 2) ->
+ {deprecated, {rand, uniform, 1}};
+
%% *** CRYPTO added in OTP 19 ***
obsolete_1(crypto, rand_bytes, 1) ->
@@ -63,178 +68,178 @@ obsolete_1(crypto, rand_bytes, 1) ->
%% *** CRYPTO added in R16B01 ***
obsolete_1(crypto, md4, 1) ->
- {deprecated, {crypto, hash, 2}};
+ {removed, {crypto, hash, 2}, "20.0"};
obsolete_1(crypto, md5, 1) ->
- {deprecated, {crypto, hash, 2}};
+ {removed, {crypto, hash, 2}, "20.0"};
obsolete_1(crypto, sha, 1) ->
- {deprecated, {crypto, hash, 2}};
+ {removed, {crypto, hash, 2}, "20.0"};
obsolete_1(crypto, md4_init, 0) ->
- {deprecated, {crypto, hash_init, 1}};
+ {removed, {crypto, hash_init, 1}, "20.0"};
obsolete_1(crypto, md5_init, 0) ->
- {deprecated, {crypto, hash_init, 1}};
+ {removed, {crypto, hash_init, 1}, "20.0"};
obsolete_1(crypto, sha_init, 0) ->
- {deprecated, {crypto, hash_init, 1}};
+ {removed, {crypto, hash_init, 1}, "20.0"};
obsolete_1(crypto, md4_update, 2) ->
- {deprecated, {crypto, hash_update, 2}};
+ {removed, {crypto, hash_update, 2}, "20.0"};
obsolete_1(crypto, md5_update, 2) ->
- {deprecated, {crypto, hash_update, 2}};
+ {removed, {crypto, hash_update, 2}, "20.0"};
obsolete_1(crypto, sha_update, 2) ->
- {deprecated, {crypto, hash_update, 2}};
+ {removed, {crypto, hash_update, 2}, "20.0"};
obsolete_1(crypto, md4_final, 1) ->
- {deprecated, {crypto, hash_final, 1}};
+ {removed, {crypto, hash_final, 1}, "20.0"};
obsolete_1(crypto, md5_final, 1) ->
- {deprecated, {crypto, hash_final, 1}};
+ {removed, {crypto, hash_final, 1}, "20.0"};
obsolete_1(crypto, sha_final, 1) ->
- {deprecated, {crypto, hash_final, 1}};
+ {removed, {crypto, hash_final, 1}, "20.0"};
obsolete_1(crypto, md5_mac, 2) ->
- {deprecated, {crypto, hmac, 3}};
+ {removed, {crypto, hmac, 3}, "20.0"};
obsolete_1(crypto, sha_mac, 2) ->
- {deprecated, {crypto, hmac, 3}};
+ {removed, {crypto, hmac, 3}, "20.0"};
obsolete_1(crypto, sha_mac, 3) ->
- {deprecated, {crypto, hmac, 4}};
+ {removed, {crypto, hmac, 4}, "20.0"};
obsolete_1(crypto, sha_mac_96, 2) ->
- {deprecated, {crypto, hmac, 4}};
+ {removed, {crypto, hmac, 4}, "20.0"};
obsolete_1(crypto, md5_mac_96, 2) ->
- {deprecated, {crypto, hmac, 4}};
+ {removed, {crypto, hmac, 4}, "20.0"};
obsolete_1(crypto, rsa_sign, 2) ->
- {deprecated, {crypto, sign, 4}};
+ {removed, {crypto, sign, 4}, "20.0"};
obsolete_1(crypto, rsa_sign, 3) ->
- {deprecated, {crypto, sign, 4}};
+ {removed, {crypto, sign, 4}, "20.0"};
obsolete_1(crypto, rsa_verify, 3) ->
- {deprecated, {crypto, verify, 5}};
+ {removed, {crypto, verify, 5}, "20.0"};
obsolete_1(crypto, rsa_verify, 4) ->
- {deprecated, {crypto, verify, 5}};
+ {removed, {crypto, verify, 5}, "20.0"};
obsolete_1(crypto, dss_sign, 2) ->
- {deprecated, {crypto, sign, 4}};
+ {removed, {crypto, sign, 4}, "20.0"};
obsolete_1(crypto, dss_sign, 3) ->
- {deprecated, {crypto, sign, 4}};
+ {removed, {crypto, sign, 4}, "20.0"};
obsolete_1(crypto, dss_verify, 3) ->
- {deprecated, {crypto, verify, 5}};
+ {removed, {crypto, verify, 5}, "20.0"};
obsolete_1(crypto, dss_verify, 4) ->
- {deprecated, {crypto, verify, 5}};
+ {removed, {crypto, verify, 5}, "20.0"};
obsolete_1(crypto, mod_exp, 3) ->
- {deprecated, {crypto, mod_pow, 3}};
+ {removed, {crypto, mod_pow, 3}, "20.0"};
obsolete_1(crypto, dh_compute_key, 3) ->
- {deprecated, {crypto, compute_key, 4}};
+ {removed, {crypto, compute_key, 4}, "20.0"};
obsolete_1(crypto, dh_generate_key, 1) ->
- {deprecated, {crypto, generate_key, 2}};
+ {removed, {crypto, generate_key, 2}, "20.0"};
obsolete_1(crypto, dh_generate_key, 2) ->
- {deprecated, {crypto, generate_key, 3}};
+ {removed, {crypto, generate_key, 3}, "20.0"};
obsolete_1(crypto, des_cbc_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, des3_cbc_encrypt, 5) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, des_ecb_encrypt, 2) ->
- {deprecated, {crypto, block_encrypt, 3}};
+ {removed, {crypto, block_encrypt, 3}, "20.0"};
obsolete_1(crypto, des_ede3_cbc_encrypt, 5) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, des_cfb_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, des3_cfb_encrypt, 5) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_ecb_encrypt, 2) ->
- {deprecated, {crypto, block_encrypt, 3}};
+ {removed, {crypto, block_encrypt, 3}, "20.0"};
obsolete_1(crypto, blowfish_cbc_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_cfb64_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_ofb64_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cfb_128_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cbc_128_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cbc_256_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto,rc2_cbc_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto,rc2_40_cbc_encrypt, 3) ->
- {deprecated, {crypto, block_encrypt, 4}};
+ {removed, {crypto, block_encrypt, 4}, "20.0"};
obsolete_1(crypto, des_cbc_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, des3_cbc_decrypt, 5) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, des_ecb_decrypt, 2) ->
- {deprecated, {crypto, block_decrypt, 3}};
+ {removed, {crypto, block_decrypt, 3}, "20.0"};
obsolete_1(crypto, des_ede3_cbc_decrypt, 5) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, des_cfb_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, des3_cfb_decrypt, 5) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_ecb_decrypt, 2) ->
- {deprecated, {crypto, block_decrypt, 3}};
+ {removed, {crypto, block_decrypt, 3}, "20.0"};
obsolete_1(crypto, blowfish_cbc_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_cfb64_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, blowfish_ofb64_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cfb_128_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cbc_128_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, aes_cbc_256_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto,rc2_cbc_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto,rc2_40_cbc_decrypt, 3) ->
- {deprecated, {crypto, block_decrypt, 4}};
+ {removed, {crypto, block_decrypt, 4}, "20.0"};
obsolete_1(crypto, aes_ctr_stream_decrypt, 2) ->
- {deprecated, {crypto, stream_decrypt, 2}};
+ {removed, {crypto, stream_decrypt, 2}, "20.0"};
obsolete_1(crypto, aes_ctr_stream_encrypt, 2) ->
- {deprecated, {crypto, stream_encrypt, 2}};
+ {removed, {crypto, stream_encrypt, 2}, "20.0"};
obsolete_1(crypto, aes_ctr_decrypt, 3) ->
- {deprecated, {crypto, stream_decrypt, 2}};
+ {removed, {crypto, stream_decrypt, 2}, "20.0"};
obsolete_1(crypto, aes_ctr_encrypt, 3) ->
- {deprecated, {crypto, stream_encrypt, 2}};
+ {removed, {crypto, stream_encrypt, 2}, "20.0"};
obsolete_1(crypto, rc4_encrypt, 2) ->
- {deprecated, {crypto, stream_encrypt, 2}};
+ {removed, {crypto, stream_encrypt, 2}, "20.0"};
obsolete_1(crypto, rc4_encrypt_with_state, 2) ->
- {deprecated, {crypto, stream_encrypt, 2}};
+ {removed, {crypto, stream_encrypt, 2}, "20.0"};
obsolete_1(crypto, aes_ctr_stream_init, 2) ->
- {deprecated, {crypto, stream_init, 3}};
+ {removed, {crypto, stream_init, 3}, "20.0"};
obsolete_1(crypto, rc4_set_key, 1) ->
- {deprecated, {crypto, stream_init, 2}};
+ {removed, {crypto, stream_init, 2}, "20.0"};
obsolete_1(crypto, rsa_private_decrypt, 3) ->
- {deprecated, {crypto, private_decrypt, 4}};
+ {removed, {crypto, private_decrypt, 4}, "20.0"};
obsolete_1(crypto, rsa_public_decrypt, 3) ->
- {deprecated, {crypto, public_decrypt, 4}};
+ {removed, {crypto, public_decrypt, 4}, "20.0"};
obsolete_1(crypto, rsa_private_encrypt, 3) ->
- {deprecated, {crypto, private_encrypt, 4}};
+ {removed, {crypto, private_encrypt, 4}, "20.0"};
obsolete_1(crypto, rsa_public_encrypt, 3) ->
- {deprecated, {crypto, public_encrypt, 4}};
+ {removed, {crypto, public_encrypt, 4}, "20.0"};
obsolete_1(crypto, des_cfb_ivec, 2) ->
- {deprecated, {crypto, next_iv, 3}};
+ {removed, {crypto, next_iv, 3}, "20.0"};
obsolete_1(crypto,des_cbc_ivec, 1) ->
- {deprecated, {crypto, next_iv, 2}};
+ {removed, {crypto, next_iv, 2}, "20.0"};
obsolete_1(crypto, aes_cbc_ivec, 1) ->
- {deprecated, {crypto, next_iv, 2}};
+ {removed, {crypto, next_iv, 2}, "20.0"};
obsolete_1(crypto,info, 0) ->
- {deprecated, {crypto, module_info, 0}};
+ {removed, {crypto, module_info, 0}, "20.0"};
obsolete_1(crypto, strong_rand_mpint, 3) ->
- {deprecated, "needed only by deprecated functions"};
+ {removed, "removed in 20.0; only needed by removed functions"};
obsolete_1(crypto, erlint, 1) ->
- {deprecated, "needed only by deprecated functions"};
+ {removed, "removed in 20.0; only needed by removed functions"};
obsolete_1(crypto, mpint, 1) ->
- {deprecated, "needed only by deprecated functions"};
+ {removed, "removed in 20.0; only needed by removed functions"};
%% *** SNMP ***
@@ -387,13 +392,13 @@ obsolete_1(erlang, concat_binary, 1) ->
%% Added in R14A.
obsolete_1(ssl, peercert, 2) ->
- {deprecated,"deprecated (will be removed in R15A); use ssl:peercert/1 and public_key:pkix_decode_cert/2 instead"};
+ {removed ,"removed in R15A; use ssl:peercert/1 and public_key:pkix_decode_cert/2 instead"};
%% Added in R14B.
obsolete_1(public_key, pem_to_der, 1) ->
- {deprecated,"deprecated (will be removed in R15A); use file:read_file/1 and public_key:pem_decode/1"};
+ {removed,"removed in R15A; use file:read_file/1 and public_key:pem_decode/1"};
obsolete_1(public_key, decode_private_key, A) when A =:= 1; A =:= 2 ->
- {deprecated,{public_key,pem_entry_decode,1},"R15A"};
+ {removed, "removed in R15A; use public_key:pem_entry_decode/1"};
%% Added in R14B03.
obsolete_1(docb_gen, _, _) ->
@@ -415,10 +420,10 @@ obsolete_1(inviso, _, _) ->
obsolete_1(gs, _, _) ->
{removed,"the gs application has been removed; use the wx application instead"};
obsolete_1(ssh, sign_data, 2) ->
- {deprecated,"deprecated (will be removed in R16A); use public_key:pem_decode/1, public_key:pem_entry_decode/1 "
+ {removed,"removed in R16A; use public_key:pem_decode/1, public_key:pem_entry_decode/1 "
"and public_key:sign/3 instead"};
obsolete_1(ssh, verify_data, 3) ->
- {deprecated,"deprecated (will be removed in R16A); use public_key:ssh_decode/1, and public_key:verify/4 instead"};
+ {removed,"removed in R16A; use public_key:ssh_decode/1, and public_key:verify/4 instead"};
%% Added in R16
obsolete_1(wxCalendarCtrl, enableYearChange, _) -> %% wx bug documented?
@@ -515,10 +520,9 @@ obsolete_1(erl_parse, get_attribute, 2) ->
obsolete_1(erl_lint, modify_line, 2) ->
{removed,{erl_parse,map_anno,2},"19.0"};
obsolete_1(ssl, negotiated_next_protocol, 1) ->
- {deprecated,{ssl,negotiated_protocol,1}};
-
+ {removed,"removed in 20.0; use ssl:negotiated_protocol/1 instead"};
obsolete_1(ssl, connection_info, 1) ->
- {deprecated, "deprecated; use connection_information/[1,2] instead"};
+ {removed, "removed in 20.0; use ssl:connection_information/[1,2] instead"};
obsolete_1(httpd_conf, check_enum, 2) ->
{deprecated, "deprecated; use lists:member/2 instead"};
@@ -548,7 +552,7 @@ obsolete_1(queue, lait, 1) ->
obsolete_1(overload, _, _) ->
{removed, "removed in OTP 19"};
obsolete_1(rpc, safe_multi_server_call, A) when A =:= 2; A =:= 3 ->
- {removed, {rpc, multi_server_call, A}};
+ {removed, {rpc, multi_server_call, A}, "removed in OTP 19"};
%% Added in OTP 20.
diff --git a/lib/stdlib/src/qlc_pt.erl b/lib/stdlib/src/qlc_pt.erl
index 28221ea75f..4a39f8ae9d 100644
--- a/lib/stdlib/src/qlc_pt.erl
+++ b/lib/stdlib/src/qlc_pt.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -439,7 +439,7 @@ compile_forms(Forms0, Options) ->
(_) -> false
end,
Forms = ([F || F <- Forms0, not Exclude(element(1, F))]
- ++ [{eof,anno0()}]),
+ ++ [{eof,0}]),
try
case compile:noenv_forms(Forms, compile_options(Options)) of
{ok, _ModName, Ws0} ->
diff --git a/lib/stdlib/src/rand.erl b/lib/stdlib/src/rand.erl
index 1f457b9e0e..ab9731180f 100644
--- a/lib/stdlib/src/rand.erl
+++ b/lib/stdlib/src/rand.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2015-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2015-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -20,6 +20,9 @@
%% =====================================================================
%% Multiple PRNG module for Erlang/OTP
%% Copyright (c) 2015-2016 Kenji Rikitake
+%%
+%% exrop (xoroshiro116+) added and statistical distribution
+%% improvements by the Erlang/OTP team 2017
%% =====================================================================
-module(rand).
@@ -28,37 +31,179 @@
export_seed/0, export_seed_s/1,
uniform/0, uniform/1, uniform_s/1, uniform_s/2,
jump/0, jump/1,
- normal/0, normal_s/1
+ normal/0, normal/2, normal_s/1, normal_s/3
]).
-compile({inline, [exs64_next/1, exsplus_next/1,
- exsplus_jump/1,
exs1024_next/1, exs1024_calc/2,
- exs1024_jump/1,
+ exrop_next/1, exrop_next_s/2,
get_52/1, normal_kiwi/1]}).
--define(DEFAULT_ALG_HANDLER, exsplus).
+-define(DEFAULT_ALG_HANDLER, exrop).
-define(SEED_DICT, rand_seed).
%% =====================================================================
+%% Bit fiddling macros
+%% =====================================================================
+
+-define(BIT(Bits), (1 bsl (Bits))).
+-define(MASK(Bits), (?BIT(Bits) - 1)).
+-define(MASK(Bits, X), ((X) band ?MASK(Bits))).
+-define(
+ BSL(Bits, X, N),
+ %% N is evaluated 2 times
+ (?MASK((Bits)-(N), (X)) bsl (N))).
+-define(
+ ROTL(Bits, X, N),
+ %% Bits is evaluated 2 times
+ %% X is evaluated 2 times
+ %% N i evaluated 3 times
+ (?BSL((Bits), (X), (N)) bor ((X) bsr ((Bits)-(N))))).
+
+%%-define(TWO_POW_MINUS53, (math:pow(2, -53))).
+-define(TWO_POW_MINUS53, 1.11022302462515657e-16).
+
+%% =====================================================================
%% Types
%% =====================================================================
+-type uint64() :: 0..?MASK(64).
+-type uint58() :: 0..?MASK(58).
+
%% This depends on the algorithm handler function
--type alg_seed() :: exs64_state() | exsplus_state() | exs1024_state().
-%% This is the algorithm handler function within this module
--type alg_handler() :: #{type := alg(),
- max := integer(),
- next := fun(),
- uniform := fun(),
- uniform_n := fun(),
- jump := fun()}.
-
-%% Internal state
--opaque state() :: {alg_handler(), alg_seed()}.
--type alg() :: exs64 | exsplus | exs1024.
--opaque export_state() :: {alg(), alg_seed()}.
--export_type([alg/0, state/0, export_state/0]).
+-type alg_state() ::
+ exs64_state() | exsplus_state() | exs1024_state() |
+ exrop_state() | term().
+
+%% This is the algorithm handling definition within this module,
+%% and the type to use for plugins.
+%%
+%% The 'type' field must be recognized by the module that implements
+%% the algorithm, to interpret an exported state.
+%%
+%% The 'bits' field indicates how many bits the integer
+%% returned from 'next' has got, i.e 'next' shall return
+%% an random integer in the range 0..(2^Bits - 1).
+%% At least 53 bits is required for the floating point
+%% producing fallbacks. This field is only used when
+%% the 'uniform' or 'uniform_n' fields are not defined.
+%%
+%% The fields 'next', 'uniform' and 'uniform_n'
+%% implement the algorithm. If 'uniform' or 'uinform_n'
+%% is not present there is a fallback using 'next' and either
+%% 'bits' or the deprecated 'max'.
+%%
+-type alg_handler() ::
+ #{type := alg(),
+ bits => non_neg_integer(),
+ weak_low_bits => non_neg_integer(),
+ max => non_neg_integer(), % Deprecated
+ next :=
+ fun ((alg_state()) -> {non_neg_integer(), alg_state()}),
+ uniform =>
+ fun ((state()) -> {float(), state()}),
+ uniform_n =>
+ fun ((pos_integer(), state()) -> {pos_integer(), state()}),
+ jump =>
+ fun ((state()) -> state())}.
+
+%% Algorithm state
+-type state() :: {alg_handler(), alg_state()}.
+-type builtin_alg() :: exs64 | exsplus | exsp | exs1024 | exs1024s | exrop.
+-type alg() :: builtin_alg() | atom().
+-type export_state() :: {alg(), alg_state()}.
+-export_type(
+ [builtin_alg/0, alg/0, alg_handler/0, alg_state/0,
+ state/0, export_state/0]).
+-export_type(
+ [exs64_state/0, exsplus_state/0, exs1024_state/0, exrop_state/0]).
+
+%% =====================================================================
+%% Range macro and helper
+%% =====================================================================
+
+-define(
+ uniform_range(Range, Alg, R, V, MaxMinusRange, I),
+ if
+ 0 =< (MaxMinusRange) ->
+ if
+ %% Really work saving in odd cases;
+ %% large ranges in particular
+ (V) < (Range) ->
+ {(V) + 1, {(Alg), (R)}};
+ true ->
+ (I) = (V) rem (Range),
+ if
+ (V) - (I) =< (MaxMinusRange) ->
+ {(I) + 1, {(Alg), (R)}};
+ true ->
+ %% V in the truncated top range
+ %% - try again
+ ?FUNCTION_NAME((Range), {(Alg), (R)})
+ end
+ end;
+ true ->
+ uniform_range((Range), (Alg), (R), (V))
+ end).
+
+%% For ranges larger than the algorithm bit size
+uniform_range(Range, #{next:=Next, bits:=Bits} = Alg, R, V) ->
+ WeakLowBits =
+ case Alg of
+ #{weak_low_bits:=WLB} -> WLB;
+ #{} -> 0
+ end,
+ %% Maybe waste the lowest bit(s) when shifting in new bits
+ Shift = Bits - WeakLowBits,
+ ShiftMask = bnot ?MASK(WeakLowBits),
+ RangeMinus1 = Range - 1,
+ if
+ (Range band RangeMinus1) =:= 0 -> % Power of 2
+ %% Generate at least the number of bits for the range
+ {V1, R1, _} =
+ uniform_range(
+ Range bsr Bits, Next, R, V, ShiftMask, Shift, Bits),
+ {(V1 band RangeMinus1) + 1, {Alg, R1}};
+ true ->
+ %% Generate a value with at least two bits more than the range
+ %% and try that for a fit, otherwise recurse
+ %%
+ %% Just one bit more should ensure that the generated
+ %% number range is at least twice the size of the requested
+ %% range, which would make the probability to draw a good
+ %% number better than 0.5. And repeating that until
+ %% success i guess would take 2 times statistically amortized.
+ %% But since the probability for fairly many attemtpts
+ %% is not that low, use two bits more than the range which
+ %% should make the probability to draw a bad number under 0.25,
+ %% which decreases the bad case probability a lot.
+ {V1, R1, B} =
+ uniform_range(
+ Range bsr (Bits - 2), Next, R, V, ShiftMask, Shift, Bits),
+ I = V1 rem Range,
+ if
+ (V1 - I) =< (1 bsl B) - Range ->
+ {I + 1, {Alg, R1}};
+ true ->
+ %% V1 drawn from the truncated top range
+ %% - try again
+ {V2, R2} = Next(R1),
+ uniform_range(Range, Alg, R2, V2)
+ end
+ end.
+%%
+uniform_range(Range, Next, R, V, ShiftMask, Shift, B) ->
+ if
+ Range =< 1 ->
+ {V, R, B};
+ true ->
+ {V1, R1} = Next(R),
+ %% Waste the lowest bit(s) when shifting in new bits
+ uniform_range(
+ Range bsr Shift, Next, R1,
+ ((V band ShiftMask) bsl Shift) bor V1,
+ ShiftMask, Shift, B + Shift)
+ end.
%% =====================================================================
%% API
@@ -72,7 +217,7 @@ export_seed() ->
_ -> undefined
end.
--spec export_seed_s(state()) -> export_state().
+-spec export_seed_s(State :: state()) -> export_state().
export_seed_s({#{type:=Alg}, Seed}) -> {Alg, Seed}.
%% seed(Alg) seeds RNG with runtime dependent values
@@ -81,27 +226,37 @@ export_seed_s({#{type:=Alg}, Seed}) -> {Alg, Seed}.
%% seed({Alg,Seed}) setup RNG with a previously exported seed
%% and return the NEW state
--spec seed(AlgOrExpState::alg() | export_state()) -> state().
+-spec seed(
+ AlgOrStateOrExpState :: builtin_alg() | state() | export_state()) ->
+ state().
seed(Alg) ->
seed_put(seed_s(Alg)).
--spec seed_s(AlgOrExpState::alg() | export_state()) -> state().
-seed_s(Alg) when is_atom(Alg) ->
- seed_s(Alg, {erlang:phash2([{node(),self()}]),
- erlang:system_time(),
- erlang:unique_integer()});
+-spec seed_s(
+ AlgOrStateOrExpState :: builtin_alg() | state() | export_state()) ->
+ state().
+seed_s({AlgHandler, _Seed} = State) when is_map(AlgHandler) ->
+ State;
seed_s({Alg0, Seed}) ->
{Alg,_SeedFun} = mk_alg(Alg0),
- {Alg, Seed}.
+ {Alg, Seed};
+seed_s(Alg) ->
+ seed_s(Alg, {erlang:phash2([{node(),self()}]),
+ erlang:system_time(),
+ erlang:unique_integer()}).
%% seed/2: seeds RNG with the algorithm and given values
%% and returns the NEW state.
--spec seed(Alg :: alg(), {integer(), integer(), integer()}) -> state().
+-spec seed(
+ Alg :: builtin_alg(), Seed :: {integer(), integer(), integer()}) ->
+ state().
seed(Alg0, S0) ->
seed_put(seed_s(Alg0, S0)).
--spec seed_s(Alg :: alg(), {integer(), integer(), integer()}) -> state().
+-spec seed_s(
+ Alg :: builtin_alg(), Seed :: {integer(), integer(), integer()}) ->
+ state().
seed_s(Alg0, S0 = {_, _, _}) ->
{Alg, Seed} = mk_alg(Alg0),
AS = Seed(S0),
@@ -113,7 +268,7 @@ seed_s(Alg0, S0 = {_, _, _}) ->
%% uniform/0: returns a random float X where 0.0 < X < 1.0,
%% updating the state in the process dictionary.
--spec uniform() -> X::float().
+-spec uniform() -> X :: float().
uniform() ->
{X, Seed} = uniform_s(seed_get()),
_ = seed_put(Seed),
@@ -123,7 +278,7 @@ uniform() ->
%% uniform/1 returns a random integer X where 1 =< X =< N,
%% updating the state in the process dictionary.
--spec uniform(N :: pos_integer()) -> X::pos_integer().
+-spec uniform(N :: pos_integer()) -> X :: pos_integer().
uniform(N) ->
{X, Seed} = uniform_s(N, seed_get()),
_ = seed_put(Seed),
@@ -133,39 +288,64 @@ uniform(N) ->
%% returns a random float X where 0.0 < X < 1.0,
%% and a new state.
--spec uniform_s(state()) -> {X::float(), NewS :: state()}.
+-spec uniform_s(State :: state()) -> {X :: float(), NewState :: state()}.
uniform_s(State = {#{uniform:=Uniform}, _}) ->
- Uniform(State).
+ Uniform(State);
+uniform_s({#{bits:=Bits, next:=Next} = Alg, R0}) ->
+ {V, R1} = Next(R0),
+ %% Produce floats on the form N * 2^(-53)
+ {(V bsr (Bits - 53)) * ?TWO_POW_MINUS53, {Alg, R1}};
+uniform_s({#{max:=Max, next:=Next} = Alg, R0}) ->
+ {V, R1} = Next(R0),
+ %% Old broken algorithm with non-uniform density
+ {V / (Max + 1), {Alg, R1}}.
+
%% uniform_s/2: given an integer N >= 1 and a state, uniform_s/2
%% uniform_s/2 returns a random integer X where 1 =< X =< N,
%% and a new state.
--spec uniform_s(N::pos_integer(), state()) -> {X::pos_integer(), NewS::state()}.
-uniform_s(N, State = {#{uniform_n:=Uniform, max:=Max}, _})
- when 0 < N, N =< Max ->
- Uniform(N, State);
-uniform_s(N, State0 = {#{uniform:=Uniform}, _})
- when is_integer(N), 0 < N ->
- {F, State} = Uniform(State0),
- {trunc(F * N) + 1, State}.
+-spec uniform_s(N :: pos_integer(), State :: state()) ->
+ {X :: pos_integer(), NewState :: state()}.
+uniform_s(N, State = {#{uniform_n:=UniformN}, _})
+ when is_integer(N), 1 =< N ->
+ UniformN(N, State);
+uniform_s(N, {#{bits:=Bits, next:=Next} = Alg, R0})
+ when is_integer(N), 1 =< N ->
+ {V, R1} = Next(R0),
+ MaxMinusN = ?BIT(Bits) - N,
+ ?uniform_range(N, Alg, R1, V, MaxMinusN, I);
+uniform_s(N, {#{max:=Max, next:=Next} = Alg, R0})
+ when is_integer(N), 1 =< N ->
+ %% Old broken algorithm with skewed probability
+ %% and gap in ranges > Max
+ {V, R1} = Next(R0),
+ if
+ N =< Max ->
+ {(V rem N) + 1, {Alg, R1}};
+ true ->
+ F = V / (Max + 1),
+ {trunc(F * N) + 1, {Alg, R1}}
+ end.
%% jump/1: given a state, jump/1
%% returns a new state which is equivalent to that
%% after a large number of call defined for each algorithm.
%% The large number is algorithm dependent.
--spec jump(state()) -> NewS :: state().
+-spec jump(state()) -> NewState :: state().
jump(State = {#{jump:=Jump}, _}) ->
- Jump(State).
+ Jump(State);
+jump({#{}, _}) ->
+ erlang:error(not_implemented).
+
%% jump/0: read the internal state and
%% apply the jump function for the state as in jump/1
%% and write back the new value to the internal state,
%% then returns the new value.
--spec jump() -> NewS :: state().
-
+-spec jump() -> NewState :: state().
jump() ->
seed_put(jump(seed_get())).
@@ -178,14 +358,21 @@ normal() ->
_ = seed_put(Seed),
X.
+%% normal/2: returns a random float with N(μ, σ²) normal distribution
+%% updating the state in the process dictionary.
+
+-spec normal(Mean :: number(), Variance :: number()) -> float().
+normal(Mean, Variance) ->
+ Mean + (math:sqrt(Variance) * normal()).
+
%% normal_s/1: returns a random float with standard normal distribution
%% The Ziggurat Method for generating random variables - Marsaglia and Tsang
%% Paper and reference code: http://www.jstatsoft.org/v05/i08/
--spec normal_s(state()) -> {float(), NewS :: state()}.
+-spec normal_s(State :: state()) -> {float(), NewState :: state()}.
normal_s(State0) ->
{Sign, R, State} = get_52(State0),
- Idx = R band 16#FF,
+ Idx = ?MASK(8, R),
Idx1 = Idx+1,
{Ki, Wi} = normal_kiwi(Idx1),
X = R * Wi,
@@ -198,18 +385,15 @@ normal_s(State0) ->
false -> normal_s(Idx, Sign, -X, State)
end.
-%% =====================================================================
-%% Internal functions
+%% normal_s/3: returns a random float with normal N(μ, σ²) distribution
--define(UINT21MASK, 16#00000000001fffff).
--define(UINT32MASK, 16#00000000ffffffff).
--define(UINT33MASK, 16#00000001ffffffff).
--define(UINT39MASK, 16#0000007fffffffff).
--define(UINT58MASK, 16#03ffffffffffffff).
--define(UINT64MASK, 16#ffffffffffffffff).
+-spec normal_s(Mean :: number(), Variance :: number(), state()) -> {float(), NewS :: state()}.
+normal_s(Mean, Variance, State0) when Variance > 0 ->
+ {X, State} = normal_s(State0),
+ {Mean + (math:sqrt(Variance) * X), State}.
--type uint64() :: 0..16#ffffffffffffffff.
--type uint58() :: 0..16#03ffffffffffffff.
+%% =====================================================================
+%% Internal functions
-spec seed_put(state()) -> state().
seed_put(Seed) ->
@@ -224,20 +408,30 @@ seed_get() ->
%% Setup alg record
mk_alg(exs64) ->
- {#{type=>exs64, max=>?UINT64MASK, next=>fun exs64_next/1,
- uniform=>fun exs64_uniform/1, uniform_n=>fun exs64_uniform/2,
- jump=>fun exs64_jump/1},
+ {#{type=>exs64, max=>?MASK(64), next=>fun exs64_next/1},
fun exs64_seed/1};
mk_alg(exsplus) ->
- {#{type=>exsplus, max=>?UINT58MASK, next=>fun exsplus_next/1,
- uniform=>fun exsplus_uniform/1, uniform_n=>fun exsplus_uniform/2,
+ {#{type=>exsplus, max=>?MASK(58), next=>fun exsplus_next/1,
+ jump=>fun exsplus_jump/1},
+ fun exsplus_seed/1};
+mk_alg(exsp) ->
+ {#{type=>exsp, bits=>58, weak_low_bits=>1, next=>fun exsplus_next/1,
+ uniform=>fun exsp_uniform/1, uniform_n=>fun exsp_uniform/2,
jump=>fun exsplus_jump/1},
fun exsplus_seed/1};
mk_alg(exs1024) ->
- {#{type=>exs1024, max=>?UINT64MASK, next=>fun exs1024_next/1,
- uniform=>fun exs1024_uniform/1, uniform_n=>fun exs1024_uniform/2,
+ {#{type=>exs1024, max=>?MASK(64), next=>fun exs1024_next/1,
+ jump=>fun exs1024_jump/1},
+ fun exs1024_seed/1};
+mk_alg(exs1024s) ->
+ {#{type=>exs1024s, bits=>64, weak_low_bits=>3, next=>fun exs1024_next/1,
jump=>fun exs1024_jump/1},
- fun exs1024_seed/1}.
+ fun exs1024_seed/1};
+mk_alg(exrop) ->
+ {#{type=>exrop, bits=>58, weak_low_bits=>1, next=>fun exrop_next/1,
+ uniform=>fun exrop_uniform/1, uniform_n=>fun exrop_uniform/2,
+ jump=>fun exrop_jump/1},
+ fun exrop_seed/1}.
%% =====================================================================
%% exs64 PRNG: Xorshift64*
@@ -245,32 +439,21 @@ mk_alg(exs1024) ->
%% Reference URL: http://xorshift.di.unimi.it/
%% =====================================================================
--type exs64_state() :: uint64().
+-opaque exs64_state() :: uint64().
exs64_seed({A1, A2, A3}) ->
- {V1, _} = exs64_next(((A1 band ?UINT32MASK) * 4294967197 + 1)),
- {V2, _} = exs64_next(((A2 band ?UINT32MASK) * 4294967231 + 1)),
- {V3, _} = exs64_next(((A3 band ?UINT32MASK) * 4294967279 + 1)),
- ((V1 * V2 * V3) rem (?UINT64MASK - 1)) + 1.
+ {V1, _} = exs64_next((?MASK(32, A1) * 4294967197 + 1)),
+ {V2, _} = exs64_next((?MASK(32, A2) * 4294967231 + 1)),
+ {V3, _} = exs64_next((?MASK(32, A3) * 4294967279 + 1)),
+ ((V1 * V2 * V3) rem (?MASK(64) - 1)) + 1.
%% Advance xorshift64* state for one step and generate 64bit unsigned integer
-spec exs64_next(exs64_state()) -> {uint64(), exs64_state()}.
exs64_next(R) ->
R1 = R bxor (R bsr 12),
- R2 = R1 bxor ((R1 band ?UINT39MASK) bsl 25),
+ R2 = R1 bxor ?BSL(64, R1, 25),
R3 = R2 bxor (R2 bsr 27),
- {(R3 * 2685821657736338717) band ?UINT64MASK, R3}.
-
-exs64_uniform({Alg, R0}) ->
- {V, R1} = exs64_next(R0),
- {V / 18446744073709551616, {Alg, R1}}.
-
-exs64_uniform(Max, {Alg, R}) ->
- {V, R1} = exs64_next(R),
- {(V rem Max) + 1, {Alg, R1}}.
-
-exs64_jump(_) ->
- erlang:error(not_implemented).
+ {?MASK(64, R3 * 2685821657736338717), R3}.
%% =====================================================================
%% exsplus PRNG: Xorshift116+
@@ -280,15 +463,17 @@ exs64_jump(_) ->
%% Modification of the original Xorshift128+ algorithm to 116
%% by Sebastiano Vigna, a lot of thanks for his help and work.
%% =====================================================================
--type exsplus_state() :: nonempty_improper_list(uint58(), uint58()).
+-opaque exsplus_state() :: nonempty_improper_list(uint58(), uint58()).
-dialyzer({no_improper_lists, exsplus_seed/1}).
exsplus_seed({A1, A2, A3}) ->
- {_, R1} = exsplus_next([(((A1 * 4294967197) + 1) band ?UINT58MASK)|
- (((A2 * 4294967231) + 1) band ?UINT58MASK)]),
- {_, R2} = exsplus_next([(((A3 * 4294967279) + 1) band ?UINT58MASK)|
- tl(R1)]),
+ {_, R1} = exsplus_next(
+ [?MASK(58, (A1 * 4294967197) + 1)|
+ ?MASK(58, (A2 * 4294967231) + 1)]),
+ {_, R2} = exsplus_next(
+ [?MASK(58, (A3 * 4294967279) + 1)|
+ tl(R1)]),
R2.
-dialyzer({no_improper_lists, exsplus_next/1}).
@@ -297,17 +482,22 @@ exsplus_seed({A1, A2, A3}) ->
-spec exsplus_next(exsplus_state()) -> {uint58(), exsplus_state()}.
exsplus_next([S1|S0]) ->
%% Note: members s0 and s1 are swapped here
- S11 = (S1 bxor (S1 bsl 24)) band ?UINT58MASK,
+ S11 = S1 bxor ?BSL(58, S1, 24),
S12 = S11 bxor S0 bxor (S11 bsr 11) bxor (S0 bsr 41),
- {(S0 + S12) band ?UINT58MASK, [S0|S12]}.
+ {?MASK(58, S0 + S12), [S0|S12]}.
-exsplus_uniform({Alg, R0}) ->
+
+exsp_uniform({Alg, R0}) ->
{I, R1} = exsplus_next(R0),
- {I / (?UINT58MASK+1), {Alg, R1}}.
+ %% Waste the lowest bit since it is of lower
+ %% randomness quality than the others
+ {(I bsr (58-53)) * ?TWO_POW_MINUS53, {Alg, R1}}.
-exsplus_uniform(Max, {Alg, R}) ->
+exsp_uniform(Range, {Alg, R}) ->
{V, R1} = exsplus_next(R),
- {(V rem Max) + 1, {Alg, R1}}.
+ MaxMinusRange = ?BIT(58) - Range,
+ ?uniform_range(Range, Alg, R1, V, MaxMinusRange, I).
+
%% This is the jump function for the exsplus generator, equivalent
%% to 2^64 calls to next/1; it can be used to generate 2^52
@@ -335,7 +525,7 @@ exsplus_jump(S, AS, _, 0) ->
{S, AS};
exsplus_jump(S, [AS0|AS1], J, N) ->
{_, NS} = exsplus_next(S),
- case (J band 1) of
+ case ?MASK(1, J) of
1 ->
[S0|S1] = S,
exsplus_jump(NS, [(AS0 bxor S0)|(AS1 bxor S1)], J bsr 1, N-1);
@@ -349,12 +539,12 @@ exsplus_jump(S, [AS0|AS1], J, N) ->
%% Reference URL: http://xorshift.di.unimi.it/
%% =====================================================================
--type exs1024_state() :: {list(uint64()), list(uint64())}.
+-opaque exs1024_state() :: {list(uint64()), list(uint64())}.
exs1024_seed({A1, A2, A3}) ->
- B1 = (((A1 band ?UINT21MASK) + 1) * 2097131) band ?UINT21MASK,
- B2 = (((A2 band ?UINT21MASK) + 1) * 2097133) band ?UINT21MASK,
- B3 = (((A3 band ?UINT21MASK) + 1) * 2097143) band ?UINT21MASK,
+ B1 = ?MASK(21, (?MASK(21, A1) + 1) * 2097131),
+ B2 = ?MASK(21, (?MASK(21, A2) + 1) * 2097133),
+ B3 = ?MASK(21, (?MASK(21, A3) + 1) * 2097143),
{exs1024_gen1024((B1 bsl 43) bor (B2 bsl 22) bor (B3 bsl 1) bor 1),
[]}.
@@ -377,11 +567,11 @@ exs1024_gen1024(N, R, L) ->
%% X: random number output
-spec exs1024_calc(uint64(), uint64()) -> {uint64(), uint64()}.
exs1024_calc(S0, S1) ->
- S11 = S1 bxor ((S1 band ?UINT33MASK) bsl 31),
+ S11 = S1 bxor ?BSL(64, S1, 31),
S12 = S11 bxor (S11 bsr 11),
S01 = S0 bxor (S0 bsr 30),
NS1 = S01 bxor S12,
- {(NS1 * 1181783497276652981) band ?UINT64MASK, NS1}.
+ {?MASK(64, NS1 * 1181783497276652981), NS1}.
%% Advance xorshift1024* state for one step and generate 64bit unsigned integer
-spec exs1024_next(exs1024_state()) -> {uint64(), exs1024_state()}.
@@ -392,13 +582,6 @@ exs1024_next({[H], RL}) ->
NL = [H|lists:reverse(RL)],
exs1024_next({NL, []}).
-exs1024_uniform({Alg, R0}) ->
- {V, R1} = exs1024_next(R0),
- {V / 18446744073709551616, {Alg, R1}}.
-
-exs1024_uniform(Max, {Alg, R}) ->
- {V, R1} = exs1024_next(R),
- {(V rem Max) + 1, {Alg, R1}}.
%% This is the jump function for the exs1024 generator, equivalent
%% to 2^512 calls to next(); it can be used to generate 2^512
@@ -445,7 +628,7 @@ exs1024_jump(S, AS, [H|T], _, 0, TN) ->
exs1024_jump(S, AS, T, H, ?JUMPELEMLEN, TN);
exs1024_jump({L, RL}, AS, JL, J, N, TN) ->
{_, NS} = exs1024_next({L, RL}),
- case (J band 1) of
+ case ?MASK(1, J) of
1 ->
AS2 = lists:zipwith(fun(X, Y) -> X bxor Y end,
AS, L ++ lists:reverse(RL)),
@@ -455,15 +638,149 @@ exs1024_jump({L, RL}, AS, JL, J, N, TN) ->
end.
%% =====================================================================
+%% exrop PRNG: Xoroshiro116+
+%%
+%% Reference URL: http://xorshift.di.unimi.it/
+%%
+%% 58 bits fits into an immediate on 64bits Erlang and is thus much faster.
+%% In fact, an immediate number is 60 bits signed in Erlang so you can
+%% add two positive 58 bit numbers and get a 59 bit number that still is
+%% a positive immediate, which is a property we utilize here...
+%%
+%% Modification of the original Xororhiro128+ algorithm to 116 bits
+%% by Sebastiano Vigna. A lot of thanks for his help and work.
+%% =====================================================================
+%% (a, b, c) = (24, 2, 35)
+%% JUMP Polynomial = 0x9863200f83fcd4a11293241fcb12a (116 bit)
+%%
+%% From http://xoroshiro.di.unimi.it/xoroshiro116plus.c:
+%% ---------------------------------------------------------------------
+%% /* Written in 2017 by Sebastiano Vigna ([email protected]).
+%%
+%% To the extent possible under law, the author has dedicated all copyright
+%% and related and neighboring rights to this software to the public domain
+%% worldwide. This software is distributed without any warranty.
+%%
+%% See <http://creativecommons.org/publicdomain/zero/1.0/>. */
+%%
+%% #include <stdint.h>
+%%
+%% #define UINT58MASK (uint64_t)((UINT64_C(1) << 58) - 1)
+%%
+%% uint64_t s[2];
+%%
+%% static inline uint64_t rotl58(const uint64_t x, int k) {
+%% return (x << k) & UINT58MASK | (x >> (58 - k));
+%% }
+%%
+%% uint64_t next(void) {
+%% uint64_t s1 = s[1];
+%% const uint64_t s0 = s[0];
+%% const uint64_t result = (s0 + s1) & UINT58MASK;
+%%
+%% s1 ^= s0;
+%% s[0] = rotl58(s0, 24) ^ s1 ^ ((s1 << 2) & UINT58MASK); // a, b
+%% s[1] = rotl58(s1, 35); // c
+%% return result;
+%% }
+%%
+%% void jump(void) {
+%% static const uint64_t JUMP[] =
+%% { 0x4a11293241fcb12a, 0x0009863200f83fcd };
+%%
+%% uint64_t s0 = 0;
+%% uint64_t s1 = 0;
+%% for(int i = 0; i < sizeof JUMP / sizeof *JUMP; i++)
+%% for(int b = 0; b < 64; b++) {
+%% if (JUMP[i] & UINT64_C(1) << b) {
+%% s0 ^= s[0];
+%% s1 ^= s[1];
+%% }
+%% next();
+%% }
+%% s[0] = s0;
+%% s[1] = s1;
+%% }
+
+-opaque exrop_state() :: nonempty_improper_list(uint58(), uint58()).
+
+-dialyzer({no_improper_lists, exrop_seed/1}).
+exrop_seed({A1, A2, A3}) ->
+ [_|S1] =
+ exrop_next_s(
+ ?MASK(58, (A1 * 4294967197) + 1),
+ ?MASK(58, (A2 * 4294967231) + 1)),
+ exrop_next_s(?MASK(58, (A3 * 4294967279) + 1), S1).
+
+-dialyzer({no_improper_lists, exrop_next_s/2}).
+%% Advance xoroshiro116+ state one step
+%% [a, b, c] = [24, 2, 35]
+-define(
+ exrop_next_s(S0, S1, S1_a),
+ begin
+ S1_a = S1 bxor S0,
+ [?ROTL(58, S0, 24) bxor S1_a bxor ?BSL(58, S1_a, 2)| % a, b
+ ?ROTL(58, S1_a, 35)] % c
+ end).
+exrop_next_s(S0, S1) ->
+ ?exrop_next_s(S0, S1, S1_a).
+
+-dialyzer({no_improper_lists, exrop_next/1}).
+%% Advance xoroshiro116+ state one step, generate 58 bit unsigned integer,
+%% and waste the lowest bit since it is of lower randomness quality
+exrop_next([S0|S1]) ->
+ {?MASK(58, S0 + S1), ?exrop_next_s(S0, S1, S1_a)}.
+
+exrop_uniform({Alg, R}) ->
+ {V, R1} = exrop_next(R),
+ %% Waste the lowest bit since it is of lower
+ %% randomness quality than the others
+ {(V bsr (58-53)) * ?TWO_POW_MINUS53, {Alg, R1}}.
+
+exrop_uniform(Range, {Alg, R}) ->
+ {V, R1} = exrop_next(R),
+ MaxMinusRange = ?BIT(58) - Range,
+ ?uniform_range(Range, Alg, R1, V, MaxMinusRange, I).
+
+%% Split a 116 bit constant into two '1'++58 bit words,
+%% the top '1' marks the top of the word
+-define(
+ JUMP_116(Jump),
+ [?BIT(58) bor ?MASK(58, (Jump)),?BIT(58) bor ((Jump) bsr 58)]).
+%%
+exrop_jump({Alg,S}) ->
+ [J|Js] = ?JUMP_116(16#9863200f83fcd4a11293241fcb12a),
+ {Alg, exrop_jump(S, 0, 0, J, Js)}.
+%%
+-dialyzer({no_improper_lists, exrop_jump/5}).
+exrop_jump(_S, S0, S1, 1, []) -> % End of jump constant
+ [S0|S1];
+exrop_jump(S, S0, S1, 1, [J|Js]) -> % End of the word
+ exrop_jump(S, S0, S1, J, Js);
+exrop_jump([S__0|S__1] = _S, S0, S1, J, Js) ->
+ case ?MASK(1, J) of
+ 1 ->
+ NewS = exrop_next_s(S__0, S__1),
+ exrop_jump(NewS, S0 bxor S__0, S1 bxor S__1, J bsr 1, Js);
+ 0 ->
+ NewS = exrop_next_s(S__0, S__1),
+ exrop_jump(NewS, S0, S1, J bsr 1, Js)
+ end.
+
+%% =====================================================================
%% Ziggurat cont
%% =====================================================================
-define(NOR_R, 3.6541528853610087963519472518).
-define(NOR_INV_R, 1/?NOR_R).
%% return a {sign, Random51bits, State}
+get_52({Alg=#{bits:=Bits, next:=Next}, S0}) ->
+ %% Use the high bits
+ {Int,S1} = Next(S0),
+ {?BIT(Bits - 51 - 1) band Int, Int bsr (Bits - 51), {Alg, S1}};
get_52({Alg=#{next:=Next}, S0}) ->
{Int,S1} = Next(S0),
- {((1 bsl 51) band Int), Int band ((1 bsl 51)-1), {Alg, S1}}.
+ {?BIT(51) band Int, ?MASK(51, Int), {Alg, S1}}.
%% Slow path
normal_s(0, Sign, X0, State0) ->
diff --git a/lib/stdlib/src/re.erl b/lib/stdlib/src/re.erl
index 52d3c35608..28aab7b590 100644
--- a/lib/stdlib/src/re.erl
+++ b/lib/stdlib/src/re.erl
@@ -33,7 +33,12 @@
%%% BIFs
--export([compile/1, compile/2, run/2, run/3, inspect/2]).
+-export([version/0, compile/1, compile/2, run/2, run/3, inspect/2]).
+
+-spec version() -> binary().
+
+version() ->
+ erlang:nif_error(undef).
-spec compile(Regexp) -> {ok, MP} | {error, ErrSpec} when
Regexp :: iodata(),
diff --git a/lib/stdlib/src/shell.erl b/lib/stdlib/src/shell.erl
index 28f37ef8bf..394f4f2fa4 100644
--- a/lib/stdlib/src/shell.erl
+++ b/lib/stdlib/src/shell.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -349,10 +349,16 @@ default_prompt(N) ->
%% Don't bother flattening the list irrespective of what the
%% I/O-protocol states.
case is_alive() of
- true -> io_lib:format(<<"(~s)~w> ">>, [node(), N]);
+ true -> io_lib:format(<<"(~ts)~w> ">>, [node_string(), N]);
false -> io_lib:format(<<"~w> ">>, [N])
end.
+node_string() ->
+ case encoding() of
+ latin1 -> io_lib:write_atom_as_latin1(node());
+ _ -> io_lib:write_atom(node())
+ end.
+
%% expand_hist(Expressions, CommandNumber)
%% Preprocess the expression list replacing all history list commands
%% with their expansions.
@@ -967,10 +973,11 @@ local_func(f, [{var,_,Name}], Bs, _Shell, _RT, _Lf, _Ef) ->
{value,ok,erl_eval:del_binding(Name, Bs)};
local_func(f, [_Other], _Bs, _Shell, _RT, _Lf, _Ef) ->
erlang:raise(error, function_clause, [{shell,f,1}]);
-local_func(rd, [{atom,_,RecName},RecDef0], Bs, _Shell, RT, _Lf, _Ef) ->
+local_func(rd, [{atom,_,RecName0},RecDef0], Bs, _Shell, RT, _Lf, _Ef) ->
RecDef = expand_value(RecDef0),
RDs = lists:flatten(erl_pp:expr(RecDef)),
- Attr = lists:concat(["-record('", RecName, "',", RDs, ")."]),
+ RecName = io_lib:write_atom_as_latin1(RecName0),
+ Attr = lists:concat(["-record(", RecName, ",", RDs, ")."]),
{ok, Tokens, _} = erl_scan:string(Attr),
case erl_parse:parse_form(Tokens) of
{ok,AttrForm} ->
@@ -1417,9 +1424,11 @@ columns() ->
{ok,N} -> N;
_ -> 80
end.
+
encoding() ->
[{encoding, Encoding}] = enc(),
Encoding.
+
enc() ->
case lists:keyfind(encoding, 1, io:getopts()) of
false -> [{encoding,latin1}]; % should never happen
diff --git a/lib/stdlib/src/stdlib.appup.src b/lib/stdlib/src/stdlib.appup.src
index 979161fef7..3c9e95e3a9 100644
--- a/lib/stdlib/src/stdlib.appup.src
+++ b/lib/stdlib/src/stdlib.appup.src
@@ -18,7 +18,7 @@
%% %CopyrightEnd%
{"%VSN%",
%% Up from - max one major revision back
- [{<<"3\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-19.*
+ [{<<"3\\.[0-3](\\.[0-9]+)*">>,[restart_new_emulator]}], % OTP-19.*
%% Down to - max one major revision back
- [{<<"3\\.[0-1](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-19.*
+ [{<<"3\\.[0-3](\\.[0-9]+)*">>,[restart_new_emulator]}] % OTP-19.*
}.
diff --git a/lib/stdlib/test/beam_lib_SUITE.erl b/lib/stdlib/test/beam_lib_SUITE.erl
index 279e15f703..1baf7d0a94 100644
--- a/lib/stdlib/test/beam_lib_SUITE.erl
+++ b/lib/stdlib/test/beam_lib_SUITE.erl
@@ -240,7 +240,7 @@ do_error(BeamFile, ACopy) ->
verify(missing_chunk, beam_lib:chunks(BF3, [imports])),
BF4 = set_byte(ACopy, BeamFile, AbstractStart+10, 17),
verify(invalid_chunk, beam_lib:chunks(BF4, [abstract_code])),
- BF5 = set_byte(ACopy, BeamFile, AttributesStart+10, 17),
+ BF5 = set_byte(ACopy, BeamFile, AttributesStart+8, 17),
verify(invalid_chunk, beam_lib:chunks(BF5, [attributes])),
BF6 = set_byte(ACopy, BeamFile, 1, 17),
@@ -251,7 +251,7 @@ do_error(BeamFile, ACopy) ->
BF8 = set_byte(ACopy, BeamFile, 13, 17),
verify(missing_chunk, beam_lib:chunks(BF8, ["AtU8"])),
- BF9 = set_byte(ACopy, BeamFile, CompileInfoStart+10, 17),
+ BF9 = set_byte(ACopy, BeamFile, CompileInfoStart+8, 17),
verify(invalid_chunk, beam_lib:chunks(BF9, [compile_info])).
diff --git a/lib/stdlib/test/erl_lint_SUITE.erl b/lib/stdlib/test/erl_lint_SUITE.erl
index ef4d363d29..03cad2c093 100644
--- a/lib/stdlib/test/erl_lint_SUITE.erl
+++ b/lib/stdlib/test/erl_lint_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1999-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1999-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -64,7 +64,8 @@
predef/1,
maps/1,maps_type/1,maps_parallel_match/1,
otp_11851/1,otp_11879/1,otp_13230/1,
- record_errors/1, otp_xxxxx/1]).
+ record_errors/1, otp_11879_cont/1,
+ non_latin1_module/1, otp_14323/1]).
suite() ->
[{ct_hooks,[ts_install_cth]},
@@ -84,7 +85,7 @@ all() ->
too_many_arguments, basic_errors, bin_syntax_errors, predef,
maps, maps_type, maps_parallel_match,
otp_11851, otp_11879, otp_13230,
- record_errors, otp_xxxxx].
+ record_errors, otp_11879_cont, non_latin1_module, otp_14323].
groups() ->
[{unused_vars_warn, [],
@@ -2098,11 +2099,11 @@ otp_5362(Config) when is_list(Config) ->
[{2,erl_lint,disallowed_nowarn_bif_clash}],[]}},
{call_deprecated_function,
- <<"t(X) -> crypto:md5(X).">>,
+ <<"t(X) -> calendar:local_time_to_universal_time(X).">>,
[],
{warnings,
- [{1,erl_lint,{deprecated,{crypto,md5,1},
- {crypto,hash,2}, "a future release"}}]}},
+ [{1,erl_lint,{deprecated,{calendar,local_time_to_universal_time,1},
+ {calendar,local_time_to_universal_time_dst,1}, "a future release"}}]}},
{call_removed_function,
<<"t(X) -> regexp:match(X).">>,
@@ -2549,7 +2550,7 @@ otp_5878(Config) when is_list(Config) ->
{function,9,t,0,[{clause,9,[],[],[{record,10,r,[]}]}]},
{eof,11}],
{error,[{"rec.erl",[{7,erl_lint,old_abstract_code}]}],[]} =
- compile:forms(OldAbstract, [return, report]),
+ compile_forms(OldAbstract, [return, report]),
ok.
@@ -3842,9 +3843,13 @@ otp_11879(_Config) ->
[{1,erl_lint,{spec_fun_undefined,{f,1}}},
{2,erl_lint,spec_wrong_arity},
{22,erl_lint,callback_wrong_arity}]}],
- []} = compile:forms(Fs, [return,report]),
+ []} = compile_forms(Fs, [return,report]),
ok.
+compile_forms(Terms, Opts) ->
+ Forms = [erl_parse:anno_from_term(Term) || Term <- Terms],
+ compile:forms(Forms, Opts).
+
%% OTP-13230: -deprecated without -module.
otp_13230(Config) when is_list(Config) ->
Abstr = <<"-deprecated([{frutt,0,next_version}]).">>,
@@ -3864,7 +3869,7 @@ record_errors(Config) when is_list(Config) ->
{3,erl_lint,{redefine_field,r,a}}],[]}}],
run(Config, Ts).
-otp_xxxxx(Config) ->
+otp_11879_cont(Config) ->
Ts = [{constraint1,
<<"-export([t/1]).
-spec t(X) -> X when is_subtype(integer()).
@@ -3913,6 +3918,68 @@ otp_xxxxx(Config) ->
[]}],
run(Config, Ts).
+%% OTP-14285: We currently don't support non-latin1 module names.
+
+non_latin1_module(_Config) ->
+ do_non_latin1_module('юникод'),
+ do_non_latin1_module(list_to_atom([256,$a,$b,$c])),
+ do_non_latin1_module(list_to_atom([$a,$b,256,$c])),
+ ok.
+
+do_non_latin1_module(Mod) ->
+ File = atom_to_list(Mod) ++ ".erl",
+ Forms = [{attribute,1,file,{File,1}},
+ {attribute,1,module,Mod},
+ {eof,2}],
+ error = compile:forms(Forms),
+ {error,_,[]} = compile:forms(Forms, [return]),
+ ok.
+
+
+%% OTP-14323: Check the dialyzer attribute.
+otp_14323(Config) ->
+ Ts = [
+ {otp_14323_1,
+ <<"-import(mod, [m/1]).
+
+ -export([f/0, g/0, h/0]).
+
+ -dialyzer({nowarn_function,module_info/0}). % undefined function
+ -dialyzer({nowarn_function,record_info/2}). % undefined function
+ -dialyzer({nowarn_function,m/1}). % undefined function
+
+ -dialyzer(nowarn_function). % unknown option
+ -dialyzer(1). % badly formed
+ -dialyzer(malformed). % unkonwn option
+ -dialyzer({malformed,f/0}). % unkonwn option
+ -dialyzer({nowarn_function,a/1}). % undefined function
+ -dialyzer({nowarn_function,{a,-1}}). % badly formed
+
+ -dialyzer([no_return, no_match]).
+ -dialyzer({nowarn_function, f/0}).
+ -dialyzer(no_improper_lists).
+ -dialyzer([{nowarn_function, [f/0]}, no_improper_lists]).
+ -dialyzer({no_improper_lists, g/0}).
+ -dialyzer({[no_return, no_match], [g/0, h/0]}).
+
+ f() -> a.
+ g() -> b.
+ h() -> c.">>,
+ [],
+ {errors,[{5,erl_lint,{undefined_function,{module_info,0}}},
+ {6,erl_lint,{undefined_function,{record_info,2}}},
+ {7,erl_lint,{undefined_function,{m,1}}},
+ {9,erl_lint,{bad_dialyzer_option,nowarn_function}},
+ {10,erl_lint,{bad_dialyzer_attribute,1}},
+ {11,erl_lint,{bad_dialyzer_option,malformed}},
+ {12,erl_lint,{bad_dialyzer_option,malformed}},
+ {13,erl_lint,{undefined_function,{a,1}}},
+ {14,erl_lint,{bad_dialyzer_attribute,
+ {nowarn_function,{a,-1}}}}],
+ []}}],
+ [] = run(Config, Ts),
+ ok.
+
run(Config, Tests) ->
F = fun({N,P,Ws,E}, BadL) ->
case catch run_test(Config, P, Ws) of
diff --git a/lib/stdlib/test/erl_pp_SUITE.erl b/lib/stdlib/test/erl_pp_SUITE.erl
index 31ea3210a8..808ba9b4c1 100644
--- a/lib/stdlib/test/erl_pp_SUITE.erl
+++ b/lib/stdlib/test/erl_pp_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2006-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -51,7 +51,7 @@
otp_6321/1, otp_6911/1, otp_6914/1, otp_8150/1, otp_8238/1,
otp_8473/1, otp_8522/1, otp_8567/1, otp_8664/1, otp_9147/1,
otp_10302/1, otp_10820/1, otp_11100/1, otp_11861/1, pr_1014/1,
- otp_13662/1]).
+ otp_13662/1, otp_14285/1]).
%% Internal export.
-export([ehook/6]).
@@ -80,7 +80,8 @@ groups() ->
{tickets, [],
[otp_6321, otp_6911, otp_6914, otp_8150, otp_8238,
otp_8473, otp_8522, otp_8567, otp_8664, otp_9147,
- otp_10302, otp_10820, otp_11100, otp_11861, pr_1014, otp_13662]}].
+ otp_10302, otp_10820, otp_11100, otp_11861, pr_1014, otp_13662,
+ otp_14285]}].
init_per_suite(Config) ->
Config.
@@ -627,11 +628,6 @@ do_hook(HookFun) ->
true =
"{some,value}" =:= lists:flatten(erl_pp:expr({value,A0,{some,value}})),
- %% Silly...
- true =
- "if true -> 0 end" =:=
- flat_expr({'if',0,[{clause,0,[],[],[{atom,0,0}]}]}),
-
%% More compatibility: before R6
OldIf = {'if',A0,[{clause,A0,[],[{atom,A0,true}],[{atom,A0,b}]}]},
NewIf = {'if',A0,[{clause,A0,[],[[{atom,A0,true}]],[{atom,A0,b}]}]},
@@ -1068,9 +1064,6 @@ otp_11100(Config) when is_list(Config) ->
%% There are a few places where the added code ("options(none)")
%% doesn't make a difference (pp:bit_elem_type/1 is an example).
- %% Cannot trigger the use of the hook function with export/import.
- "-export([{fy,a}/b]).\n" =
- pf({attribute,1,export,[{{fy,a},b}]}),
A1 = erl_anno:new(1),
"-type foo() :: integer(INVALID-FORM:{foo,bar}:).\n" =
pf({attribute,A1,type,{foo,{type,A1,integer,[{foo,bar}]},[]}}),
@@ -1100,10 +1093,11 @@ otp_11100(Config) when is_list(Config) ->
%% OTP-11861. behaviour_info() and -callback.
otp_11861(Config) when is_list(Config) ->
+ A3 = erl_anno:new(3),
"-optional_callbacks([bar/0]).\n" =
- pf({attribute,3,optional_callbacks,[{bar,0}]}),
+ pf({attribute,A3,optional_callbacks,[{bar,0}]}),
"-optional_callbacks([{bar,1,bad}]).\n" =
- pf({attribute,4,optional_callbacks,[{bar,1,bad}]}),
+ pf({attribute,A3,optional_callbacks,[{bar,1,bad}]}),
ok.
pf(Form) ->
@@ -1145,6 +1139,34 @@ otp_13662(Config) ->
],
compile(Config, Ts).
+otp_14285(_Config) ->
+ pp_forms(<<"-export([t/0, '\\x{400}\\''/0]).">>),
+ pp_forms(<<"-import(lists, [append/2]).">>),
+ pp_forms(<<"-optional_callbacks([]).">>),
+ pp_forms(<<"-optional_callbacks(['\\x{400}\\''/1]).">>),
+ pp_forms(<<"-'\\x{400}\\''('\\x{400}\\'').">>),
+ pp_forms(<<"-type '\\x{400}\\''() :: '\\x{400}\\''.">>),
+ pp_forms(<<"-record('\\x{400}\\'', {'\\x{400}\\''}).">>),
+ pp_forms(<<"-callback '\\x{400}\\''(_) -> '\\x{400}\\''.">>),
+ pp_forms(<<"t() -> '\\x{400}\\''('\\x{400}\\'').">>),
+ pp_forms(<<"'\\x{400}\\''(_) -> '\\x{400}\\''.">>),
+ pp_forms(<<"-spec '\\x{400}'() -> "
+ "#'\\x{400}'{'\\x{400}' :: '\\x{400}'}.">>),
+ pp_forms(<<"'\\x{400}\\''() ->"
+ "R = #'\\x{400}\\''{},"
+ "#'\\x{400}\\''{'\\x{400}\\'' ="
+ "{'\\x{400}\\'',"
+ "fun '\\x{400}\\''/0,"
+ "R#'\\x{400}\\''.'\\x{400}\\'',"
+ "#'\\x{400}\\''.'\\x{400}\\''}}.">>),
+
+ %% Special...
+ true =
+ "{some,'\\x{400}\\''}" =:=
+ lists:flatten(erl_pp:expr({value,erl_anno:new(0),{some,'\x{400}\''}},
+ [{encoding,latin1}])),
+ ok.
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
compile(Config, Tests) ->
diff --git a/lib/stdlib/test/erl_scan_SUITE.erl b/lib/stdlib/test/erl_scan_SUITE.erl
index 7d0ba967f9..aca5b1e54f 100644
--- a/lib/stdlib/test/erl_scan_SUITE.erl
+++ b/lib/stdlib/test/erl_scan_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1998-2016. All Rights Reserved.
+%% Copyright Ericsson AB 1998-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -904,9 +904,9 @@ more_chars() ->
otp_10302(Config) when is_list(Config) ->
%% From unicode():
{ok,[{atom,1,'aсb'}],1} =
- erl_scan:string("'a"++[1089]++"b'", 1),
+ erl_scan_string("'a"++[1089]++"b'", 1),
{ok,[{atom,{1,1},'qaપ'}],{1,12}} =
- erl_scan:string("'qa\\x{aaa}'",{1,1}),
+ erl_scan_string("'qa\\x{aaa}'",{1,1}),
{ok,[{char,1,1089}],1} = erl_scan_string([$$,1089], 1),
{ok,[{char,1,1089}],1} = erl_scan_string([$$,$\\,1089],1),
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index 8581440d58..2dfd481665 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -39,8 +39,9 @@
-export([lookup_element_mult/1]).
-export([foldl_ordered/1, foldr_ordered/1, foldl/1, foldr/1, fold_empty/1]).
-export([t_delete_object/1, t_init_table/1, t_whitebox/1,
+ select_bound_chunk/1,
t_delete_all_objects/1, t_insert_list/1, t_test_ms/1,
- t_select_delete/1,t_ets_dets/1]).
+ t_select_delete/1,t_select_replace/1,t_ets_dets/1]).
-export([ordered/1, ordered_match/1, interface_equality/1,
fixtable_next/1, fixtable_insert/1, rename/1, rename_unnamed/1, evil_rename/1,
@@ -64,7 +65,7 @@
meta_lookup_named_read/1, meta_lookup_named_write/1,
meta_newdel_unnamed/1, meta_newdel_named/1]).
-export([smp_insert/1, smp_fixed_delete/1, smp_unfix_fix/1, smp_select_delete/1,
- otp_8166/1, otp_8732/1]).
+ smp_select_replace/1, otp_8166/1, otp_8732/1]).
-export([exit_large_table_owner/1,
exit_many_large_table_owner/1,
exit_many_tables_owner/1,
@@ -75,7 +76,7 @@
-export([otp_9423/1]).
-export([otp_10182/1]).
-export([ets_all/1]).
--export([memory_check_summary/1]).
+-export([massive_ets_all/1]).
-export([take/1]).
-export([init_per_testcase/2, end_per_testcase/2]).
@@ -87,13 +88,13 @@
-include_lib("common_test/include/ct.hrl").
-define(m(A,B), assert_eq(A,B)).
+-define(heap_binary_size, 64).
init_per_testcase(Case, Config) ->
rand:seed(exsplus),
io:format("*** SEED: ~p ***\n", [rand:export_seed()]),
start_spawn_logger(),
wait_for_test_procs(), %% Ensure previous case cleaned up
- put('__ETS_TEST_CASE__', Case),
[{test_case, Case} | Config].
end_per_testcase(_Func, _Config) ->
@@ -118,15 +119,16 @@ all() ->
update_counter_with_default, partly_bound,
update_counter_table_growth,
match_heavy, {group, fold}, member, t_delete_object,
+ select_bound_chunk,
t_init_table, t_whitebox, t_delete_all_objects,
- t_insert_list, t_test_ms, t_select_delete, t_ets_dets,
- memory, t_select_reverse, t_bucket_disappears,
+ t_insert_list, t_test_ms, t_select_delete, t_select_replace,
+ t_ets_dets, memory, t_select_reverse, t_bucket_disappears,
select_fail, t_insert_new, t_repair_continuation,
otp_5340, otp_6338, otp_6842_select_1000, otp_7665,
otp_8732, meta_wb, grow_shrink, grow_pseudo_deleted,
shrink_pseudo_deleted, {group, meta_smp}, smp_insert,
- smp_fixed_delete, smp_unfix_fix, smp_select_delete,
- otp_8166, exit_large_table_owner,
+ smp_fixed_delete, smp_unfix_fix, smp_select_replace,
+ smp_select_delete, otp_8166, exit_large_table_owner,
exit_many_large_table_owner, exit_many_tables_owner,
exit_many_many_tables_owner, write_concurrency, heir,
give_away, setopts, bad_table, types,
@@ -134,9 +136,8 @@ all() ->
otp_9932,
otp_9423,
ets_all,
- take,
-
- memory_check_summary]. % MUST BE LAST
+ massive_ets_all,
+ take].
groups() ->
[{new, [],
@@ -181,27 +182,6 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
-%% Test that we did not have "too many" failed verify_etsmem()'s
-%% in the test suite.
-%% verify_etsmem() may give a low number of false positives
-%% as concurrent activities, such as lingering processes
-%% from earlier test suites, may do unrelated ets (de)allocations.
-memory_check_summary(_Config) ->
- case whereis(ets_test_spawn_logger) of
- undefined ->
- ct:fail("No spawn logger exist");
- _ ->
- ets_test_spawn_logger ! {self(), get_failed_memchecks},
- receive {get_failed_memchecks, FailedMemchecks} -> ok end,
- io:format("Failed memchecks: ~p\n",[FailedMemchecks]),
- NoFailedMemchecks = length(FailedMemchecks),
- if NoFailedMemchecks > 1 ->
- ct:fail("Too many failed (~p) memchecks", [NoFailedMemchecks]);
- true ->
- ok
- end
- end.
-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -718,6 +698,15 @@ whitebox_2(Opts) ->
ets:delete(T2),
ok.
+select_bound_chunk(Config) ->
+ repeat_for_opts(fun select_bound_chunk_do/1, [all_types]).
+
+select_bound_chunk_do(Opts) ->
+ T = ets:new(x, Opts),
+ ets:insert(T, [{key, 1}]),
+ {[{key, 1}], '$end_of_table'} = ets:select(T, [{{key,1},[],['$_']}], 100000),
+ ok.
+
%% Test ets:to/from_dets.
t_ets_dets(Config) when is_list(Config) ->
@@ -1159,6 +1148,211 @@ t_select_delete(Config) when is_list(Config) ->
lists:foreach(fun(Tab) -> ets:delete(Tab) end,Tables),
verify_etsmem(EtsMem).
+%% Tests the ets:select_replace/2 BIF
+t_select_replace(Config) when is_list(Config) ->
+ EtsMem = etsmem(),
+ Tables = fill_sets_int(10000) ++ fill_sets_int(10000, [{write_concurrency,true}]),
+
+ TestFun = fun (Table, TableType) when TableType =:= bag ->
+ % Operation not supported; bag implementation
+ % presented both semantic consistency and performance issues.
+ 10000 = ets:select_delete(Table, [{'_',[],[true]}]);
+
+ (Table, TableType) ->
+ % Invalid replacement doesn't keep the key
+ MatchSpec1 = [{{'$1', '$2'},
+ [{'=:=', {'band', '$1', 2#11}, 2#11},
+ {'=/=', {'hd', '$2'}, $x}],
+ [{{'$2', '$1'}}]}],
+ {'EXIT',{badarg,_}} = (catch ets:select_replace(Table, MatchSpec1)),
+
+ % Invalid replacement doesn't keep the key (even though it would be the same value)
+ MatchSpec2 = [{{'$1', '$2'},
+ [{'=:=', {'band', '$1', 2#11}, 2#11}],
+ [{{{'+', '$1', 0}, '$2'}}]},
+ {{'$1', '$2'},
+ [{'=/=', {'band', '$1', 2#11}, 2#11}],
+ [{{{'-', '$1', 0}, '$2'}}]}],
+ {'EXIT',{badarg,_}} = (catch ets:select_replace(Table, MatchSpec2)),
+
+ % Invalid replacement changes key to float equivalent
+ MatchSpec3 = [{{'$1', '$2'},
+ [{'=:=', {'band', '$1', 2#11}, 2#11},
+ {'=/=', {'hd', '$2'}, $x}],
+ [{{{'*', '$1', 1.0}, '$2'}}]}],
+ {'EXIT',{badarg,_}} = (catch ets:select_replace(Table, MatchSpec3)),
+
+ % Replacements are differently-sized tuples
+ MatchSpec4_A = [{{'$1','$2'},
+ [{'<', {'rem', '$1', 5}, 2}],
+ [{{'$1', [$x | '$2'], stuff}}]}],
+ MatchSpec4_B = [{{'$1','$2','_'},
+ [],
+ [{{'$1','$2'}}]}],
+ 4000 = ets:select_replace(Table, MatchSpec4_A),
+ 4000 = ets:select_replace(Table, MatchSpec4_B),
+
+ % Replacement is the same tuple
+ MatchSpec5 = [{{'$1', '$2'},
+ [{'>', {'rem', '$1', 5}, 3}],
+ ['$_']}],
+ 2000 = ets:select_replace(Table, MatchSpec5),
+
+ % Replacement reconstructs an equal tuple
+ MatchSpec6 = [{{'$1', '$2'},
+ [{'>', {'rem', '$1', 5}, 3}],
+ [{{'$1', '$2'}}]}],
+ 2000 = ets:select_replace(Table, MatchSpec6),
+
+ % Replacement uses {element,KeyPos,T} for key
+ 2000 = ets:select_replace(Table,
+ [{{'$1', '$2'},
+ [{'>', {'rem', '$1', 5}, 3}],
+ [{{{element, 1, '$_'}, '$2'}}]}]),
+
+ % Replacement uses wrong {element,KeyPos,T} for key
+ {'EXIT',{badarg,_}} = (catch ets:select_replace(Table,
+ [{{'$1', '$2'},
+ [],
+ [{{{element, 2, '$_'}, '$2'}}]}])),
+
+ check(Table,
+ fun ({N, [$x, C | _]}) when ((N rem 5) < 2) -> (C >= $0) andalso (C =< $9);
+ ({N, [C | _]}) when is_float(N) -> (C >= $0) andalso (C =< $9);
+ ({N, [C | _]}) when ((N rem 5) > 3) -> (C >= $0) andalso (C =< $9);
+ ({_, [C | _]}) -> (C >= $0) andalso (C =< $9)
+ end,
+ 10000),
+
+ % Replace unbound range (>)
+ MatchSpec7 = [{{'$1', '$2'},
+ [{'>', '$1', 7000}],
+ [{{'$1', {{gt_range, '$2'}}}}]}],
+ 3000 = ets:select_replace(Table, MatchSpec7),
+
+ % Replace unbound range (<)
+ MatchSpec8 = [{{'$1', '$2'},
+ [{'<', '$1', 3000}],
+ [{{'$1', {{le_range, '$2'}}}}]}],
+ case TableType of
+ ordered_set -> 2999 = ets:select_replace(Table, MatchSpec8);
+ set -> 2999 = ets:select_replace(Table, MatchSpec8);
+ duplicate_bag -> 2998 = ets:select_replace(Table, MatchSpec8)
+ end,
+
+ % Replace bound range
+ MatchSpec9 = [{{'$1', '$2'},
+ [{'>=', '$1', 3001},
+ {'<', '$1', 7000}],
+ [{{'$1', {{range, '$2'}}}}]}],
+ case TableType of
+ ordered_set -> 3999 = ets:select_replace(Table, MatchSpec9);
+ set -> 3999 = ets:select_replace(Table, MatchSpec9);
+ duplicate_bag -> 3998 = ets:select_replace(Table, MatchSpec9)
+ end,
+
+ % Replace particular keys
+ MatchSpec10 = [{{'$1', '$2'},
+ [{'==', '$1', 3000}],
+ [{{'$1', {{specific1, '$2'}}}}]},
+ {{'$1', '$2'},
+ [{'==', '$1', 7000}],
+ [{{'$1', {{specific2, '$2'}}}}]}],
+ case TableType of
+ ordered_set -> 2 = ets:select_replace(Table, MatchSpec10);
+ set -> 2 = ets:select_replace(Table, MatchSpec10);
+ duplicate_bag -> 4 = ets:select_replace(Table, MatchSpec10)
+ end,
+
+ check(Table,
+ fun ({N, {gt_range, _}}) -> N > 7000;
+ ({N, {le_range, _}}) -> N < 3000;
+ ({N, {range, _}}) -> (N >= 3001) andalso (N < 7000);
+ ({N, {specific1, _}}) -> N == 3000;
+ ({N, {specific2, _}}) -> N == 7000
+ end,
+ 10000),
+
+ 10000 = ets:select_delete(Table, [{'_',[],[true]}]),
+ check(Table, fun (_) -> false end, 0)
+ end,
+
+ lists:foreach(
+ fun(Table) ->
+ TestFun(Table, ets:info(Table, type)),
+ ets:delete(Table)
+ end,
+ Tables),
+
+ %% Test key-safe match-specs are accepted
+ BigNum = (123 bsl 123),
+ RefcBin = list_to_binary(lists:seq(1,?heap_binary_size+1)),
+ Terms = [a, "hej", 123, 1.23, BigNum , <<"123">>, RefcBin, TestFun, self()],
+ EqPairs = fun(X,Y) ->
+ [{ '$1', '$1'},
+ { {X, Y}, {{X, Y}}},
+ { {'$1', Y}, {{'$1', Y}}},
+ { {{X, Y}}, {{{{X, Y}}}}},
+ { {X}, {{X}}},
+ { X, {const, X}},
+ { {X,Y}, {const, {X,Y}}},
+ { {X}, {const, {X}}},
+ { {X, Y}, {{X, {const, Y}}}},
+ { {X, {Y,'$1'}}, {{{const, X}, {{Y,'$1'}}}}},
+ { [X, Y | '$1'], [X, Y | '$1']},
+ { [{X, '$1'}, Y], [{{X, '$1'}}, Y]},
+ { [{X, Y} | '$1'], [{const, {X, Y}} | '$1']},
+ { [$p,$r,$e,$f,$i,$x | '$1'], [$p,$r,$e,$f,$i,$x | '$1']},
+ { {[{X,Y}]}, {{[{{X,Y}}]}}},
+ { {[{X,Y}]}, {{{const, [{X,Y}]}}}},
+ { {[{X,Y}]}, {{[{const,{X,Y}}]}}}
+ ]
+ end,
+
+ T2 = ets:new(x, []),
+ [lists:foreach(fun({A, B}) ->
+ %% just check that matchspec is accepted
+ 0 = ets:select_replace(T2, [{{A, '$2', '$3'}, [], [{{B, '$3', '$2'}}]}])
+ end,
+ EqPairs(X,Y)) || X <- Terms, Y <- Terms],
+
+ %% Test key-unsafe matchspecs are rejected
+ NeqPairs = fun(X, Y) ->
+ [{'$1', '$2'},
+ {{X, Y}, {X, Y}},
+ {{{X, Y}}, {{{X, Y}}}},
+ {{X}, {{{X}}}},
+ {{const, X}, {const, X}},
+ {{const, {X,Y}}, {const, {X,Y}}},
+ {'$1', {const, '$1'}},
+ {{X}, {const, {{X}}}},
+ {{X, {Y,'$1'}}, {{{const, X}, {Y,'$1'}}}},
+ {[X, Y | '$1'], [X, Y]},
+ {[X, Y], [X, Y | '$1']},
+ {[{X, '$1'}, Y], [{X, '$1'}, Y]},
+ {[$p,$r,$e,$f,$i,$x | '$1'], [$p,$r,$e,$f,$I,$x | '$1']},
+ { {[{X,Y}]}, {{[{X,Y}]}}},
+ { {[{X,Y}]}, {{{const, [{{X,Y}}]}}}},
+ { {[{X,Y}]}, {{[{const,{{X,Y}}}]}}},
+ {'_', '_'},
+ {'$_', '$_'},
+ {'$$', '$$'},
+ {#{}, #{}},
+ {#{X => '$1'}, #{X => '$1'}}
+ ]
+ end,
+
+ [lists:foreach(fun({A, B}) ->
+ %% just check that matchspec is rejected
+ {'EXIT',{badarg,_}} = (catch ets:select_replace(T2, [{{A, '$2', '$3'}, [], [{{B, '$3', '$2'}}]}]))
+ end,
+ NeqPairs(X,Y)) || X <- Terms, Y <- Terms],
+
+
+ ets:delete(T2),
+
+ verify_etsmem(EtsMem).
+
%% Test that partly bound keys gives faster matches.
partly_bound(Config) when is_list(Config) ->
case os:type() of
@@ -5090,7 +5284,7 @@ meta_lookup_unnamed_read(Config) when is_list(Config) ->
end,
FiniF = fun(Tab) -> true = ets:delete(Tab)
end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
meta_lookup_unnamed_write(Config) when is_list(Config) ->
InitF = fun(_) -> Tab = ets_new(unnamed,[]),
@@ -5101,7 +5295,7 @@ meta_lookup_unnamed_write(Config) when is_list(Config) ->
end,
FiniF = fun({Tab,_}) -> true = ets:delete(Tab)
end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
meta_lookup_named_read(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> Name = list_to_atom(integer_to_list(ProcN)),
@@ -5114,7 +5308,7 @@ meta_lookup_named_read(Config) when is_list(Config) ->
end,
FiniF = fun(Tab) -> true = ets:delete(Tab)
end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
meta_lookup_named_write(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> Name = list_to_atom(integer_to_list(ProcN)),
@@ -5126,7 +5320,7 @@ meta_lookup_named_write(Config) when is_list(Config) ->
end,
FiniF = fun({Tab,_}) -> true = ets:delete(Tab)
end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
meta_newdel_unnamed(Config) when is_list(Config) ->
InitF = fun(_) -> ok end,
@@ -5134,7 +5328,7 @@ meta_newdel_unnamed(Config) when is_list(Config) ->
true = ets:delete(Tab)
end,
FiniF = fun(_) -> ok end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
meta_newdel_named(Config) when is_list(Config) ->
InitF = fun([ProcN|_]) -> list_to_atom(integer_to_list(ProcN))
@@ -5144,7 +5338,7 @@ meta_newdel_named(Config) when is_list(Config) ->
Name
end,
FiniF = fun(_) -> ok end,
- run_workers(InitF,ExecF,FiniF,10000).
+ run_smp_workers(InitF,ExecF,FiniF,10000).
%% Concurrent insert's on same table.
smp_insert(Config) when is_list(Config) ->
@@ -5153,7 +5347,7 @@ smp_insert(Config) when is_list(Config) ->
ExecF = fun(_) -> true = ets:insert(smp_insert,{rand:uniform(10000)})
end,
FiniF = fun(_) -> ok end,
- run_workers(InitF,ExecF,FiniF,100000),
+ run_smp_workers(InitF,ExecF,FiniF,100000),
verify_table_load(smp_insert),
ets:delete(smp_insert).
@@ -5176,7 +5370,7 @@ smp_fixed_delete_do() ->
{Key+Increment,Increment}
end,
FiniF = fun(_) -> ok end,
- run_workers_do(InitF,ExecF,FiniF,NumOfObjs),
+ run_sched_workers(InitF,ExecF,FiniF,NumOfObjs),
0 = ets:info(T,size),
true = ets:info(T,fixed),
Buckets = num_of_buckets(T),
@@ -5417,7 +5611,7 @@ smp_select_delete(Config) when is_list(Config) ->
end
end,
FiniF = fun(Result) -> Result end,
- Results = run_workers_do(InitF,ExecF,FiniF,20000),
+ Results = run_sched_workers(InitF,ExecF,FiniF,20000),
TotCnts = lists:foldl(fun(Diffs, Sum) -> add_lists(Sum,tuple_to_list(Diffs)) end,
lists:duplicate(Mod, 0), Results),
io:format("TotCnts = ~p\n",[TotCnts]),
@@ -5442,6 +5636,45 @@ smp_select_delete(Config) when is_list(Config) ->
false = ets:info(T,fixed),
ets:delete(T).
+smp_select_replace(Config) when is_list(Config) ->
+ repeat_for_opts(fun smp_select_replace_do/1,
+ [[set,ordered_set,duplicate_bag]]).
+
+smp_select_replace_do(Opts) ->
+ T = ets_new(smp_select_replace,
+ [public, {write_concurrency, true} | Opts]),
+ ObjCount = 20,
+ InitF = fun (_) -> 0 end,
+ ExecF = fun (Cnt0) ->
+ CounterId = rand:uniform(ObjCount),
+ Match = [{{'$1', '$2'},
+ [{'=:=', '$1', CounterId}],
+ [{{'$1', {'+', '$2', 1}}}]}],
+ Cnt1 = case ets:select_replace(T, Match) of
+ 1 -> Cnt0+1;
+ 0 ->
+ ets:insert_new(T, {CounterId, 0}),
+ Cnt0
+ end,
+ receive stop ->
+ [end_of_work | Cnt1]
+ after 0 ->
+ Cnt1
+ end
+ end,
+ FiniF = fun (Cnt) -> Cnt end,
+ Pids = run_sched_workers(InitF, ExecF, FiniF, infinite),
+ receive after 3*1000 -> ok end,
+ [P ! stop || P <- Pids],
+ Results = wait_pids(Pids),
+ FinalCounts = ets:select(T, [{{'_', '$1'}, [], ['$1']}]),
+ Total = lists:sum(FinalCounts),
+ Total = lists:sum(Results),
+ ObjCount = ets:select_delete(T, [{{'_', '_'}, [], [true]}]),
+ 0 = ets:info(T, size),
+ true = ets:delete(T),
+ ok.
+
%% Test different types.
types(Config) when is_list(Config) ->
init_externals(),
@@ -5504,7 +5737,7 @@ otp_9423(Config) when is_list(Config) ->
end
end,
FiniF = fun(R) -> R end,
- case run_workers(InitF, ExecF, FiniF, infinite, 1) of
+ case run_smp_workers(InitF, ExecF, FiniF, infinite, 1) of
Pids when is_list(Pids) ->
%%[P ! start || P <- Pids],
repeat(fun() -> ets:new(otp_9423, [named_table, public, {write_concurrency,true}]),
@@ -5545,6 +5778,68 @@ ets_all_run() ->
false = lists:member(Table, ets:all()),
ets_all_run().
+create_tables(N) ->
+ create_tables(N, []).
+
+create_tables(0, Ts) ->
+ Ts;
+create_tables(N, Ts) ->
+ create_tables(N-1, [ets:new(tjo, [])|Ts]).
+
+massive_ets_all(Config) when is_list(Config) ->
+ Me = self(),
+ InitTables = lists:sort(ets:all()),
+ io:format("InitTables=~p~n", [InitTables]),
+ PMs0 = lists:map(fun (Sid) ->
+ my_spawn_opt(fun () ->
+ Ts = create_tables(250),
+ Me ! {self(), up, Ts},
+ receive {Me, die} -> ok end
+ end,
+ [link, monitor, {scheduler, Sid}])
+ end,
+ lists:seq(1, erlang:system_info(schedulers_online))),
+ AllRes = lists:sort(lists:foldl(fun ({P, _M}, Ts) ->
+ receive
+ {P, up, PTs} ->
+ PTs ++ Ts
+ end
+ end,
+ InitTables,
+ PMs0)),
+ AllRes = lists:sort(ets:all()),
+ PMs1 = lists:map(fun (_) ->
+ my_spawn_opt(fun () ->
+ AllRes = lists:sort(ets:all())
+ end,
+ [link, monitor])
+ end, lists:seq(1, 50)),
+ lists:foreach(fun ({P, M}) ->
+ receive
+ {'DOWN', M, process, P, _} ->
+ ok
+ end
+ end, PMs1),
+ PMs2 = lists:map(fun (_) ->
+ my_spawn_opt(fun () ->
+ _ = ets:all()
+ end,
+ [link, monitor])
+ end, lists:seq(1, 50)),
+ lists:foreach(fun ({P, _M}) ->
+ P ! {Me, die}
+ end, PMs0),
+ lists:foreach(fun ({P, M}) ->
+ receive
+ {'DOWN', M, process, P, _} ->
+ ok
+ end
+ end, PMs0 ++ PMs2),
+ EndTables = lists:sort(ets:all()),
+ io:format("EndTables=~p~n", [EndTables]),
+ InitTables = EndTables,
+ ok.
+
take(Config) when is_list(Config) ->
%% Simple test for set tables.
@@ -5594,23 +5889,27 @@ add_lists([],[],Acc) ->
add_lists([E1|T1], [E2|T2], Acc) ->
add_lists(T1, T2, [E1+E2 | Acc]).
-run_workers(InitF,ExecF,FiniF,Laps) ->
- run_workers(InitF,ExecF,FiniF,Laps, 0).
-run_workers(InitF,ExecF,FiniF,Laps, Exclude) ->
+run_smp_workers(InitF,ExecF,FiniF,Laps) ->
+ run_smp_workers(InitF,ExecF,FiniF,Laps, 0).
+run_smp_workers(InitF,ExecF,FiniF,Laps, Exclude) ->
case erlang:system_info(smp_support) of
true ->
- run_workers_do(InitF,ExecF,FiniF,Laps, Exclude);
+ case erlang:system_info(schedulers_online) of
+ N when N > Exclude ->
+ run_workers_do(InitF,ExecF,FiniF,Laps, N - Exclude);
+ _ ->
+ {skipped, "Too few schedulers online"}
+ end;
false ->
{skipped,"No smp support"}
end.
-run_workers_do(InitF,ExecF,FiniF,Laps) ->
- run_workers_do(InitF,ExecF,FiniF,Laps, 0).
-run_workers_do(InitF,ExecF,FiniF,Laps, Exclude) ->
- NumOfProcs = case erlang:system_info(schedulers) of
- N when (N > Exclude) -> N - Exclude
- end,
- io:format("smp starting ~p workers\n",[NumOfProcs]),
+run_sched_workers(InitF,ExecF,FiniF,Laps) ->
+ run_workers_do(InitF,ExecF,FiniF,Laps,
+ erlang:system_info(schedulers)).
+
+run_workers_do(InitF,ExecF,FiniF,Laps, NumOfProcs) ->
+ io:format("starting ~p workers\n",[NumOfProcs]),
Seeds = [{ProcN,rand:uniform(9999)} || ProcN <- lists:seq(1,NumOfProcs)],
Parent = self(),
Pids = [my_spawn_link(fun()-> worker(Seed,InitF,ExecF,FiniF,Laps,Parent,NumOfProcs) end)
@@ -5712,45 +6011,27 @@ etsmem() ->
{Bl0+Bl,BlSz0+BlSz}
end, {0,0}, CS)
end},
- {Mem,AllTabs, erts_debug:get_internal_state('DbTable_meta')}.
+ {Mem,AllTabs}.
-verify_etsmem(EtsMem) ->
+verify_etsmem({MemInfo,AllTabs}) ->
wait_for_test_procs(),
- verify_etsmem(EtsMem, false).
-
-verify_etsmem({MemInfo,AllTabs,MetaState}=EtsMem, Adjusted) ->
case etsmem() of
- {MemInfo,_,_} ->
+ {MemInfo,_} ->
io:format("Ets mem info: ~p", [MemInfo]),
case MemInfo of
{ErlMem,EtsAlloc} when ErlMem == notsup; EtsAlloc == undefined ->
%% Use 'erl +Mea max' to do more complete memory leak testing.
{comment,"Incomplete or no mem leak testing"};
_ ->
- case Adjusted of
- true ->
- {comment, "Meta state adjusted"};
- false ->
- ok
- end
+ ok
end;
- {MemInfo2, AllTabs2, MetaState2} ->
+ {MemInfo2, AllTabs2} ->
io:format("Expected: ~p", [MemInfo]),
io:format("Actual: ~p", [MemInfo2]),
io:format("Changed tables before: ~p\n",[AllTabs -- AllTabs2]),
io:format("Changed tables after: ~p\n", [AllTabs2 -- AllTabs]),
- io:format("Meta state before: ~p\n", [MetaState]),
- io:format("Meta state after: ~p\n", [MetaState2]),
- case {MetaState =:= MetaState2, Adjusted} of
- {false, false} ->
- io:format("Adjust meta state and retry...\n\n",[]),
- {ok,ok} = erts_debug:set_internal_state('DbTable_meta', MetaState),
- verify_etsmem(EtsMem, true);
- _ ->
- ets_test_spawn_logger ! {failed_memcheck, get('__ETS_TEST_CASE__')},
- {comment, "Failed memory check"}
- end
+ ct:fail("Failed memory check")
end.
@@ -5772,10 +6053,10 @@ stop_loopers(Loopers) ->
looper(Fun, State) ->
looper(Fun, Fun(State)).
-spawn_logger(Procs, FailedMemchecks) ->
+spawn_logger(Procs) ->
receive
{new_test_proc, Proc} ->
- spawn_logger([Proc|Procs], FailedMemchecks);
+ spawn_logger([Proc|Procs]);
{sync_test_procs, Kill, From} ->
lists:foreach(fun (Proc) when From == Proc ->
ok;
@@ -5799,14 +6080,7 @@ spawn_logger(Procs, FailedMemchecks) ->
end
end, Procs),
From ! test_procs_synced,
- spawn_logger([From], FailedMemchecks);
-
- {failed_memcheck, TestCase} ->
- spawn_logger(Procs, [TestCase|FailedMemchecks]);
-
- {Pid, get_failed_memchecks} ->
- Pid ! {get_failed_memchecks, FailedMemchecks},
- spawn_logger(Procs, FailedMemchecks)
+ spawn_logger([From])
end.
pid_status(Pid) ->
@@ -5822,7 +6096,7 @@ start_spawn_logger() ->
case whereis(ets_test_spawn_logger) of
Pid when is_pid(Pid) -> true;
_ -> register(ets_test_spawn_logger,
- spawn_opt(fun () -> spawn_logger([], []) end,
+ spawn_opt(fun () -> spawn_logger([]) end,
[{priority, max}]))
end.
@@ -5945,7 +6219,6 @@ only_if_smp(Schedulers, Func) ->
end.
%% Copy-paste from emulator/test/binary_SUITE.erl
--define(heap_binary_size, 64).
test_terms(Test_Func, Mode) ->
garbage_collect(),
Pib0 = process_info(self(),binary),
diff --git a/lib/stdlib/test/filelib_SUITE.erl b/lib/stdlib/test/filelib_SUITE.erl
index 87fba815d2..6133a3ded4 100644
--- a/lib/stdlib/test/filelib_SUITE.erl
+++ b/lib/stdlib/test/filelib_SUITE.erl
@@ -507,7 +507,12 @@ file_props_symlink(Config) ->
end.
find_source(Config) when is_list(Config) ->
- BeamFile = code:which(lists),
+ %% filename:find_{file,source}() does not work if the files are
+ %% cover-compiled. To make sure that the test does not fail
+ %% when the STDLIB is cover-compiled, search for modules in
+ %% the compiler application.
+
+ BeamFile = code:which(compile),
BeamName = filename:basename(BeamFile),
BeamDir = filename:dirname(BeamFile),
SrcName = filename:basename(BeamFile, ".beam") ++ ".erl",
@@ -530,7 +535,7 @@ find_source(Config) when is_list(Config) ->
{error, not_found} = filelib:find_source(BeamName, BeamDir,
[{".erl",".yrl",[{"",""}]}]),
- {ok, ParserErl} = filelib:find_source(code:which(erl_parse)),
+ {ok, ParserErl} = filelib:find_source(code:which(core_parse)),
{ok, ParserYrl} = filelib:find_source(ParserErl),
"lry." ++ _ = lists:reverse(ParserYrl),
{ok, ParserYrl} = filelib:find_source(ParserErl,
diff --git a/lib/stdlib/test/io_SUITE.erl b/lib/stdlib/test/io_SUITE.erl
index d546e8fad2..b2754e47ba 100644
--- a/lib/stdlib/test/io_SUITE.erl
+++ b/lib/stdlib/test/io_SUITE.erl
@@ -30,7 +30,8 @@
io_lib_print_binary_depth_one/1, otp_10302/1, otp_10755/1,
otp_10836/1, io_lib_width_too_small/1,
io_with_huge_message_queue/1, format_string/1,
- maps/1, coverage/1, otp_14178_unicode_atoms/1, otp_14175/1]).
+ maps/1, coverage/1, otp_14178_unicode_atoms/1, otp_14175/1,
+ otp_14285/1]).
-export([pretty/2]).
@@ -61,7 +62,8 @@ all() ->
printable_range, bad_printable_range,
io_lib_print_binary_depth_one, otp_10302, otp_10755, otp_10836,
io_lib_width_too_small, io_with_huge_message_queue,
- format_string, maps, coverage, otp_14178_unicode_atoms, otp_14175].
+ format_string, maps, coverage, otp_14178_unicode_atoms, otp_14175,
+ otp_14285].
%% Error cases for output.
error_1(Config) when is_list(Config) ->
@@ -755,6 +757,8 @@ rfd(rrrrr, 3) ->
[f1, f2, f3];
rfd(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, 0) ->
[];
+rfd('\x{400}', 1) ->
+ ['\x{400}'];
rfd(_, _) ->
no.
@@ -1881,6 +1885,7 @@ otp_10302(Suite) when is_list(Suite) ->
pretty(Term, Depth) when is_integer(Depth) ->
Opts = [{column, 1}, {line_length, 20},
{depth, Depth}, {max_chars, 60},
+ {record_print_fun, fun rfd/2},
{encoding, unicode}],
pretty(Term, Opts);
pretty(Term, Opts) when is_list(Opts) ->
@@ -2324,3 +2329,23 @@ text1([T|Ts]) ->
[erl_anno:text(Anno) | text1(Ts)].
-endif. % EXACT
+
+otp_14285(_Config) ->
+ UOpts = [{record_print_fun, fun rfd/2},
+ {encoding, unicode}],
+ LOpts = [{record_print_fun, fun rfd/2},
+ {encoding, latin1}],
+
+ RT = {'\x{400}','\x{400}'},
+ "#'\x{400}'{'\x{400}' = '\x{400}'}" = pretty(RT, UOpts),
+ "#'\\x{400}'{'\\x{400}' = '\\x{400}'}" = pretty(RT, LOpts),
+
+ Chars = lists:seq(0, 512),
+ [] = [C ||
+ C <- Chars,
+ S <- io_lib:write_atom_as_latin1(list_to_atom([C])),
+ not is_latin1(S)],
+ L1 = [S || C <- Chars, S <- io_lib:write_atom(list_to_atom([C])),
+ not is_latin1(S)],
+ L1 = lists:seq(256, 512),
+ ok.
diff --git a/lib/stdlib/test/io_proto_SUITE.erl b/lib/stdlib/test/io_proto_SUITE.erl
index db321d7490..b795cb0b61 100644
--- a/lib/stdlib/test/io_proto_SUITE.erl
+++ b/lib/stdlib/test/io_proto_SUITE.erl
@@ -18,7 +18,6 @@
%% %CopyrightEnd%
%%
-module(io_proto_SUITE).
--compile(r12).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end_per_group/2]).
@@ -26,15 +25,14 @@
-export([init_per_testcase/2, end_per_testcase/2]).
-export([setopts_getopts/1,unicode_options/1,unicode_options_gen/1,
- binary_options/1, bc_with_r12/1,
- bc_with_r12_gl/1, read_modes_gl/1,bc_with_r12_ogl/1,
+ binary_options/1, read_modes_gl/1,
read_modes_ogl/1, broken_unicode/1,eof_on_pipe/1,unicode_prompt/1]).
-export([io_server_proxy/1,start_io_server_proxy/0, proxy_getall/1,
proxy_setnext/2, proxy_quit/1]).
%% For spawn
--export([toerl_server/3,hold_the_line/3,answering_machine1/3,
+-export([toerl_server/3,answering_machine1/3,
answering_machine2/3]).
-export([uprompt/1]).
@@ -79,8 +77,7 @@ suite() ->
all() ->
[setopts_getopts, unicode_options, unicode_options_gen,
- binary_options, bc_with_r12, bc_with_r12_gl,
- bc_with_r12_ogl, read_modes_gl, read_modes_ogl,
+ binary_options, read_modes_gl, read_modes_ogl,
broken_unicode, eof_on_pipe, unicode_prompt].
groups() ->
@@ -742,263 +739,7 @@ binary_options(Config) when is_list(Config) ->
],[],[],"-oldshell"),
ok.
-%% Test io protocol compatibility with R12 nodes.
-bc_with_r12(Config) when is_list(Config) ->
- case test_server:is_release_available("r12b") of
- true -> bc_with_r12_1(Config);
- false -> {skip,"No R12B found"}
- end.
-
-bc_with_r12_1(Config) ->
- PA = filename:dirname(code:which(?MODULE)),
- Name1 = io_proto_r12_1,
- N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- test_server:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},
- {erl,[{release,"r12b"}]}]),
- DataDir = proplists:get_value(data_dir,Config),
- FileName1 = filename:join([DataDir,"testdata_latin1.dat"]),
- TestDataLine1 = [229,228,246],
- TestDataLine2 = [197,196,214],
- SPid1 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
- {ok,F1} = receive
- {SPid1,Res1} ->
- Res1
- after 5000 ->
- exit(timeout)
- end,
- TestDataLine1 = chomp(io:get_line(F1,'')),
- SPid1 ! die,
- receive after 1000 -> ok end,
- SPid2 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read,binary]]]),
- {ok,F2} = receive
- {SPid2,Res2} ->
- Res2
- after 5000 ->
- exit(timeout)
- end,
- TestDataLine1BinUtf = unicode:characters_to_binary(TestDataLine1),
- TestDataLine1BinLatin = list_to_binary(TestDataLine1),
- TestDataLine2BinUtf = unicode:characters_to_binary(TestDataLine2),
- TestDataLine2BinLatin = list_to_binary(TestDataLine2),
- TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
- TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
- %%io:format(standard_error,"Exec:~s\r\n",[rpc:call(N1,os,find_executable,["erl"])]),
- %%io:format(standard_error,"Io:~s\r\n",[rpc:call(N1,code,which,[io])]),
- %%io:format(standard_error,"File_io_server:~s\r\n",[rpc:call(N1,code,which,[file_io_server])]),
- file:position(F2,0),
- TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- TestDataLine2BinUtf = chomp(io:get_line(F2,'')),
- file:position(F2,0),
- TestDataLine1BinUtf = chomp(io:get_line(F2,'')),
- TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- eof = chomp(rpc:call(N1,io,get_line,[F2,''])),
- file:position(F2,0),
- TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F2,'',3]),
- io:get_chars(F2,'',1),
- TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F2,''])),
- file:position(F2,0),
- {ok,[TestDataLine1]} = io:fread(F2,'',"~s"),
- {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F2,'',"~s"]),
-
- DataLen1 = length(TestDataLine1),
- DataLen2 = length(TestDataLine2),
- file:position(F2,0),
- {ok,TestDataLine1BinLatin} = file:read(F2,DataLen1),
- {ok,_} = file:read(F2,1),
- {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F2,DataLen2]),
- {ok,_} = file:read(F2,1),
- eof = rpc:call(N1,file,read,[F2,1]),
- %% As r12 has a bug when setting options with setopts, we need
- %% to reopen the file...
- SPid2 ! die,
- receive after 1000 -> ok end,
- SPid3 = rpc:call(N1,erlang,spawn,[?MODULE,hold_the_line,[self(),FileName1,[read]]]),
- {ok,F3} = receive
- {SPid3,Res3} ->
- Res3
- after 5000 ->
- exit(timeout)
- end,
-
- file:position(F3,0),
- {ok,[TestDataLine1]} = io:fread(F3,'',"~s"),
- {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F3,'',"~s"]),
-
-
- file:position(F3,0),
- {ok,TestDataLine1} = file:read(F3,DataLen1),
- {ok,_} = file:read(F3,1),
- {ok,TestDataLine2} = rpc:call(N1,file,read,[F3,DataLen2]),
- {ok,_} = file:read(F3,1),
- eof = rpc:call(N1,file,read,[F3,1]),
-
-
- %% So, lets do it all again, but the other way around
- {ok,F4} = file:open(FileName1,[read]),
- TestDataLine1 = chomp(io:get_line(F4,'')),
- file:position(F4,0),
- io:setopts(F4,[binary]),
- TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- file:position(F4,0),
- TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- file:position(F4,0),
- TestDataLine1BinUtf = chomp(io:get_line(F4,'')),
- TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- file:position(F4,0),
- TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- TestDataLine2BinUtf = chomp(io:get_line(F4,'')),
- eof = chomp(rpc:call(N1,io,get_line,[F4,''])),
- file:position(F4,0),
- TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[F4,'',3]),
- io:get_chars(F4,'',1),
- TestDataLine2BinLatin = chomp(rpc:call(N1,io,get_line,[F4,''])),
- file:position(F4,0),
- {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
- {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
- file:position(F4,0),
- {ok,TestDataLine1BinLatin} = file:read(F4,DataLen1),
- {ok,_} = file:read(F4,1),
- {ok,TestDataLine2BinLatin} = rpc:call(N1,file,read,[F4,DataLen2]),
- {ok,_} = file:read(F4,1),
- eof = rpc:call(N1,file,read,[F4,1]),
- io:setopts(F4,[list]),
-
- file:position(F4,0),
- {ok,[TestDataLine1]} = io:fread(F4,'',"~s"),
- {ok,[TestDataLine2]} = rpc:call(N1,io,fread,[F4,'',"~s"]),
-
-
- file:position(F4,0),
- {ok,TestDataLine1} = file:read(F4,DataLen1),
- {ok,_} = file:read(F4,1),
- {ok,TestDataLine2} = rpc:call(N1,file,read,[F4,DataLen2]),
- {ok,_} = file:read(F4,1),
- eof = rpc:call(N1,file,read,[F4,1]),
-
- file:close(F4),
- test_server:stop_node(N1),
- ok.
-
-hold_the_line(Parent,Filename,Options) ->
- Parent ! {self(), file:open(Filename,Options)},
- receive
- die ->
- ok
- end.
-
-
-%% Test io protocol compatibility with R12 nodes (terminals).
-bc_with_r12_gl(Config) when is_list(Config) ->
- case test_server:is_release_available("r12b") of
- true ->
- case get_progs() of
- {error,Reason} ->
- {skip, Reason};
- _ ->
- bc_with_r12_gl_1(Config,answering_machine1)
- end;
- false ->
- {skip,"No R12B found"}
- end.
-
-%% Test io protocol compatibility with R12 nodes (oldshell).
-bc_with_r12_ogl(Config) when is_list(Config) ->
- case test_server:is_release_available("r12b") of
- true ->
- case get_progs() of
- {error,Reason} ->
- {skip, Reason};
- _ ->
- bc_with_r12_gl_1(Config,answering_machine2)
- end;
- false ->
- {skip,"No R12B found"}
- end.
-
-bc_with_r12_gl_1(_Config,Machine) ->
- PA = filename:dirname(code:which(?MODULE)),
- Name1 = io_proto_r12_gl_1,
- N1 = list_to_atom(atom_to_list(Name1) ++ "@" ++ hostname()),
- test_server:start_node(Name1, peer, [{args, "-pz \""++PA++"\""},
- {erl,[{release,"r12b"}]}]),
- TestDataLine1 = [229,228,246],
- TestDataLine1BinUtf = unicode:characters_to_binary(TestDataLine1),
- TestDataLine1BinLatin = list_to_binary(TestDataLine1),
-
- {ok,N2List} = create_nodename(),
- MyNodeList = atom2list(node()),
- register(io_proto_suite,self()),
- AM1 = spawn(?MODULE,Machine,
- [MyNodeList, "io_proto_suite", N2List]),
-
- GL = receive X when is_pid(X) -> X end,
- %% get_line
- "Hej\n" = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
- io:setopts(GL,[binary]),
- io:format(GL,"Okej~n",[]),
- <<"Hej\n">> = rpc:call(N1,io,get_line,[GL,"Prompt\n"]),
- io:setopts(GL,[{encoding,latin1}]),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- io:setopts(GL,[{encoding,unicode}]),
-
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinLatin = chomp(rpc:call(N1,io,get_line,[GL,"Prompt\n"])),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinUtf = chomp(io:get_line(GL,"Prompt\n")),
- io:setopts(GL,[list]),
- io:format(GL,"Okej~n",[]),
-
- %%get_chars
- "Hej" = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- io:setopts(GL,[binary]),
- io:format(GL,"Okej~n",[]),
- <<"Hej">> = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- io:setopts(GL,[{encoding,latin1}]),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- io:setopts(GL,[{encoding,unicode}]),
-
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinLatin = rpc:call(N1,io,get_chars,[GL,"Prompt\n",3]),
- io:format(GL,"Okej~n",[]),
- TestDataLine1BinUtf = io:get_chars(GL,"Prompt\n",3),
- io:setopts(GL,[list]),
- io:format(GL,"Okej~n",[]),
- %%fread
- {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- io:setopts(GL,[binary]),
- io:format(GL,"Okej~n",[]),
- {ok,["Hej"]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- io:setopts(GL,[{encoding,latin1}]),
- io:format(GL,"Okej~n",[]),
- {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- io:format(GL,"Okej~n",[]),
- {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- io:setopts(GL,[{encoding,unicode}]),
- io:format(GL,"Okej~n",[]),
- {ok,[TestDataLine1]} = rpc:call(N1,io,fread,[GL,"Prompt\n","~s"]),
- io:format(GL,"Okej~n",[]),
- {ok,[TestDataLine1]} = io:fread(GL,"Prompt\n","~s"),
- io:setopts(GL,[list]),
- io:format(GL,"Okej~n",[]),
-
-
- receive
- {AM1,done} ->
- ok
- after 5000 ->
- exit(timeout)
- end,
- test_server:stop_node(N1),
- ok.
answering_machine1(OthNode,OthReg,Me) ->
@@ -1900,13 +1641,6 @@ convert(Data, latin1, binary) ->
{error, {cannot_convert, unicode, latin1}}
end.
-hostname() ->
- from($@, atom_to_list(node())).
-
-from(H, [H | T]) -> T;
-from(H, [_ | T]) -> from(H, T);
-from(_, []) -> [].
-
atom2list(A) ->
lists:flatten(io_lib:format("~w", [A])).
diff --git a/lib/stdlib/test/rand_SUITE.erl b/lib/stdlib/test/rand_SUITE.erl
index fe5eaccda5..36bc283aec 100644
--- a/lib/stdlib/test/rand_SUITE.erl
+++ b/lib/stdlib/test/rand_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2000-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2000-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@
-export([interval_int/1, interval_float/1, seed/1,
api_eq/1, reference/1,
basic_stats_uniform_1/1, basic_stats_uniform_2/1,
+ basic_stats_standard_normal/1,
basic_stats_normal/1,
plugin/1, measure/1,
reference_jump_state/1, reference_jump_procdict/1]).
@@ -52,7 +53,8 @@ all() ->
groups() ->
[{basic_stats, [parallel],
- [basic_stats_uniform_1, basic_stats_uniform_2, basic_stats_normal]},
+ [basic_stats_uniform_1, basic_stats_uniform_2,
+ basic_stats_standard_normal, basic_stats_normal]},
{reference_jump, [parallel],
[reference_jump_state, reference_jump_procdict]}].
@@ -66,18 +68,19 @@ group(reference_jump) ->
%% A simple helper to test without test_server during dev
test() ->
Tests = all(),
- lists:foreach(fun(Test) ->
- try
- ok = ?MODULE:Test([]),
- io:format("~p: ok~n", [Test])
- catch _:Reason ->
- io:format("Failed: ~p: ~p ~p~n",
- [Test, Reason, erlang:get_stacktrace()])
- end
- end, Tests).
+ lists:foreach(
+ fun (Test) ->
+ try
+ ok = ?MODULE:Test([]),
+ io:format("~p: ok~n", [Test])
+ catch _:Reason ->
+ io:format("Failed: ~p: ~p ~p~n",
+ [Test, Reason, erlang:get_stacktrace()])
+ end
+ end, Tests).
algs() ->
- [exs64, exsplus, exs1024].
+ [exs64, exsplus, exsp, exrop, exs1024, exs1024s].
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -226,10 +229,10 @@ interval_float_1(0) -> ok;
interval_float_1(N) ->
X = rand:uniform(),
if
- 0.0 < X, X < 1.0 ->
+ 0.0 =< X, X < 1.0 ->
ok;
true ->
- io:format("X=~p 0<~p<1.0~n", [X,X]),
+ io:format("X=~p 0=<~p<1.0~n", [X,X]),
exit({X, rand:export_seed()})
end,
interval_float_1(N-1).
@@ -246,6 +249,8 @@ reference_1(Alg) ->
Testval = gen(Alg),
case Refval =:= Testval of
true -> ok;
+ false when Refval =:= not_implemented ->
+ exit({not_implemented,Alg});
false ->
io:format("Failed: ~p~n",[Alg]),
io:format("Length ~p ~p~n",[length(Refval), length(Testval)]),
@@ -254,25 +259,29 @@ reference_1(Alg) ->
end.
gen(Algo) ->
- Seed = case Algo of
- exsplus -> %% Printed with orig 'C' code and this seed
- rand:seed_s({exsplus, [12345678|12345678]});
- exs64 -> %% Printed with orig 'C' code and this seed
- rand:seed_s({exs64, 12345678});
- exs1024 -> %% Printed with orig 'C' code and this seed
- rand:seed_s({exs1024, {lists:duplicate(16, 12345678), []}});
- _ ->
- rand:seed(Algo, {100, 200, 300})
- end,
- gen(?LOOP, Seed, []).
-
-gen(N, State0 = {#{max:=Max}, _}, Acc) when N > 0 ->
+ State =
+ case Algo of
+ exs64 -> %% Printed with orig 'C' code and this seed
+ rand:seed_s({exs64, 12345678});
+ _ when Algo =:= exsplus; Algo =:= exsp; Algo =:= exrop ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed_s({Algo, [12345678|12345678]});
+ _ when Algo =:= exs1024; Algo =:= exs1024s ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed_s({Algo, {lists:duplicate(16, 12345678), []}});
+ _ ->
+ rand:seed(Algo, {100, 200, 300})
+ end,
+ Max = range(State),
+ gen(?LOOP, State, Max, []).
+
+gen(N, State0, Max, Acc) when N > 0 ->
{Random, State} = rand:uniform_s(Max, State0),
case N rem (?LOOP div 100) of
- 0 -> gen(N-1, State, [Random|Acc]);
- _ -> gen(N-1, State, Acc)
+ 0 -> gen(N-1, State, Max, [Random|Acc]);
+ _ -> gen(N-1, State, Max, Acc)
end;
-gen(_, _, Acc) -> lists:reverse(Acc).
+gen(_, _, _, Acc) -> lists:reverse(Acc).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This just tests the basics so we have not made any serious errors
@@ -294,12 +303,35 @@ basic_stats_uniform_2(Config) when is_list(Config) ->
|| Alg <- algs()],
ok.
-basic_stats_normal(Config) when is_list(Config) ->
+basic_stats_standard_normal(Config) when is_list(Config) ->
ct:timetrap({minutes,6}), %% valgrind needs a lot of time
- io:format("Testing normal~n",[]),
- [basic_normal_1(?LOOP, rand:seed_s(Alg), 0, 0) || Alg <- algs()],
+ io:format("Testing standard normal~n",[]),
+ IntendedMean = 0,
+ IntendedVariance = 1,
+ [basic_normal_1(?LOOP, IntendedMean, IntendedVariance,
+ rand:seed_s(Alg), 0, 0)
+ || Alg <- algs()],
ok.
+basic_stats_normal(Config) when is_list(Config) ->
+ IntendedMeans = [-1.0e6, -50, -math:pi(), -math:exp(-1),
+ 0.12345678, math:exp(1), 100, 1.0e6],
+ IntendedVariances = [1.0e-6, math:exp(-1), 1, math:pi(), 1.0e6],
+ IntendedMeanVariancePairs =
+ [{Mean, Variance} || Mean <- IntendedMeans,
+ Variance <- IntendedVariances],
+
+ ct:timetrap({minutes, 6 * length(IntendedMeanVariancePairs)}), %% valgrind needs a lot of time
+ lists:foreach(
+ fun ({IntendedMean, IntendedVariance}) ->
+ io:format("Testing normal(~.2f, ~.2f)~n",
+ [float(IntendedMean), float(IntendedVariance)]),
+ [basic_normal_1(?LOOP, IntendedMean, IntendedVariance,
+ rand:seed_s(Alg), 0, 0)
+ || Alg <- algs()]
+ end,
+ IntendedMeanVariancePairs).
+
basic_uniform_1(N, S0, Sum, A0) when N > 0 ->
{X,S} = rand:uniform_s(S0),
I = trunc(X*100),
@@ -307,11 +339,11 @@ basic_uniform_1(N, S0, Sum, A0) when N > 0 ->
basic_uniform_1(N-1, S, Sum+X, A);
basic_uniform_1(0, {#{type:=Alg}, _}, Sum, A) ->
AverN = Sum / ?LOOP,
- io:format("~.10w: Average: ~.4f~n", [Alg, AverN]),
+ io:format("~.12w: Average: ~.4f~n", [Alg, AverN]),
Counters = array:to_list(A),
Min = lists:min(Counters),
Max = lists:max(Counters),
- io:format("~.10w: Min: ~p Max: ~p~n", [Alg, Min, Max]),
+ io:format("~.12w: Min: ~p Max: ~p~n", [Alg, Min, Max]),
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
@@ -326,11 +358,11 @@ basic_uniform_2(N, S0, Sum, A0) when N > 0 ->
basic_uniform_2(N-1, S, Sum+X, A);
basic_uniform_2(0, {#{type:=Alg}, _}, Sum, A) ->
AverN = Sum / ?LOOP,
- io:format("~.10w: Average: ~.4f~n", [Alg, AverN]),
+ io:format("~.12w: Average: ~.4f~n", [Alg, AverN]),
Counters = tl(array:to_list(A)),
Min = lists:min(Counters),
Max = lists:max(Counters),
- io:format("~.10w: Min: ~p Max: ~p~n", [Alg, Min, Max]),
+ io:format("~.12w: Min: ~p Max: ~p~n", [Alg, Min, Max]),
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
@@ -339,107 +371,270 @@ basic_uniform_2(0, {#{type:=Alg}, _}, Sum, A) ->
abs(?LOOP div 100 - Max) < 1000 orelse ct:fail({max, Alg, Max}),
ok.
-basic_normal_1(N, S0, Sum, Sq) when N > 0 ->
- {X,S} = rand:normal_s(S0),
- basic_normal_1(N-1, S, X+Sum, X*X+Sq);
-basic_normal_1(0, {#{type:=Alg}, _}, Sum, SumSq) ->
- Mean = Sum / ?LOOP,
- StdDev = math:sqrt((SumSq - (Sum*Sum/?LOOP))/(?LOOP - 1)),
- io:format("~.10w: Average: ~7.4f StdDev ~6.4f~n", [Alg, Mean, StdDev]),
+basic_normal_1(N, IntendedMean, IntendedVariance, S0, StandardSum, StandardSq) when N > 0 ->
+ {X,S} = normal_s(IntendedMean, IntendedVariance, S0),
+ % We now shape X into a standard normal distribution (in case it wasn't already)
+ % in order to minimise the accumulated error on Sum / SumSq;
+ % otherwise said error would prevent us of making a fair judgment on
+ % the overall distribution when targeting large means and variances.
+ StandardX = (X - IntendedMean) / math:sqrt(IntendedVariance),
+ basic_normal_1(N-1, IntendedMean, IntendedVariance, S,
+ StandardX+StandardSum, StandardX*StandardX+StandardSq);
+basic_normal_1(0, _IntendedMean, _IntendedVariance, {#{type:=Alg}, _}, StandardSum, StandardSumSq) ->
+ StandardMean = StandardSum / ?LOOP,
+ StandardVariance = (StandardSumSq - (StandardSum*StandardSum/?LOOP))/(?LOOP - 1),
+ StandardStdDev = math:sqrt(StandardVariance),
+ io:format("~.12w: Standardised Average: ~7.4f, Standardised StdDev ~6.4f~n",
+ [Alg, StandardMean, StandardStdDev]),
%% Verify that the basic statistics are ok
%% be gentle we don't want to see to many failing tests
- abs(Mean) < 0.005 orelse ct:fail({average, Alg, Mean}),
- abs(StdDev - 1.0) < 0.005 orelse ct:fail({stddev, Alg, StdDev}),
+ abs(StandardMean) < 0.005 orelse ct:fail({average, Alg, StandardMean}),
+ abs(StandardStdDev - 1.0) < 0.005 orelse ct:fail({stddev, Alg, StandardStdDev}),
ok.
+normal_s(Mean, Variance, State0) when Mean == 0, Variance == 1 ->
+ % Make sure we're also testing the standard normal interface
+ rand:normal_s(State0);
+normal_s(Mean, Variance, State0) ->
+ rand:normal_s(Mean, Variance, State0).
+
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Test that the user can write algorithms.
plugin(Config) when is_list(Config) ->
- _ = lists:foldl(fun(_, S0) ->
- {V1, S1} = rand:uniform_s(10000, S0),
- true = is_integer(V1),
- {V2, S2} = rand:uniform_s(S1),
- true = is_float(V2),
- S2
- end, crypto_seed(), lists:seq(1, 200)),
- ok.
+ try crypto:strong_rand_bytes(1) of
+ <<_>> ->
+ _ = lists:foldl(
+ fun(_, S0) ->
+ {V1, S1} = rand:uniform_s(10000, S0),
+ true = is_integer(V1),
+ {V2, S2} = rand:uniform_s(S1),
+ true = is_float(V2),
+ S2
+ end, crypto64_seed(), lists:seq(1, 200)),
+ ok
+ catch
+ error:low_entropy ->
+ {skip,low_entropy};
+ error:undef ->
+ {skip,no_crypto}
+ end.
%% Test implementation
-crypto_seed() ->
- {#{type=>crypto,
- max=>(1 bsl 64)-1,
- next=>fun crypto_next/1,
- uniform=>fun crypto_uniform/1,
- uniform_n=>fun crypto_uniform_n/2},
+crypto64_seed() ->
+ {#{type=>crypto64,
+ bits=>64,
+ next=>fun crypto64_next/1,
+ uniform=>fun crypto64_uniform/1,
+ uniform_n=>fun crypto64_uniform_n/2},
<<>>}.
%% Be fair and create bignums i.e. 64bits otherwise use 58bits
-crypto_next(<<Num:64, Bin/binary>>) ->
+crypto64_next(<<Num:64, Bin/binary>>) ->
{Num, Bin};
-crypto_next(_) ->
- crypto_next(crypto:strong_rand_bytes((64 div 8)*100)).
+crypto64_next(_) ->
+ crypto64_next(crypto:strong_rand_bytes((64 div 8)*100)).
-crypto_uniform({Api, Data0}) ->
- {Int, Data} = crypto_next(Data0),
+crypto64_uniform({Api, Data0}) ->
+ {Int, Data} = crypto64_next(Data0),
{Int / (1 bsl 64), {Api, Data}}.
-crypto_uniform_n(N, {Api, Data0}) when N < (1 bsl 64) ->
- {Int, Data} = crypto_next(Data0),
+crypto64_uniform_n(N, {Api, Data0}) when N < (1 bsl 64) ->
+ {Int, Data} = crypto64_next(Data0),
{(Int rem N)+1, {Api, Data}};
-crypto_uniform_n(N, State0) ->
- {F,State} = crypto_uniform(State0),
+crypto64_uniform_n(N, State0) ->
+ {F,State} = crypto64_uniform(State0),
{trunc(F * N) + 1, State}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Not a test but measures the time characteristics of the different algorithms
-measure(Suite) when is_atom(Suite) -> [];
-measure(_Config) ->
- ct:timetrap({minutes,15}), %% valgrind needs a lot of time
- Algos = [crypto64|algs()],
- io:format("RNG uniform integer performance~n",[]),
- _ = measure_1(random, fun(State) -> {int, random:uniform_s(10000, State)} end),
- _ = [measure_1(Algo, fun(State) -> {int, rand:uniform_s(10000, State)} end) || Algo <- Algos],
- io:format("RNG uniform float performance~n",[]),
- _ = measure_1(random, fun(State) -> {uniform, random:uniform_s(State)} end),
- _ = [measure_1(Algo, fun(State) -> {uniform, rand:uniform_s(State)} end) || Algo <- Algos],
- io:format("RNG normal float performance~n",[]),
- io:format("~.10w: not implemented (too few bits)~n", [random]),
- _ = [measure_1(Algo, fun(State) -> {normal, rand:normal_s(State)} end) || Algo <- Algos],
+measure(Config) ->
+ ct:timetrap({minutes,30}), %% valgrind needs a lot of time
+ case ct:get_timetrap_info() of
+ {_,{_,1}} -> % No scaling
+ do_measure(Config);
+ {_,{_,Scale}} ->
+ {skip,{will_not_run_in_scaled_time,Scale}}
+ end.
+
+do_measure(_Config) ->
+ Algos =
+ try crypto:strong_rand_bytes(1) of
+ <<_>> -> [crypto64, crypto]
+ catch
+ error:low_entropy -> [];
+ error:undef -> []
+ end ++ algs(),
+ %%
+ ct:pal("RNG uniform integer performance~n",[]),
+ TMark1 =
+ measure_1(
+ random,
+ fun (_) -> 10000 end,
+ undefined,
+ fun (Range, State) ->
+ {int, random:uniform_s(Range, State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ fun (_) -> 10000 end,
+ TMark1,
+ fun (Range, State) ->
+ {int, rand:uniform_s(Range, State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG uniform integer 2^(N-1) performance~n",[]),
+ RangeTwoPowFun = fun (State) -> quart_range(State) bsl 1 end,
+ TMark2 =
+ measure_1(
+ random,
+ RangeTwoPowFun,
+ undefined,
+ fun (Range, State) ->
+ {int, random:uniform_s(Range, State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ RangeTwoPowFun,
+ TMark2,
+ fun (Range, State) ->
+ {int, rand:uniform_s(Range, State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG uniform integer 3*2^(N-2)+1 performance~n",[]),
+ RangeLargeFun = fun (State) -> 3 * quart_range(State) + 1 end,
+ TMark3 =
+ measure_1(
+ random,
+ RangeLargeFun,
+ undefined,
+ fun (Range, State) ->
+ {int, random:uniform_s(Range, State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ RangeLargeFun,
+ TMark3,
+ fun (Range, State) ->
+ {int, rand:uniform_s(Range, State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG uniform integer 2^128 performance~n",[]),
+ TMark4 =
+ measure_1(
+ random,
+ fun (_) -> 1 bsl 128 end,
+ undefined,
+ fun (Range, State) ->
+ {int, random:uniform_s(Range, State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ fun (_) -> 1 bsl 128 end,
+ TMark4,
+ fun (Range, State) ->
+ {int, rand:uniform_s(Range, State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG uniform integer 2^128 + 1 performance~n",[]),
+ TMark5 =
+ measure_1(
+ random,
+ fun (_) -> (1 bsl 128) + 1 end,
+ undefined,
+ fun (Range, State) ->
+ {int, random:uniform_s(Range, State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ fun (_) -> (1 bsl 128) + 1 end,
+ TMark5,
+ fun (Range, State) ->
+ {int, rand:uniform_s(Range, State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG uniform float performance~n",[]),
+ TMark6 =
+ measure_1(
+ random,
+ fun (_) -> 0 end,
+ undefined,
+ fun (_, State) ->
+ {uniform, random:uniform_s(State)}
+ end),
+ _ =
+ [measure_1(
+ Algo,
+ fun (_) -> 0 end,
+ TMark6,
+ fun (_, State) ->
+ {uniform, rand:uniform_s(State)}
+ end) || Algo <- Algos],
+ %%
+ ct:pal("~nRNG normal float performance~n",[]),
+ io:format("~.12w: not implemented (too few bits)~n", [random]),
+ _ = [measure_1(
+ Algo,
+ fun (_) -> 0 end,
+ TMark6,
+ fun (_, State) ->
+ {normal, rand:normal_s(State)}
+ end) || Algo <- Algos],
ok.
-measure_1(Algo, Gen) ->
+measure_1(Algo, RangeFun, TMark, Gen) ->
Parent = self(),
- Seed = fun(crypto64) -> crypto_seed();
- (random) -> random:seed(os:timestamp()), get(random_seed);
- (Alg) -> rand:seed_s(Alg)
- end,
-
- Pid = spawn_link(fun() ->
- Fun = fun() -> measure_2(?LOOP, Seed(Algo), Gen) end,
- {Time, ok} = timer:tc(Fun),
- io:format("~.10w: ~pµs~n", [Algo, Time]),
- Parent ! {self(), ok},
- normal
- end),
+ Seed =
+ case Algo of
+ crypto64 ->
+ crypto64_seed();
+ crypto ->
+ crypto:rand_seed_s();
+ random ->
+ random:seed(os:timestamp()), get(random_seed);
+ _ ->
+ rand:seed_s(Algo)
+ end,
+ Range = RangeFun(Seed),
+ Pid = spawn_link(
+ fun() ->
+ Fun = fun() -> measure_2(?LOOP, Range, Seed, Gen) end,
+ {Time, ok} = timer:tc(Fun),
+ Percent =
+ case TMark of
+ undefined -> 100;
+ _ -> (Time * 100 + 50) div TMark
+ end,
+ io:format(
+ "~.12w: ~p ns ~p% [16#~.16b]~n",
+ [Algo, (Time * 1000 + 500) div ?LOOP, Percent, Range]),
+ Parent ! {self(), Time},
+ normal
+ end),
receive
{Pid, Msg} -> Msg
end.
-measure_2(N, State0, Fun) when N > 0 ->
- case Fun(State0) of
+measure_2(N, Range, State0, Fun) when N > 0 ->
+ case Fun(Range, State0) of
{int, {Random, State}}
- when is_integer(Random), Random >= 1, Random =< 100000 ->
- measure_2(N-1, State, Fun);
- {uniform, {Random, State}} when is_float(Random), Random > 0, Random < 1 ->
- measure_2(N-1, State, Fun);
+ when is_integer(Random), Random >= 1, Random =< Range ->
+ measure_2(N-1, Range, State, Fun);
+ {uniform, {Random, State}}
+ when is_float(Random), 0.0 =< Random, Random < 1.0 ->
+ measure_2(N-1, Range, State, Fun);
{normal, {Random, State}} when is_float(Random) ->
- measure_2(N-1, State, Fun);
+ measure_2(N-1, Range, State, Fun);
Res ->
exit({error, Res, State0})
end;
-measure_2(0, _, _) -> ok.
+measure_2(0, _, _, _) -> ok.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% The jump sequence tests has two parts
@@ -464,36 +659,43 @@ reference_jump_1(Alg) ->
io:format("Failed: ~p~n",[Alg]),
io:format("Length ~p ~p~n",[length(Refval), length(Testval)]),
io:format("Head ~p ~p~n",[hd(Refval), hd(Testval)]),
+ io:format("Vals ~p ~p~n",[Refval, Testval]),
exit(wrong_value)
end.
gen_jump_1(Algo) ->
- Seed = case Algo of
- exsplus -> %% Printed with orig 'C' code and this seed
- rand:seed_s({exsplus, [12345678|12345678]});
- exs1024 -> %% Printed with orig 'C' code and this seed
- rand:seed_s({exs1024, {lists:duplicate(16, 12345678), []}});
- exs64 -> %% Test exception of not_implemented notice
- try rand:jump(rand:seed_s(exs64))
- catch
- error:not_implemented -> not_implemented
- end;
- _ -> % unimplemented
- not_implemented
- end,
- case Seed of
+ State =
+ case Algo of
+ exs64 -> %% Test exception of not_implemented notice
+ try rand:jump(rand:seed_s(exs64))
+ catch
+ error:not_implemented -> not_implemented
+ end;
+ _ when Algo =:= exsplus; Algo =:= exsp; Algo =:= exrop ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed_s({Algo, [12345678|12345678]});
+ _ when Algo =:= exs1024; Algo =:= exs1024s ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed_s({Algo, {lists:duplicate(16, 12345678), []}});
+ _ -> % unimplemented
+ not_implemented
+ end,
+ case State of
not_implemented -> [not_implemented];
- S -> gen_jump_1(?LOOP_JUMP, S, [])
+ _ ->
+ Max = range(State),
+ gen_jump_1(?LOOP_JUMP, State, Max, [])
end.
-gen_jump_1(N, State0 = {#{max:=Max}, _}, Acc) when N > 0 ->
+gen_jump_1(N, State0, Max, Acc) when N > 0 ->
{_, State1} = rand:uniform_s(Max, State0),
{Random, State2} = rand:uniform_s(Max, rand:jump(State1)),
case N rem (?LOOP_JUMP div 100) of
- 0 -> gen_jump_1(N-1, State2, [Random|Acc]);
- _ -> gen_jump_1(N-1, State2, Acc)
+ 0 -> gen_jump_1(N-1, State2, Max, [Random|Acc]);
+ _ -> gen_jump_1(N-1, State2, Max, Acc)
end;
-gen_jump_1(_, _, Acc) -> lists:reverse(Acc).
+gen_jump_1(_, _, _, Acc) -> lists:reverse(Acc).
+
%% Check if each algorithm generates the proper jump sequence
%% with the internal state in the process dictionary.
@@ -515,25 +717,26 @@ reference_jump_0(Alg) ->
gen_jump_0(Algo) ->
Seed = case Algo of
- exsplus -> %% Printed with orig 'C' code and this seed
- rand:seed({exsplus, [12345678|12345678]});
- exs1024 -> %% Printed with orig 'C' code and this seed
- rand:seed({exs1024, {lists:duplicate(16, 12345678), []}});
exs64 -> %% Test exception of not_implemented notice
- try
- _ = rand:seed(exs64),
- rand:jump()
- catch
- error:not_implemented -> not_implemented
- end;
+ try
+ _ = rand:seed(exs64),
+ rand:jump()
+ catch
+ error:not_implemented -> not_implemented
+ end;
+ _ when Algo =:= exsplus; Algo =:= exsp; Algo =:= exrop ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed({Algo, [12345678|12345678]});
+ _ when Algo =:= exs1024; Algo =:= exs1024s ->
+ %% Printed with orig 'C' code and this seed
+ rand:seed({Algo, {lists:duplicate(16, 12345678), []}});
_ -> % unimplemented
not_implemented
end,
case Seed of
not_implemented -> [not_implemented];
- S ->
- {Seedmap=#{}, _} = S,
- Max = maps:get(max, Seedmap),
+ _ ->
+ Max = range(Seed),
gen_jump_0(?LOOP_JUMP, Max, [])
end.
@@ -628,9 +831,77 @@ reference_val(exsplus) ->
16#6c6145ffa1169d,16#18ec2c393d45359,16#1f1a5f256e7130c,16#131cc2f49b8004f,
16#36f715a249f4ec2,16#1c27629826c50d3,16#914d9a6648726a,16#27f5bf5ce2301e8,
16#3dd493b8012970f,16#be13bed1e00e5c,16#ceef033b74ae10,16#3da38c6a50abe03,
- 16#15cbd1a421c7a8c,16#22794e3ec6ef3b1,16#26154d26e7ea99f,16#3a66681359a6ab6].
+ 16#15cbd1a421c7a8c,16#22794e3ec6ef3b1,16#26154d26e7ea99f,16#3a66681359a6ab6];
+
+reference_val(exsp) ->
+ reference_val(exsplus);
+reference_val(exs1024s) ->
+ reference_val(exs1024);
+reference_val(exrop) ->
+%% #include <stdint.h>
+%% #include <stdio.h>
+%%
+%% uint64_t s[2];
+%% uint64_t next(void);
+%% /* Xoroshiro116+ PRNG here */
+%%
+%% int main(char *argv[]) {
+%% int n;
+%% uint64_t r;
+%% s[0] = 12345678;
+%% s[1] = 12345678;
+%%
+%% for (n = 1000000; n > 0; n--) {
+%% r = next();
+%% if ((n % 10000) == 0) {
+%% printf("%llu,", (unsigned long long) (r + 1));
+%% }
+%% }
+%% printf("\n");
+%% }
+ [24691357,29089185972758626,135434857127264790,
+ 277209758236304485,101045429972817342,
+ 241950202080388093,283018380268425711,268233672110762489,
+ 173241488791227202,245038518481669421,
+ 253627577363613736,234979870724373477,115607127954560275,
+ 96445882796968228,166106849348423677,
+ 83614184550774836,109634510785746957,68415533259662436,
+ 12078288820568786,246413981014863011,
+ 96953486962147513,138629231038332640,206078430370986460,
+ 11002780552565714,238837272913629203,
+ 60272901610411077,148828243883348685,203140738399788939,
+ 131001610760610046,30717739120305678,
+ 262903815608472425,31891125663924935,107252017522511256,
+ 241577109487224033,263801934853180827,
+ 155517416581881714,223609336630639997,112175917931581716,
+ 16523497284706825,201453767973653420,
+ 35912153101632769,211525452750005043,96678037860996922,
+ 70962216125870068,107383886372877124,
+ 223441708670831233,247351119445661499,233235283318278995,
+ 280646255087307741,232948506631162445,
+ %%
+ 117394974124526779,55395923845250321,274512622756597759,
+ 31754154862553492,222645458401498438,
+ 161643932692872858,11771755227312868,93933211280589745,
+ 92242631276348831,197206910466548143,
+ 150370169849735808,229903773212075765,264650708561842793,
+ 30318996509793571,158249985447105184,
+ 220423733894955738,62892844479829080,112941952955911674,
+ 203157000073363030,54175707830615686,
+ 50121351829191185,115891831802446962,62298417197154985,
+ 6569598473421167,69822368618978464,
+ 176271134892968134,160793729023716344,271997399244980560,
+ 59100661824817999,150500611720118722,
+ 23707133151561128,25156834940231911,257788052162304719,
+ 176517852966055005,247173855600850875,
+ 83440973524473396,94711136045581604,154881198769946042,
+ 236537934330658377,152283781345006019,
+ 250789092615679985,78848633178610658,72059442721196128,
+ 98223942961505519,191144652663779840,
+ 102425686803727694,89058927716079076,80721467542933080,
+ 8462479817391645,2774921106204163].
-%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
reference_jump_val(exsplus) ->
[82445318862816932, 145810727464480743, 16514517716894509, 247642377064868650,
@@ -686,4 +957,93 @@ reference_jump_val(exs1024) ->
17936751184378118743, 4224632875737239207, 15888641556987476199, 9586888813112229805,
9476861567287505094, 14909536929239540332, 17996844556292992842, 2699310519182298856];
-reference_jump_val(exs64) -> [not_implemented].
+reference_jump_val(exsp) ->
+ reference_jump_val(exsplus);
+reference_jump_val(exs1024s) ->
+ reference_jump_val(exs1024);
+reference_jump_val(exs64) -> [not_implemented];
+reference_jump_val(exrop) ->
+%% #include <stdint.h>
+%% #include <stdio.h>
+%%
+%% uint64_t s[2];
+%% uint64_t next(void);
+%% /* Xoroshiro116+ PRNG here */
+%%
+%% int main(char *argv[]) {
+%% int n;
+%% uint64_t r;
+%% s[0] = 12345678;
+%% s[1] = 12345678;
+
+%% for (n = 1000; n > 0; n--) {
+%% next();
+%% jump();
+%% r = next();
+%% if ((n % 10) == 0) {
+%% printf("%llu,", (unsigned long long) (r + 1));
+%% }
+%% }
+%% printf("\n");
+%% }
+ [60301713907476001,135397949584721850,4148159712710727,
+ 110297784509908316,18753463199438866,
+ 106699913259182846,2414728156662676,237591345910610406,
+ 48519427605486503,38071665570452612,
+ 235484041375354592,45428997361037927,112352324717959775,
+ 226084403445232507,270797890380258829,
+ 160587966336947922,80453153271416820,222758573634013699,
+ 195715386237881435,240975253876429810,
+ 93387593470886224,23845439014202236,235376123357642262,
+ 22286175195310374,239068556844083490,
+ 120126027410954482,250690865061862527,113265144383673111,
+ 57986825640269127,206087920253971490,
+ 265971029949338955,40654558754415167,185972161822891882,
+ 72224917962819036,116613804322063968,
+ 129103518989198416,236110607653724474,98446977363728314,
+ 122264213760984600,55635665885245081,
+ 42625530794327559,288031254029912894,81654312180555835,
+ 261800844953573559,144734008151358432,
+ 77095621402920587,286730580569820386,274596992060316466,
+ 97977034409404188,5517946553518132,
+ %%
+ 56460292644964432,252118572460428657,38694442746260303,
+ 165653145330192194,136968555571402812,
+ 64905200201714082,257386366768713186,22702362175273017,
+ 208480936480037395,152926769756967697,
+ 256751159334239189,130982960476845557,21613531985982870,
+ 87016962652282927,130446710536726404,
+ 188769410109327420,282891129440391928,251807515151187951,
+ 262029034126352975,30694713572208714,
+ 46430187445005589,176983177204884508,144190360369444480,
+ 14245137612606100,126045457407279122,
+ 169277107135012393,42599413368851184,130940158341360014,
+ 113412693367677211,119353175256553456,
+ 96339829771832349,17378172025472134,110141940813943768,
+ 253735613682893347,234964721082540068,
+ 85668779779185140,164542570671430062,18205512302089755,
+ 282380693509970845,190996054681051049,
+ 250227633882474729,171181147785250210,55437891969696407,
+ 241227318715885854,77323084015890802,
+ 1663590009695191,234064400749487599,222983191707424780,
+ 254956809144783896,203898972156838252].
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% The old algorithms used a range 2^N - 1 for their reference val
+%% tests, which was incorrect but works as long as you do not draw
+%% the value 2^N, which is very unlikely. It was not possible
+%% to simply correct the range to 2^N due to another incorrectness
+%% in that the old algorithms changed to using the broken
+%% (multiply a float approach with too few bits) approach for
+%% ranges >= 2^N. This function digs out the range to use
+%% for the reference tests for old and new algorithms.
+range({#{bits:=Bits}, _}) -> 1 bsl Bits;
+range({#{max:=Max}, _}) -> Max; %% Old incorrect range
+range({_, _, _}) -> 51. % random
+
+
+quart_range({#{bits:=Bits}, _}) -> 1 bsl (Bits - 2);
+quart_range({#{max:=Max}, _}) -> (Max bsr 2) + 1;
+quart_range({#{}, _}) -> 1 bsl 62; % crypto
+quart_range({_, _, _}) -> 1 bsl 49. % random
diff --git a/lib/stdlib/test/re_SUITE.erl b/lib/stdlib/test/re_SUITE.erl
index 52d3a9f797..71f86e32e5 100644
--- a/lib/stdlib/test/re_SUITE.erl
+++ b/lib/stdlib/test/re_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
run_options/1,combined_options/1,replace_autogen/1,
global_capture/1,replace_input_types/1,replace_return/1,
split_autogen/1,split_options/1,split_specials/1,
- error_handling/1,pcre_cve_2008_2371/1,
+ error_handling/1,pcre_cve_2008_2371/1,re_version/1,
pcre_compile_workspace_overflow/1,re_infinite_loop/1,
re_backwards_accented/1,opt_dupnames/1,opt_all_names/1,inspect/1,
opt_no_start_optimize/1,opt_never_utf/1,opt_ucp/1,
@@ -45,7 +45,7 @@ all() ->
pcre_compile_workspace_overflow, re_infinite_loop,
re_backwards_accented, opt_dupnames, opt_all_names,
inspect, opt_no_start_optimize,opt_never_utf,opt_ucp,
- match_limit, sub_binaries].
+ match_limit, sub_binaries, re_version].
groups() ->
[].
@@ -194,6 +194,14 @@ run_options(Config) when is_list(Config) ->
+%% Test the version is retorned correctly
+re_version(_Config) ->
+ Version = re:version(),
+ {match,[Version]} = re:run(Version,"^[0-9]\\.[0-9]{2} 20[0-9]{2}-[0-9]{2}-[0-9]{2}",[{capture,all,binary}]),
+ ok.
+
+
+
%% Test compile options given directly to run.
combined_options(Config) when is_list(Config) ->
ok = crtest("ABDabcdABCD","abcd",[],true,{match,[{3,4}]}),
@@ -612,9 +620,15 @@ pcre_cve_2008_2371(Config) when is_list(Config) ->
%% http://vcs.pcre.org/viewvc/code/trunk/pcre_compile.c?r1=504&r2=505&view=patch
pcre_compile_workspace_overflow(Config) when is_list(Config) ->
N = 819,
- {error,{"internal error: overran compiling workspace",799}} =
- re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]),
- ok.
+ ExpStr = "Got expected error: ",
+ case re:compile([lists:duplicate(N, $(), lists:duplicate(N, $))]) of
+ {error, {"regular expression is too complicated" = Str,799}} ->
+ {comment, ExpStr ++ Str};
+ {error, {"parentheses are too deeply nested (stack check)" = Str, _No}} ->
+ {comment, ExpStr ++ Str};
+ Other ->
+ ?t:fail({unexpected, Other})
+ end.
%% Make sure matches that really loop infinitely actually fail.
re_infinite_loop(Config) when is_list(Config) ->
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput1 b/lib/stdlib/test/re_SUITE_data/testoutput1
index 3ed635146a..a2b3cffe9d 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput1
+++ b/lib/stdlib/test/re_SUITE_data/testoutput1
@@ -1,6 +1,8 @@
/-- This set of tests is for features that are compatible with all versions of
- Perl >= 5.10, in non-UTF-8 mode. It should run clean for both the 8-bit and
- 16-bit PCRE libraries. --/
+ Perl >= 5.10, in non-UTF-8 mode. It should run clean for the 8-bit, 16-bit,
+ and 32-bit PCRE libraries. --/
+
+< forbid 89?=ABCDEFfGILMNPTUWXZ<
/the quick brown fox/
the quick brown fox
@@ -221,7 +223,7 @@ No match
babababc
No match
-/^\ca\cA\c[\c{\c:/
+/^\ca\cA\c[;\c:/
\x01\x01\e;z
0: \x01\x01\x1b;z
@@ -2149,18 +2151,35 @@ No match
abc\100\60
0: abc@0
1: abc
-
-/abc\81/
- abc\081
- 0: abc\x0081
- abc\0\x38\x31
- 0: abc\x0081
-
-/abc\91/
- abc\091
- 0: abc\x0091
- abc\0\x39\x31
- 0: abc\x0091
+
+/^A\8B\9C$/
+ A8B9C
+ 0: A8B9C
+ *** Failers
+No match
+ A\08B\09C
+No match
+
+/^(A)(B)(C)(D)(E)(F)(G)(H)(I)\8\9$/
+ ABCDEFGHIHI
+ 0: ABCDEFGHIHI
+ 1: A
+ 2: B
+ 3: C
+ 4: D
+ 5: E
+ 6: F
+ 7: G
+ 8: H
+ 9: I
+
+/^[A\8B\9C]+$/
+ A8B9C
+ 0: A8B9C
+ *** Failers
+No match
+ A8B9C\x00
+No match
/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\12\123/
abcdefghijkllS
@@ -5972,18 +5991,6 @@ No match
0:
0:
-/^[a-\d]/
- abcde
- 0: a
- -things
- 0: -
- 0digit
- 0: 0
- *** Failers
-No match
- bcdef
-No match
-
/^[\d-a]/
abcde
0: a
@@ -6006,15 +6013,15 @@ No match
/[\s]+/
> \x09\x0a\x0c\x0d\x0b<
- 0: \x09\x0a\x0c\x0d
+ 0: \x09\x0a\x0c\x0d\x0b
/\s+/
> \x09\x0a\x0c\x0d\x0b<
- 0: \x09\x0a\x0c\x0d
+ 0: \x09\x0a\x0c\x0d\x0b
/a b/x
ab
-No match
+ 0: ab
/(?!\A)x/m
a\nxb\n
@@ -6904,10 +6911,6 @@ No match
bc
0: b
-/^(?=(a)){0}b(?1)/
- backgammon
- 0: ba
-
/^(?=(?1))?[az]([abc])d/
abd
0: abd
@@ -8231,6 +8234,16 @@ MK: M
aaaabcde
0: aaaab
1: aaaab
+
+/((?(R)a|(?1)))*/
+ aaa
+ 0: aaa
+ 1: a
+
+/((?(R)a|(?1)))+/
+ aaa
+ 0: aaa
+ 1: a
/a(*:any
name)/K
@@ -9200,4 +9213,233 @@ No match
aaa
No match
+/(?(?=ab)ab)/+
+ ca
+ 0:
+ 0+ ca
+ cd
+ 0:
+ 0+ cd
+
+/(?:(?<n>foo)|(?<n>bar))\k<n>/J
+ foofoo
+ 0: foofoo
+ 1: foo
+ barbar
+ 0: barbar
+ 1: <unset>
+ 2: bar
+
+/(?<n>A)(?:(?<n>foo)|(?<n>bar))\k<n>/J
+ AfooA
+ 0: AfooA
+ 1: A
+ 2: foo
+ AbarA
+ 0: AbarA
+ 1: A
+ 2: <unset>
+ 3: bar
+ ** Failers
+No match
+ Afoofoo
+No match
+ Abarbar
+No match
+
+/^(\d+)\s+IN\s+SOA\s+(\S+)\s+(\S+)\s*\(\s*$/
+ 1 IN SOA non-sp1 non-sp2(
+ 0: 1 IN SOA non-sp1 non-sp2(
+ 1: 1
+ 2: non-sp1
+ 3: non-sp2
+
+/^ (?:(?<A>A)|(?'B'B)(?<A>A)) (?('A')x) (?(<B>)y)$/xJ
+ Ax
+ 0: Ax
+ 1: A
+ BAxy
+ 0: BAxy
+ 1: <unset>
+ 2: B
+ 3: A
+
+/^A\xZ/
+ A\0Z
+ 0: A\x00Z
+
+/^A\o{123}B/
+ A\123B
+ 0: ASB
+
+/ ^ a + + b $ /x
+ aaaab
+ 0: aaaab
+
+/ ^ a + #comment
+ + b $ /x
+ aaaab
+ 0: aaaab
+
+/ ^ a + #comment
+ #comment
+ + b $ /x
+ aaaab
+ 0: aaaab
+
+/ ^ (?> a + ) b $ /x
+ aaaab
+ 0: aaaab
+
+/ ^ ( a + ) + + \w $ /x
+ aaaab
+ 0: aaaab
+ 1: aaaa
+
+/(?:a\Kb)*+/+
+ ababc
+ 0: b
+ 0+ c
+
+/(?>a\Kb)*/+
+ ababc
+ 0: b
+ 0+ c
+
+/(?:a\Kb)*/+
+ ababc
+ 0: b
+ 0+ c
+
+/(a\Kb)*+/+
+ ababc
+ 0: b
+ 0+ c
+ 1: ab
+
+/(a\Kb)*/+
+ ababc
+ 0: b
+ 0+ c
+ 1: ab
+
+/(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc/
+ acb
+No match
+
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")++\")++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+
+'\A([^\"1]++|[\"2]([^\"3]*+|[\"4][\"5])*+[\"6])++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+ 1: AFTER
+ 2:
+
+/^\w+(?>\s*)(?<=\w)/
+ test test
+ 0: tes
+
+/(?P<same>a)(?P<same>b)/gJ
+ abbaba
+ 0: ab
+ 1: a
+ 2: b
+ 0: ab
+ 1: a
+ 2: b
+
+/(?P<same>a)(?P<same>b)(?P=same)/gJ
+ abbaba
+ 0: aba
+ 1: a
+ 2: b
+
+/(?P=same)?(?P<same>a)(?P<same>b)/gJ
+ abbaba
+ 0: ab
+ 1: a
+ 2: b
+ 0: ab
+ 1: a
+ 2: b
+
+/(?:(?P=same)?(?:(?P<same>a)|(?P<same>b))(?P=same))+/gJ
+ bbbaaabaabb
+ 0: bbbaaaba
+ 1: a
+ 2: b
+ 0: bb
+ 1: <unset>
+ 2: b
+
+/(?:(?P=same)?(?:(?P=same)(?P<same>a)(?P=same)|(?P=same)?(?P<same>b)(?P=same)){2}(?P=same)(?P<same>c)(?P=same)){2}(?P<same>z)?/gJ
+ bbbaaaccccaaabbbcc
+No match
+
+/(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l/
+ acl
+ 0: acl
+ 1: a
+ bdl
+ 0: bdl
+ 1: <unset>
+ 2: b
+ adl
+ 0: dl
+ bcl
+ 0: l
+
+/\sabc/
+ \x{0b}abc
+ 0: \x0babc
+
+/[\Qa]\E]+/
+ aa]]
+ 0: aa]]
+
+/[\Q]a\E]+/
+ aa]]
+ 0: aa]]
+
+/(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))/
+ 1234abcd
+ 0:
+ 1: <unset>
+ 2: <unset>
+ 3: <unset>
+ 4: <unset>
+ 5:
+
+/(\2)(\1)/
+
+"Z*(|d*){216}"
+
+"(?1)(?#?'){8}(a)"
+ baaaaaaaaac
+ 0: aaaaaaaaa
+ 1: a
+
+"(?|(\k'Pm')|(?'Pm'))"
+ abcd
+ 0:
+ 1:
+
+/(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\s])/
+ \ Fred:099
+ 0:
+
+/(?=.*X)X$/
+ \ X
+ 0: X
+
/-- End of testinput1 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput10 b/lib/stdlib/test/re_SUITE_data/testoutput10
index c1c85f9a3b..5a4fbb2366 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput10
+++ b/lib/stdlib/test/re_SUITE_data/testoutput10
@@ -63,6 +63,7 @@ Memory allocation (code space): 7
6 End
------------------------------------------------------------------
Capturing subpattern count = 0
+May match empty string
Options: extended
No first char
No need char
@@ -99,15 +100,13 @@ Memory allocation (code space): 9
------------------------------------------------------------------
/x{1,3}+/BM
-Memory allocation (code space): 19
+Memory allocation (code space): 13
------------------------------------------------------------------
- 0 15 Bra
- 3 9 Once
- 6 x
- 8 x{0,2}
- 12 9 Ket
- 15 15 Ket
- 18 End
+ 0 9 Bra
+ 3 x
+ 5 x{0,2}+
+ 9 9 Ket
+ 12 End
------------------------------------------------------------------
/(x)*+/BM
@@ -138,7 +137,7 @@ Memory allocation (code space): 120
66 [bc]+
100 39 Ket
103 7 CBra 5
-108 \w*
+108 \w*+
110 7 Ket
113 109 Ket
116 116 Ket
@@ -232,7 +231,7 @@ Memory allocation (code space): 45
------------------------------------------------------------------
/(?P<a>a)...(?P=a)bbb(?P>a)d/BM
-Memory allocation (code space): 34
+Memory allocation (code space): 62
------------------------------------------------------------------
0 30 Bra
3 7 CBra 1
@@ -327,7 +326,7 @@ Memory allocation (code space): 12
------------------------------------------------------------------
/\x{110000}/8BM
-Failed: character value in \x{...} sequence is too large at offset 9
+Failed: character value in \x{} or \o{} is too large at offset 9
/[\x{ff}]/8BM
Memory allocation (code space): 10
@@ -503,7 +502,7 @@ Memory allocation (code space): 15
Memory allocation (code space): 48
------------------------------------------------------------------
0 44 Bra
- 3 [+\-\p{Nd}]+
+ 3 [+\-\p{Nd}]++
44 44 Ket
47 End
------------------------------------------------------------------
@@ -651,24 +650,24 @@ Memory allocation (code space): 10
/[[:^alpha:][:^cntrl:]]+/8WB
------------------------------------------------------------------
- 0 44 Bra
- 3 [ -~\x80-\xff\P{L}]+
- 44 44 Ket
- 47 End
+ 0 51 Bra
+ 3 [ -~\x80-\xff\P{L}\x{100}-\x{10ffff}]++
+ 51 51 Ket
+ 54 End
------------------------------------------------------------------
/[[:^cntrl:][:^alpha:]]+/8WB
------------------------------------------------------------------
- 0 44 Bra
- 3 [ -~\x80-\xff\P{L}]+
- 44 44 Ket
- 47 End
+ 0 51 Bra
+ 3 [ -~\x80-\xff\x{100}-\x{10ffff}\P{L}]++
+ 51 51 Ket
+ 54 End
------------------------------------------------------------------
/[[:alpha:]]+/8WB
------------------------------------------------------------------
0 12 Bra
- 3 [\p{L}]+
+ 3 [\p{L}]++
12 12 Ket
15 End
------------------------------------------------------------------
@@ -676,7 +675,7 @@ Memory allocation (code space): 10
/[[:^alpha:]\S]+/8WB
------------------------------------------------------------------
0 15 Bra
- 3 [\P{L}\P{Xsp}]+
+ 3 [\P{L}\P{Xsp}]++
15 15 Ket
18 End
------------------------------------------------------------------
@@ -710,4 +709,63 @@ Memory allocation (code space): 10
76 End
------------------------------------------------------------------
+/(((a\2)|(a*)\g<-1>))*a?/B
+------------------------------------------------------------------
+ 0 57 Bra
+ 3 Brazero
+ 4 48 SCBra 1
+ 9 40 Once
+ 12 18 CBra 2
+ 17 10 CBra 3
+ 22 a
+ 24 \2
+ 27 10 Ket
+ 30 16 Alt
+ 33 7 CBra 4
+ 38 a*
+ 40 7 Ket
+ 43 33 Recurse
+ 46 34 Ket
+ 49 40 Ket
+ 52 48 KetRmax
+ 55 a?+
+ 57 57 Ket
+ 60 End
+------------------------------------------------------------------
+
+/((?+1)(\1))/B
+------------------------------------------------------------------
+ 0 31 Bra
+ 3 25 Once
+ 6 19 CBra 1
+ 11 14 Recurse
+ 14 8 CBra 2
+ 19 \1
+ 22 8 Ket
+ 25 19 Ket
+ 28 25 Ket
+ 31 31 Ket
+ 34 End
+------------------------------------------------------------------
+
+/.((?2)(?R)\1)()/B
+------------------------------------------------------------------
+ 0 35 Bra
+ 3 Any
+ 4 20 Once
+ 7 14 CBra 1
+ 12 27 Recurse
+ 15 0 Recurse
+ 18 \1
+ 21 14 Ket
+ 24 20 Ket
+ 27 5 CBra 2
+ 32 5 Ket
+ 35 35 Ket
+ 38 End
+------------------------------------------------------------------
+
+/([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00]([00](*ACCEPT)/
+Failed: missing ) at offset 509
+
/-- End of testinput11 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput2 b/lib/stdlib/test/re_SUITE_data/testoutput2
index fd958c2eb7..811bbefc84 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput2
+++ b/lib/stdlib/test/re_SUITE_data/testoutput2
@@ -7,9 +7,12 @@
NOTE: This is a non-UTF set of tests. When UTF support is needed, use
test 5, and if Unicode Property Support is needed, use test 7. --/
+
+< forbid 8W
/(a)b|/I
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
@@ -175,7 +178,7 @@ No options
No first char
No need char
Subject length lower bound = 3
-Starting byte set: c d e
+Starting chars: c d e
this sentence eventually mentions a cat
0: cat
this sentences rambles on and on for a while and then reaches elephant
@@ -187,7 +190,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 3
-Starting byte set: C D E c d e
+Starting chars: C D E c d e
this sentence eventually mentions a CAT cat
0: CAT
this sentences rambles on and on for a while to elephant ElePhant
@@ -199,7 +202,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b c d
+Starting chars: a b c d
/(a|[^\dZ])/IS
Capturing subpattern count = 1
@@ -207,7 +210,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
+Starting chars: \x00 \x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08 \x09 \x0a
\x0b \x0c \x0d \x0e \x0f \x10 \x11 \x12 \x13 \x14 \x15 \x16 \x17 \x18 \x19
\x1a \x1b \x1c \x1d \x1e \x1f \x20 ! " # $ % & ' ( ) * + , - . / : ; < = >
? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y [ \ ] ^ _ ` a b c d
@@ -228,7 +231,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: \x09 \x0a \x0c \x0d \x20 a b
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 a b
/(ab\2)/
Failed: reference to non-existent subpattern at offset 6
@@ -416,7 +419,7 @@ Need char = '>'
/(?U)<.*>/I
Capturing subpattern count = 0
-Options: ungreedy
+No options
First char = '<'
Need char = '>'
abc<def>ghi<klm>nop
@@ -440,7 +443,7 @@ Need char = '='
/(?U)={3,}?/I
Capturing subpattern count = 0
-Options: ungreedy
+No options
First char = '='
Need char = '='
abc========def
@@ -474,7 +477,7 @@ Failed: lookbehind assertion is not fixed length at offset 12
/(?i)abc/I
Capturing subpattern count = 0
-Options: caseless
+No options
First char = 'a' (caseless)
Need char = 'c' (caseless)
@@ -486,7 +489,7 @@ No need char
/(?i)^1234/I
Capturing subpattern count = 0
-Options: anchored caseless
+Options: anchored
No first char
No need char
@@ -498,7 +501,8 @@ No need char
/(?s).*/I
Capturing subpattern count = 0
-Options: anchored dotall
+May match empty string
+Options: anchored
No first char
No need char
@@ -508,23 +512,23 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b c d
+Starting chars: a b c d
/(?i)[abcd]/IS
Capturing subpattern count = 0
-Options: caseless
+No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: A B C D a b c d
+Starting chars: A B C D a b c d
/(?m)[xy]|(b|c)/IS
Capturing subpattern count = 1
-Options: multiline
+No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: b c x y
+Starting chars: b c x y
/(^a|^b)/Im
Capturing subpattern count = 1
@@ -534,7 +538,7 @@ No need char
/(?i)(^a|^b)/Im
Capturing subpattern count = 1
-Options: caseless multiline
+Options: multiline
First char at start or follows newline
No need char
@@ -545,19 +549,19 @@ Failed: conditional group contains more than two branches at offset 13
Failed: conditional group contains more than two branches at offset 12
/(?(1a)/
-Failed: missing ) at offset 6
+Failed: malformed number or name after (?( at offset 4
/(?(1a))/
-Failed: reference to non-existent subpattern at offset 6
+Failed: malformed number or name after (?( at offset 4
/(?(?i))/
-Failed: assertion expected after (?( at offset 3
+Failed: assertion expected after (?( or (?(?C) at offset 3
/(?(abc))/
Failed: reference to non-existent subpattern at offset 7
/(?(?<ab))/
-Failed: syntax error in subpattern name (missing terminator) at offset 7
+Failed: assertion expected after (?( or (?(?C) at offset 3
/((?s)blah)\s+\1/I
Capturing subpattern count = 1
@@ -587,7 +591,7 @@ No options
First char = 'b' (caseless)
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/(a*b|(?i:c*(?-i)d))/IS
Capturing subpattern count = 1
@@ -595,7 +599,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: C a b c d
+Starting chars: C a b c d
/a$/I
Capturing subpattern count = 0
@@ -662,7 +666,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
/(?<!foo)(alpha|omega)/IS
Capturing subpattern count = 1
@@ -671,7 +675,7 @@ No options
No first char
Need char = 'a'
Subject length lower bound = 5
-Starting byte set: a o
+Starting chars: a o
/(?!alphabet)[ab]/IS
Capturing subpattern count = 0
@@ -679,7 +683,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
/(?<=foo\n)^bar/Im
Capturing subpattern count = 0
@@ -762,6 +766,7 @@ No match
/(?<=ab(?i)x|y|z)/I
Capturing subpattern count = 0
Max lookbehind = 3
+May match empty string
No options
No first char
No need char
@@ -769,6 +774,7 @@ No need char
/(?>.*)(?<=(abcd)|(xyz))/I
Capturing subpattern count = 2
Max lookbehind = 4
+May match empty string
No options
No first char
No need char
@@ -1173,7 +1179,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 1
-Options: anchored dotall
+Options: anchored
No first char
No need char
@@ -1377,6 +1383,7 @@ Need char = 'c'
/a*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -1395,6 +1402,7 @@ Need char = 'a'
/a{0,3}/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -1558,30 +1566,35 @@ Need char = 'b'
/a(?(1)b)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
No need char
/a(?(1)bag|big)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
Need char = 'g'
/a(?(1)bag|big)*(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
No need char
/a(?(1)bag|big)+(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
Need char = 'g'
/a(?(1)b..|b..)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
Need char = 'b'
@@ -1594,6 +1607,7 @@ Need char = 'e'
/a?b?/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -1612,6 +1626,7 @@ No match
/|-/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -1632,7 +1647,7 @@ Options: anchored
No first char
Need char = 'd'
Subject length lower bound = 4
-No set of starting bytes
+No starting char list
/\( # ( at start
(?: # Non-capturing bracket
@@ -1865,7 +1880,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
+Starting chars: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
_ a b c d e f g h i j k l m n o p q r s t u v w x y z
/^[[:ascii:]]/DZ
@@ -1927,7 +1942,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: \x09 \x0a \x0b \x0c \x0d \x20
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20
/^[[:cntrl:]]/DZ
------------------------------------------------------------------
@@ -2625,6 +2640,7 @@ Need char = '-'
End
------------------------------------------------------------------
Capturing subpattern count = 0
+May match empty string
Options: extended
No first char
No need char
@@ -2644,7 +2660,7 @@ No need char
/[\s]/DZ
------------------------------------------------------------------
Bra
- [\x09\x0a\x0c\x0d ]
+ [\x09-\x0d ]
Ket
End
------------------------------------------------------------------
@@ -2656,7 +2672,7 @@ No need char
/[\S]/DZ
------------------------------------------------------------------
Bra
- [\x00-\x08\x0b\x0e-\x1f!-\xff] (neg)
+ [\x00-\x08\x0e-\x1f!-\xff] (neg)
Ket
End
------------------------------------------------------------------
@@ -2719,7 +2735,7 @@ No match
End
------------------------------------------------------------------
Capturing subpattern count = 0
-Options: caseless extended
+Options: extended
First char = 'a' (caseless)
Need char = 'c' (caseless)
@@ -2732,7 +2748,7 @@ Need char = 'c' (caseless)
End
------------------------------------------------------------------
Capturing subpattern count = 0
-Options: caseless extended
+Options: extended
First char = 'a' (caseless)
Need char = 'c' (caseless)
@@ -2767,6 +2783,7 @@ Need char = '0'
End
------------------------------------------------------------------
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -2866,6 +2883,7 @@ No match
End
------------------------------------------------------------------
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -2882,20 +2900,41 @@ No options
First char = 'x'
No need char
-/x{1,3}+/DZ
+/x{1,3}+/BZO
------------------------------------------------------------------
Bra
- Once
x
- x{0,2}
+ x{0,2}+
Ket
+ End
+------------------------------------------------------------------
+
+/x{1,3}+/BZOi
+------------------------------------------------------------------
+ Bra
+ /i x
+ /i x{0,2}+
+ Ket
+ End
+------------------------------------------------------------------
+
+/[^x]{1,3}+/BZO
+------------------------------------------------------------------
+ Bra
+ [^x]
+ [^x]{0,2}+
+ Ket
+ End
+------------------------------------------------------------------
+
+/[^x]{1,3}+/BZOi
+------------------------------------------------------------------
+ Bra
+ /i [^x]
+ /i [^x]{0,2}+
Ket
End
------------------------------------------------------------------
-Capturing subpattern count = 0
-No options
-First char = 'x'
-No need char
/(x)*+/DZ
------------------------------------------------------------------
@@ -2908,12 +2947,14 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
/^(\w++|\s++)*$/I
Capturing subpattern count = 1
+May match empty string
Options: anchored
No first char
No need char
@@ -3054,7 +3095,7 @@ Need char = 'b'
End
------------------------------------------------------------------
Capturing subpattern count = 0
-Options: ungreedy
+No options
First char = 'x'
Need char = 'b'
xaaaab
@@ -3075,7 +3116,7 @@ Need char = 'b'
[bc]+
Ket
CBra 5
- \w*
+ \w*+
Ket
Ket
Ket
@@ -3142,6 +3183,10 @@ Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
/\U/I
Failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1
+/a{1,3}b/U
+ ab
+ 0: ab
+
/[/I
Failed: missing terminating ] for character class at offset 1
@@ -3154,7 +3199,7 @@ Failed: missing terminating ] for character class at offset 10
/[\s]/IDZ
------------------------------------------------------------------
Bra
- [\x09\x0a\x0c\x0d ]
+ [\x09-\x0d ]
Ket
End
------------------------------------------------------------------
@@ -3289,6 +3334,7 @@ Need char = 'b'
/(?=a).*/I
Capturing subpattern count = 0
+May match empty string
No options
First char = 'a'
No need char
@@ -3307,6 +3353,7 @@ Need char = 'z' (caseless)
/(?=a)(?=b)/I
Capturing subpattern count = 0
+May match empty string
No options
First char = 'a'
No need char
@@ -3337,24 +3384,28 @@ Need char = 'a'
/(?(1)ab|ac)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
No need char
/(?(1)abz|acz)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
First char = 'a'
Need char = 'z'
/(?(1)abz)(.)/I
Capturing subpattern count = 1
+Max back reference = 1
No options
No first char
No need char
/(?(1)abz)(1)23/I
Capturing subpattern count = 1
+Max back reference = 1
No options
No first char
Need char = '3'
@@ -3373,6 +3424,7 @@ Need char = 'a'
/(a)*/I
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
@@ -3395,7 +3447,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
/[^a]/I
Capturing subpattern count = 0
@@ -3415,7 +3467,7 @@ No options
No first char
Need char = '6'
Subject length lower bound = 4
-Starting byte set: 0 1 2 3 4 5 6 7 8 9
+Starting chars: 0 1 2 3 4 5 6 7 8 9
/a^b/I
Capturing subpattern count = 0
@@ -3445,11 +3497,11 @@ Need char = 'c'
/(?i)[ab]/IS
Capturing subpattern count = 0
-Options: caseless
+No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: A B a b
+Starting chars: A B a b
/[ab](?i)cd/IS
Capturing subpattern count = 0
@@ -3457,7 +3509,7 @@ No options
No first char
Need char = 'd' (caseless)
Subject length lower bound = 3
-Starting byte set: a b
+Starting chars: a b
/abc(?C)def/I
Capturing subpattern count = 0
@@ -3498,7 +3550,7 @@ No options
No first char
Need char = 'f'
Subject length lower bound = 7
-Starting byte set: 0 1 2 3 4 5 6 7 8 9
+Starting chars: 0 1 2 3 4 5 6 7 8 9
1234abcdef
--->1234abcdef
1 ^ \d
@@ -3601,6 +3653,7 @@ No match
/(?C0)(abc(?C1))*/I
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
@@ -3634,6 +3687,7 @@ No need char
/(\d{3}(?C))*/I
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
@@ -3770,20 +3824,6 @@ Need char = 'b'
--->abbbbbccc
1 ^ ^
Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
- 1 ^ ^
-Callout data = 1
No match
/a(b+?)(c*?)(?C1)/I
@@ -3829,7 +3869,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
/(?R)/I
Failed: recursive call could loop indefinitely at offset 3
@@ -3880,6 +3920,7 @@ Failed: recursive call could loop indefinitely at offset 16
/^([^()]|\((?1)*\))*$/I
Capturing subpattern count = 1
+May match empty string
Options: anchored
No first char
No need char
@@ -4159,6 +4200,7 @@ Named capturing subpatterns:
one 1
three 3
two 2
+May match empty string
Options: anchored caseless
No first char
No need char
@@ -4258,6 +4300,7 @@ Need char = 'z'
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a/Is
Capturing subpattern count = 31
+May match empty string
Options: anchored dotall
No first char
No need char
@@ -4265,6 +4308,7 @@ No need char
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\31/Is
Capturing subpattern count = 31
Max back reference = 31
+May match empty string
Options: dotall
No first char
No need char
@@ -4272,6 +4316,7 @@ No need char
/(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)|(.*)a\32/Is
Capturing subpattern count = 32
Max back reference = 32
+May match empty string
Options: dotall
No first char
No need char
@@ -4423,6 +4468,7 @@ Capturing subpattern count = 2
Named capturing subpatterns:
Tes 1
Test 2
+May match empty string
No options
No first char
No need char
@@ -4441,6 +4487,7 @@ Capturing subpattern count = 2
Named capturing subpatterns:
Tes 2
Test 1
+May match empty string
No options
No first char
No need char
@@ -4518,6 +4565,7 @@ Need char = ']'
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
No options
No first char
No need char
@@ -4538,6 +4586,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
No options
No first char
No need char
@@ -4569,6 +4618,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
No options
No first char
No need char
@@ -4576,9 +4626,7 @@ No need char
/[ab]{1}+/DZ
------------------------------------------------------------------
Bra
- Once
- [ab]{1,1}
- Ket
+ [ab]{1,1}+
Ket
End
------------------------------------------------------------------
@@ -4602,7 +4650,7 @@ Options: caseless
No first char
Need char = 'g' (caseless)
Subject length lower bound = 8
-No set of starting bytes
+No starting char list
Baby Bjorn Active Carrier - With free SHIPPING!!
0: Baby Bjorn Active Carrier - With free SHIPPING!!
1: Baby Bjorn Active Carrier - With free SHIPPING!!
@@ -4621,7 +4669,7 @@ No options
No first char
Need char = 'b'
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/(a|b)*.?c/ISDZ
------------------------------------------------------------------
@@ -4642,7 +4690,7 @@ No options
No first char
Need char = 'c'
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/abc(?C255)de(?C)f/DZ
------------------------------------------------------------------
@@ -4715,7 +4763,7 @@ Options:
No first char
Need char = 'b'
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
ab
--->ab
+0 ^ a*
@@ -4858,7 +4906,7 @@ Options:
No first char
Need char = 'x'
Subject length lower bound = 4
-Starting byte set: a d
+Starting chars: a d
abcx
--->abcx
+0 ^ (abc|def)
@@ -5092,7 +5140,7 @@ Options:
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b x
+Starting chars: a b x
Note: that { does NOT introduce a quantifier
--->Note: that { does NOT introduce a quantifier
+0 ^ ([ab]{,4}c|xy)
@@ -5290,7 +5338,7 @@ No match
Callout 255 0 21
CBra 1
Callout 255 1 9
- [ab]{1,4}
+ [ab]{1,4}+
Callout 255 10 1
c
Callout 255 11 0
@@ -5303,7 +5351,7 @@ No match
Ket
CBra 1
Callout 255 1 9
- [ab]{1,4}
+ [ab]{1,4}+
Callout 255 10 1
c
Callout 255 11 0
@@ -5316,7 +5364,7 @@ No match
Ket
CBra 1
Callout 255 1 9
- [ab]{1,4}
+ [ab]{1,4}+
Callout 255 10 1
c
Callout 255 11 0
@@ -5329,7 +5377,7 @@ No match
Ket
CBra 1
Callout 255 1 9
- [ab]{1,4}
+ [ab]{1,4}+
Callout 255 10 1
c
Callout 255 11 0
@@ -5343,7 +5391,7 @@ No match
Braminzero
CBra 1
Callout 255 1 9
- [ab]{1,4}
+ [ab]{1,4}+
Callout 255 10 1
c
Callout 255 11 0
@@ -5397,6 +5445,7 @@ Need char = '3'
/\b.*/I
Capturing subpattern count = 0
Max lookbehind = 1
+May match empty string
No options
No first char
No need char
@@ -5406,6 +5455,7 @@ No need char
/\b.*/Is
Capturing subpattern count = 0
Max lookbehind = 1
+May match empty string
Options: dotall
No first char
No need char
@@ -5414,6 +5464,7 @@ No need char
/(?!.bcd).*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -5563,13 +5614,17 @@ No match
123456\P
No match
+//KF>testsavedregex
+Compiled pattern written to testsavedregex
+Study data written to testsavedregex
+
/abc/IS>testsavedregex
Capturing subpattern count = 0
No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
-No set of starting bytes
+No starting char list
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@@ -5604,7 +5659,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 3
-No set of starting bytes
+No starting char list
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@@ -5639,7 +5694,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@@ -5678,7 +5733,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b
+Starting chars: a b
Compiled pattern written to testsavedregex
Study data written to testsavedregex
<testsavedregex
@@ -5779,13 +5834,13 @@ No match
No match
/a{11111111111111111111}/I
-Failed: number too big in {} quantifier at offset 22
+Failed: number too big in {} quantifier at offset 8
/(){64294967295}/I
-Failed: number too big in {} quantifier at offset 14
+Failed: number too big in {} quantifier at offset 9
/(){2,4294967295}/I
-Failed: number too big in {} quantifier at offset 15
+Failed: number too big in {} quantifier at offset 11
"(?i:a)(?i:b)(?i:c)(?i:d)(?i:e)(?i:f)(?i:g)(?i:h)(?i:i)(?i:j)(k)(?i:l)A\1B"I
Capturing subpattern count = 1
@@ -6002,6 +6057,7 @@ Matched, but too many substrings
/[^()]*(?:\((?R)\)[^()]*)*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -6014,6 +6070,7 @@ No need char
/[^()]*(?:\((?>(?R))\)[^()]*)*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -6024,6 +6081,7 @@ No need char
/[^()]*(?:\((?R)\))*[^()]*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -6034,6 +6092,7 @@ No need char
/(?:\((?R)\))*[^()]*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -6046,6 +6105,7 @@ No need char
/(?:\((?R)\))|[^()]*/I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -6095,6 +6155,17 @@ no parentheses with name "Z"
2: a1
copy substring Z failed -7
C a1 (2) A
+
+/(?|(?<a>)(?<b>)(?<a>)|(?<a>)(?<b>)(?<a>))/IJ
+Capturing subpattern count = 3
+Named capturing subpatterns:
+ a 1
+ a 3
+ b 2
+May match empty string
+Options: dupnames
+No first char
+No need char
/^(?P<A>a)(?P<A>b)/IJ
Capturing subpattern count = 2
@@ -6228,7 +6299,7 @@ Capturing subpattern count = 3
Named capturing subpatterns:
A 2
A 3
-Options: anchored dupnames
+Options: anchored
Duplicate name status changes
No first char
No need char
@@ -6278,6 +6349,7 @@ No need char
/^(?P<A>a)?(?(A)a|b)/I
Capturing subpattern count = 1
+Max back reference = 1
Named capturing subpatterns:
A 1
Options: anchored
@@ -6295,6 +6367,7 @@ No match
/(?:(?(ZZ)a|b)(?P<ZZ>X))+/I
Capturing subpattern count = 1
+Max back reference = 1
Named capturing subpatterns:
ZZ 1
No options
@@ -6305,13 +6378,14 @@ Need char = 'X'
1: X
/(?:(?(2y)a|b)(X))+/I
-Failed: reference to non-existent subpattern at offset 9
+Failed: malformed number or name after (?( at offset 7
/(?:(?(ZA)a|b)(?P<ZZ>X))+/I
Failed: reference to non-existent subpattern at offset 9
/(?:(?(ZZ)a|b)(?(ZZ)a|b)(?P<ZZ>X))+/I
Capturing subpattern count = 1
+Max back reference = 1
Named capturing subpatterns:
ZZ 1
No options
@@ -6323,6 +6397,7 @@ Need char = 'X'
/(?:(?(ZZ)a|\(b\))\\(?P<ZZ>X))+/I
Capturing subpattern count = 1
+Max back reference = 1
Named capturing subpatterns:
ZZ 1
No options
@@ -6377,9 +6452,9 @@ No options
No first char
Need char = ','
Subject length lower bound = 1
-Starting byte set: \x09 \x0a \x0c \x0d \x20 ,
+Starting chars: \x09 \x0a \x0b \x0c \x0d \x20 ,
\x0b,\x0b
- 0: ,
+ 0: \x0b,\x0b
\x0c,\x0d
0: \x0c,\x0d
@@ -6488,7 +6563,7 @@ No match
No match
/^abc/Im<bad>
-Unknown newline type at: <bad>
+Unknown modifier at: <bad>
/abc/I
@@ -6497,12 +6572,13 @@ No options
First char = 'a'
Need char = 'c'
xyz\rabc\<bad>
-Unknown newline type at: <bad>
+Unknown escape sequence at: <bad>
abc
0: abc
/.*/I<lf>
Capturing subpattern count = 0
+May match empty string
Options:
Forced newline sequence: LF
First char at start or follows newline
@@ -6544,6 +6620,7 @@ Need char = 'f'
+((?:\s|//.*\\n|/[*](?:\\n|.)*?[*]/)*)+I
Capturing subpattern count = 1
+May match empty string
No options
No first char
No need char
@@ -6682,7 +6759,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: C a b c d
+Starting chars: C a b c d
/()[ab]xyz/IS
Capturing subpattern count = 1
@@ -6690,7 +6767,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b
+Starting chars: a b
/(|)[ab]xyz/IS
Capturing subpattern count = 1
@@ -6698,7 +6775,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b
+Starting chars: a b
/(|c)[ab]xyz/IS
Capturing subpattern count = 1
@@ -6706,7 +6783,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b c
+Starting chars: a b c
/(|c?)[ab]xyz/IS
Capturing subpattern count = 1
@@ -6714,7 +6791,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b c
+Starting chars: a b c
/(d?|c?)[ab]xyz/IS
Capturing subpattern count = 1
@@ -6722,7 +6799,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b c d
+Starting chars: a b c d
/(d?|c)[ab]xyz/IS
Capturing subpattern count = 1
@@ -6730,7 +6807,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 4
-Starting byte set: a b c d
+Starting chars: a b c d
/^a*b\d/DZ
------------------------------------------------------------------
@@ -6823,7 +6900,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b c d
+Starting chars: a b c d
/(a+|b*)[cd]/IS
Capturing subpattern count = 1
@@ -6831,7 +6908,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b c d
+Starting chars: a b c d
/(a*|b+)[cd]/IS
Capturing subpattern count = 1
@@ -6839,7 +6916,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: a b c d
+Starting chars: a b c d
/(a+|b+)[cd]/IS
Capturing subpattern count = 1
@@ -6847,7 +6924,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((
@@ -7467,7 +7544,7 @@ Matched, but too many substrings
/a*[^a]/BZ
------------------------------------------------------------------
Bra
- a*
+ a*+
[^a]
Ket
End
@@ -7609,7 +7686,7 @@ No match
------------------------------------------------------------------
Bra
^
- [a-z]+
+ [a-z]++
Ket
End
------------------------------------------------------------------
@@ -7650,7 +7727,7 @@ No match
^
CBra 1
Cond
- 2 Cond nref
+ 2 Cond ref
y
Ket
[()]
@@ -7710,6 +7787,7 @@ Named capturing subpatterns:
one 1
three 3
two 2
+May match empty string
Options: anchored caseless
No first char
No need char
@@ -7792,7 +7870,7 @@ No match
Failed: malformed number or name after (?( at offset 6
/(?(''))/
-Failed: assertion expected after (?( at offset 4
+Failed: assertion expected after (?( or (?(?C) at offset 4
/(?('R')stuff)/
Failed: reference to non-existent subpattern at offset 7
@@ -7809,15 +7887,9 @@ Failed: reference to non-existent subpattern at offset 7
1: abcabc1Xabc2XabcX
2: abcabc1Xabc2XabcX
-/(?<A> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
+/(?<A> (?'B' abc (?(R) (?(R&C)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
Failed: reference to non-existent subpattern at offset 29
-/(?<1> (?'B' abc (?(R) (?(R&1)1) (?(R&B)2) X | (?1) (?2) (?R) ))) /x
- abcabc1Xabc2XabcXabcabc
- 0: abcabc1Xabc2XabcX
- 1: abcabc1Xabc2XabcX
- 2: abcabc1Xabc2XabcX
-
/^(?(DEFINE) abc | xyz ) /x
Failed: DEFINE group contains more than one branch at offset 22
@@ -8041,7 +8113,7 @@ Failed: a numbered reference must not be zero at offset 8
/^(a)\g{3/
Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 8
-/^(a)\g{4a}/
+/^(a)\g{aa}/
Failed: reference to non-existent subpattern at offset 9
/^a.b/<lf>
@@ -8546,7 +8618,7 @@ No match
\d
\v++
\w
- \v+
+ \v++
\S
\v++
\V
@@ -8644,27 +8716,18 @@ No match
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
- +4 ^ ^ c+
- +2 ^ ^ b?
- +4 ^ ^ c+
- +2 ^^ b?
- +4 ^^ c+
+0 ^ a+
+2 ^ ^ b?
+4 ^ ^ c+
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
- +4 ^ ^ c+
- +2 ^^ b?
- +4 ^^ c+
+0 ^ a+
+2 ^^ b?
+4 ^ ^ c+
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
+6 ^ ^ (*FAIL)
- +4 ^^ c+
No match
/a+b?(*PRUNE)c+(*FAIL)/C
@@ -9072,10 +9135,10 @@ Failed: subpattern name expected at offset 3
Failed: subpattern name expected at offset 3
/\k/
-Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 2
+Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 1
/\kabc/
-Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 5
+Failed: \k is not followed by a braced, angle-bracketed, or quoted name at offset 1
/(?P=)/
Failed: subpattern name expected at offset 4
@@ -9123,7 +9186,7 @@ Failed: unknown POSIX class name at offset 6
Failed: unknown POSIX class name at offset 3
/(^(a|b\g<-1'c))/
-Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 15
+Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 8
/^(?+1)(?<a>x|y){0}z/
xzxx
@@ -9233,8 +9296,28 @@ No match
ab
No match
-/a(?!)+b/
-Failed: nothing to repeat at offset 5
+/a(?!)b/BZ
+------------------------------------------------------------------
+ Bra
+ a
+ *FAIL
+ b
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?!)?a/BZ
+------------------------------------------------------------------
+ Bra
+ Brazero
+ Assert not
+ Ket
+ a
+ Ket
+ End
+------------------------------------------------------------------
+ ab
+ 0: a
/a(*FAIL)+b/
Failed: nothing to repeat at offset 8
@@ -9245,10 +9328,11 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: x y z
+Starting chars: x y z
/(?(?=.*b)b|^)/CI
Capturing subpattern count = 0
+May match empty string
Options:
No first char
No need char
@@ -9296,7 +9380,7 @@ No need char
/(?(?=.*b).*b|^d)/I
Capturing subpattern count = 0
No options
-First char at start or follows newline
+No first char
No need char
/xyz/C
@@ -9353,7 +9437,7 @@ No match
No match
/(*NO_START_OPT)xyz/C
- abcxyz
+ abcxyz
--->abcxyz
+15 ^ x
+15 ^ x
@@ -9363,6 +9447,15 @@ No match
+17 ^ ^ z
+18 ^ ^
0: xyz
+
+/(*NO_AUTO_POSSESS)a+b/BZ
+------------------------------------------------------------------
+ Bra
+ a+
+ b
+ Ket
+ End
+------------------------------------------------------------------
/xyz/CY
abcxyz
@@ -10024,7 +10117,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/(a|bc)\1{2,3}/SI
Capturing subpattern count = 1
@@ -10033,7 +10126,7 @@ No options
No first char
No need char
Subject length lower bound = 3
-Starting byte set: a b
+Starting chars: a b
/(a|bc)(?1)/SI
Capturing subpattern count = 1
@@ -10041,7 +10134,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/(a|b\1)(a|b\1)/SI
Capturing subpattern count = 2
@@ -10050,7 +10143,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/(a|b\1){2}/SI
Capturing subpattern count = 1
@@ -10059,7 +10152,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/(a|bbbb\1)(a|bbbb\1)/SI
Capturing subpattern count = 2
@@ -10068,7 +10161,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/(a|bbbb\1){2}/SI
Capturing subpattern count = 1
@@ -10077,7 +10170,7 @@ No options
No first char
No need char
Subject length lower bound = 2
-Starting byte set: a b
+Starting chars: a b
/^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]/SI
Capturing subpattern count = 1
@@ -10085,7 +10178,7 @@ Options: anchored
No first char
Need char = ':'
Subject length lower bound = 22
-No set of starting bytes
+No starting char list
/<tr([\w\W\s\d][^<>]{0,})><TD([\w\W\s\d][^<>]{0,})>([\d]{0,}\.)(.*)((<BR>([\w\W\s\d][^<>]{0,})|[\s]{0,}))<\/a><\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><TD([\w\W\s\d][^<>]{0,})>([\w\W\s\d][^<>]{0,})<\/TD><\/TR>/isIS
Capturing subpattern count = 11
@@ -10093,7 +10186,7 @@ Options: caseless dotall
First char = '<'
Need char = '>'
Subject length lower bound = 47
-No set of starting bytes
+No starting char list
"(?>.*/)foo"SI
Capturing subpattern count = 0
@@ -10101,7 +10194,7 @@ No options
No first char
Need char = 'o'
Subject length lower bound = 4
-No set of starting bytes
+No starting char list
/(?(?=[^a-z]+[a-z]) \d{2}-[a-z]{3}-\d{2} | \d{2}-\d{2}-\d{2} ) /xSI
Capturing subpattern count = 0
@@ -10109,7 +10202,7 @@ Options: extended
No first char
Need char = '-'
Subject length lower bound = 8
-No set of starting bytes
+No starting char list
/(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))/iSI
Capturing subpattern count = 1
@@ -10117,7 +10210,7 @@ Options: caseless
No first char
No need char
Subject length lower bound = 1
-Starting byte set: A B C a b c
+Starting chars: A B C a b c
/(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))/SI
Capturing subpattern count = 0
@@ -10125,7 +10218,7 @@ No options
No first char
Need char = 'b'
Subject length lower bound = 41
-Starting byte set: c d
+Starting chars: c d
/<a[\s]+href[\s]*=[\s]* # find <a href=
([\"\'])? # find single or double quote
@@ -10138,7 +10231,7 @@ Options: caseless extended dotall
First char = '<'
Need char = '='
Subject length lower bound = 9
-No set of starting bytes
+No starting char list
/^(?!:) # colon disallowed at start
(?: # start of item
@@ -10150,17 +10243,17 @@ No set of starting bytes
(?(1)|.) # check that there was an empty component
/xiIS
Capturing subpattern count = 1
+Max back reference = 1
Options: anchored caseless extended
No first char
Need char = ':'
Subject length lower bound = 2
-No set of starting bytes
+No starting char list
/(?|(?<a>A)|(?<a>B))/I
Capturing subpattern count = 1
Named capturing subpatterns:
a 1
- a 1
No options
No first char
No need char
@@ -10180,6 +10273,7 @@ Failed: different names for subpatterns of the same number are not allowed at of
b(?<quote> (?<apostrophe>')|(?<realquote>")) )
(?('quote')[a-z]+|[0-9]+)/JIx
Capturing subpattern count = 6
+Max back reference = 1
Named capturing subpatterns:
apostrophe 2
apostrophe 5
@@ -10233,7 +10327,7 @@ No match
Ket
Ket
Cond
- 4 Cond nref
+ Cond ref <D>2
X
Alt
Y
@@ -10242,6 +10336,7 @@ No match
End
------------------------------------------------------------------
Capturing subpattern count = 4
+Max back reference = 4
Named capturing subpatterns:
D 4
D 1
@@ -10279,7 +10374,7 @@ No match
CBra 4
d
Cond
- Cond nrecurse 1
+ Cond recurse <A>2
$
Alt
Recurse
@@ -10289,6 +10384,7 @@ No match
End
------------------------------------------------------------------
Capturing subpattern count = 4
+Max back reference = 1
Named capturing subpatterns:
A 1
A 4
@@ -10379,7 +10475,7 @@ Options:
No first char
Need char = 'a'
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
cat
0: a
1:
@@ -10393,7 +10489,7 @@ No options
No first char
Need char = 'a'
Subject length lower bound = 3
-No set of starting bytes
+No starting char list
cat
No match
@@ -10405,17 +10501,18 @@ No options
First char = 'i'
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
i
0: i
/()i(?(1)a)/SI
Capturing subpattern count = 1
+Max back reference = 1
No options
No first char
Need char = 'i'
Subject length lower bound = 1
-Starting byte set: i
+Starting chars: i
ia
0: ia
1:
@@ -11009,7 +11106,7 @@ No options
First char = 'a'
Need char = '4'
Subject length lower bound = 5
-No set of starting bytes
+No starting char list
/([abc])++1234/SI
Capturing subpattern count = 1
@@ -11017,7 +11114,7 @@ No options
No first char
Need char = '4'
Subject length lower bound = 5
-Starting byte set: a b c
+Starting chars: a b c
/(?<=(abc)+)X/
Failed: lookbehind assertion is not fixed length at offset 10
@@ -11036,12 +11133,14 @@ No need char
/(^ab|^)+/I
Capturing subpattern count = 1
+May match empty string
Options: anchored
No first char
No need char
/(^ab|^)++/I
Capturing subpattern count = 1
+May match empty string
Options: anchored
No first char
No need char
@@ -11060,12 +11159,14 @@ No need char
/(?:^ab|^)+/I
Capturing subpattern count = 0
+May match empty string
Options: anchored
No first char
No need char
/(?:^ab|^)++/I
Capturing subpattern count = 0
+May match empty string
Options: anchored
No first char
No need char
@@ -11084,12 +11185,14 @@ Need char = 'b'
/(.*ab|.*)+/I
Capturing subpattern count = 1
+May match empty string
No options
First char at start or follows newline
No need char
/(.*ab|.*)++/I
Capturing subpattern count = 1
+May match empty string
No options
First char at start or follows newline
No need char
@@ -11108,12 +11211,14 @@ Need char = 'b'
/(?:.*ab|.*)+/I
Capturing subpattern count = 0
+May match empty string
No options
First char at start or follows newline
No need char
/(?:.*ab|.*)++/I
Capturing subpattern count = 0
+May match empty string
No options
First char at start or follows newline
No need char
@@ -11290,7 +11395,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/(a(?2)|b)(b(?1)|a)(?:(?1)|(?2))/SI
Capturing subpattern count = 2
@@ -11298,7 +11403,7 @@ No options
No first char
No need char
Subject length lower bound = 3
-Starting byte set: a b
+Starting chars: a b
/(a(?2)|b)(b(?1)|a)(?1)(?2)/SI
Capturing subpattern count = 2
@@ -11306,7 +11411,7 @@ No options
No first char
No need char
Subject length lower bound = 4
-Starting byte set: a b
+Starting chars: a b
/(abc)(?1)/SI
Capturing subpattern count = 1
@@ -11314,7 +11419,7 @@ No options
First char = 'a'
Need char = 'c'
Subject length lower bound = 6
-No set of starting bytes
+No starting char list
/^(?>a)++/
aa\M
@@ -11519,7 +11624,7 @@ Matched, but too many substrings
Assert not
a
Ket
- \w+
+ \w++
Ket
End
------------------------------------------------------------------
@@ -11632,7 +11737,7 @@ No options
First char = 't'
Need char = 't'
Subject length lower bound = 18
-No set of starting bytes
+No starting char list
/\btype\b\W*?\btext\b\W*?\bjavascript\b|\burl\b\W*?\bshell:|<input\b.*?\btype\b\W*?\bimage\b|\bonkeyup\b\W*?\=/IS
Capturing subpattern count = 0
@@ -11641,15 +11746,16 @@ No options
No first char
No need char
Subject length lower bound = 8
-Starting byte set: < o t u
+Starting chars: < o t u
/a(*SKIP)c|b(*ACCEPT)|/+S!I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
Subject length lower bound = -1
-No set of starting bytes
+No starting char list
a
0:
0+
@@ -11660,7 +11766,7 @@ No options
No first char
No need char
Subject length lower bound = -1
-Starting byte set: a b x
+Starting chars: a b x
ax
0: x
@@ -11715,11 +11821,11 @@ Minimum match() recursion limit = 45
Bra
^
Once_NC
- a+
+ a++
Ket
Once
CBra 1
- z+
+ z++
Ket
Ket
\w
@@ -11778,14 +11884,14 @@ No match
/^(?>a+)(?>b+)(?>c+)(?>d+)(?>e+)/
\Maabbccddee
-Minimum match() limit = 12
-Minimum match() recursion limit = 3
+Minimum match() limit = 7
+Minimum match() recursion limit = 2
0: aabbccddee
/^(?>(a+))(?>(b+))(?>(c+))(?>(d+))(?>(e+))/
\Maabbccddee
-Minimum match() limit = 22
-Minimum match() recursion limit = 21
+Minimum match() limit = 17
+Minimum match() recursion limit = 16
0: aabbccddee
1: aa
2: bb
@@ -11795,8 +11901,8 @@ Minimum match() recursion limit = 21
/^(?>(a+))(?>b+)(?>(c+))(?>d+)(?>(e+))/
\Maabbccddee
-Minimum match() limit = 18
-Minimum match() recursion limit = 13
+Minimum match() limit = 13
+Minimum match() recursion limit = 10
0: aabbccddee
1: aa
2: cc
@@ -11887,7 +11993,10 @@ No match
Failed: \N is not supported in a class at offset 3
/a[B-\Nc]/
-Failed: \N is not supported in a class at offset 5
+Failed: invalid range in character class at offset 5
+
+/a[B\Nc]/
+Failed: \N is not supported in a class at offset 4
/(a)(?2){0,1999}?(b)/
@@ -12293,6 +12402,7 @@ No need char
/(?>.*?)(?<=(abcd)|(wxyz))/I
Capturing subpattern count = 2
Max lookbehind = 4
+May match empty string
No options
No first char
No need char
@@ -12300,6 +12410,7 @@ No need char
/(?>.*)(?<=(abcd)|(wxyz))/I
Capturing subpattern count = 2
Max lookbehind = 4
+May match empty string
No options
No first char
No need char
@@ -12338,6 +12449,7 @@ Need char = 'c'
/.?/S-I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
@@ -12345,11 +12457,12 @@ Study returned NULL
/.?/S!I
Capturing subpattern count = 0
+May match empty string
No options
No first char
No need char
Subject length lower bound = -1
-No set of starting bytes
+No starting char list
/(?:(a)+(?C1)bb|aa(?C2)b)/
aab\C+
@@ -12635,7 +12748,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
-Starting byte set: a z
+Starting chars: a z
aaaaaaaaaaaaaz
Error -21 (recursion limit exceeded)
aaaaaaaaaaaaaz\Q1000
@@ -12648,7 +12761,7 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
-Starting byte set: a z
+Starting chars: a z
aaaaaaaaaaaaaz
Error -21 (recursion limit exceeded)
@@ -12659,10 +12772,1937 @@ No options
No first char
Need char = 'z'
Subject length lower bound = 2
-Starting byte set: a z
+Starting chars: a z
aaaaaaaaaaaaaz
No match
aaaaaaaaaaaaaz\Q10
Error -21 (recursion limit exceeded)
+/-- This test causes a segfault with Perl 5.18.0 --/
+
+/^(?=(a)){0}b(?1)/
+ backgammon
+ 0: ba
+
+/(?|(?<n>f)|(?<n>b))/JI
+Capturing subpattern count = 1
+Named capturing subpatterns:
+ n 1
+Options: dupnames
+No first char
+No need char
+
+/(?<a>abc)(?<a>z)\k<a>()/JDZS
+------------------------------------------------------------------
+ Bra
+ CBra 1
+ abc
+ Ket
+ CBra 2
+ z
+ Ket
+ \k<a>2
+ CBra 3
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 3
+Max back reference = 2
+Named capturing subpatterns:
+ a 1
+ a 2
+Options: dupnames
+First char = 'a'
+Need char = 'z'
+Subject length lower bound = 5
+No starting char list
+
+/a*[bcd]/BZ
+------------------------------------------------------------------
+ Bra
+ a*+
+ [b-d]
+ Ket
+ End
+------------------------------------------------------------------
+
+/[bcd]*a/BZ
+------------------------------------------------------------------
+ Bra
+ [b-d]*+
+ a
+ Ket
+ End
+------------------------------------------------------------------
+
+/-- A complete set of tests for auto-possessification of character types --/
+
+/\D+\D \D+\d \D+\S \D+\s \D+\W \D+\w \D+. \D+\C \D+\R \D+\H \D+\h \D+\V \D+\v \D+\Z \D+\z \D+$/BZx
+------------------------------------------------------------------
+ Bra
+ \D+
+ \D
+ \D++
+ \d
+ \D+
+ \S
+ \D+
+ \s
+ \D+
+ \W
+ \D+
+ \w
+ \D+
+ Any
+ \D+
+ AllAny
+ \D+
+ \R
+ \D+
+ \H
+ \D+
+ \h
+ \D+
+ \V
+ \D+
+ \v
+ \D+
+ \Z
+ \D++
+ \z
+ \D+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\d+\D \d+\d \d+\S \d+\s \d+\W \d+\w \d+. \d+\C \d+\R \d+\H \d+\h \d+\V \d+\v \d+\Z \d+\z \d+$/BZx
+------------------------------------------------------------------
+ Bra
+ \d++
+ \D
+ \d+
+ \d
+ \d+
+ \S
+ \d++
+ \s
+ \d++
+ \W
+ \d+
+ \w
+ \d+
+ Any
+ \d+
+ AllAny
+ \d++
+ \R
+ \d+
+ \H
+ \d++
+ \h
+ \d+
+ \V
+ \d++
+ \v
+ \d++
+ \Z
+ \d++
+ \z
+ \d++
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\S+\D \S+\d \S+\S \S+\s \S+\W \S+\w \S+. \S+\C \S+\R \S+\H \S+\h \S+\V \S+\v \S+\Z \S+\z \S+$/BZx
+------------------------------------------------------------------
+ Bra
+ \S+
+ \D
+ \S+
+ \d
+ \S+
+ \S
+ \S++
+ \s
+ \S+
+ \W
+ \S+
+ \w
+ \S+
+ Any
+ \S+
+ AllAny
+ \S++
+ \R
+ \S+
+ \H
+ \S++
+ \h
+ \S+
+ \V
+ \S++
+ \v
+ \S++
+ \Z
+ \S++
+ \z
+ \S++
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\s+\D \s+\d \s+\S \s+\s \s+\W \s+\w \s+. \s+\C \s+\R \s+\H \s+\h \s+\V \s+\v \s+\Z \s+\z \s+$/BZx
+------------------------------------------------------------------
+ Bra
+ \s+
+ \D
+ \s++
+ \d
+ \s++
+ \S
+ \s+
+ \s
+ \s+
+ \W
+ \s++
+ \w
+ \s+
+ Any
+ \s+
+ AllAny
+ \s+
+ \R
+ \s+
+ \H
+ \s+
+ \h
+ \s+
+ \V
+ \s+
+ \v
+ \s+
+ \Z
+ \s++
+ \z
+ \s+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\W+\D \W+\d \W+\S \W+\s \W+\W \W+\w \W+. \W+\C \W+\R \W+\H \W+\h \W+\V \W+\v \W+\Z \W+\z \W+$/BZx
+------------------------------------------------------------------
+ Bra
+ \W+
+ \D
+ \W++
+ \d
+ \W+
+ \S
+ \W+
+ \s
+ \W+
+ \W
+ \W++
+ \w
+ \W+
+ Any
+ \W+
+ AllAny
+ \W+
+ \R
+ \W+
+ \H
+ \W+
+ \h
+ \W+
+ \V
+ \W+
+ \v
+ \W+
+ \Z
+ \W++
+ \z
+ \W+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\w+\D \w+\d \w+\S \w+\s \w+\W \w+\w \w+. \w+\C \w+\R \w+\H \w+\h \w+\V \w+\v \w+\Z \w+\z \w+$/BZx
+------------------------------------------------------------------
+ Bra
+ \w+
+ \D
+ \w+
+ \d
+ \w+
+ \S
+ \w++
+ \s
+ \w++
+ \W
+ \w+
+ \w
+ \w+
+ Any
+ \w+
+ AllAny
+ \w++
+ \R
+ \w+
+ \H
+ \w++
+ \h
+ \w+
+ \V
+ \w++
+ \v
+ \w++
+ \Z
+ \w++
+ \z
+ \w++
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\C+\D \C+\d \C+\S \C+\s \C+\W \C+\w \C+. \C+\C \C+\R \C+\H \C+\h \C+\V \C+\v \C+\Z \C+\z \C+$/BZx
+------------------------------------------------------------------
+ Bra
+ AllAny+
+ \D
+ AllAny+
+ \d
+ AllAny+
+ \S
+ AllAny+
+ \s
+ AllAny+
+ \W
+ AllAny+
+ \w
+ AllAny+
+ Any
+ AllAny+
+ AllAny
+ AllAny+
+ \R
+ AllAny+
+ \H
+ AllAny+
+ \h
+ AllAny+
+ \V
+ AllAny+
+ \v
+ AllAny+
+ \Z
+ AllAny++
+ \z
+ AllAny+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\R+\D \R+\d \R+\S \R+\s \R+\W \R+\w \R+. \R+\C \R+\R \R+\H \R+\h \R+\V \R+\v \R+\Z \R+\z \R+$/BZx
+------------------------------------------------------------------
+ Bra
+ \R+
+ \D
+ \R++
+ \d
+ \R+
+ \S
+ \R++
+ \s
+ \R+
+ \W
+ \R++
+ \w
+ \R++
+ Any
+ \R+
+ AllAny
+ \R+
+ \R
+ \R+
+ \H
+ \R++
+ \h
+ \R+
+ \V
+ \R+
+ \v
+ \R+
+ \Z
+ \R++
+ \z
+ \R+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\H+\D \H+\d \H+\S \H+\s \H+\W \H+\w \H+. \H+\C \H+\R \H+\H \H+\h \H+\V \H+\v \H+\Z \H+\z \H+$/BZx
+------------------------------------------------------------------
+ Bra
+ \H+
+ \D
+ \H+
+ \d
+ \H+
+ \S
+ \H+
+ \s
+ \H+
+ \W
+ \H+
+ \w
+ \H+
+ Any
+ \H+
+ AllAny
+ \H+
+ \R
+ \H+
+ \H
+ \H++
+ \h
+ \H+
+ \V
+ \H+
+ \v
+ \H+
+ \Z
+ \H++
+ \z
+ \H+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\h+\D \h+\d \h+\S \h+\s \h+\W \h+\w \h+. \h+\C \h+\R \h+\H \h+\h \h+\V \h+\v \h+\Z \h+\z \h+$/BZx
+------------------------------------------------------------------
+ Bra
+ \h+
+ \D
+ \h++
+ \d
+ \h++
+ \S
+ \h+
+ \s
+ \h+
+ \W
+ \h++
+ \w
+ \h+
+ Any
+ \h+
+ AllAny
+ \h++
+ \R
+ \h++
+ \H
+ \h+
+ \h
+ \h+
+ \V
+ \h++
+ \v
+ \h+
+ \Z
+ \h++
+ \z
+ \h+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\V+\D \V+\d \V+\S \V+\s \V+\W \V+\w \V+. \V+\C \V+\R \V+\H \V+\h \V+\V \V+\v \V+\Z \V+\z \V+$/BZx
+------------------------------------------------------------------
+ Bra
+ \V+
+ \D
+ \V+
+ \d
+ \V+
+ \S
+ \V+
+ \s
+ \V+
+ \W
+ \V+
+ \w
+ \V+
+ Any
+ \V+
+ AllAny
+ \V++
+ \R
+ \V+
+ \H
+ \V+
+ \h
+ \V+
+ \V
+ \V++
+ \v
+ \V+
+ \Z
+ \V++
+ \z
+ \V+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\v+\D \v+\d \v+\S \v+\s \v+\W \v+\w \v+. \v+\C \v+\R \v+\H \v+\h \v+\V \v+\v \v+\Z \v+\z \v+$/BZx
+------------------------------------------------------------------
+ Bra
+ \v+
+ \D
+ \v++
+ \d
+ \v++
+ \S
+ \v+
+ \s
+ \v+
+ \W
+ \v++
+ \w
+ \v+
+ Any
+ \v+
+ AllAny
+ \v+
+ \R
+ \v+
+ \H
+ \v++
+ \h
+ \v++
+ \V
+ \v+
+ \v
+ \v+
+ \Z
+ \v++
+ \z
+ \v+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/ a+\D a+\d a+\S a+\s a+\W a+\w a+. a+\C a+\R a+\H a+\h a+\V a+\v a+\Z a+\z a+$/BZx
+------------------------------------------------------------------
+ Bra
+ a+
+ \D
+ a++
+ \d
+ a+
+ \S
+ a++
+ \s
+ a++
+ \W
+ a+
+ \w
+ a+
+ Any
+ a+
+ AllAny
+ a++
+ \R
+ a+
+ \H
+ a++
+ \h
+ a+
+ \V
+ a++
+ \v
+ a++
+ \Z
+ a++
+ \z
+ a++
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\n+\D \n+\d \n+\S \n+\s \n+\W \n+\w \n+. \n+\C \n+\R \n+\H \n+\h \n+\V \n+\v \n+\Z \n+\z \n+$/BZx
+------------------------------------------------------------------
+ Bra
+ \x0a+
+ \D
+ \x0a++
+ \d
+ \x0a++
+ \S
+ \x0a+
+ \s
+ \x0a+
+ \W
+ \x0a++
+ \w
+ \x0a+
+ Any
+ \x0a+
+ AllAny
+ \x0a+
+ \R
+ \x0a+
+ \H
+ \x0a++
+ \h
+ \x0a++
+ \V
+ \x0a+
+ \v
+ \x0a+
+ \Z
+ \x0a++
+ \z
+ \x0a+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZx
+------------------------------------------------------------------
+ Bra
+ Any+
+ \D
+ Any+
+ \d
+ Any+
+ \S
+ Any+
+ \s
+ Any+
+ \W
+ Any+
+ \w
+ Any+
+ Any
+ Any+
+ AllAny
+ Any++
+ \R
+ Any+
+ \H
+ Any+
+ \h
+ Any+
+ \V
+ Any+
+ \v
+ Any+
+ \Z
+ Any++
+ \z
+ Any+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/ .+\D .+\d .+\S .+\s .+\W .+\w .+. .+\C .+\R .+\H .+\h .+\V .+\v .+\Z .+\z .+$/BZxs
+------------------------------------------------------------------
+ Bra
+ AllAny+
+ \D
+ AllAny+
+ \d
+ AllAny+
+ \S
+ AllAny+
+ \s
+ AllAny+
+ \W
+ AllAny+
+ \w
+ AllAny+
+ AllAny
+ AllAny+
+ AllAny
+ AllAny+
+ \R
+ AllAny+
+ \H
+ AllAny+
+ \h
+ AllAny+
+ \V
+ AllAny+
+ \v
+ AllAny+
+ \Z
+ AllAny++
+ \z
+ AllAny+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\D+$ \d+$ \S+$ \s+$ \W+$ \w+$ \C+$ \R+$ \H+$ \h+$ \V+$ \v+$ a+$ \n+$ .+$ .+$/BZxm
+------------------------------------------------------------------
+ Bra
+ \D+
+ /m $
+ \d++
+ /m $
+ \S++
+ /m $
+ \s+
+ /m $
+ \W+
+ /m $
+ \w++
+ /m $
+ AllAny+
+ /m $
+ \R+
+ /m $
+ \H+
+ /m $
+ \h+
+ /m $
+ \V+
+ /m $
+ \v+
+ /m $
+ a+
+ /m $
+ \x0a+
+ /m $
+ Any+
+ /m $
+ Any+
+ /m $
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?=a+)a(a+)++a/BZ
+------------------------------------------------------------------
+ Bra
+ Assert
+ a++
+ Ket
+ a
+ CBraPos 1
+ a++
+ KetRpos
+ a
+ Ket
+ End
+------------------------------------------------------------------
+
+/a+(bb|cc)a+(?:bb|cc)a+(?>bb|cc)a+(?:bb|cc)+a+(aa)a+(?:bb|aa)/BZ
+------------------------------------------------------------------
+ Bra
+ a++
+ CBra 1
+ bb
+ Alt
+ cc
+ Ket
+ a++
+ Bra
+ bb
+ Alt
+ cc
+ Ket
+ a++
+ Once_NC
+ bb
+ Alt
+ cc
+ Ket
+ a++
+ Bra
+ bb
+ Alt
+ cc
+ KetRmax
+ a+
+ CBra 2
+ aa
+ Ket
+ a+
+ Bra
+ bb
+ Alt
+ aa
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/a+(bb|cc)?#a+(?:bb|cc)??#a+(?:bb|cc)?+#a+(?:bb|cc)*#a+(bb|cc)?a#a+(?:aa)?/BZ
+------------------------------------------------------------------
+ Bra
+ a++
+ Brazero
+ CBra 1
+ bb
+ Alt
+ cc
+ Ket
+ #
+ a++
+ Braminzero
+ Bra
+ bb
+ Alt
+ cc
+ Ket
+ #
+ a++
+ Once
+ Brazero
+ Bra
+ bb
+ Alt
+ cc
+ Ket
+ Ket
+ #
+ a++
+ Brazero
+ Bra
+ bb
+ Alt
+ cc
+ KetRmax
+ #
+ a+
+ Brazero
+ CBra 2
+ bb
+ Alt
+ cc
+ Ket
+ a#
+ a+
+ Brazero
+ Bra
+ aa
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/a+(?:bb)?a#a+(?:|||)#a+(?:|b)a#a+(?:|||)?a/BZ
+------------------------------------------------------------------
+ Bra
+ a+
+ Brazero
+ Bra
+ bb
+ Ket
+ a#
+ a++
+ Bra
+ Alt
+ Alt
+ Alt
+ Ket
+ #
+ a+
+ Bra
+ Alt
+ b
+ Ket
+ a#
+ a+
+ Brazero
+ Bra
+ Alt
+ Alt
+ Alt
+ Ket
+ a
+ Ket
+ End
+------------------------------------------------------------------
+
+/[ab]*/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]*+
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aaaa
+
+/[ab]*?/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]*?
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0:
+
+/[ab]?/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]?+
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: a
+
+/[ab]??/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]??
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0:
+
+/[ab]+/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]++
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aaaa
+
+/[ab]+?/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]+?
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: a
+
+/[ab]{2,3}/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]{2,3}+
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aaa
+
+/[ab]{2,3}?/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]{2,3}?
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aa
+
+/[ab]{2,}/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]{2,}+
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aaaa
+
+/[ab]{2,}?/BZ
+------------------------------------------------------------------
+ Bra
+ [ab]{2,}?
+ Ket
+ End
+------------------------------------------------------------------
+ aaaa
+ 0: aa
+
+/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/BZ
+------------------------------------------------------------------
+ Bra
+ \d++
+ \s{0,5}+
+ =
+ \s*+
+ \S?
+ =
+ \w{0,4}+
+ \W*+
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-d]{5,12}[e-z0-9]*#[^a-z]+[b-y]*a[2-7]?[^0-9a-z]+/BZ
+------------------------------------------------------------------
+ Bra
+ [a-d]{5,12}+
+ [0-9e-z]*+
+ #
+ [\x00-`{-\xff] (neg)++
+ [b-y]*+
+ a
+ [2-7]?+
+ [\x00-/:-`{-\xff] (neg)++
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-z]*\s#[ \t]?\S#[a-c]*\S#[C-G]+?\d#[4-8]*\D#[4-9,]*\D#[!$]{0,5}\w#[M-Xf-l]+\W#[a-c,]?\W/BZ
+------------------------------------------------------------------
+ Bra
+ [a-z]*+
+ \s
+ #
+ [\x09 ]?+
+ \S
+ #
+ [a-c]*
+ \S
+ #
+ [C-G]++
+ \d
+ #
+ [4-8]*+
+ \D
+ #
+ [,4-9]*
+ \D
+ #
+ [!$]{0,5}+
+ \w
+ #
+ [M-Xf-l]++
+ \W
+ #
+ [,a-c]?
+ \W
+ Ket
+ End
+------------------------------------------------------------------
+
+/a+(aa|bb)*c#a*(bb|cc)*a#a?(bb|cc)*d#[a-f]*(g|hh)*f/BZ
+------------------------------------------------------------------
+ Bra
+ a+
+ Brazero
+ CBra 1
+ aa
+ Alt
+ bb
+ KetRmax
+ c#
+ a*
+ Brazero
+ CBra 2
+ bb
+ Alt
+ cc
+ KetRmax
+ a#
+ a?+
+ Brazero
+ CBra 3
+ bb
+ Alt
+ cc
+ KetRmax
+ d#
+ [a-f]*
+ Brazero
+ CBra 4
+ g
+ Alt
+ hh
+ KetRmax
+ f
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-f]*(g|hh|i)*i#[a-x]{4,}(y{0,6})*y#[a-k]+(ll|mm)+n/BZ
+------------------------------------------------------------------
+ Bra
+ [a-f]*+
+ Brazero
+ CBra 1
+ g
+ Alt
+ hh
+ Alt
+ i
+ KetRmax
+ i#
+ [a-x]{4,}
+ Brazero
+ SCBra 2
+ y{0,6}
+ KetRmax
+ y#
+ [a-k]++
+ CBra 3
+ ll
+ Alt
+ mm
+ KetRmax
+ n
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-f]*(?>gg|hh)+#[a-f]*(?>gg|hh)?#[a-f]*(?>gg|hh)*a#[a-f]*(?>gg|hh)*h/BZ
+------------------------------------------------------------------
+ Bra
+ [a-f]*+
+ Once_NC
+ gg
+ Alt
+ hh
+ KetRmax
+ #
+ [a-f]*+
+ Brazero
+ Once_NC
+ gg
+ Alt
+ hh
+ Ket
+ #
+ [a-f]*
+ Brazero
+ Once_NC
+ gg
+ Alt
+ hh
+ KetRmax
+ a#
+ [a-f]*+
+ Brazero
+ Once_NC
+ gg
+ Alt
+ hh
+ KetRmax
+ h
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-c]*d/DZS
+------------------------------------------------------------------
+ Bra
+ [a-c]*+
+ d
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+Need char = 'd'
+Subject length lower bound = 1
+Starting chars: a b c d
+
+/[a-c]+d/DZS
+------------------------------------------------------------------
+ Bra
+ [a-c]++
+ d
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+Need char = 'd'
+Subject length lower bound = 2
+Starting chars: a b c
+
+/[a-c]?d/DZS
+------------------------------------------------------------------
+ Bra
+ [a-c]?+
+ d
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+Need char = 'd'
+Subject length lower bound = 1
+Starting chars: a b c d
+
+/[a-c]{4,6}d/DZS
+------------------------------------------------------------------
+ Bra
+ [a-c]{4,6}+
+ d
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+Need char = 'd'
+Subject length lower bound = 5
+Starting chars: a b c
+
+/[a-c]{0,6}d/DZS
+------------------------------------------------------------------
+ Bra
+ [a-c]{0,6}+
+ d
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+Need char = 'd'
+Subject length lower bound = 1
+Starting chars: a b c d
+
+/-- End of special auto-possessive tests --/
+
+/^A\o{1239}B/
+Failed: non-octal character in \o{} (closing brace missing?) at offset 8
+
+/^A\oB/
+Failed: missing opening brace after \o at offset 3
+
+/^A\x{zz}B/
+Failed: non-hex character in \x{} (closing brace missing?) at offset 5
+
+/^A\x{12Z/
+Failed: non-hex character in \x{} (closing brace missing?) at offset 7
+
+/^A\x{/
+Failed: non-hex character in \x{} (closing brace missing?) at offset 5
+
+/[ab]++/BZO
+------------------------------------------------------------------
+ Bra
+ [ab]++
+ Ket
+ End
+------------------------------------------------------------------
+
+/[^ab]*+/BZO
+------------------------------------------------------------------
+ Bra
+ [\x00-`c-\xff] (neg)*+
+ Ket
+ End
+------------------------------------------------------------------
+
+/a{4}+/BZO
+------------------------------------------------------------------
+ Bra
+ a{4}
+ Ket
+ End
+------------------------------------------------------------------
+
+/a{4}+/BZOi
+------------------------------------------------------------------
+ Bra
+ /i a{4}
+ Ket
+ End
+------------------------------------------------------------------
+
+/[a-[:digit:]]+/
+Failed: invalid range in character class at offset 3
+
+/[A-[:digit:]]+/
+Failed: invalid range in character class at offset 3
+
+/[a-[.xxx.]]+/
+Failed: invalid range in character class at offset 3
+
+/[a-[=xxx=]]+/
+Failed: invalid range in character class at offset 3
+
+/[a-[!xxx!]]+/
+Failed: range out of order in character class at offset 3
+
+/[A-[!xxx!]]+/
+ A]]]
+ 0: A]]]
+
+/[a-\d]+/
+Failed: invalid range in character class at offset 4
+
+/(?<0abc>xx)/
+Failed: group name must start with a non-digit at offset 3
+
+/(?&1abc)xx(?<1abc>y)/
+Failed: group name must start with a non-digit at offset 3
+
+/(?<ab-cd>xx)/
+Failed: syntax error in subpattern name (missing terminator) at offset 5
+
+/(?'0abc'xx)/
+Failed: group name must start with a non-digit at offset 3
+
+/(?P<0abc>xx)/
+Failed: group name must start with a non-digit at offset 4
+
+/\k<5ghj>/
+Failed: group name must start with a non-digit at offset 3
+
+/\k'5ghj'/
+Failed: group name must start with a non-digit at offset 3
+
+/\k{2fgh}/
+Failed: group name must start with a non-digit at offset 3
+
+/(?P=8yuki)/
+Failed: group name must start with a non-digit at offset 4
+
+/\g{4df}/
+Failed: group name must start with a non-digit at offset 3
+
+/(?&1abc)xx(?<1abc>y)/
+Failed: group name must start with a non-digit at offset 3
+
+/(?P>1abc)xx(?<1abc>y)/
+Failed: group name must start with a non-digit at offset 4
+
+/\g'3gh'/
+Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 2
+
+/\g<5fg>/
+Failed: \g is not followed by a braced, angle-bracketed, or quoted name/number or by a plain number at offset 2
+
+/(?(<4gh>)abc)/
+Failed: group name must start with a non-digit at offset 4
+
+/(?('4gh')abc)/
+Failed: group name must start with a non-digit at offset 4
+
+/(?(4gh)abc)/
+Failed: malformed number or name after (?( at offset 4
+
+/(?(R&6yh)abc)/
+Failed: group name must start with a non-digit at offset 5
+
+/(((a\2)|(a*)\g<-1>))*a?/BZ
+------------------------------------------------------------------
+ Bra
+ Brazero
+ SCBra 1
+ Once
+ CBra 2
+ CBra 3
+ a
+ \2
+ Ket
+ Alt
+ CBra 4
+ a*
+ Ket
+ Recurse
+ Ket
+ Ket
+ KetRmax
+ a?+
+ Ket
+ End
+------------------------------------------------------------------
+
+/-- Test the ugly "start or end of word" compatibility syntax --/
+
+/[[:<:]]red[[:>:]]/BZ
+------------------------------------------------------------------
+ Bra
+ \b
+ Assert
+ \w
+ Ket
+ red
+ \b
+ AssertB
+ Reverse
+ \w
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+ little red riding hood
+ 0: red
+ a /red/ thing
+ 0: red
+ red is a colour
+ 0: red
+ put it all on red
+ 0: red
+ ** Failers
+No match
+ no reduction
+No match
+ Alfred Winifred
+No match
+
+/[a[:<:]] should give error/
+Failed: unknown POSIX class name at offset 4
+
+/(?=ab\K)/+
+ abcd
+Start of matched string is beyond its end - displaying from end to start.
+ 0: ab
+ 0+ abcd
+
+/abcd/f<lf>
+ xx\nxabcd
+No match
+
+/ -- Test stack check external calls --/
+
+/(((((a)))))/Q0
+
+/(((((a)))))/Q1
+Failed: parentheses are too deeply nested (stack check) at offset 0
+
+/(((((a)))))/Q
+** Missing 0 or 1 after /Q
+
+/^\w+(?>\s*)(?<=\w)/BZ
+------------------------------------------------------------------
+ Bra
+ ^
+ \w+
+ Once_NC
+ \s*+
+ Ket
+ AssertB
+ Reverse
+ \w
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/\othing/
+Failed: missing opening brace after \o at offset 1
+
+/\o{}/
+Failed: digits missing in \x{} or \o{} at offset 1
+
+/\o{whatever}/
+Failed: non-octal character in \o{} (closing brace missing?) at offset 3
+
+/\xthing/
+
+/\x{}/
+Failed: digits missing in \x{} or \o{} at offset 3
+
+/\x{whatever}/
+Failed: non-hex character in \x{} (closing brace missing?) at offset 3
+
+"((?=(?(?=(?(?=(?(?=()))))))))"
+ a
+ 0:
+ 1:
+ 2:
+
+"(?(?=)==)(((((((((?=)))))))))"
+ a
+No match
+
+/^(?:(a)|b)(?(1)A|B)/I
+Capturing subpattern count = 1
+Max back reference = 1
+Options: anchored
+No first char
+No need char
+ aA123\O3
+Matched, but too many substrings
+ 0: aA
+ aA123\O6
+ 0: aA
+ 1: a
+
+'^(?:(?<AA>a)|b)(?(<AA>)A|B)'
+ aA123\O3
+Matched, but too many substrings
+ 0: aA
+ aA123\O6
+ 0: aA
+ 1: a
+
+'^(?<AA>)(?:(?<AA>a)|b)(?(<AA>)A|B)'J
+ aA123\O3
+Matched, but too many substrings
+ 0: aA
+ aA123\O6
+Matched, but too many substrings
+ 0: aA
+ 1:
+
+'^(?:(?<AA>X)|)(?:(?<AA>a)|b)\k{AA}'J
+ aa123\O3
+Matched, but too many substrings
+ 0: aa
+ aa123\O6
+Matched, but too many substrings
+ 0: aa
+ 1: <unset>
+
+/(?<N111>(?J)(?<N111>1(111111)11|)1|1|)(?(<N111>)1)/
+
+/(?(?=0)?)+/
+Failed: nothing to repeat at offset 7
+
+/(?(?=0)(?=00)?00765)/
+ 00765
+ 0: 00765
+
+/(?(?=0)(?=00)?00765|(?!3).56)/
+ 00765
+ 0: 00765
+ 456
+ 0: 456
+ ** Failers
+No match
+ 356
+No match
+
+'^(a)*+(\w)'
+ g
+ 0: g
+ 1: <unset>
+ 2: g
+ g\O3
+Matched, but too many substrings
+ 0: g
+
+'^(?:a)*+(\w)'
+ g
+ 0: g
+ 1: g
+ g\O3
+Matched, but too many substrings
+ 0: g
+
+//C
+ \O\C+
+Callout 255: last capture = -1
+--->
+ +0 ^
+Matched, but too many substrings
+
+"((?2){0,1999}())?"
+
+/((?+1)(\1))/BZ
+------------------------------------------------------------------
+ Bra
+ Once
+ CBra 1
+ Recurse
+ CBra 2
+ \1
+ Ket
+ Ket
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?(?!)a|b)/
+ bbb
+ 0: b
+ aaa
+No match
+
+"((?2)+)((?1))"
+
+"(?(?<E>.*!.*)?)"
+Failed: assertion expected after (?( or (?(?C) at offset 3
+
+"X((?2)()*+){2}+"BZ
+------------------------------------------------------------------
+ Bra
+ X
+ Once
+ CBra 1
+ Recurse
+ Braposzero
+ SCBraPos 2
+ KetRpos
+ Ket
+ CBra 1
+ Recurse
+ Braposzero
+ SCBraPos 2
+ KetRpos
+ Ket
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+"X((?2)()*+){2}"BZ
+------------------------------------------------------------------
+ Bra
+ X
+ CBra 1
+ Recurse
+ Braposzero
+ SCBraPos 2
+ KetRpos
+ Ket
+ CBra 1
+ Recurse
+ Braposzero
+ SCBraPos 2
+ KetRpos
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+"(?<=((?2))((?1)))"
+Failed: lookbehind assertion is not fixed length at offset 17
+
+/(?<=\Ka)/g+
+ aaaaa
+ 0: a
+ 0+ aaaa
+ 0: a
+ 0+ aaaa
+ 0: a
+ 0+ aaa
+ 0: a
+ 0+ aa
+ 0: a
+ 0+ a
+ 0: a
+ 0+
+
+/(?<=\Ka)/G+
+ aaaaa
+ 0: a
+ 0+ aaaa
+ 0: a
+ 0+ aaa
+ 0: a
+ 0+ aa
+ 0: a
+ 0+ a
+ 0: a
+ 0+
+
+/((?2){73}(?2))((?1))/
+
+/.((?2)(?R)\1)()/BZ
+------------------------------------------------------------------
+ Bra
+ Any
+ Once
+ CBra 1
+ Recurse
+ Recurse
+ \1
+ Ket
+ Ket
+ CBra 2
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?1)()((((((\1++))\x85)+)|))/
+
+/(\9*+(?2);\3++()2|)++{/
+Failed: reference to non-existent subpattern at offset 22
+
+/\V\x85\9*+((?2)\3++()2)*:2/
+Failed: reference to non-existent subpattern at offset 26
+
+/(((?(R)){0,2}) (?''((?'R')((?'R')))))/J
+
+/(((?(X)){0,2}) (?''((?'X')((?'X')))))/J
+
+/(((?(R)){0,2}) (?''((?'X')((?'R')))))/
+
+"(?J)(?'d'(?'d'\g{d}))"
+
+".*?\h.+.\.+\R*?\xd(?i)(?=!(?=b`b`b`\`b\xa9b!)`\a`bbbbbbbbbbbbb`bbbbbbbbbbbb*R\x85bbbbbbb\C?{((?2)(?))((
+\H){8(?<=(?1){29}\xa8bbbb\x16\xd\xc6^($(?<! )(\xa9H4){4}h}1)B))\x15')"
+
+"(?J:(?|(?'R')(\k'R')|((?'R'))))"
+
+/(?<=|(\,\$(?73591620449005828816)\xa8.{7}){6}\x09)/
+Failed: number is too big at offset 32
+
+//
+\O1
+Matched, but too many substrings
+
+/^(?:(?(1)x|)+)+$()/BZ
+------------------------------------------------------------------
+ Bra
+ ^
+ SBra
+ SCond
+ 1 Cond ref
+ x
+ Alt
+ KetRmax
+ KetRmax
+ $
+ CBra 1
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?=di(?<=(?1))|(?=(.))))/
+Failed: unmatched parentheses at offset 23
+
+/(?(R))*+/BZ
+------------------------------------------------------------------
+ Bra
+ Braposzero
+ SBraPos
+ SCond
+ Cond recurse any
+ Ket
+ KetRpos
+ Ket
+ End
+------------------------------------------------------------------
+
+/[[:\\](?'abc')[a:]/
+
+"[[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[:::::::::::::::::[[.\xe8Nq\xffq\xff\xe0\x2|||::Nq\xffq\xff\xe0\x6\x2|||::[[[:[::::::[[[[[::::::::[:[[[:[:::[[[[[[[[[[[[[[:::E[[[:[:[[:[:::[[:::E[[[:[:[[:'[:::::E[[[:[::::::[[[:[[[[[[[::E[[[:[::::::[[[:[[[[[[[[:[[::[::::[[:::::::[[:[[[[[[[:[[::[:[[:[~"
+Failed: missing terminating ] for character class at offset 353
+
+/()(?(R)0)*+/BZ
+------------------------------------------------------------------
+ Bra
+ CBra 1
+ Ket
+ Braposzero
+ SBraPos
+ SCond
+ Cond recurse any
+ 0
+ Ket
+ KetRpos
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?R-:(?</
+Failed: (?R or (?[+-]digits must be followed by ) at offset 3
+
+/(?1){3918}(((((0(\k'R'))))(?J)(?'R'(?'R'\3){99})))/I
+Capturing subpattern count = 8
+Max back reference = 8
+Named capturing subpatterns:
+ R 7
+ R 8
+No options
+Duplicate name status changes
+No first char
+Need char = '0'
+
+/(?J:(?|(:(?|(?'R')(\k'R')|((?'R')))H'Rk'Rf)|s(?'R')))/
+
+/0(?0)|(1)(*THEN)(*SKIP:0)(*FAIL)/
+ 01
+No match
+
+/((?(R8000000000)))/
+Failed: number is too big at offset 16
+
+/(?(8000000000/
+Failed: number is too big at offset 13
+
+/(?:ab)?(?:ab)(?:ab)/
+ abab
+ 0: abab
+ ababab
+ 0: ababab
+ aba
+No match
+
+/((*MARK:A))++a(*SKIP:B)b/
+ aacb
+No match
+
+/(?J:(?|(:(?|(?'R')(\z(?|(?'R')(\k'R')|((?'R')))k'R')|((?'R')))H'Ak'Rf)|s(?'R')))/
+
+/(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?&a)(?<a>1)/
+
+/a[[:punct:]b]/BZ
+------------------------------------------------------------------
+ Bra
+ a
+ [!-/:-@[-`b{-~]
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/BZ
+------------------------------------------------------------------
+ Bra
+ L?+
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/BOZ
+------------------------------------------------------------------
+ Bra
+ L?
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/BCZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 14
+ L?+
+ Callout 255 14 0
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/BCOZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 14
+ L?
+ Callout 255 14 0
+ Ket
+ End
+------------------------------------------------------------------
+
+/(A*)\E+/CBZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 7
+ SCBra 1
+ Callout 255 1 2
+ A*
+ Callout 255 3 0
+ KetRmax
+ Callout 255 7 0
+ Ket
+ End
+------------------------------------------------------------------
+
+/()\Q\E*]/BCZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 7
+ Brazero
+ SCBra 1
+ Callout 255 1 0
+ KetRmax
+ Callout 255 7 1
+ ]
+ Callout 255 8 0
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?<A>)(?J:(?<B>)(?<B>))(?<C>)/
+ \O\CC
+Matched, but too many substrings
+copy substring C failed -7
+
+/(?=a\K)/
+ ring bpattingbobnd $ 1,oern cou \rb\L
+Start of matched string is beyond its end - displaying from end to start.
+ 0: a
+ 0L
+
+/(?<=((?C)0))/
+ 9010
+--->9010
+ 0 ^ 0
+ 0 ^ 0
+ 0:
+ 1: 0
+ abcd
+--->abcd
+ 0 ^ 0
+ 0 ^ 0
+ 0 ^ 0
+ 0 ^ 0
+No match
+
+/((?J)(?'R'(?'R'(?'R'(?'R'(?'R'(?|(\k'R'))))))))/
+
+/\N(?(?C)0?!.)*/
+Failed: assertion expected after (?( or (?(?C) at offset 4
+
+/(?<RA>abc)(?(R)xyz)/BZ
+------------------------------------------------------------------
+ Bra
+ CBra 1
+ abc
+ Ket
+ Cond
+ Cond recurse any
+ xyz
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?<R>abc)(?(R)xyz)/BZ
+------------------------------------------------------------------
+ Bra
+ CBra 1
+ abc
+ Ket
+ Cond
+ 1 Cond ref
+ xyz
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+
+/(?=.*[A-Z])/I
+Capturing subpattern count = 0
+May match empty string
+No options
+No first char
+No need char
+
/-- End of testinput2 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput3 b/lib/stdlib/test/re_SUITE_data/testoutput3
index 7b0a3e926e..73119ab4b7 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput3
+++ b/lib/stdlib/test/re_SUITE_data/testoutput3
@@ -1,6 +1,11 @@
-/-- This set of tests checks local-specific features, using the fr_FR locale.
- It is not Perl-compatible. There is different version called wintestinput3
- f or use on Windows, where the locale is called "french". --/
+/-- This set of tests checks local-specific features, using the "fr_FR" locale.
+ It is not Perl-compatible. When run via RunTest, the locale is edited to
+ be whichever of "fr_FR", "french", or "fr" is found to exist. There is
+ different version of this file called wintestinput3 for use on Windows,
+ where the locale is called "french" and the tests are run using
+ RunTest.bat. --/
+
+< forbid 8W
/^[\w]+/
*** Failers
@@ -88,7 +93,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfr_FR
@@ -97,7 +102,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
� � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � � �
� � � � � � � � � � � � � � � � � � � � � � � � � � � �
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput4 b/lib/stdlib/test/re_SUITE_data/testoutput4
index 6694111fb5..d43c12392d 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput4
+++ b/lib/stdlib/test/re_SUITE_data/testoutput4
@@ -1,6 +1,8 @@
/-- This set of tests is for UTF support, excluding Unicode properties. It is
compatible with all versions of Perl >= 5.10 and both the 8-bit and 16-bit
PCRE libraries. --/
+
+< forbid 9?=ABCDEFfGILMNPTUWXZ<
/a.b/8
acb
@@ -1257,4 +1259,22 @@ No match
\x{100}\x{100}\x{100}
No match
+/^a+[a\x{200}]/8
+ aa
+ 0: aa
+
+/^.\B.\B./8
+ \x{10123}\x{10124}\x{10125}
+ 0: \x{10123}\x{10124}\x{10125}
+
+/^#[^\x{ffff}]#[^\x{ffff}]#[^\x{ffff}]#/8
+ #\x{10000}#\x{100}#\x{10ffff}#
+ 0: #\x{10000}#\x{100}#\x{10ffff}#
+
+"[\S\V\H]"8
+
+/\C(\W?ſ)'?{{/8
+ \\C(\\W?ſ)'?{{
+No match
+
/-- End of testinput4 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput5 b/lib/stdlib/test/re_SUITE_data/testoutput5
index d583119dd9..bab989ca7e 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput5
+++ b/lib/stdlib/test/re_SUITE_data/testoutput5
@@ -1,26 +1,47 @@
/-- This set of tests checks the API, internals, and non-Perl stuff for UTF
support, excluding Unicode properties. However, tests that give different
results in 8-bit and 16-bit modes are excluded (see tests 16 and 17). --/
+
+< forbid W
/\x{110000}/8DZ
-Failed: character value in \x{...} sequence is too large at offset 9
+Failed: character value in \x{} or \o{} is too large at offset 9
+
+/\o{4200000}/8DZ
+Failed: character value in \x{} or \o{} is too large at offset 10
/\x{ffffffff}/8
-Failed: character value in \x{...} sequence is too large at offset 11
+Failed: character value in \x{} or \o{} is too large at offset 11
+
+/\o{37777777777}/8
+Failed: character value in \x{} or \o{} is too large at offset 14
/\x{100000000}/8
-Failed: character value in \x{...} sequence is too large at offset 12
+Failed: character value in \x{} or \o{} is too large at offset 12
+
+/\o{77777777777}/8
+Failed: character value in \x{} or \o{} is too large at offset 14
/\x{d800}/8
Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
+/\o{154000}/8
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 9
+
/\x{dfff}/8
Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
+/\o{157777}/8
+Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 9
+
/\x{d7ff}/8
+/\o{153777}/8
+
/\x{e000}/8
+/\o{170000}/8
+
/^\x{100}a\x{1234}/8
\x{100}a\x{1234}bcd
0: \x{100}a\x{1234}
@@ -146,11 +167,12 @@ No match
/\x{100}*/8DZ
------------------------------------------------------------------
Bra
- \x{100}*
+ \x{100}*+
Ket
End
------------------------------------------------------------------
Capturing subpattern count = 0
+May match empty string
Options: utf
No first char
No need char
@@ -159,7 +181,7 @@ No need char
------------------------------------------------------------------
Bra
a
- \x{100}*
+ \x{100}*+
Ket
End
------------------------------------------------------------------
@@ -172,7 +194,7 @@ No need char
------------------------------------------------------------------
Bra
ab
- \x{100}*
+ \x{100}*+
Ket
End
------------------------------------------------------------------
@@ -248,7 +270,7 @@ No match
/[z-\x{100}]/8DZ
------------------------------------------------------------------
Bra
- [z-\x{100}]
+ [z-\xff\x{100}]
Ket
End
------------------------------------------------------------------
@@ -373,6 +395,7 @@ Need char = 'z'
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
Options: utf
No first char
No need char
@@ -404,6 +427,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
Options: utf
No first char
No need char
@@ -424,6 +448,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
Options: utf
No first char
No need char
@@ -455,6 +480,7 @@ No need char
End
------------------------------------------------------------------
Capturing subpattern count = 2
+May match empty string
Options: utf
No first char
No need char
@@ -768,7 +794,7 @@ No match
/[\h]{3,}/8BZ
------------------------------------------------------------------
Bra
- [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]{3,}
+ [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}]{3,}+
Ket
End
------------------------------------------------------------------
@@ -786,7 +812,7 @@ No match
/[\H]/8BZ
------------------------------------------------------------------
Bra
- [\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}]
+ [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}]
Ket
End
------------------------------------------------------------------
@@ -794,7 +820,7 @@ No match
/[\V]/8BZ
------------------------------------------------------------------
Bra
- [\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}]
+ [\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}]
Ket
End
------------------------------------------------------------------
@@ -1510,7 +1536,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/[^\x{1234}]+?/iS8I
Capturing subpattern count = 0
@@ -1518,7 +1544,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/[^\x{1234}]++/iS8I
Capturing subpattern count = 0
@@ -1526,7 +1552,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 1
-No set of starting bytes
+No starting char list
/[^\x{1234}]{2}/iS8I
Capturing subpattern count = 0
@@ -1534,7 +1560,7 @@ Options: caseless utf
No first char
No need char
Subject length lower bound = 2
-No set of starting bytes
+No starting char list
//<bsr_anycrlf><bsr_unicode>
Failed: inconsistent NEWLINE options at offset 0
@@ -1572,7 +1598,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\h\x{e000}]+/8BZ
------------------------------------------------------------------
Bra
- [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{e000}]+
+ [\x09 \xa0\x{1680}\x{180e}\x{2000}-\x{200a}\x{202f}\x{205f}\x{3000}\x{e000}]++
Ket
End
------------------------------------------------------------------
@@ -1594,7 +1620,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\H\x{d7ff}]+/8BZ
------------------------------------------------------------------
Bra
- [\x00-\x08\x0a-\x1f!-\x9f\x{a1}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]+
+ [\x00-\x08\x0a-\x1f!-\x9f\xa1-\xff\x{100}-\x{167f}\x{1681}-\x{180d}\x{180f}-\x{1fff}\x{200b}-\x{202e}\x{2030}-\x{205e}\x{2060}-\x{2fff}\x{3001}-\x{10ffff}\x{d7ff}]++
Ket
End
------------------------------------------------------------------
@@ -1616,7 +1642,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\v\x{e000}]+/8BZ
------------------------------------------------------------------
Bra
- [\x0a-\x0d\x85\x{2028}-\x{2029}\x{e000}]+
+ [\x0a-\x0d\x85\x{2028}-\x{2029}\x{e000}]++
Ket
End
------------------------------------------------------------------
@@ -1634,7 +1660,7 @@ Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 7
/[\V\x{d7ff}]+/8BZ
------------------------------------------------------------------
Bra
- [\x00-\x09\x0e-\x84\x{86}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]+
+ [\x00-\x09\x0e-\x84\x86-\xff\x{100}-\x{2027}\x{202a}-\x{10ffff}\x{d7ff}]++
Ket
End
------------------------------------------------------------------
@@ -1808,10 +1834,8 @@ Partial match: \x{0d}\x{0d}
/i [^\x{8000}]*
/i [^\x{7fff}]{2}
/i [^\x{7fff}]{0,7}?
- Once
/i [^\x{fffff}]{5}
- /i [^\x{fffff}]?
- Ket
+ /i [^\x{fffff}]?+
Ket
End
------------------------------------------------------------------
@@ -1846,4 +1870,76 @@ No match
/\ud800/<JS>8
Failed: disallowed Unicode code point (>= 0xd800 && <= 0xdfff) at offset 5
+/^a+[a\x{200}]/8BZ
+------------------------------------------------------------------
+ Bra
+ ^
+ a+
+ [a\x{200}]
+ Ket
+ End
+------------------------------------------------------------------
+ aa
+ 0: aa
+
+/[b-d\x{200}-\x{250}]*[ae-h]?#[\x{200}-\x{250}]{0,8}[\x00-\xff]*#[\x{200}-\x{250}]+[a-z]/8BZ
+------------------------------------------------------------------
+ Bra
+ [b-d\x{200}-\x{250}]*+
+ [ae-h]?+
+ #
+ [\x{200}-\x{250}]{0,8}+
+ [\x00-\xff]*
+ #
+ [\x{200}-\x{250}]++
+ [a-z]
+ Ket
+ End
+------------------------------------------------------------------
+
+/[^\xff]*PRUNE:\x{100}abc(xyz(?1))/8DZ
+------------------------------------------------------------------
+ Bra
+ [^\x{ff}]*
+ PRUNE:\x{100}abc
+ CBra 1
+ xyz
+ Recurse
+ Ket
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 1
+Options: utf
+No first char
+Need char = 'z'
+
+/(?<=\K\x{17f})/8g+
+ \x{17f}\x{17f}\x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}
+ 0: \x{17f}
+ 0+
+
+/(?<=\K\x{17f})/8G+
+ \x{17f}\x{17f}\x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}\x{17f}
+ 0: \x{17f}
+ 0+ \x{17f}
+ 0: \x{17f}
+ 0+
+
/-- End of testinput5 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput6 b/lib/stdlib/test/re_SUITE_data/testoutput6
index b1d4579926..422d383357 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput6
+++ b/lib/stdlib/test/re_SUITE_data/testoutput6
@@ -1,5 +1,7 @@
/-- This set of tests is for Unicode property support. It is compatible with
Perl >= 5.15. --/
+
+< forbid 9?=ABCDEFfGILMNPTUXZ<
/^\pC\pL\pM\pN\pP\pS\pZ</8
\x7f\x{c0}\x{30f}\x{660}\x{66c}\x{f01}\x{1680}<
@@ -543,16 +545,6 @@ No match
abc
No match
-/\p{Lu}/8i
- A
- 0: A
- aZ
- 0: Z
- ** Failers
- 0: F
- abc
-No match
-
/\p{Ll}/8
a
0: a
@@ -729,6 +721,8 @@ No match
0: \x{60b}
** Failers
No match
+ \x{061c}
+No match
X\x{06e9}
No match
@@ -1310,7 +1304,7 @@ No match
/^>\s+/8W
>\x{20}\x{a0}\x{1680}\x{2028}\x{2029}\x{202f}\x{9}\x{b}
- 0: > \x{a0}\x{1680}\x{2028}\x{2029}\x{202f}\x{09}
+ 0: > \x{a0}\x{1680}\x{2028}\x{2029}\x{202f}\x{09}\x{0b}
/^>\pZ+/8W
>\x{20}\x{a0}\x{1680}\x{2028}\x{2029}\x{202f}\x{9}\x{b}
@@ -1338,15 +1332,15 @@ No match
/^[[:graph:]]*/8W
A\x{a1}\x{a0}
- 0: A
+ 0: A\x{a1}
/^[[:print:]]*/8W
A z\x{a0}\x{a1}
- 0: A z
+ 0: A z\x{a0}\x{a1}
/^[[:punct:]]*/8W
.+\x{a1}\x{a0}
- 0: .+
+ 0: .+\x{a1}
/\p{Zs}*?\R/
** Failers
@@ -1548,6 +1542,19 @@ No match
0: \x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}\x{1111}\x{ae4c}X
0+
+/\X*Z/8Y
+ A\x{300}
+No match
+
+/\X*(.)/8Y
+ A\x{1111}\x{ae4c}\x{1169}
+ 0: A\x{1111}
+ 1: \x{1111}
+
+/\X?abc/8Y
+\xff\x7f\x00\x00\x03\x00\x41\xcc\x80\x41\x{300}\x61\x62\x63\x00\>06\?
+ 0: A\x{300}abc
+
/-- --/
/\x{1e9e}+/8i
@@ -2139,11 +2146,439 @@ No match
0: 1234
123
No match
-
+
/^\X*\w{4}/8
1234
0: 1234
123
No match
+
+/^A\s+Z/8W
+ A\x{2005}Z
+ 0: A\x{2005}Z
+ A\x{85}\x{180e}\x{2005}Z
+ 0: A\x{85}\x{180e}\x{2005}Z
+
+/^A[\s]+Z/8W
+ A\x{2005}Z
+ 0: A\x{2005}Z
+ A\x{85}\x{180e}\x{2005}Z
+ 0: A\x{85}\x{180e}\x{2005}Z
+
+/^[[:graph:]]+$/8W
+ Letter:ABC
+ 0: Letter:ABC
+ Mark:\x{300}\x{1d172}\x{1d17b}
+ 0: Mark:\x{300}\x{1d172}\x{1d17b}
+ Number:9\x{660}
+ 0: Number:9\x{660}
+ Punctuation:\x{66a},;
+ 0: Punctuation:\x{66a},;
+ Symbol:\x{6de}<>\x{fffc}
+ 0: Symbol:\x{6de}<>\x{fffc}
+ Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+ 0: Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+ \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+ 0: \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+ \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+ 0: \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+ \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+ 0: \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+ \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+ 0: \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+ \x{feff}
+ 0: \x{feff}
+ \x{fff9}\x{fffa}\x{fffb}
+ 0: \x{fff9}\x{fffa}\x{fffb}
+ \x{110bd}
+ 0: \x{110bd}
+ \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+ 0: \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+ \x{e0001}
+ 0: \x{e0001}
+ \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+ 0: \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+ ** Failers
+No match
+ \x{09}
+No match
+ \x{0a}
+No match
+ \x{1D}
+No match
+ \x{20}
+No match
+ \x{85}
+No match
+ \x{a0}
+No match
+ \x{61c}
+No match
+ \x{1680}
+No match
+ \x{180e}
+No match
+ \x{2028}
+No match
+ \x{2029}
+No match
+ \x{202f}
+No match
+ \x{2065}
+No match
+ \x{2066}
+No match
+ \x{2067}
+No match
+ \x{2068}
+No match
+ \x{2069}
+No match
+ \x{3000}
+No match
+ \x{e0002}
+No match
+ \x{e001f}
+No match
+ \x{e0080}
+No match
+
+/^[[:print:]]+$/8W
+ Space: \x{a0}
+ 0: Space: \x{a0}
+ \x{1680}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}
+ 0: \x{1680}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}
+ \x{2006}\x{2007}\x{2008}\x{2009}\x{200a}
+ 0: \x{2006}\x{2007}\x{2008}\x{2009}\x{200a}
+ \x{202f}\x{205f}
+ 0: \x{202f}\x{205f}
+ \x{3000}
+ 0: \x{3000}
+ Letter:ABC
+ 0: Letter:ABC
+ Mark:\x{300}\x{1d172}\x{1d17b}
+ 0: Mark:\x{300}\x{1d172}\x{1d17b}
+ Number:9\x{660}
+ 0: Number:9\x{660}
+ Punctuation:\x{66a},;
+ 0: Punctuation:\x{66a},;
+ Symbol:\x{6de}<>\x{fffc}
+ 0: Symbol:\x{6de}<>\x{fffc}
+ Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+ 0: Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+ \x{180e}
+ 0: \x{180e}
+ \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+ 0: \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+ \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+ 0: \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+ \x{202f}
+ 0: \x{202f}
+ \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+ 0: \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+ \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+ 0: \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+ \x{feff}
+ 0: \x{feff}
+ \x{fff9}\x{fffa}\x{fffb}
+ 0: \x{fff9}\x{fffa}\x{fffb}
+ \x{110bd}
+ 0: \x{110bd}
+ \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+ 0: \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+ \x{e0001}
+ 0: \x{e0001}
+ \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+ 0: \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+ ** Failers
+ 0: ** Failers
+ \x{09}
+No match
+ \x{1D}
+No match
+ \x{85}
+No match
+ \x{61c}
+No match
+ \x{2028}
+No match
+ \x{2029}
+No match
+ \x{2065}
+No match
+ \x{2066}
+No match
+ \x{2067}
+No match
+ \x{2068}
+No match
+ \x{2069}
+No match
+ \x{e0002}
+No match
+ \x{e001f}
+No match
+ \x{e0080}
+No match
+
+/^[[:punct:]]+$/8W
+ \$+<=>^`|~
+ 0: $+<=>^`|~
+ !\"#%&'()*,-./:;?@[\\]_{}
+ 0: !"#%&'()*,-./:;?@[\]_{}
+ \x{a1}\x{a7}
+ 0: \x{a1}\x{a7}
+ \x{37e}
+ 0: \x{37e}
+ ** Failers
+No match
+ abcde
+No match
+
+/^[[:^graph:]]+$/8W
+ \x{09}\x{0a}\x{1D}\x{20}\x{85}\x{a0}\x{61c}\x{1680}\x{180e}
+ 0: \x{09}\x{0a}\x{1d} \x{85}\x{a0}\x{61c}\x{1680}\x{180e}
+ \x{2028}\x{2029}\x{202f}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}
+ 0: \x{2028}\x{2029}\x{202f}\x{2065}\x{2066}\x{2067}\x{2068}\x{2069}
+ \x{3000}\x{e0002}\x{e001f}\x{e0080}
+ 0: \x{3000}\x{e0002}\x{e001f}\x{e0080}
+ ** Failers
+No match
+ Letter:ABC
+No match
+ Mark:\x{300}\x{1d172}\x{1d17b}
+No match
+ Number:9\x{660}
+No match
+ Punctuation:\x{66a},;
+No match
+ Symbol:\x{6de}<>\x{fffc}
+No match
+ Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+No match
+ \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+No match
+ \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+No match
+ \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+No match
+ \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+No match
+ \x{feff}
+No match
+ \x{fff9}\x{fffa}\x{fffb}
+No match
+ \x{110bd}
+No match
+ \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+No match
+ \x{e0001}
+No match
+ \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+No match
+
+/^[[:^print:]]+$/8W
+ \x{09}\x{1D}\x{85}\x{61c}\x{2028}\x{2029}\x{2065}\x{2066}\x{2067}
+ 0: \x{09}\x{1d}\x{85}\x{61c}\x{2028}\x{2029}\x{2065}\x{2066}\x{2067}
+ \x{2068}\x{2069}\x{e0002}\x{e001f}\x{e0080}
+ 0: \x{2068}\x{2069}\x{e0002}\x{e001f}\x{e0080}
+ ** Failers
+No match
+ Space: \x{a0}
+No match
+ \x{1680}\x{2000}\x{2001}\x{2002}\x{2003}\x{2004}\x{2005}
+No match
+ \x{2006}\x{2007}\x{2008}\x{2009}\x{200a}
+No match
+ \x{202f}\x{205f}
+No match
+ \x{3000}
+No match
+ Letter:ABC
+No match
+ Mark:\x{300}\x{1d172}\x{1d17b}
+No match
+ Number:9\x{660}
+No match
+ Punctuation:\x{66a},;
+No match
+ Symbol:\x{6de}<>\x{fffc}
+No match
+ Cf-property:\x{ad}\x{600}\x{601}\x{602}\x{603}\x{604}\x{6dd}\x{70f}
+No match
+ \x{180e}
+No match
+ \x{200b}\x{200c}\x{200d}\x{200e}\x{200f}
+No match
+ \x{202a}\x{202b}\x{202c}\x{202d}\x{202e}
+No match
+ \x{202f}
+No match
+ \x{2060}\x{2061}\x{2062}\x{2063}\x{2064}
+No match
+ \x{206a}\x{206b}\x{206c}\x{206d}\x{206e}\x{206f}
+No match
+ \x{feff}
+No match
+ \x{fff9}\x{fffa}\x{fffb}
+No match
+ \x{110bd}
+No match
+ \x{1d173}\x{1d174}\x{1d175}\x{1d176}\x{1d177}\x{1d178}\x{1d179}\x{1d17a}
+No match
+ \x{e0001}
+No match
+ \x{e0020}\x{e0030}\x{e0040}\x{e0050}\x{e0060}\x{e0070}\x{e007f}
+No match
+
+/^[[:^punct:]]+$/8W
+ abcde
+ 0: abcde
+ ** Failers
+No match
+ \$+<=>^`|~
+No match
+ !\"#%&'()*,-./:;?@[\\]_{}
+No match
+ \x{a1}\x{a7}
+No match
+ \x{37e}
+No match
+
+/[RST]+/8iW
+ Ss\x{17f}
+ 0: Ss\x{17f}
+
+/[R-T]+/8iW
+ Ss\x{17f}
+ 0: Ss\x{17f}
+
+/[q-u]+/8iW
+ Ss\x{17f}
+ 0: Ss\x{17f}
+
+/^s?c/mi8
+ scat
+ 0: sc
+
+/[A-`]/i8
+ abcdefghijklmno
+ 0: a
+
+/\C\X*QT/8
+ Ӆ\x0aT
+No match
+
+/[\pS#moq]/
+ =
+ 0: =
+
+/[[:punct:]]/8W
+ \xc2\xb4
+No match
+ \x{b4}
+No match
+
+/[[:^ascii:]]/8W
+ \x{100}
+ 0: \x{100}
+ \x{200}
+ 0: \x{200}
+ \x{300}
+ 0: \x{300}
+ \x{37e}
+ 0: \x{37e}
+ a
+No match
+ 9
+No match
+ g
+No match
+
+/[[:^ascii:]\w]/8W
+ a
+ 0: a
+ 9
+ 0: 9
+ g
+ 0: g
+ \x{100}
+ 0: \x{100}
+ \x{200}
+ 0: \x{200}
+ \x{300}
+ 0: \x{300}
+ \x{37e}
+ 0: \x{37e}
+
+/[\w[:^ascii:]]/8W
+ a
+ 0: a
+ 9
+ 0: 9
+ g
+ 0: g
+ \x{100}
+ 0: \x{100}
+ \x{200}
+ 0: \x{200}
+ \x{300}
+ 0: \x{300}
+ \x{37e}
+ 0: \x{37e}
+
+/[^[:ascii:]\W]/8W
+ a
+No match
+ 9
+No match
+ g
+No match
+ \x{100}
+ 0: \x{100}
+ \x{200}
+ 0: \x{200}
+ \x{300}
+No match
+ \x{37e}
+No match
+
+/[[:^ascii:]a]/8W
+ a
+ 0: a
+ 9
+No match
+ g
+No match
+ \x{100}
+ 0: \x{100}
+ \x{200}
+ 0: \x{200}
+ \x{37e}
+ 0: \x{37e}
+
+/[^[:^ascii:]\d]/8W
+ a
+ 0: a
+ ~
+ 0: ~
+ 0
+No match
+ \a
+ 0: \x{07}
+ \x{7f}
+ 0: \x{7f}
+ \x{389}
+No match
+ \x{20ac}
+No match
+
+/(?=.*b)\pL/
+ 11bb
+ 0: b
+/(?(?=.*b)(?=.*b)\pL|.*c)/
+ 11bb
+ 0: b
+
/-- End of testinput6 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput7 b/lib/stdlib/test/re_SUITE_data/testoutput7
index ddd96fc2ed..2b167b28d1 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput7
+++ b/lib/stdlib/test/re_SUITE_data/testoutput7
@@ -78,7 +78,7 @@ No need char
/[\p{Nd}+-]+/8DZ
------------------------------------------------------------------
Bra
- [+\-\p{Nd}]+
+ [+\-\p{Nd}]++
Ket
End
------------------------------------------------------------------
@@ -124,7 +124,7 @@ No match
/[z-\x{100}]/8iDZ
------------------------------------------------------------------
Bra
- [Z\x{39c}\x{3bc}\x{1e9e}\x{178}z-\x{101}]
+ [Zz-\xff\x{39c}\x{3bc}\x{212b}\x{1e9e}\x{212b}\x{178}\x{100}-\x{101}]
Ket
End
------------------------------------------------------------------
@@ -162,7 +162,7 @@ No match
/[z-\x{100}]/8DZi
------------------------------------------------------------------
Bra
- [Z\x{39c}\x{3bc}\x{1e9e}\x{178}z-\x{101}]
+ [Zz-\xff\x{39c}\x{3bc}\x{212b}\x{1e9e}\x{212b}\x{178}\x{100}-\x{101}]
Ket
End
------------------------------------------------------------------
@@ -270,6 +270,20 @@ No need char
End
------------------------------------------------------------------
+/^\p{Cf}/8
+ \x{180e}
+ 0: \x{180e}
+ \x{061c}
+ 0: \x{61c}
+ \x{2066}
+ 0: \x{2066}
+ \x{2067}
+ 0: \x{2067}
+ \x{2068}
+ 0: \x{2068}
+ \x{2069}
+ 0: \x{2069}
+
/^\p{Cs}/8
\?\x{dfff}
0: \x{dfff}
@@ -278,6 +292,22 @@ No match
\x{09f}
No match
+/^\p{Mn}/8
+ \x{1a1b}
+ 0: \x{1a1b}
+
+/^\p{Pe}/8
+ \x{2309}
+ 0: \x{2309}
+ \x{230b}
+ 0: \x{230b}
+
+/^\p{Ps}/8
+ \x{2308}
+ 0: \x{2308}
+ \x{230a}
+ 0: \x{230a}
+
/^\p{Sc}+/8
$\x{a2}\x{a3}\x{a4}\x{a5}\x{a6}
0: $\x{a2}\x{a3}\x{a4}\x{a5}
@@ -297,8 +327,6 @@ No match
0: \x{a0}
\x{1680}
0: \x{1680}
- \x{180e}
- 0: \x{180e}
\x{2000}
0: \x{2000}
\x{2001}
@@ -310,8 +338,9 @@ No match
\x{200d}
No match
-/-- These four are here rather than in test 6 because Perl has problems with
- the negative versions of the properties. --/
+/-- These are here rather than in test 6 because Perl has problems with
+ the negative versions of the properties and behaves has changed how
+ it behaves for caseless matching. --/
/\p{^Lu}/8i
1234
@@ -351,6 +380,16 @@ No match
\x{1d00}
No match
+/\p{Lu}/8i
+ A
+ 0: A
+ aZ
+ 0: Z
+ ** Failers
+ 0: F
+ abc
+No match
+
/[\x{c0}\x{391}]/8i
\x{c0}
0: \x{c0}
@@ -501,7 +540,7 @@ No match
/^>\p{Xsp}+/8
> \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
- 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}
+ 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
/^>\p{Xsp}+?/8
>\x{1680}\x{2028}\x{0b}
@@ -509,11 +548,11 @@ No match
/^>\p{Xsp}*/8
> \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
- 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}
+ 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
/^>\p{Xsp}{2,9}/8
> \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
- 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}
+ 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
/^>\p{Xsp}{2,9}?/8
> \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
@@ -525,7 +564,7 @@ No match
/^>[\p{Xsp}]+/8
> \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
- 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}
+ 0: > \x{09}\x{0a}\x{0c}\x{0d}\x{a0}\x{1680}\x{2028}\x{0b}
/^>\p{Xps}/8
>\x{1680}\x{2028}\x{0b}
@@ -820,7 +859,7 @@ No match
/[[:graph:]]/WBZ
------------------------------------------------------------------
Bra
- [!-~]
+ [[:graph:]]
Ket
End
------------------------------------------------------------------
@@ -828,7 +867,7 @@ No match
/[[:print:]]/WBZ
------------------------------------------------------------------
Bra
- [ -~]
+ [[:print:]]
Ket
End
------------------------------------------------------------------
@@ -836,7 +875,7 @@ No match
/[[:punct:]]/WBZ
------------------------------------------------------------------
Bra
- [!-/:-@[-`{-~]
+ [[:punct:]]
Ket
End
------------------------------------------------------------------
@@ -910,7 +949,7 @@ No match
/[[:^alpha:][:^cntrl:]]+/8WBZ
------------------------------------------------------------------
Bra
- [ -~\x80-\xff\P{L}]+
+ [ -~\x80-\xff\P{L}\x{100}-\x{10ffff}]++
Ket
End
------------------------------------------------------------------
@@ -922,7 +961,7 @@ No match
/[[:^cntrl:][:^alpha:]]+/8WBZ
------------------------------------------------------------------
Bra
- [ -~\x80-\xff\P{L}]+
+ [ -~\x80-\xff\x{100}-\x{10ffff}\P{L}]++
Ket
End
------------------------------------------------------------------
@@ -934,7 +973,7 @@ No match
/[[:alpha:]]+/8WBZ
------------------------------------------------------------------
Bra
- [\p{L}]+
+ [\p{L}]++
Ket
End
------------------------------------------------------------------
@@ -944,7 +983,7 @@ No match
/[[:^alpha:]\S]+/8WBZ
------------------------------------------------------------------
Bra
- [\P{L}\P{Xsp}]+
+ [\P{L}\P{Xsp}]++
Ket
End
------------------------------------------------------------------
@@ -956,7 +995,7 @@ No match
/[^\d]+/8WBZ
------------------------------------------------------------------
Bra
- [^\p{Nd}]+
+ [^\p{Nd}]++
Ket
End
------------------------------------------------------------------
@@ -1070,8 +1109,8 @@ No match
prop Nd
B+
prop N *+
- B+
- prop Nd *
+ B++
+ prop Nd *+
Ket
End
------------------------------------------------------------------
@@ -1347,7 +1386,7 @@ Need char = 'B' (caseless)
/[\x{3a3}]+/8iBZ
------------------------------------------------------------------
Bra
- clist 03a3 03c2 03c3 +
+ clist 03a3 03c2 03c3 ++
Ket
End
------------------------------------------------------------------
@@ -1355,7 +1394,7 @@ Need char = 'B' (caseless)
/[^\x{3a3}]+/8iBZ
------------------------------------------------------------------
Bra
- not clist 03a3 03c2 03c3 +
+ not clist 03a3 03c2 03c3 ++
Ket
End
------------------------------------------------------------------
@@ -1577,5 +1616,730 @@ No match
No match
\x{1234}abc
No match
+
+/-- Some auto-possessification tests --/
+
+/\pN+\z/BZ
+------------------------------------------------------------------
+ Bra
+ prop N ++
+ \z
+ Ket
+ End
+------------------------------------------------------------------
+
+/\PN+\z/BZ
+------------------------------------------------------------------
+ Bra
+ notprop N ++
+ \z
+ Ket
+ End
+------------------------------------------------------------------
+
+/\pN+/BZ
+------------------------------------------------------------------
+ Bra
+ prop N ++
+ Ket
+ End
+------------------------------------------------------------------
+
+/\PN+/BZ
+------------------------------------------------------------------
+ Bra
+ notprop N ++
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Any}+\p{Any} \p{Any}+\P{Any} \p{Any}+\p{L&} \p{Any}+\p{L} \p{Any}+\p{Lu} \p{Any}+\p{Han} \p{Any}+\p{Xan} \p{Any}+\p{Xsp} \p{Any}+\p{Xps} \p{Xwd}+\p{Any} \p{Any}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Any +
+ prop Any
+ prop Any +
+ notprop Any
+ prop Any +
+ prop L&
+ prop Any +
+ prop L
+ prop Any +
+ prop Lu
+ prop Any +
+ prop Han
+ prop Any +
+ prop Xan
+ prop Any +
+ prop Xsp
+ prop Any +
+ prop Xps
+ prop Xwd +
+ prop Any
+ prop Any +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{L&}+\p{Any} \p{L&}+\p{L&} \P{L&}+\p{L&} \p{L&}+\p{L} \p{L&}+\p{Lu} \p{L&}+\p{Han} \p{L&}+\p{Xan} \p{L&}+\P{Xan} \p{L&}+\p{Xsp} \p{L&}+\p{Xps} \p{Xwd}+\p{L&} \p{L&}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop L& +
+ prop Any
+ prop L& +
+ prop L&
+ notprop L& ++
+ prop L&
+ prop L& +
+ prop L
+ prop L& +
+ prop Lu
+ prop L& +
+ prop Han
+ prop L& +
+ prop Xan
+ prop L& ++
+ notprop Xan
+ prop L& ++
+ prop Xsp
+ prop L& ++
+ prop Xps
+ prop Xwd +
+ prop L&
+ prop L& +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{N}+\p{Any} \p{N}+\p{L&} \p{N}+\p{L} \p{N}+\P{L} \p{N}+\P{N} \p{N}+\p{Lu} \p{N}+\p{Han} \p{N}+\p{Xan} \p{N}+\p{Xsp} \p{N}+\p{Xps} \p{Xwd}+\p{N} \p{N}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop N +
+ prop Any
+ prop N +
+ prop L&
+ prop N ++
+ prop L
+ prop N +
+ notprop L
+ prop N ++
+ notprop N
+ prop N ++
+ prop Lu
+ prop N +
+ prop Han
+ prop N +
+ prop Xan
+ prop N ++
+ prop Xsp
+ prop N ++
+ prop Xps
+ prop Xwd +
+ prop N
+ prop N +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Lu}+\p{Any} \p{Lu}+\p{L&} \p{Lu}+\p{L} \p{Lu}+\p{Lu} \P{Lu}+\p{Lu} \p{Lu}+\p{Nd} \p{Lu}+\P{Nd} \p{Lu}+\p{Han} \p{Lu}+\p{Xan} \p{Lu}+\p{Xsp} \p{Lu}+\p{Xps} \p{Xwd}+\p{Lu} \p{Lu}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Lu +
+ prop Any
+ prop Lu +
+ prop L&
+ prop Lu +
+ prop L
+ prop Lu +
+ prop Lu
+ notprop Lu ++
+ prop Lu
+ prop Lu ++
+ prop Nd
+ prop Lu +
+ notprop Nd
+ prop Lu +
+ prop Han
+ prop Lu +
+ prop Xan
+ prop Lu ++
+ prop Xsp
+ prop Lu ++
+ prop Xps
+ prop Xwd +
+ prop Lu
+ prop Lu +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Han}+\p{Lu} \p{Han}+\p{L&} \p{Han}+\p{L} \p{Han}+\p{Lu} \p{Han}+\p{Arabic} \p{Arabic}+\p{Arabic} \p{Han}+\p{Xan} \p{Han}+\p{Xsp} \p{Han}+\p{Xps} \p{Xwd}+\p{Han} \p{Han}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Han +
+ prop Lu
+ prop Han +
+ prop L&
+ prop Han +
+ prop L
+ prop Han +
+ prop Lu
+ prop Han ++
+ prop Arabic
+ prop Arabic +
+ prop Arabic
+ prop Han +
+ prop Xan
+ prop Han +
+ prop Xsp
+ prop Han +
+ prop Xps
+ prop Xwd +
+ prop Han
+ prop Han +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xan}+\p{Any} \p{Xan}+\p{L&} \P{Xan}+\p{L&} \p{Xan}+\p{L} \p{Xan}+\p{Lu} \p{Xan}+\p{Han} \p{Xan}+\p{Xan} \p{Xan}+\P{Xan} \p{Xan}+\p{Xsp} \p{Xan}+\p{Xps} \p{Xwd}+\p{Xan} \p{Xan}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xan +
+ prop Any
+ prop Xan +
+ prop L&
+ notprop Xan ++
+ prop L&
+ prop Xan +
+ prop L
+ prop Xan +
+ prop Lu
+ prop Xan +
+ prop Han
+ prop Xan +
+ prop Xan
+ prop Xan ++
+ notprop Xan
+ prop Xan ++
+ prop Xsp
+ prop Xan ++
+ prop Xps
+ prop Xwd +
+ prop Xan
+ prop Xan +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xsp}+\p{Any} \p{Xsp}+\p{L&} \p{Xsp}+\p{L} \p{Xsp}+\p{Lu} \p{Xsp}+\p{Han} \p{Xsp}+\p{Xan} \p{Xsp}+\p{Xsp} \P{Xsp}+\p{Xsp} \p{Xsp}+\p{Xps} \p{Xwd}+\p{Xsp} \p{Xsp}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xsp +
+ prop Any
+ prop Xsp ++
+ prop L&
+ prop Xsp ++
+ prop L
+ prop Xsp ++
+ prop Lu
+ prop Xsp +
+ prop Han
+ prop Xsp ++
+ prop Xan
+ prop Xsp +
+ prop Xsp
+ notprop Xsp ++
+ prop Xsp
+ prop Xsp +
+ prop Xps
+ prop Xwd ++
+ prop Xsp
+ prop Xsp +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xwd}+\p{Any} \p{Xwd}+\p{L&} \p{Xwd}+\p{L} \p{Xwd}+\p{Lu} \p{Xwd}+\p{Han} \p{Xwd}+\p{Xan} \p{Xwd}+\p{Xsp} \p{Xwd}+\p{Xps} \p{Xwd}+\p{Xwd} \p{Xwd}+\P{Xwd} \p{Xwd}+\p{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xwd +
+ prop Any
+ prop Xwd +
+ prop L&
+ prop Xwd +
+ prop L
+ prop Xwd +
+ prop Lu
+ prop Xwd +
+ prop Han
+ prop Xwd +
+ prop Xan
+ prop Xwd ++
+ prop Xsp
+ prop Xwd ++
+ prop Xps
+ prop Xwd +
+ prop Xwd
+ prop Xwd ++
+ notprop Xwd
+ prop Xwd +
+ prop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xuc}+\p{Any} \p{Xuc}+\p{L&} \p{Xuc}+\p{L} \p{Xuc}+\p{Lu} \p{Xuc}+\p{Han} \p{Xuc}+\p{Xan} \p{Xuc}+\p{Xsp} \p{Xuc}+\p{Xps} \p{Xwd}+\p{Xuc} \p{Xuc}+\p{Xuc} \p{Xuc}+\P{Xuc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xuc +
+ prop Any
+ prop Xuc +
+ prop L&
+ prop Xuc +
+ prop L
+ prop Xuc +
+ prop Lu
+ prop Xuc +
+ prop Han
+ prop Xuc +
+ prop Xan
+ prop Xuc +
+ prop Xsp
+ prop Xuc +
+ prop Xps
+ prop Xwd +
+ prop Xuc
+ prop Xuc +
+ prop Xuc
+ prop Xuc ++
+ notprop Xuc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{N}+\p{Ll} \p{N}+\p{Nd} \p{N}+\P{Nd}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop N ++
+ prop Ll
+ prop N +
+ prop Nd
+ prop N +
+ notprop Nd
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xan}+\p{L} \p{Xan}+\p{N} \p{Xan}+\p{C} \p{Xan}+\P{L} \P{Xan}+\p{N} \p{Xan}+\P{C}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xan +
+ prop L
+ prop Xan +
+ prop N
+ prop Xan ++
+ prop C
+ prop Xan +
+ notprop L
+ notprop Xan ++
+ prop N
+ prop Xan +
+ notprop C
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{L}+\p{Xan} \p{N}+\p{Xan} \p{C}+\p{Xan} \P{L}+\p{Xan} \p{N}+\p{Xan} \P{C}+\p{Xan} \p{L}+\P{Xan}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop L +
+ prop Xan
+ prop N +
+ prop Xan
+ prop C ++
+ prop Xan
+ notprop L +
+ prop Xan
+ prop N +
+ prop Xan
+ notprop C +
+ prop Xan
+ prop L ++
+ notprop Xan
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xan}+\p{Lu} \p{Xan}+\p{Nd} \p{Xan}+\p{Cc} \p{Xan}+\P{Ll} \P{Xan}+\p{No} \p{Xan}+\P{Cf}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xan +
+ prop Lu
+ prop Xan +
+ prop Nd
+ prop Xan ++
+ prop Cc
+ prop Xan +
+ notprop Ll
+ notprop Xan ++
+ prop No
+ prop Xan +
+ notprop Cf
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Lu}+\p{Xan} \p{Nd}+\p{Xan} \p{Cs}+\p{Xan} \P{Lt}+\p{Xan} \p{Nl}+\p{Xan} \P{Cc}+\p{Xan} \p{Lt}+\P{Xan}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Lu +
+ prop Xan
+ prop Nd +
+ prop Xan
+ prop Cs ++
+ prop Xan
+ notprop Lt +
+ prop Xan
+ prop Nl +
+ prop Xan
+ notprop Cc +
+ prop Xan
+ prop Lt ++
+ notprop Xan
+ Ket
+ End
+------------------------------------------------------------------
+
+/\w+\p{P} \w+\p{Po} \w+\s \p{Xan}+\s \s+\p{Xan} \s+\w/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xwd +
+ prop P
+ prop Xwd +
+ prop Po
+ prop Xwd ++
+ prop Xsp
+ prop Xan ++
+ prop Xsp
+ prop Xsp ++
+ prop Xan
+ prop Xsp ++
+ prop Xwd
+ Ket
+ End
+------------------------------------------------------------------
+
+/\w+\P{P} \W+\p{Po} \w+\S \P{Xan}+\s \s+\P{Xan} \s+\W/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xwd +
+ notprop P
+ notprop Xwd +
+ prop Po
+ prop Xwd +
+ notprop Xsp
+ notprop Xan +
+ prop Xsp
+ prop Xsp +
+ notprop Xan
+ prop Xsp +
+ notprop Xwd
+ Ket
+ End
+------------------------------------------------------------------
+
+/\w+\p{Po} \w+\p{Pc} \W+\p{Po} \W+\p{Pc} \w+\P{Po} \w+\P{Pc}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xwd +
+ prop Po
+ prop Xwd ++
+ prop Pc
+ notprop Xwd +
+ prop Po
+ notprop Xwd +
+ prop Pc
+ prop Xwd +
+ notprop Po
+ prop Xwd +
+ notprop Pc
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Nl}+\p{Xan} \P{Nl}+\p{Xan} \p{Nl}+\P{Xan} \P{Nl}+\P{Xan}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Nl +
+ prop Xan
+ notprop Nl +
+ prop Xan
+ prop Nl ++
+ notprop Xan
+ notprop Nl +
+ notprop Xan
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xan}+\p{Nl} \P{Xan}+\p{Nl} \p{Xan}+\P{Nl} \P{Xan}+\P{Nl}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xan +
+ prop Nl
+ notprop Xan ++
+ prop Nl
+ prop Xan +
+ notprop Nl
+ notprop Xan +
+ notprop Nl
+ Ket
+ End
+------------------------------------------------------------------
+
+/\p{Xan}+\p{Nd} \P{Xan}+\p{Nd} \p{Xan}+\P{Nd} \P{Xan}+\P{Nd}/BWZx
+------------------------------------------------------------------
+ Bra
+ prop Xan +
+ prop Nd
+ notprop Xan ++
+ prop Nd
+ prop Xan +
+ notprop Nd
+ notprop Xan +
+ notprop Nd
+ Ket
+ End
+------------------------------------------------------------------
+
+/-- End auto-possessification tests --/
+
+/\w+/8CWBZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 3
+ prop Xwd ++
+ Callout 255 3 0
+ Ket
+ End
+------------------------------------------------------------------
+ abcd
+--->abcd
+ +0 ^ \w+
+ +3 ^ ^
+ 0: abcd
+
+/[\p{N}]?+/BZO
+------------------------------------------------------------------
+ Bra
+ [\p{N}]?+
+ Ket
+ End
+------------------------------------------------------------------
+
+/[\p{L}ab]{2,3}+/BZO
+------------------------------------------------------------------
+ Bra
+ [ab\p{L}]{2,3}+
+ Ket
+ End
+------------------------------------------------------------------
+
+/\D+\X \d+\X \S+\X \s+\X \W+\X \w+\X \C+\X \R+\X \H+\X \h+\X \V+\X \v+\X a+\X \n+\X .+\X/BZx
+------------------------------------------------------------------
+ Bra
+ \D+
+ extuni
+ \d+
+ extuni
+ \S+
+ extuni
+ \s+
+ extuni
+ \W+
+ extuni
+ \w+
+ extuni
+ AllAny+
+ extuni
+ \R+
+ extuni
+ \H+
+ extuni
+ \h+
+ extuni
+ \V+
+ extuni
+ \v+
+ extuni
+ a+
+ extuni
+ \x0a+
+ extuni
+ Any+
+ extuni
+ Ket
+ End
+------------------------------------------------------------------
+
+/.+\X/BZxs
+------------------------------------------------------------------
+ Bra
+ AllAny+
+ extuni
+ Ket
+ End
+------------------------------------------------------------------
+
+/\X+$/BZxm
+------------------------------------------------------------------
+ Bra
+ extuni+
+ /m $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\X+\D \X+\d \X+\S \X+\s \X+\W \X+\w \X+. \X+\C \X+\R \X+\H \X+\h \X+\V \X+\v \X+\X \X+\Z \X+\z \X+$/BZx
+------------------------------------------------------------------
+ Bra
+ extuni+
+ \D
+ extuni+
+ \d
+ extuni+
+ \S
+ extuni+
+ \s
+ extuni+
+ \W
+ extuni+
+ \w
+ extuni+
+ Any
+ extuni+
+ AllAny
+ extuni+
+ \R
+ extuni+
+ \H
+ extuni+
+ \h
+ extuni+
+ \V
+ extuni+
+ \v
+ extuni+
+ extuni
+ extuni+
+ \Z
+ extuni++
+ \z
+ extuni+
+ $
+ Ket
+ End
+------------------------------------------------------------------
+
+/\d+\s{0,5}=\s*\S?=\w{0,4}\W*/8WBZ
+------------------------------------------------------------------
+ Bra
+ prop Nd ++
+ prop Xsp {0,5}+
+ =
+ prop Xsp *+
+ notprop Xsp ?
+ =
+ prop Xwd {0,4}+
+ notprop Xwd *+
+ Ket
+ End
+------------------------------------------------------------------
+
+/[RST]+/8iWBZ
+------------------------------------------------------------------
+ Bra
+ [R-Tr-t\x{17f}]++
+ Ket
+ End
+------------------------------------------------------------------
+
+/[R-T]+/8iWBZ
+------------------------------------------------------------------
+ Bra
+ [R-Tr-t\x{17f}]++
+ Ket
+ End
+------------------------------------------------------------------
+
+/[Q-U]+/8iWBZ
+------------------------------------------------------------------
+ Bra
+ [Q-Uq-u\x{17f}]++
+ Ket
+ End
+------------------------------------------------------------------
+
+/^s?c/mi8I
+Capturing subpattern count = 0
+Options: caseless multiline utf
+First char at start or follows newline
+Need char = 'c' (caseless)
+ scat
+ 0: sc
+
+/a[[:punct:]b]/WBZ
+------------------------------------------------------------------
+ Bra
+ a
+ [b[:punct:]]
+ Ket
+ End
+------------------------------------------------------------------
+
+/a[[:punct:]b]/8WBZ
+------------------------------------------------------------------
+ Bra
+ a
+ [b[:punct:]]
+ Ket
+ End
+------------------------------------------------------------------
+
+/a[b[:punct:]]/8WBZ
+------------------------------------------------------------------
+ Bra
+ a
+ [b[:punct:]]
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B8COZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 14
+ L?
+ Callout 255 14 0
+ Ket
+ End
+------------------------------------------------------------------
+
+/L(?#(|++<!(2)?/B8WCZ
+------------------------------------------------------------------
+ Bra
+ Callout 255 0 14
+ L?+
+ Callout 255 14 0
+ Ket
+ End
+------------------------------------------------------------------
/-- End of testinput7 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput8 b/lib/stdlib/test/re_SUITE_data/testoutput8
index 75affbe2d4..17b667a980 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput8
+++ b/lib/stdlib/test/re_SUITE_data/testoutput8
@@ -1,5 +1,8 @@
-/-- This set of tests check the DFA matching functionality of pcre_dfa_exec().
- The -dfa flag must be used with pcretest when running it. --/
+/-- This set of tests check the DFA matching functionality of pcre_dfa_exec(),
+ excluding UTF and Unicode property support. The -dfa flag must be used with
+ pcretest when running it. --/
+
+< forbid 8W
/abc/
abc
@@ -25,7 +28,7 @@ No match
ab
No match
-/a*/
+/a*/O
a
0: a
1:
@@ -341,7 +344,7 @@ No match
axyzq
No match
-/[^a]+/
+/[^a]+/O
bac
0: b
bcdefax
@@ -359,7 +362,7 @@ No match
aaaaa
No match
-/[^a]*/
+/[^a]*/O
bac
0: b
1:
@@ -380,7 +383,7 @@ No match
aaaaa
0:
-/[^a]{3,5}/
+/[^a]{3,5}/O
xyz
0: xyz
awxyza
@@ -408,29 +411,18 @@ No match
/\d*/
1234b567
0: 1234
- 1: 123
- 2: 12
- 3: 1
- 4:
xyz
0:
/\D*/
a1234b567
0: a
- 1:
xyz
0: xyz
- 1: xy
- 2: x
- 3:
/\d+/
ab1234c56
0: 1234
- 1: 123
- 2: 12
- 3: 1
*** Failers
No match
xyz
@@ -439,19 +431,8 @@ No match
/\D+/
ab123c56
0: ab
- 1: a
*** Failers
0: *** Failers
- 1: *** Failer
- 2: *** Faile
- 3: *** Fail
- 4: *** Fai
- 5: *** Fa
- 6: *** F
- 7: ***
- 8: ***
- 9: **
-10: *
789
No match
@@ -478,9 +459,6 @@ No match
/a+/
aaaa
0: aaaa
- 1: aaa
- 2: aa
- 3: a
/^.*xyz/
xyz
@@ -886,9 +864,6 @@ No match
0:
aaabcd
0: aaa
- 1: aa
- 2: a
- 3:
xyz
0: xyz
1:
@@ -1577,18 +1552,6 @@ No match
/^[.^$|()*+?{,}]+/
.^\$(*+)|{?,?}
0: .^$(*+)|{?,?}
- 1: .^$(*+)|{?,?
- 2: .^$(*+)|{?,
- 3: .^$(*+)|{?
- 4: .^$(*+)|{
- 5: .^$(*+)|
- 6: .^$(*+)
- 7: .^$(*+
- 8: .^$(*
- 9: .^$(
-10: .^$
-11: .^
-12: .
/^a*\w/
z
@@ -1744,38 +1707,16 @@ No match
/foo(?!bar)(.*)/
foobar is foolish see?
0: foolish see?
- 1: foolish see
- 2: foolish se
- 3: foolish s
- 4: foolish
- 5: foolish
- 6: foolis
- 7: fooli
- 8: fool
- 9: foo
/(?:(?!foo)...|^.{0,2})bar(.*)/
foobar crowbar etc
0: rowbar etc
- 1: rowbar et
- 2: rowbar e
- 3: rowbar
- 4: rowbar
barrel
0: barrel
- 1: barre
- 2: barr
- 3: bar
2barrel
0: 2barrel
- 1: 2barre
- 2: 2barr
- 3: 2bar
A barrel
0: A barrel
- 1: A barre
- 2: A barr
- 3: A bar
/^(\D*)(?=\d)(?!123)/
abc456
@@ -1820,7 +1761,7 @@ No match
the abc
No match
-/^[ab]{1,3}(ab*|b)/
+/^[ab]{1,3}(ab*|b)/O
aabbbbb
0: aabbbbb
1: aabbbb
@@ -1829,7 +1770,7 @@ No match
4: aab
5: aa
-/^[ab]{1,3}?(ab*|b)/
+/^[ab]{1,3}?(ab*|b)/O
aabbbbb
0: aabbbbb
1: aabbbb
@@ -1838,7 +1779,7 @@ No match
4: aab
5: aa
-/^[ab]{1,3}?(ab*?|b)/
+/^[ab]{1,3}?(ab*?|b)/O
aabbbbb
0: aabbbbb
1: aabbbb
@@ -1847,7 +1788,7 @@ No match
4: aab
5: aa
-/^[ab]{1,3}(ab*?|b)/
+/^[ab]{1,3}(ab*?|b)/O
aabbbbb
0: aabbbbb
1: aabbbb
@@ -2705,10 +2646,6 @@ No match
/\0*/
\0\0\0\0
0: \x00\x00\x00\x00
- 1: \x00\x00\x00
- 2: \x00\x00
- 3: \x00
- 4:
/A\x0{2,3}Z/
The A\x0\x0Z
@@ -2760,56 +2697,14 @@ No match
/([^.]*)\.([^:]*):[T ]+(.*)/
track1.title:TBlah blah blah
0: track1.title:TBlah blah blah
- 1: track1.title:TBlah blah bla
- 2: track1.title:TBlah blah bl
- 3: track1.title:TBlah blah b
- 4: track1.title:TBlah blah
- 5: track1.title:TBlah blah
- 6: track1.title:TBlah bla
- 7: track1.title:TBlah bl
- 8: track1.title:TBlah b
- 9: track1.title:TBlah
-10: track1.title:TBlah
-11: track1.title:TBla
-12: track1.title:TBl
-13: track1.title:TB
-14: track1.title:T
/([^.]*)\.([^:]*):[T ]+(.*)/i
track1.title:TBlah blah blah
0: track1.title:TBlah blah blah
- 1: track1.title:TBlah blah bla
- 2: track1.title:TBlah blah bl
- 3: track1.title:TBlah blah b
- 4: track1.title:TBlah blah
- 5: track1.title:TBlah blah
- 6: track1.title:TBlah bla
- 7: track1.title:TBlah bl
- 8: track1.title:TBlah b
- 9: track1.title:TBlah
-10: track1.title:TBlah
-11: track1.title:TBla
-12: track1.title:TBl
-13: track1.title:TB
-14: track1.title:T
/([^.]*)\.([^:]*):[t ]+(.*)/i
track1.title:TBlah blah blah
0: track1.title:TBlah blah blah
- 1: track1.title:TBlah blah bla
- 2: track1.title:TBlah blah bl
- 3: track1.title:TBlah blah b
- 4: track1.title:TBlah blah
- 5: track1.title:TBlah blah
- 6: track1.title:TBlah bla
- 7: track1.title:TBlah bl
- 8: track1.title:TBlah b
- 9: track1.title:TBlah
-10: track1.title:TBlah
-11: track1.title:TBla
-12: track1.title:TBl
-13: track1.title:TB
-14: track1.title:T
/^[W-c]+$/
WXY_^abc
@@ -2882,13 +2777,10 @@ No match
0: b
c::b
0: ::
- 1: :
/[-az]+/
az-
0: az-
- 1: az
- 2: a
*** Failers
0: a
b
@@ -2897,8 +2789,6 @@ No match
/[az-]+/
za-
0: za-
- 1: za
- 2: z
*** Failers
0: a
b
@@ -2907,8 +2797,6 @@ No match
/[a\-z]+/
a-z
0: a-z
- 1: a-
- 2: a
*** Failers
0: a
b
@@ -2917,20 +2805,10 @@ No match
/[a-z]+/
abcdxyz
0: abcdxyz
- 1: abcdxy
- 2: abcdx
- 3: abcd
- 4: abc
- 5: ab
- 6: a
/[\d-]+/
12-34
0: 12-34
- 1: 12-3
- 2: 12-
- 3: 12
- 4: 1
*** Failers
No match
aaa
@@ -2939,11 +2817,6 @@ No match
/[\d-z]+/
12-34z
0: 12-34z
- 1: 12-34
- 2: 12-3
- 3: 12-
- 4: 12
- 5: 1
*** Failers
No match
aaa
@@ -3027,18 +2900,22 @@ No match
abc\100\60
0: abc@0
-/abc\81/
- abc\081
- 0: abc\x0081
- abc\0\x38\x31
- 0: abc\x0081
-
-/abc\91/
- abc\091
- 0: abc\x0091
- abc\0\x39\x31
- 0: abc\x0091
-
+/^A\8B\9C$/
+ A8B9C
+ 0: A8B9C
+ *** Failers
+No match
+ A\08B\09C
+No match
+
+/^[A\8B\9C]+$/
+ A8B9C
+ 0: A8B9C
+ *** Failers
+No match
+ A8B9C\x00
+No match
+
/(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\12\123/
abcdefghijk\12S
0: abcdefghijk\x0aS
@@ -3077,16 +2954,13 @@ No match
1: baNOTccc
2: baNOTcc
3: baNOTc
- 4: baNOT
baNOTcccd
0: baNOTccc
1: baNOTcc
2: baNOTc
- 3: baNOT
baNOTccd
0: baNOTcc
1: baNOTc
- 2: baNOT
bacccd
0: baccc
*** Failers
@@ -3096,7 +2970,6 @@ No match
3: *** Fail
4: *** Fai
5: *** Fa
- 6: *** F
anything
No match
b\bc
@@ -3115,23 +2988,14 @@ No match
/[^a]+/
AAAaAbc
0: AAA
- 1: AA
- 2: A
/[^a]+/i
AAAaAbc
0: bc
- 1: b
/[^a]+/
bbb\nccc
0: bbb\x0accc
- 1: bbb\x0acc
- 2: bbb\x0ac
- 3: bbb\x0a
- 4: bbb
- 5: bb
- 6: b
/[^k]$/
abc
@@ -3208,20 +3072,8 @@ No match
/(\.\d\d[1-9]?)\d+/
1.230003938
0: .230003938
- 1: .23000393
- 2: .2300039
- 3: .230003
- 4: .23000
- 5: .2300
- 6: .230
1.875000282
0: .875000282
- 1: .87500028
- 2: .8750002
- 3: .875000
- 4: .87500
- 5: .8750
- 6: .875
1.235
0: .235
@@ -3243,10 +3095,6 @@ No match
/\b(foo)\s+(\w+)/i
Food is on the foo table
0: foo table
- 1: foo tabl
- 2: foo tab
- 3: foo ta
- 4: foo t
/foo(.*)bar/
The food is under the bar in the barn.
@@ -3258,7 +3106,7 @@ No match
0: food is under the bar in the bar
1: food is under the bar
-/(.*)(\d*)/
+/(.*)(\d*)/O
I have 2 numbers: 53147
Matched, but offsets vector is too small to show all matches
0: I have 2 numbers: 53147
@@ -3287,13 +3135,9 @@ Matched, but offsets vector is too small to show all matches
/(.*)(\d+)/
I have 2 numbers: 53147
0: I have 2 numbers: 53147
- 1: I have 2 numbers: 5314
- 2: I have 2 numbers: 531
- 3: I have 2 numbers: 53
- 4: I have 2 numbers: 5
- 5: I have 2
+ 1: I have 2
-/(.*?)(\d*)/
+/(.*?)(\d*)/O
I have 2 numbers: 53147
Matched, but offsets vector is too small to show all matches
0: I have 2 numbers: 53147
@@ -3322,11 +3166,7 @@ Matched, but offsets vector is too small to show all matches
/(.*?)(\d+)/
I have 2 numbers: 53147
0: I have 2 numbers: 53147
- 1: I have 2 numbers: 5314
- 2: I have 2 numbers: 531
- 3: I have 2 numbers: 53
- 4: I have 2 numbers: 5
- 5: I have 2
+ 1: I have 2
/(.*)(\d+)$/
I have 2 numbers: 53147
@@ -3738,13 +3578,8 @@ No match
0: a
ab
0: ab
- 1: a
abbbb
0: abbbb
- 1: abbb
- 2: abb
- 3: ab
- 4: a
*** Failers
0: a
bbbbb
@@ -3930,19 +3765,8 @@ No match
/(?>(\.\d\d[1-9]?))\d+/
1.230003938
0: .230003938
- 1: .23000393
- 2: .2300039
- 3: .230003
- 4: .23000
- 5: .2300
- 6: .230
1.875000282
0: .875000282
- 1: .87500028
- 2: .8750002
- 3: .875000
- 4: .87500
- 5: .8750
*** Failers
No match
1.235
@@ -4561,7 +4385,6 @@ No match
/.{3,4}/
abbbbc
0: abbb
- 1: abb
/ab{0,}bc/
abbbbc
@@ -4929,9 +4752,6 @@ No match
/[^ab]*/
cde
0: cde
- 1: cd
- 2: c
- 3:
/abc/
*** Failers
@@ -4966,7 +4786,6 @@ No match
/ab*/
xabyabbbz
0: ab
- 1: a
xayabbbz
0: a
@@ -4995,8 +4814,7 @@ No match
/a([bc]*)c*/
abc
0: abc
- 1: ab
- 2: a
+ 1: a
/a([bc]*)(c*d)/
abcd
@@ -5033,10 +4851,6 @@ No match
/[a-zA-Z_][a-zA-Z0-9_]*/
alpha
0: alpha
- 1: alph
- 2: alp
- 3: al
- 4: a
/^a(bc+|b[eh])g|.h$/
abh
@@ -5079,8 +4893,6 @@ No match
/(.*)c(.*)/
abcde
0: abcde
- 1: abcd
- 2: abc
/\((.*), (.*)\)/
(a, b)
@@ -5395,9 +5207,6 @@ No match
/[^ab]*/i
CDE
0: CDE
- 1: CD
- 2: C
- 3:
/abc/i
@@ -5427,7 +5236,6 @@ No match
/ab*/i
XABYABBBZ
0: AB
- 1: A
XAYABBBZ
0: A
@@ -5458,8 +5266,7 @@ No match
/a([bc]*)c*/i
ABC
0: ABC
- 1: AB
- 2: A
+ 1: A
/a([bc]*)(c*d)/i
ABCD
@@ -5490,10 +5297,6 @@ No match
/[a-zA-Z_][a-zA-Z0-9_]*/i
ALPHA
0: ALPHA
- 1: ALPH
- 2: ALP
- 3: AL
- 4: A
/^a(bc+|b[eh])g|.h$/i
ABH
@@ -5546,8 +5349,6 @@ No match
/(.*)c(.*)/i
ABCDE
0: ABCDE
- 1: ABCD
- 2: ABC
/\((.*), (.*)\)/i
(A, B)
@@ -6052,17 +5853,14 @@ No match
/([[:]+)/
a:[b]:
0: :[
- 1: :
/([[=]+)/
a=[b]=
0: =[
- 1: =
/([[.]+)/
a.[b].
0: .[
- 1: .
/((?>a+)b)/
aaab
@@ -6196,26 +5994,12 @@ No match
/a*/g
abbab
0: a
- 1:
0:
0:
0: a
- 1:
0:
0:
-/^[a-\d]/
- abcde
- 0: a
- -things
- 0: -
- 0digit
- 0: 0
- *** Failers
-No match
- bcdef
-No match
-
/^[\d-a]/
abcde
0: a
@@ -6231,36 +6015,22 @@ No match
/[[:space:]]+/
> \x09\x0a\x0c\x0d\x0b<
0: \x09\x0a\x0c\x0d\x0b
- 1: \x09\x0a\x0c\x0d
- 2: \x09\x0a\x0c
- 3: \x09\x0a
- 4: \x09
- 5:
/[[:blank:]]+/
> \x09\x0a\x0c\x0d\x0b<
0: \x09
- 1:
/[\s]+/
> \x09\x0a\x0c\x0d\x0b<
- 0: \x09\x0a\x0c\x0d
- 1: \x09\x0a\x0c
- 2: \x09\x0a
- 3: \x09
- 4:
+ 0: \x09\x0a\x0c\x0d\x0b
/\s+/
> \x09\x0a\x0c\x0d\x0b<
- 0: \x09\x0a\x0c\x0d
- 1: \x09\x0a\x0c
- 2: \x09\x0a
- 3: \x09
- 4:
+ 0: \x09\x0a\x0c\x0d\x0b
/a b/x
ab
-No match
+ 0: ab
/(?!\A)x/m
a\nxb\n
@@ -6563,8 +6333,6 @@ Partial match: 123
/Content-Type\x3A[^\r\n]{6,}/
Content-Type:xxxxxyyy
0: Content-Type:xxxxxyyy
- 1: Content-Type:xxxxxyy
- 2: Content-Type:xxxxxy
/Content-Type\x3A[^\r\n]{6,}z/
Content-Type:xxxxxyyyz
@@ -6661,66 +6429,22 @@ No match
/.*/<lf>
abc\ndef
0: abc
- 1: ab
- 2: a
- 3:
abc\rdef
0: abc\x0ddef
- 1: abc\x0dde
- 2: abc\x0dd
- 3: abc\x0d
- 4: abc
- 5: ab
- 6: a
- 7:
abc\r\ndef
0: abc\x0d
- 1: abc
- 2: ab
- 3: a
- 4:
\<cr>abc\ndef
0: abc\x0adef
- 1: abc\x0ade
- 2: abc\x0ad
- 3: abc\x0a
- 4: abc
- 5: ab
- 6: a
- 7:
\<cr>abc\rdef
0: abc
- 1: ab
- 2: a
- 3:
\<cr>abc\r\ndef
0: abc
- 1: ab
- 2: a
- 3:
\<crlf>abc\ndef
0: abc\x0adef
- 1: abc\x0ade
- 2: abc\x0ad
- 3: abc\x0a
- 4: abc
- 5: ab
- 6: a
- 7:
\<crlf>abc\rdef
0: abc\x0ddef
- 1: abc\x0dde
- 2: abc\x0dd
- 3: abc\x0d
- 4: abc
- 5: ab
- 6: a
- 7:
\<crlf>abc\r\ndef
0: abc
- 1: ab
- 2: a
- 3:
/\w+(.)(.)?def/s
abc\ndef
@@ -7033,10 +6757,8 @@ No match
/\H*\h+\V?\v{3,4}/
\x09\x20\xa0X\x0a\x0b\x0c\x0d\x0a
0: \x09 \xa0X\x0a\x0b\x0c\x0d
- 1: \x09 \xa0X\x0a\x0b\x0c
\x09\x20\xa0\x0a\x0b\x0c\x0d\x0a
0: \x09 \xa0\x0a\x0b\x0c\x0d
- 1: \x09 \xa0\x0a\x0b\x0c
\x09\x20\xa0\x0a\x0b\x0c
0: \x09 \xa0\x0a\x0b\x0c
** Failers
@@ -7047,7 +6769,6 @@ No match
/\H{3,4}/
XY ABCDE
0: ABCD
- 1: ABC
XY PQR ST
0: PQR
@@ -7511,7 +7232,7 @@ No options
No first char
No need char
Subject length lower bound = 3
-Starting byte set: a d x
+Starting chars: a d x
terhjk;abcdaadsfe
0: abc
the quick xyz brown fox
@@ -7531,15 +7252,11 @@ No match
xxxxabcd\P
0: abcd
0+
- 1: abc
xxxxabcd\P\P
Partial match: abcd
dddxxx\R
0: ddd
0+ xxx
- 1: dd
- 2: d
- 3:
xxxxabcd\P\P
Partial match: abcd
xxx\R
@@ -7549,27 +7266,22 @@ Partial match: abcd
/abcd*/i
xxxxabcd\P
0: abcd
- 1: abc
xxxxabcd\P\P
Partial match: abcd
XXXXABCD\P
0: ABCD
- 1: ABC
XXXXABCD\P\P
Partial match: ABCD
/abc\d*/
xxxxabc1\P
0: abc1
- 1: abc
xxxxabc1\P\P
Partial match: abc1
/abc[de]*/
xxxxabcde\P
0: abcde
- 1: abcd
- 2: abc
xxxxabcde\P\P
Partial match: abcde
@@ -7684,11 +7396,8 @@ Partial match: abc
/.+/
abc\>0
0: abc
- 1: ab
- 2: a
abc\>1
0: bc
- 1: b
abc\>2
0: c
abc\>3
@@ -7811,10 +7520,6 @@ No match
/^(?!a){0}\w+/
aaaaa
0: aaaaa
- 1: aaaa
- 2: aaa
- 3: aa
- 4: a
/(?<=(abc))?xyz/
abcxyz
@@ -7846,7 +7551,7 @@ Error -17 (backreference condition or recursion test not supported for DFA match
aaaabcde
Error -26 (nested recursion at the same subject position)
-/(a+)/
+/(a+)/O
\O6aaaa
Matched, but offsets vector is too small to show all matches
0: aaaa
@@ -7971,7 +7676,6 @@ Partial match: \x0d
Partial match: \x0d\x0d
\r\r\r\P
0: \x0d\x0d\x0d
- 1: \x0d\x0d
\r\r\r\P\P
Partial match: \x0d\x0d\x0d
@@ -8020,4 +7724,81 @@ Error -30 (invalid data in workspace for DFA restart)
abcd\O0
Matched, but offsets vector is too small to show all matches
+/-- These tests show up auto-possessification --/
+
+/[ab]*/
+ aaaa
+ 0: aaaa
+
+/[ab]*?/
+ aaaa
+ 0: aaaa
+ 1: aaa
+ 2: aa
+ 3: a
+ 4:
+
+/[ab]?/
+ aaaa
+ 0: a
+
+/[ab]??/
+ aaaa
+ 0: a
+ 1:
+
+/[ab]+/
+ aaaa
+ 0: aaaa
+
+/[ab]+?/
+ aaaa
+ 0: aaaa
+ 1: aaa
+ 2: aa
+ 3: a
+
+/[ab]{2,3}/
+ aaaa
+ 0: aaa
+
+/[ab]{2,3}?/
+ aaaa
+ 0: aaa
+ 1: aa
+
+/[ab]{2,}/
+ aaaa
+ 0: aaaa
+
+/[ab]{2,}?/
+ aaaa
+ 0: aaaa
+ 1: aaa
+ 2: aa
+
+'\A(?:[^\"]++|\"(?:[^\"]*+|\"\")*+\")++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+
+'\A(?:[^\"]++|\"(?:[^\"]++|\"\")*+\")++'
+ NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED
+ 0: NON QUOTED "QUOT""ED" AFTER
+
+/(?(?!)a|b)/
+ bbb
+ 0: b
+ aaa
+No match
+
+/()()a+/O=
+ aaa\D
+** Show all captures ignored after DFA matching
+ 0: aaa
+ 1: aa
+ 2: a
+ a\D
+** Show all captures ignored after DFA matching
+ 0: a
+
/-- End of testinput8 --/
diff --git a/lib/stdlib/test/re_SUITE_data/testoutput9 b/lib/stdlib/test/re_SUITE_data/testoutput9
index 0bb101ad61..efbbf18010 100644
--- a/lib/stdlib/test/re_SUITE_data/testoutput9
+++ b/lib/stdlib/test/re_SUITE_data/testoutput9
@@ -1,6 +1,8 @@
/-- This set of tests checks UTF-8 support with the DFA matching functionality
- of pcre_dfa_exec(). The -dfa flag must be used with pcretest when running
- it. --/
+ of pcre_dfa_exec(), excluding Unicode property support. The -dfa flag must
+ be used with pcretest when running it. --/
+
+< forbid W
/\x{100}ab/8
\x{100}ab
@@ -313,13 +315,9 @@ No match
/[^a]+/8g
bcd
0: bcd
- 1: bc
- 2: b
\x{100}aY\x{256}Z
0: \x{100}
0: Y\x{256}Z
- 1: Y\x{256}
- 2: Y
/^[^a]{2}/8
\x{100}bc
@@ -328,8 +326,6 @@ No match
/^[^a]{2,}/8
\x{100}bcAa
0: \x{100}bcA
- 1: \x{100}bc
- 2: \x{100}b
/^[^a]{2,}?/8
\x{100}bca
@@ -339,13 +335,9 @@ No match
/[^a]+/8ig
bcd
0: bcd
- 1: bc
- 2: b
\x{100}aY\x{256}Z
0: \x{100}
0: Y\x{256}Z
- 1: Y\x{256}
- 2: Y
/^[^a]{2}/8i
\x{100}bc
@@ -354,7 +346,6 @@ No match
/^[^a]{2,}/8i
\x{100}bcAa
0: \x{100}bc
- 1: \x{100}b
/^[^a]{2,}?/8i
\x{100}bca
@@ -370,28 +361,18 @@ No match
0:
\x{100}\x{100}
0: \x{100}
- 1:
/\x{100}{0,3}/8
\x{100}\x{100}
0: \x{100}\x{100}
- 1: \x{100}
- 2:
\x{100}\x{100}\x{100}\x{100}
0: \x{100}\x{100}\x{100}
- 1: \x{100}\x{100}
- 2: \x{100}
- 3:
/\x{100}*/8
abce
0:
\x{100}\x{100}\x{100}\x{100}
0: \x{100}\x{100}\x{100}\x{100}
- 1: \x{100}\x{100}\x{100}
- 2: \x{100}\x{100}
- 3: \x{100}
- 4:
/\x{100}{1,1}/8
abcd\x{100}\x{100}\x{100}\x{100}
@@ -400,15 +381,10 @@ No match
/\x{100}{1,3}/8
abcd\x{100}\x{100}\x{100}\x{100}
0: \x{100}\x{100}\x{100}
- 1: \x{100}\x{100}
- 2: \x{100}
/\x{100}+/8
abcd\x{100}\x{100}\x{100}\x{100}
0: \x{100}\x{100}\x{100}\x{100}
- 1: \x{100}\x{100}\x{100}
- 2: \x{100}\x{100}
- 3: \x{100}
/\x{100}{3}/8
abcd\x{100}\x{100}\x{100}XX
@@ -417,10 +393,8 @@ No match
/\x{100}{3,5}/8
abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
0: \x{100}\x{100}\x{100}\x{100}\x{100}
- 1: \x{100}\x{100}\x{100}\x{100}
- 2: \x{100}\x{100}\x{100}
-/\x{100}{3,}/8
+/\x{100}{3,}/8O
abcd\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}XX
0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
1: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
@@ -432,7 +406,7 @@ No match
Xyyya\x{100}\x{100}bXzzz
0: X
-/\D*/8
+/\D*/8O
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Matched, but offsets vector is too small to show all matches
0: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
@@ -458,7 +432,7 @@ Matched, but offsets vector is too small to show all matches
20: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
21: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-/\D*/8
+/\D*/8O
\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
Matched, but offsets vector is too small to show all matches
0: \x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}\x{100}
@@ -507,33 +481,18 @@ Matched, but offsets vector is too small to show all matches
/\D+/8
12abcd34
0: abcd
- 1: abc
- 2: ab
- 3: a
*** Failers
0: *** Failers
- 1: *** Failer
- 2: *** Faile
- 3: *** Fail
- 4: *** Fai
- 5: *** Fa
- 6: *** F
- 7: ***
- 8: ***
- 9: **
-10: *
1234
No match
/\D{2,3}/8
12abcd34
0: abc
- 1: ab
12ab34
0: ab
*** Failers
0: ***
- 1: **
1234
No match
12a34
@@ -556,7 +515,6 @@ No match
/\d+/8
12abcd34
0: 12
- 1: 1
*** Failers
No match
@@ -565,7 +523,6 @@ No match
0: 12
1234abcd
0: 123
- 1: 12
*** Failers
No match
1.4
@@ -585,30 +542,18 @@ No match
/\S+/8
12abcd34
0: 12abcd34
- 1: 12abcd3
- 2: 12abcd
- 3: 12abc
- 4: 12ab
- 5: 12a
- 6: 12
- 7: 1
*** Failers
0: ***
- 1: **
- 2: *
\ \
No match
/\S{2,3}/8
12abcd34
0: 12a
- 1: 12
1234abcd
0: 123
- 1: 12
*** Failers
0: ***
- 1: **
\ \
No match
@@ -654,15 +599,8 @@ No match
/\w+/8
12 34
0: 12
- 1: 1
*** Failers
0: Failers
- 1: Failer
- 2: Faile
- 3: Fail
- 4: Fai
- 5: Fa
- 6: F
+++=*!
No match
@@ -671,10 +609,8 @@ No match
0: ab
abcd ce
0: abc
- 1: ab
*** Failers
0: Fai
- 1: Fa
a.b.c
No match
@@ -693,26 +629,18 @@ No match
/\W+/8
12====34
0: ====
- 1: ===
- 2: ==
- 3: =
*** Failers
0: ***
- 1: ***
- 2: **
- 3: *
abcd
No match
/\W{2,3}/8
ab====cd
0: ===
- 1: ==
ab==cd
0: ==
*** Failers
0: ***
- 1: **
a.b.c
No match
@@ -825,8 +753,6 @@ No match
0: \x{200}
ab\x{200}\x{100}\x{200}\x{100}cd
0: \x{200}\x{100}\x{200}
- 1: \x{200}\x{100}
- 2: \x{200}
*** Failers
No match
@@ -849,8 +775,6 @@ No match
0: \x{200}
ab\x{200}\x{100}\x{200}\x{100}cd
0: \x{200}\x{100}\x{200}
- 1: \x{200}\x{100}
- 2: \x{200}
*** Failers
No match
@@ -1126,21 +1050,21 @@ No match
a\r
No match
-/\h+\V?\v{3,4}/8
+/\h+\V?\v{3,4}/8O
\x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d}
1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}
-/\V?\v{3,4}/8
+/\V?\v{3,4}/8O
\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
0: X\x{0a}\x{0b}\x{0c}\x{0d}
1: X\x{0a}\x{0b}\x{0c}
-/\h+\V?\v{3,4}/8
+/\h+\V?\v{3,4}/8O
>\x09\x20\x{a0}X\x0a\x0a\x0a<
0: \x{09} \x{a0}X\x{0a}\x{0a}\x{0a}
-/\V?\v{3,4}/8
+/\V?\v{3,4}/8O
>\x09\x20\x{a0}X\x0a\x0a\x0a<
0: X\x{0a}\x{0a}\x{0a}
@@ -1154,7 +1078,7 @@ No match
\x{a0} X\x0a
No match
-/\H*\h+\V?\v{3,4}/8
+/\H*\h+\V?\v{3,4}/8O
\x09\x20\x{a0}X\x0a\x0b\x0c\x0d\x0a
0: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}\x{0d}
1: \x{09} \x{a0}X\x{0a}\x{0b}\x{0c}
@@ -1178,7 +1102,7 @@ No match
\x{2009} X\x0a
No match
-/\H*\h+\V?\v{3,4}/8
+/\H*\h+\V?\v{3,4}/8O
\x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x0c\x0d\x0a
0: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c}\x{0d}
1: \x{1680}\x{180e}\x{2007}X\x{2028}\x{2029}\x{0c}
@@ -1279,34 +1203,28 @@ No match
/abcd*/8
xxxxabcd\P
0: abcd
- 1: abc
xxxxabcd\P\P
Partial match: abcd
/abcd*/i8
xxxxabcd\P
0: abcd
- 1: abc
xxxxabcd\P\P
Partial match: abcd
XXXXABCD\P
0: ABCD
- 1: ABC
XXXXABCD\P\P
Partial match: ABCD
/abc\d*/8
xxxxabc1\P
0: abc1
- 1: abc
xxxxabc1\P\P
Partial match: abc1
/abc[de]*/8
xxxxabcde\P
0: abcde
- 1: abcd
- 2: abc
xxxxabcde\P\P
Partial match: abcde
@@ -1340,7 +1258,6 @@ Partial match: \x{0d}
Partial match: \x{0d}\x{0d}
\r\r\r\P
0: \x{0d}\x{0d}\x{0d}
- 1: \x{0d}\x{0d}
\r\r\r\P\P
Partial match: \x{0d}\x{0d}\x{0d}
@@ -1366,6 +1283,5 @@ Partial match: \x{0d}\x{0d}\x{0d}
/[^\x{100}]+/8
\x{100}\x{101}X
0: \x{101}X
- 1: \x{101}
/-- End of testinput9 --/
diff --git a/lib/stdlib/test/re_testoutput1_replacement_test.erl b/lib/stdlib/test/re_testoutput1_replacement_test.erl
index 563e0001e4..f14df547ef 100644
--- a/lib/stdlib/test/re_testoutput1_replacement_test.erl
+++ b/lib/stdlib/test/re_testoutput1_replacement_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -77,697 +77,703 @@ run() ->
run52(),
run53(),
run54(),
+ run55(),
+ run56(),
ok.
run0() ->
- <<"KXii">> = iolist_to_binary(re:replace("the quick brown fox","the quick brown fox","KXii",[])),
- <<"KXii">> = iolist_to_binary(re:replace("the quick brown fox","the quick brown fox","KXii",[global])),
- <<"The quick brown FOX">> = iolist_to_binary(re:replace("The quick brown FOX","the quick brown fox","HRC\\1&rBc&X&M\\1",[])),
- <<"The quick brown FOX">> = iolist_to_binary(re:replace("The quick brown FOX","the quick brown fox","HRC\\1&rBc&X&M\\1",[global])),
- <<"What do you know about Hthe quick brown foxgViGthe quick brown fox?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","the quick brown fox","H&gViG\\1&",[])),
- <<"What do you know about Hthe quick brown foxgViGthe quick brown fox?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","the quick brown fox","H&gViG\\1&",[global])),
- <<"What do you know about THE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","the quick brown fox","N&hDtbGaV",[])),
- <<"What do you know about THE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","the quick brown fox","N&hDtbGaV",[global])),
- <<"hQCthe quick brown foxthe quick brown foxjQpvbBuHjthe quick brown foxw">> = iolist_to_binary(re:replace("the quick brown fox","The quick brown fox","hQC&&jQ\\1pvbBuHj&w",[caseless])),
- <<"hQCthe quick brown foxthe quick brown foxjQpvbBuHjthe quick brown foxw">> = iolist_to_binary(re:replace("the quick brown fox","The quick brown fox","hQC&&jQ\\1pvbBuHj&w",[caseless,
- global])),
- <<"gkWwP">> = iolist_to_binary(re:replace("The quick brown FOX","The quick brown fox","gkWwP",[caseless])),
- <<"gkWwP">> = iolist_to_binary(re:replace("The quick brown FOX","The quick brown fox","gkWwP",[caseless,
- global])),
- <<"What do you know about ncBxuJXMsIrBx?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","The quick brown fox","ncBxuJXMsIr\\1Bx",[caseless])),
- <<"What do you know about ncBxuJXMsIrBx?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","The quick brown fox","ncBxuJXMsIr\\1Bx",[caseless,
- global])),
- <<"What do you know about ESkbGx?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","The quick brown fox","ESkbGx",[caseless])),
- <<"What do you know about ESkbGx?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","The quick brown fox","ESkbGx",[caseless,
- global])),
- <<"UImxeSkabcd
- 9;$\\?caxyzF">> = iolist_to_binary(re:replace("abcd
- 9;$\\?caxyz","abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz","UImxeSk&F",[])),
- <<"UImxeSkabcd
- 9;$\\?caxyzF">> = iolist_to_binary(re:replace("abcd
- 9;$\\?caxyz","abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz","UImxeSk&F",[global])),
- <<"LhHLabxyzpqrrrabbxyyyypqAzzkWRsxabxyzpqrrrabbxyyyypqAzzVMIt">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","LhHL&kWRsx\\1\\1&VMIt",[])),
- <<"LhHLabxyzpqrrrabbxyyyypqAzzkWRsxabxyzpqrrrabbxyyyypqAzzVMIt">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","LhHL&kWRsx\\1\\1&VMIt",[global])),
- <<"HLabxyzpqrrrabbxyyyypqAzzOTupMnssabxyzpqrrrabbxyyyypqAzzJs">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","HL&OTupMnss&\\1Js",[])),
- <<"HLabxyzpqrrrabbxyyyypqAzzOTupMnssabxyzpqrrrabbxyyyypqAzzJs">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","HL&OTupMnss&\\1Js",[global])),
- <<"HrnoCAoMBaabxyzpqrrrabbxyyyypqAzzUYaabxyzpqrrrabbxyyyypqAzzXaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","HrnoCA\\1oM\\1B&\\1UY&X&&&",[])),
- <<"HrnoCAoMBaabxyzpqrrrabbxyyyypqAzzUYaabxyzpqrrrabbxyyyypqAzzXaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","HrnoCA\\1oM\\1B&\\1UY&X&&&",[global])),
- <<"aaabxyzpqrrrabbxyyyypqAzzsiD">> = iolist_to_binary(re:replace("aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&siD",[])),
- <<"aaabxyzpqrrrabbxyyyypqAzzsiD">> = iolist_to_binary(re:replace("aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&siD",[global])),
- <<"aaaabxyzpqrrrabbxyyyypqAzzqgRtoWloBl">> = iolist_to_binary(re:replace("aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&q\\1gRt\\1oWloB\\1\\1\\1l",[])),
- <<"aaaabxyzpqrrrabbxyyyypqAzzqgRtoWloBl">> = iolist_to_binary(re:replace("aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&q\\1gRt\\1oWloB\\1\\1\\1l",[global])),
- <<"sRmsQabcxyzpqrrrabbxyyyypqAzzThd">> = iolist_to_binary(re:replace("abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sRmsQ&Thd",[])),
- <<"sRmsQabcxyzpqrrrabbxyyyypqAzzThd">> = iolist_to_binary(re:replace("abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sRmsQ&Thd",[global])),
- <<"aabcxyzpqrrrabbxyyyypqAzzRHoaabcxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&RHo&",[])),
- <<"aabcxyzpqrrrabbxyyyypqAzzRHoaabcxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&RHo&",[global])),
- <<"kaaabcxyzpqrrrabbxyyyypAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","k\\1&",[])),
- <<"kaaabcxyzpqrrrabbxyyyypAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","k\\1&",[global])),
- <<"RxvGiseEerlAfPpFb">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","RxvGiseEerlAfPp\\1F\\1b",[])),
- <<"RxvGiseEerlAfPpFb">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","RxvGiseEerlAfPp\\1F\\1b",[global])),
- <<"sUgRgemex">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sUgR\\1gem\\1ex\\1",[])),
- <<"sUgRgemex">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sUgR\\1gem\\1ex\\1",[global])),
- <<"S">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","S",[])),
- <<"S">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","S",[global])),
- <<"QCVAHkaaabcxyzpqrrrabbxyyyypqqqqAzzCsM">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","QCVAHk&CsM",[])),
- <<"QCVAHkaaabcxyzpqrrrabbxyyyypqqqqAzzCsM">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","QCVAHk&CsM",[global])),
- <<"kV">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","kV",[])),
- <<"kV">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","kV",[global])),
- <<"sEX">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sEX",[])),
- <<"sEX">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sEX",[global])),
- <<"lgaaaabcxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1lg&",[])),
- <<"lgaaaabcxyzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1lg&",[global])),
- <<"H">> = iolist_to_binary(re:replace("abxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","H",[])),
- <<"H">> = iolist_to_binary(re:replace("abxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","H",[global])),
- <<"sLyaabxyzzzpqrrrabbxyyyypqAzzJJPghXisEdXaabxyzzzpqrrrabbxyyyypqAzzS">> = iolist_to_binary(re:replace("aabxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sLy&JJPghXi\\1sEdX&S\\1",[])),
- <<"sLyaabxyzzzpqrrrabbxyyyypqAzzJJPghXisEdXaabxyzzzpqrrrabbxyyyypqAzzS">> = iolist_to_binary(re:replace("aabxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","sLy&JJPghXi\\1sEdX&S\\1",[global])),
- <<"">> = iolist_to_binary(re:replace("aaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1",[])),
- <<"">> = iolist_to_binary(re:replace("aaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1",[global])),
- <<"XHrPpSaaaabxyzzzzpqrrrabbxyyyypqAzzgAh">> = iolist_to_binary(re:replace("aaaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","XHr\\1PpS&gAh",[])),
- <<"XHrPpSaaaabxyzzzzpqrrrabbxyyyypqAzzgAh">> = iolist_to_binary(re:replace("aaaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","XHr\\1PpS&gAh",[global])),
- <<"NeJBabcxyzzpqrrrabbxyyyypqAzzGo">> = iolist_to_binary(re:replace("abcxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","NeJB&Go",[])),
- <<"NeJBabcxyzzpqrrrabbxyyyypqAzzGo">> = iolist_to_binary(re:replace("abcxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","NeJB&Go",[global])),
- <<"mu">> = iolist_to_binary(re:replace("aabcxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","mu",[])),
- <<"mu">> = iolist_to_binary(re:replace("aabcxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","mu",[global])),
- <<"aaabcxyzzzzpqrrrabbxyyyypqAzzaaabcxyzzzzpqrrrabbxyyyypqAzzN">> = iolist_to_binary(re:replace("aaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&&N",[])),
- <<"aaabcxyzzzzpqrrrabbxyyyypqAzzaaabcxyzzzzpqrrrabbxyyyypqAzzN">> = iolist_to_binary(re:replace("aaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&&N",[global])),
- <<"TY">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","TY",[])),
- <<"TY">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","TY",[global])),
- <<"BSUyMaaaabcxyzzzzpqrrrabbbxyyyypqAzzeeab">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","BSUyM&e\\1eab",[])),
- <<"BSUyMaaaabcxyzzzzpqrrrabbbxyyyypqAzzeeab">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","BSUyM&e\\1eab",[global])),
- <<"bLbpTaaaabcxyzzzzpqrrrabbbxyyyyypqAzzcn">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1bLbp\\1T&cn",[])),
- <<"bLbpTaaaabcxyzzzzpqrrrabbbxyyyyypqAzzcn">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1bLbp\\1T&cn",[global])),
- <<"qOqibaaabcxyzpqrrrabbxyyyypABzzFnNENBaaabcxyzpqrrrabbxyyyypABzza">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","qOqib&F\\1\\1nNENB\\1&a",[])),
- <<"qOqibaaabcxyzpqrrrabbxyyyypABzzFnNENBaaabcxyzpqrrrabbxyyyypABzza">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","qOqib&F\\1\\1nNENB\\1&a",[global])),
- <<"SBfQjRuQKXkm">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABBzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","SBf\\1\\1QjR\\1uQKXkm\\1",[])),
- <<"SBfQjRuQKXkm">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABBzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","SBf\\1\\1QjR\\1uQKXkm\\1",[global])),
- <<">>>bVaaabxyzpqrrrabbxyyyypqAzzaaabxyzpqrrrabbxyyyypqAzzAiToCwaaabxyzpqrrrabbxyyyypqAzzcehOK">> = iolist_to_binary(re:replace(">>>aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","bV\\1\\1&&\\1AiToCw&cehOK",[])),
- <<">>>bVaaabxyzpqrrrabbxyyyypqAzzaaabxyzpqrrrabbxyyyypqAzzAiToCwaaabxyzpqrrrabbxyyyypqAzzcehOK">> = iolist_to_binary(re:replace(">>>aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","bV\\1\\1&&\\1AiToCw&cehOK",[global])),
- <<">RYHNAEdfNPaaaabxyzpqrrrabbxyyyypqAzzHLi">> = iolist_to_binary(re:replace(">aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","RY\\1HNA\\1\\1EdfNP&HLi",[])),
- <<">RYHNAEdfNPaaaabxyzpqrrrabbxyyyypqAzzHLi">> = iolist_to_binary(re:replace(">aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","RY\\1HNA\\1\\1EdfNP&HLi",[global])),
- <<">>>>wRIXabcxyzpqrrrabbxyyyypqAzzhabcxyzpqrrrabbxyyyypqAzzaCoikaFu">> = iolist_to_binary(re:replace(">>>>abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1wRIX&h&aCoika\\1Fu",[])),
- <<">>>>wRIXabcxyzpqrrrabbxyyyypqAzzhabcxyzpqrrrabbxyyyypqAzzaCoikaFu">> = iolist_to_binary(re:replace(">>>>abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1wRIX&h&aCoika\\1Fu",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","XSdFB",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","XSdFB",[global])),
- <<"abxyzpqrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","p&sjpo&\\1MeLw",[])),
- <<"abxyzpqrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","p&sjpo&\\1MeLw",[global])),
- <<"abxyzpqrrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Np\\1BvTaI&WRss&",[])),
- <<"abxyzpqrrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Np\\1BvTaI&WRss&",[global])),
- <<"abxyzpqrrrabxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrabxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Jm\\1&IqjePLT",[])),
- <<"abxyzpqrrrabxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrabxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Jm\\1&IqjePLT",[global])),
- <<"aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","X&\\1EJejYwBT\\1N&Vu\\1\\1hj",[])),
- <<"aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","X&\\1EJejYwBT\\1N&Vu\\1\\1hj",[global])),
- <<"aaaabcxyzzzzpqrrrabbbxyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","ACr\\1ExPn&TggeSRc&pgC",[])),
- <<"aaaabcxyzzzzpqrrrabbbxyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","ACr\\1ExPn&TggeSRc&pgC",[global])),
- <<"aaabcxyzpqrrrabbxyyyypqqqqqqqAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","AQG",[])),
- <<"aaabcxyzpqrrrabbxyyyypqqqqqqqAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","AQG",[global])),
- <<"Ms">> = iolist_to_binary(re:replace("abczz","^(abc){1,2}zz","Ms",[])),
- <<"Ms">> = iolist_to_binary(re:replace("abczz","^(abc){1,2}zz","Ms",[global])),
- <<"abcjqKYJWAabcabczzXCsCP">> = iolist_to_binary(re:replace("abcabczz","^(abc){1,2}zz","\\1jqKYJWA&XCsCP",[])),
- <<"abcjqKYJWAabcabczzXCsCP">> = iolist_to_binary(re:replace("abcabczz","^(abc){1,2}zz","\\1jqKYJWA&XCsCP",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(abc){1,2}zz","Q\\1PQoCjb\\1eQ&\\1JaSTQ",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(abc){1,2}zz","Q\\1PQoCjb\\1eQ&\\1JaSTQ",[global])),
- <<"zz">> = iolist_to_binary(re:replace("zz","^(abc){1,2}zz","DxU",[])),
- <<"zz">> = iolist_to_binary(re:replace("zz","^(abc){1,2}zz","DxU",[global])),
- <<"abcabcabczz">> = iolist_to_binary(re:replace("abcabcabczz","^(abc){1,2}zz","wRiyMR&vafm&",[])),
- <<"abcabcabczz">> = iolist_to_binary(re:replace("abcabcabczz","^(abc){1,2}zz","wRiyMR&vafm&",[global])),
- <<">>abczz">> = iolist_to_binary(re:replace(">>abczz","^(abc){1,2}zz","fCQBocoTpl&om",[])),
- <<">>abczz">> = iolist_to_binary(re:replace(">>abczz","^(abc){1,2}zz","fCQBocoTpl&om",[global])),
- <<"BbtYviciAuOmX">> = iolist_to_binary(re:replace("bc","^(b+?|a){1,2}?c","B\\1tYviciAuOmX",[])),
- <<"BbtYviciAuOmX">> = iolist_to_binary(re:replace("bc","^(b+?|a){1,2}?c","B\\1tYviciAuOmX",[global])),
- <<"bbcbbcmoxNDbcM">> = iolist_to_binary(re:replace("bbc","^(b+?|a){1,2}?c","&&moxND\\1cM",[])),
- <<"bbcbbcmoxNDbcM">> = iolist_to_binary(re:replace("bbc","^(b+?|a){1,2}?c","&&moxND\\1cM",[global])),
- <<"HmYAbbbcbbuUEdmhvgxQbbbb">> = iolist_to_binary(re:replace("bbbc","^(b+?|a){1,2}?c","HmYA&\\1uUEdmhvgxQ\\1\\1",[])),
- <<"HmYAbbbcbbuUEdmhvgxQbbbb">> = iolist_to_binary(re:replace("bbbc","^(b+?|a){1,2}?c","HmYA&\\1uUEdmhvgxQ\\1\\1",[global])),
- <<"YRq">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","YRq",[])),
- <<"YRq">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","YRq",[global])),
- <<"bbacaOVQYgoesBaHi">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","&\\1OVQYgoesB\\1Hi",[])),
- <<"bbacaOVQYgoesBaHi">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","&\\1OVQYgoesB\\1Hi",[global])),
- <<"dIraaacvlpk">> = iolist_to_binary(re:replace("aac","^(b+?|a){1,2}?c","dIr\\1&vlpk",[])),
- <<"dIraaacvlpk">> = iolist_to_binary(re:replace("aac","^(b+?|a){1,2}?c","dIr\\1&vlpk",[global])),
- <<"KbbbbbbbbbbbobbbbbbbbbbbFjgyx">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+?|a){1,2}?c","K\\1o\\1Fjgyx",[])),
- <<"KbbbbbbbbbbbobbbbbbbbbbbFjgyx">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+?|a){1,2}?c","K\\1o\\1Fjgyx",[global])),
- <<"dkNSkahOVMwoAfbbbbbbbbbbbacchbbbbbbbbbbbacKA">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+?|a){1,2}?c","dkNSk\\1hOVMwoAf&ch&KA",[])),
- <<"dkNSkahOVMwoAfbbbbbbbbbbbacchbbbbbbbbbbbacKA">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+?|a){1,2}?c","dkNSk\\1hOVMwoAf&ch&KA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+?|a){1,2}?c","lRqMfmvH",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+?|a){1,2}?c","lRqMfmvH",[global])),
- <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+?|a){1,2}?c","Ya\\1SeSYOH",[])),
- <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+?|a){1,2}?c","Ya\\1SeSYOH",[global])),
- <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+?|a){1,2}?c","Mjs\\1&mpd",[])),
- <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+?|a){1,2}?c","Mjs\\1&mpd",[global])),
- <<"MbGjTbfbuoXTyLDU">> = iolist_to_binary(re:replace("bc","^(b+|a){1,2}c","M\\1GjT\\1f\\1uoXTyLDU",[])),
- <<"MbGjTbfbuoXTyLDU">> = iolist_to_binary(re:replace("bc","^(b+|a){1,2}c","M\\1GjT\\1f\\1uoXTyLDU",[global])),
- <<"Xbbbbcbbihpfm">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}c","X\\1&\\1ihpfm",[])),
- <<"Xbbbbcbbihpfm">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}c","X\\1&\\1ihpfm",[global])),
- <<"bbbbbbpCDbbLKbbbq">> = iolist_to_binary(re:replace("bbbc","^(b+|a){1,2}c","\\1\\1pCDbbLK\\1q",[])),
- <<"bbbbbbpCDbbLKbbbq">> = iolist_to_binary(re:replace("bbbc","^(b+|a){1,2}c","\\1\\1pCDbbLK\\1q",[global])),
- <<"bacjc">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}c","&jc",[])),
- <<"bacjc">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}c","&jc",[global])),
- <<"bbacmybbacWtbbacjPQXaybbacl">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}c","&my&Wt&jPQXay&l",[])),
- <<"bbacmybbacWtbbacjPQXaybbacl">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}c","&my&Wt&jPQXay&l",[global])),
- <<"QcYXpaaGA">> = iolist_to_binary(re:replace("aac","^(b+|a){1,2}c","QcYXpa\\1GA",[])),
- <<"QcYXpaaGA">> = iolist_to_binary(re:replace("aac","^(b+|a){1,2}c","QcYXpa\\1GA",[global])),
- <<"habbbbbbbbbbbcYbbbbbbbbbbbY">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+|a){1,2}c","h&Y\\1Y",[])),
- <<"habbbbbbbbbbbcYbbbbbbbbbbbY">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+|a){1,2}c","h&Y\\1Y",[global])),
- <<"DkD">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+|a){1,2}c","DkD",[])),
- <<"DkD">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+|a){1,2}c","DkD",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+|a){1,2}c","UgARueRrJoL\\1\\1WgjAP",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+|a){1,2}c","UgARueRrJoL\\1\\1WgjAP",[global])),
- <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+|a){1,2}c","IGJPbXNc&kfu\\1xi",[])),
- <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+|a){1,2}c","IGJPbXNc&kfu\\1xi",[global])),
- <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+|a){1,2}c","pWvBeG&&iyL",[])),
- <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+|a){1,2}c","pWvBeG&&iyL",[global])),
- <<"g">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}?bc","g",[])),
- <<"g">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}?bc","g",[global])),
- <<"rXsdbaababcQbambabcWcnvbj">> = iolist_to_binary(re:replace("babc","^(b*|ba){1,2}?bc","rXsd\\1a&Q\\1m&Wcnvbj",[])),
- <<"rXsdbaababcQbambabcWcnvbj">> = iolist_to_binary(re:replace("babc","^(b*|ba){1,2}?bc","rXsd\\1a&Q\\1m&Wcnvbj",[global])),
- <<"x">> = iolist_to_binary(re:replace("bbabc","^(b*|ba){1,2}?bc","x",[])),
- <<"x">> = iolist_to_binary(re:replace("bbabc","^(b*|ba){1,2}?bc","x",[global])),
- <<"TMNcgqpTbaE">> = iolist_to_binary(re:replace("bababc","^(b*|ba){1,2}?bc","TMNcgqpT\\1E",[])),
- <<"TMNcgqpTbaE">> = iolist_to_binary(re:replace("bababc","^(b*|ba){1,2}?bc","TMNcgqpT\\1E",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b*|ba){1,2}?bc","IM",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b*|ba){1,2}?bc","IM",[global])),
- <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(b*|ba){1,2}?bc","TbVp\\1&mhNgFw\\1",[])),
- <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(b*|ba){1,2}?bc","TbVp\\1&mhNgFw\\1",[global])),
- <<"babababc">> = iolist_to_binary(re:replace("babababc","^(b*|ba){1,2}?bc","&yrdhkl&hx&\\1M\\1\\1BiFK",[])),
- <<"babababc">> = iolist_to_binary(re:replace("babababc","^(b*|ba){1,2}?bc","&yrdhkl&hx&\\1M\\1\\1BiFK",[global])),
- <<"bailvqbafDWIOQe">> = iolist_to_binary(re:replace("babc","^(ba|b*){1,2}?bc","\\1ilvq\\1fDWIOQe",[])),
- <<"bailvqbafDWIOQe">> = iolist_to_binary(re:replace("babc","^(ba|b*){1,2}?bc","\\1ilvq\\1fDWIOQe",[global])),
- <<"o">> = iolist_to_binary(re:replace("bbabc","^(ba|b*){1,2}?bc","o",[])),
- <<"o">> = iolist_to_binary(re:replace("bbabc","^(ba|b*){1,2}?bc","o",[global])),
- <<"qyH">> = iolist_to_binary(re:replace("bababc","^(ba|b*){1,2}?bc","qyH",[])),
- <<"qyH">> = iolist_to_binary(re:replace("bababc","^(ba|b*){1,2}?bc","qyH",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ba|b*){1,2}?bc","GBLVYAxKwO",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ba|b*){1,2}?bc","GBLVYAxKwO",[global])),
- <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(ba|b*){1,2}?bc","u&GWGypjK&r\\1\\1&",[])),
- <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(ba|b*){1,2}?bc","u&GWGypjK&r\\1\\1&",[global])),
- <<"babababc">> = iolist_to_binary(re:replace("babababc","^(ba|b*){1,2}?bc","Vb",[])),
- <<"babababc">> = iolist_to_binary(re:replace("babababc","^(ba|b*){1,2}?bc","Vb",[global])),
- <<"nli;znvMfDQEb;zGHXN">> = iolist_to_binary(re:replace(";z","^\\ca\\cA\\c[\\c{\\c:","nli\\1\\1&nv\\1MfDQEb&GHXN",[])),
- <<"nli;znvMfDQEb;zGHXN">> = iolist_to_binary(re:replace(";z","^\\ca\\cA\\c[\\c{\\c:","nli\\1\\1&nv\\1MfDQEb&GHXN",[global])),
- <<"yxcaleHEFWgGiwbQathing">> = iolist_to_binary(re:replace("athing","^[ab\\]cde]","\\1yxc\\1&leHE\\1FWgGiwbQ&",[])),
- <<"yxcaleHEFWgGiwbQathing">> = iolist_to_binary(re:replace("athing","^[ab\\]cde]","\\1yxc\\1&leHE\\1FWgGiwbQ&",[global])),
- <<"MeNvthing">> = iolist_to_binary(re:replace("bthing","^[ab\\]cde]","MeNv\\1",[])),
- <<"MeNvthing">> = iolist_to_binary(re:replace("bthing","^[ab\\]cde]","MeNv\\1",[global])),
- <<"]T]qQDvRdthing">> = iolist_to_binary(re:replace("]thing","^[ab\\]cde]","&T&qQDvRd",[])),
- <<"]T]qQDvRdthing">> = iolist_to_binary(re:replace("]thing","^[ab\\]cde]","&T&qQDvRd",[global])),
- <<"GFxthing">> = iolist_to_binary(re:replace("cthing","^[ab\\]cde]","GFx",[])),
- <<"GFxthing">> = iolist_to_binary(re:replace("cthing","^[ab\\]cde]","GFx",[global])),
- <<"kLFxTOaEthing">> = iolist_to_binary(re:replace("dthing","^[ab\\]cde]","kLFxTOaE",[])),
- <<"kLFxTOaEthing">> = iolist_to_binary(re:replace("dthing","^[ab\\]cde]","kLFxTOaE",[global])),
- <<"RtthVFthing">> = iolist_to_binary(re:replace("ething","^[ab\\]cde]","Rtt\\1hVF",[])),
- <<"RtthVFthing">> = iolist_to_binary(re:replace("ething","^[ab\\]cde]","Rtt\\1hVF",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[ab\\]cde]","Srer\\1pi",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[ab\\]cde]","Srer\\1pi",[global])),
- <<"fthing">> = iolist_to_binary(re:replace("fthing","^[ab\\]cde]","&AaO",[])),
- <<"fthing">> = iolist_to_binary(re:replace("fthing","^[ab\\]cde]","&AaO",[global])),
- <<"[thing">> = iolist_to_binary(re:replace("[thing","^[ab\\]cde]","GujQJxlam\\1f\\1FD",[])),
- <<"[thing">> = iolist_to_binary(re:replace("[thing","^[ab\\]cde]","GujQJxlam\\1f\\1FD",[global])),
- <<"\\thing">> = iolist_to_binary(re:replace("\\thing","^[ab\\]cde]","&&yX",[])),
- <<"\\thing">> = iolist_to_binary(re:replace("\\thing","^[ab\\]cde]","&&yX",[global])),
- <<"s]tXLkthing">> = iolist_to_binary(re:replace("]thing","^[]cde]","s&tXLk",[])),
- <<"s]tXLkthing">> = iolist_to_binary(re:replace("]thing","^[]cde]","s&tXLk",[global])),
- <<"HiVDFyrMvAaDvdYdUthing">> = iolist_to_binary(re:replace("cthing","^[]cde]","H\\1iVDFyrMvAaDv\\1\\1dYdU",[])),
- <<"HiVDFyrMvAaDvdYdUthing">> = iolist_to_binary(re:replace("cthing","^[]cde]","H\\1iVDFyrMvAaDv\\1\\1dYdU",[global])),
- <<"jkWeKNthing">> = iolist_to_binary(re:replace("dthing","^[]cde]","jkWeKN",[])),
- <<"jkWeKNthing">> = iolist_to_binary(re:replace("dthing","^[]cde]","jkWeKN",[global])),
- <<"strycWDFQcthing">> = iolist_to_binary(re:replace("ething","^[]cde]","stry\\1cWDFQc",[])),
- <<"strycWDFQcthing">> = iolist_to_binary(re:replace("ething","^[]cde]","stry\\1cWDFQc",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[]cde]","s",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[]cde]","s",[global])),
- <<"athing">> = iolist_to_binary(re:replace("athing","^[]cde]","\\1xREinh\\1vCv",[])),
- <<"athing">> = iolist_to_binary(re:replace("athing","^[]cde]","\\1xREinh\\1vCv",[global])),
- <<"fthing">> = iolist_to_binary(re:replace("fthing","^[]cde]","\\1h&Y\\1HwTkCc",[])),
- <<"fthing">> = iolist_to_binary(re:replace("fthing","^[]cde]","\\1h&Y\\1HwTkCc",[global])),
- <<"uifmTffffWmKXllBthing">> = iolist_to_binary(re:replace("fthing","^[^ab\\]cde]","ui&mT&f&&WmKXllB",[])),
- <<"uifmTffffWmKXllBthing">> = iolist_to_binary(re:replace("fthing","^[^ab\\]cde]","ui&mT&f&&WmKXllB",[global])),
- <<"Kyn[lihrXoXthing">> = iolist_to_binary(re:replace("[thing","^[^ab\\]cde]","Kyn&lihrXoX",[])),
- <<"Kyn[lihrXoXthing">> = iolist_to_binary(re:replace("[thing","^[^ab\\]cde]","Kyn&lihrXoX",[global])),
- <<"UXMYd\\fthing">> = iolist_to_binary(re:replace("\\thing","^[^ab\\]cde]","U\\1XMYd\\1\\1&f\\1",[])),
- <<"UXMYd\\fthing">> = iolist_to_binary(re:replace("\\thing","^[^ab\\]cde]","U\\1XMYd\\1\\1&f\\1",[global])),
- <<"QYuh*KpbKbO** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^ab\\]cde]","\\1QYuh&KpbKbO",[])),
- <<"QYuh*KpbKbO** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^ab\\]cde]","\\1QYuh&KpbKbO",[global])),
- <<"athing">> = iolist_to_binary(re:replace("athing","^[^ab\\]cde]","JwKDqeNpO\\1&m",[])),
- <<"athing">> = iolist_to_binary(re:replace("athing","^[^ab\\]cde]","JwKDqeNpO\\1&m",[global])),
- <<"bthing">> = iolist_to_binary(re:replace("bthing","^[^ab\\]cde]","G",[])),
- <<"bthing">> = iolist_to_binary(re:replace("bthing","^[^ab\\]cde]","G",[global])),
- <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^ab\\]cde]","VomLLa&\\1xDtJWx",[])),
- <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^ab\\]cde]","VomLLa&\\1xDtJWx",[global])),
- <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^ab\\]cde]","&DWkG&&kk",[])),
- <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^ab\\]cde]","&DWkG&&kk",[global])),
- <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^ab\\]cde]","MYpgcbh&\\1knLFcDqwN",[])),
- <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^ab\\]cde]","MYpgcbh&\\1knLFcDqwN",[global])),
- <<"ething">> = iolist_to_binary(re:replace("ething","^[^ab\\]cde]","h\\1nb\\1c&&KMVOIu",[])),
- <<"ething">> = iolist_to_binary(re:replace("ething","^[^ab\\]cde]","h\\1nb\\1c&&KMVOIu",[global])),
- <<"qRaQDneiathing">> = iolist_to_binary(re:replace("athing","^[^]cde]","qR&QDnei&",[])),
- <<"qRaQDneiathing">> = iolist_to_binary(re:replace("athing","^[^]cde]","qR&QDnei&",[global])),
- <<"YtUthing">> = iolist_to_binary(re:replace("fthing","^[^]cde]","YtU",[])),
- <<"YtUthing">> = iolist_to_binary(re:replace("fthing","^[^]cde]","YtU",[global])),
- <<"PUGKhoJ*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^]cde]","P\\1UGKhoJ&",[])),
- <<"PUGKhoJ*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^]cde]","P\\1UGKhoJ&",[global])),
- <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^]cde]","Xh&gbPHspjXNu&YKXwHH",[])),
- <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^]cde]","Xh&gbPHspjXNu&YKXwHH",[global])),
- <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^]cde]","kmMlgoXI&xF\\1hwlT",[])),
- <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^]cde]","kmMlgoXI&xF\\1hwlT",[global])),
- <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^]cde]","ue\\1\\1DU",[])),
- <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^]cde]","ue\\1\\1DU",[global])),
- <<"ething">> = iolist_to_binary(re:replace("ething","^[^]cde]","x\\1CM",[])),
- <<"ething">> = iolist_to_binary(re:replace("ething","^[^]cde]","x\\1CM",[global])),
- <<"skV">> = iolist_to_binary(re:replace("0","^[0-9]+$","sk\\1V\\1",[])),
- <<"skV">> = iolist_to_binary(re:replace("0","^[0-9]+$","sk\\1V\\1",[global])),
- <<"dchqDQcnPE1m">> = iolist_to_binary(re:replace("1","^[0-9]+$","dchqDQcnPE&m",[])),
- <<"dchqDQcnPE1m">> = iolist_to_binary(re:replace("1","^[0-9]+$","dchqDQcnPE&m",[global])),
- <<"iKMEYpXlyVKXB">> = iolist_to_binary(re:replace("2","^[0-9]+$","iKMEYpXlyVK\\1XB",[])),
- <<"iKMEYpXlyVKXB">> = iolist_to_binary(re:replace("2","^[0-9]+$","iKMEYpXlyVK\\1XB",[global])),
- <<"lTM3XtBQD3KqG33G">> = iolist_to_binary(re:replace("3","^[0-9]+$","lTM&X\\1tBQD&KqG&&G",[])),
- <<"lTM3XtBQD3KqG33G">> = iolist_to_binary(re:replace("3","^[0-9]+$","lTM&X\\1tBQD&KqG&&G",[global])),
- <<"A4RtR4paCNffVmKS44ru">> = iolist_to_binary(re:replace("4","^[0-9]+$","A&RtR&paCNffVmKS&&ru",[])),
- <<"A4RtR4paCNffVmKS44ru">> = iolist_to_binary(re:replace("4","^[0-9]+$","A&RtR&paCNffVmKS&&ru",[global])),
- <<"FvNdw">> = iolist_to_binary(re:replace("5","^[0-9]+$","F\\1vNdw",[])),
- <<"FvNdw">> = iolist_to_binary(re:replace("5","^[0-9]+$","F\\1vNdw",[global])),
- <<"6bMIirlh">> = iolist_to_binary(re:replace("6","^[0-9]+$","&bMIi\\1rlh",[])),
- <<"6bMIirlh">> = iolist_to_binary(re:replace("6","^[0-9]+$","&bMIi\\1rlh",[global])),
- <<"7IgF">> = iolist_to_binary(re:replace("7","^[0-9]+$","\\1\\1&IgF\\1\\1",[])),
- <<"7IgF">> = iolist_to_binary(re:replace("7","^[0-9]+$","\\1\\1&IgF\\1\\1",[global])),
- <<"kXpaB8C">> = iolist_to_binary(re:replace("8","^[0-9]+$","kXpaB&C",[])),
- <<"kXpaB8C">> = iolist_to_binary(re:replace("8","^[0-9]+$","kXpaB&C",[global])),
- <<"rxDNFoULsT">> = iolist_to_binary(re:replace("9","^[0-9]+$","rxDNFoULsT",[])),
- <<"rxDNFoULsT">> = iolist_to_binary(re:replace("9","^[0-9]+$","rxDNFoULsT",[global])),
- <<"YmBdr10cd10f10RQlRK">> = iolist_to_binary(re:replace("10","^[0-9]+$","YmBd\\1r&cd&f&RQlRK",[])),
- <<"YmBdr10cd10f10RQlRK">> = iolist_to_binary(re:replace("10","^[0-9]+$","YmBd\\1r&cd&f&RQlRK",[global])),
- <<"RLqdwwceTW">> = iolist_to_binary(re:replace("100","^[0-9]+$","RLqdwwceTW\\1",[])),
- <<"RLqdwwceTW">> = iolist_to_binary(re:replace("100","^[0-9]+$","RLqdwwceTW\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[0-9]+$","BdnjJh\\1urLa&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[0-9]+$","BdnjJh\\1urLa&",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","^[0-9]+$","&&oa&dfYGxAdt&\\1\\1Q&m",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","^[0-9]+$","&&oa&dfYGxAdt&\\1\\1Q&m",[global])),
- <<"ndenterMpPenterqHbSYUGGN">> = iolist_to_binary(re:replace("enter","^.*nter","nd&MpP&qHb\\1SY\\1UGGN",[])),
- <<"ndenterMpPenterqHbSYUGGN">> = iolist_to_binary(re:replace("enter","^.*nter","nd&MpP&qHb\\1SY\\1UGGN",[global])),
- <<"LSinterEPdYinterHoNIyUIDOinter">> = iolist_to_binary(re:replace("inter","^.*nter","LS&\\1EPdY&Ho\\1NIyUIDO&",[])),
- <<"LSinterEPdYinterHoNIyUIDOinter">> = iolist_to_binary(re:replace("inter","^.*nter","LS&\\1EPdY&Ho\\1NIyUIDO&",[global])),
- <<"IIUwhHsQfXMYBSb">> = iolist_to_binary(re:replace("uponter","^.*nter","IIUwhHsQ\\1fX\\1MYBS\\1b",[])),
- <<"IIUwhHsQfXMYBSb">> = iolist_to_binary(re:replace("uponter","^.*nter","IIUwhHsQ\\1fX\\1MYBS\\1b",[global])),
+ <<"SSxHvfHfMHTdP">> = iolist_to_binary(re:replace("the quick brown fox","the quick brown fox","SSx\\1HvfHfMHTdP",[])),
+ <<"SSxHvfHfMHTdP">> = iolist_to_binary(re:replace("the quick brown fox","the quick brown fox","SSx\\1HvfHfMHTdP",[global])),
+ <<"The quick brown FOX">> = iolist_to_binary(re:replace("The quick brown FOX","the quick brown fox","sSrOvIDlw&sr",[])),
+ <<"The quick brown FOX">> = iolist_to_binary(re:replace("The quick brown FOX","the quick brown fox","sSrOvIDlw&sr",[global])),
+ <<"What do you know about HAthe quick brown foxExLcRRqeQthe quick brown foxe?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","the quick brown fox","HA&ExLcRRqeQ&e",[])),
+ <<"What do you know about HAthe quick brown foxExLcRRqeQthe quick brown foxe?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","the quick brown fox","HA&ExLcRRqeQ&e",[global])),
+ <<"What do you know about THE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","the quick brown fox","l",[])),
+ <<"What do you know about THE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","the quick brown fox","l",[global])),
+ <<"x">> = iolist_to_binary(re:replace("the quick brown fox","The quick brown fox","x",[caseless])),
+ <<"x">> = iolist_to_binary(re:replace("the quick brown fox","The quick brown fox","x",[caseless,
+ global])),
+ <<"SODNIyIgxThe quick brown FOXBThe quick brown FOXbBb">> = iolist_to_binary(re:replace("The quick brown FOX","The quick brown fox","SOD\\1NIy\\1Igx&B&b\\1Bb",[caseless])),
+ <<"SODNIyIgxThe quick brown FOXBThe quick brown FOXbBb">> = iolist_to_binary(re:replace("The quick brown FOX","The quick brown fox","SOD\\1NIy\\1Igx&B&b\\1Bb",[caseless,
+ global])),
+ <<"What do you know about TI?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","The quick brown fox","TI",[caseless])),
+ <<"What do you know about TI?">> = iolist_to_binary(re:replace("What do you know about the quick brown fox?","The quick brown fox","TI",[caseless,
+ global])),
+ <<"What do you know about miTHE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","The quick brown fox","mi&",[caseless])),
+ <<"What do you know about miTHE QUICK BROWN FOX?">> = iolist_to_binary(re:replace("What do you know about THE QUICK BROWN FOX?","The quick brown fox","mi&",[caseless,
+ global])),
+ <<"LhLxqabcd
+ 9;$\\?caxyzBxFJ">> = iolist_to_binary(re:replace("abcd
+ 9;$\\?caxyz","abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz","LhLxq&\\1Bx\\1FJ",[])),
+ <<"LhLxqabcd
+ 9;$\\?caxyzBxFJ">> = iolist_to_binary(re:replace("abcd
+ 9;$\\?caxyz","abcd\\t\\n\\r\\f\\a\\e\\071\\x3b\\$\\\\\\?caxyz","LhLxq&\\1Bx\\1FJ",[global])),
+ <<"wqqHkXDku">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","wqqHkXDku",[])),
+ <<"wqqHkXDku">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","wqqHkXDku",[global])),
+ <<"jL">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","jL",[])),
+ <<"jL">> = iolist_to_binary(re:replace("abxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","jL",[global])),
+ <<"IIBgfOPaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzzUE">> = iolist_to_binary(re:replace("aabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","IIBgfOP&&UE",[])),
+ <<"IIBgfOPaabxyzpqrrrabbxyyyypqAzzaabxyzpqrrrabbxyyyypqAzzUE">> = iolist_to_binary(re:replace("aabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","IIBgfOP&&UE",[global])),
+ <<"asmnbaRlhmj">> = iolist_to_binary(re:replace("aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","as\\1mnbaRlhmj",[])),
+ <<"asmnbaRlhmj">> = iolist_to_binary(re:replace("aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","as\\1mnbaRlhmj",[global])),
+ <<"PPkDpiQNRoIwOISn">> = iolist_to_binary(re:replace("aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PPkDpiQNRoIwOISn",[])),
+ <<"PPkDpiQNRoIwOISn">> = iolist_to_binary(re:replace("aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PPkDpiQNRoIwOISn",[global])),
+ <<"WA">> = iolist_to_binary(re:replace("abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","WA",[])),
+ <<"WA">> = iolist_to_binary(re:replace("abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","WA",[global])),
+ <<"MmDiT">> = iolist_to_binary(re:replace("aabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","MmDiT\\1",[])),
+ <<"MmDiT">> = iolist_to_binary(re:replace("aabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","MmDiT\\1",[global])),
+ <<"rvMxRG">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","r\\1vMxRG",[])),
+ <<"rvMxRG">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","r\\1vMxRG",[global])),
+ <<"PNbQpnwvNqPbU">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PNbQpnwvNqPb\\1U",[])),
+ <<"PNbQpnwvNqPbU">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PNbQpnwvNqPb\\1U",[global])),
+ <<"aaabcxyzpqrrrabbxyyyypqqAzzYVt">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&YVt",[])),
+ <<"aaabcxyzpqrrrabbxyyyypqqAzzYVt">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&YVt",[global])),
+ <<"gMA">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","gMA",[])),
+ <<"gMA">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","gMA",[global])),
+ <<"PkGaaabcxyzpqrrrabbxyyyypqqqqAzzHIbA">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PkG&HIbA",[])),
+ <<"PkGaaabcxyzpqrrrabbxyyyypqqqqAzzHIbA">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","PkG&HIbA",[global])),
+ <<"NAVDRk">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","N\\1AVDRk\\1",[])),
+ <<"NAVDRk">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","N\\1AVDRk\\1",[global])),
+ <<"l">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","l",[])),
+ <<"l">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","l",[global])),
+ <<"i">> = iolist_to_binary(re:replace("aaaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","i",[])),
+ <<"i">> = iolist_to_binary(re:replace("aaaabcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","i",[global])),
+ <<"gsLSabxyzzpqrrrabbxyyyypqAzzmSnQdb">> = iolist_to_binary(re:replace("abxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","gsLS&mSnQdb",[])),
+ <<"gsLSabxyzzpqrrrabbxyyyypqAzzmSnQdb">> = iolist_to_binary(re:replace("abxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","gsLS&mSnQdb",[global])),
+ <<"kaabxyzzzpqrrrabbxyyyypqAzzKdaabxyzzzpqrrrabbxyyyypqAzzaabxyzzzpqrrrabbxyyyypqAzzoPf">> = iolist_to_binary(re:replace("aabxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","k\\1&Kd&&oPf",[])),
+ <<"kaabxyzzzpqrrrabbxyyyypqAzzKdaabxyzzzpqrrrabbxyyyypqAzzaabxyzzzpqrrrabbxyyyypqAzzoPf">> = iolist_to_binary(re:replace("aabxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","k\\1&Kd&&oPf",[global])),
+ <<"dgKHkAqsVS">> = iolist_to_binary(re:replace("aaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","dgKH\\1kAqsVS",[])),
+ <<"dgKHkAqsVS">> = iolist_to_binary(re:replace("aaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","dgKH\\1kAqsVS",[global])),
+ <<"meKaaaabxyzzzzpqrrrabbxyyyypqAzzPvFP">> = iolist_to_binary(re:replace("aaaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1meK&\\1\\1PvFP",[])),
+ <<"meKaaaabxyzzzzpqrrrabbxyyyypqAzzPvFP">> = iolist_to_binary(re:replace("aaaabxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","\\1meK&\\1\\1PvFP",[global])),
+ <<"YNabcxyzzpqrrrabbxyyyypqAzzTEpGJfWxCPabcxyzzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abcxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","YN&TEpGJfWxCP&",[])),
+ <<"YNabcxyzzpqrrrabbxyyyypqAzzTEpGJfWxCPabcxyzzpqrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abcxyzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","YN&TEpGJfWxCP&",[global])),
+ <<"SaabcxyzzzpqrrrabbxyyyypqAzzwJjqEgHHwYYq">> = iolist_to_binary(re:replace("aabcxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","S&w\\1JjqE\\1gHHwYYq",[])),
+ <<"SaabcxyzzzpqrrrabbxyyyypqAzzwJjqEgHHwYYq">> = iolist_to_binary(re:replace("aabcxyzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","S&w\\1JjqE\\1gHHwYYq",[global])),
+ <<"aaabcxyzzzzpqrrrabbxyyyypqAzzGwVGaaabcxyzzzzpqrrrabbxyyyypqAzzlvXk">> = iolist_to_binary(re:replace("aaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&GwVG&lvXk\\1\\1",[])),
+ <<"aaabcxyzzzzpqrrrabbxyyyypqAzzGwVGaaabcxyzzzzpqrrrabbxyyyypqAzzlvXk">> = iolist_to_binary(re:replace("aaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&GwVG&lvXk\\1\\1",[global])),
+ <<"aaaabcxyzzzzpqrrrabbxyyyypqAzznNjmmVWTBVTADm">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&nN\\1jmmVWTBVTADm",[])),
+ <<"aaaabcxyzzzzpqrrrabbxyyyypqAzznNjmmVWTBVTADm">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&nN\\1jmmVWTBVTADm",[global])),
+ <<"PoqkwiYVqDWATAJwKaaaabcxyzzzzpqrrrabbbxyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Po\\1qkwiYVqDWATAJw\\1K&",[])),
+ <<"PoqkwiYVqDWATAJwKaaaabcxyzzzzpqrrrabbbxyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Po\\1qkwiYVqDWATAJw\\1K&",[global])),
+ <<"JNUVqARhXKto">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","JNUVqARh\\1\\1XKto",[])),
+ <<"JNUVqARhXKto">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","JNUVqARh\\1\\1XKto",[global])),
+ <<"ssvjVvyXuCJeoj">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","ss\\1vjVvyXuCJ\\1eoj\\1",[])),
+ <<"ssvjVvyXuCJeoj">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","ss\\1vjVvyXuCJ\\1eoj\\1",[global])),
+ <<"IKBpn">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABBzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","IK\\1Bpn",[])),
+ <<"IKBpn">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypABBzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","IK\\1Bpn",[global])),
+ <<">>>GGeaaabxyzpqrrrabbxyyyypqAzzrpKAckaaabxyzpqrrrabbxyyyypqAzzaGC">> = iolist_to_binary(re:replace(">>>aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","GGe&rpKAc\\1k&aGC",[])),
+ <<">>>GGeaaabxyzpqrrrabbxyyyypqAzzrpKAckaaabxyzpqrrrabbxyyyypqAzzaGC">> = iolist_to_binary(re:replace(">>>aaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","GGe&rpKAc\\1k&aGC",[global])),
+ <<">P">> = iolist_to_binary(re:replace(">aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","P",[])),
+ <<">P">> = iolist_to_binary(re:replace(">aaaabxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","P",[global])),
+ <<">>>>abcxyzpqrrrabbxyyyypqAzzqKSkoXQtabcxyzpqrrrabbxyyyypqAzzabcxyzpqrrrabbxyyyypqAzzGFnXukr">> = iolist_to_binary(re:replace(">>>>abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&qKSkoXQt&&GFnXukr",[])),
+ <<">>>>abcxyzpqrrrabbxyyyypqAzzqKSkoXQtabcxyzpqrrrabbxyyyypqAzzabcxyzpqrrrabbxyyyypqAzzGFnXukr">> = iolist_to_binary(re:replace(">>>>abcxyzpqrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&qKSkoXQt&&GFnXukr",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","th\\1ha",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","th\\1ha",[global])),
+ <<"abxyzpqrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&h&ni&NOS&oHE&M&DW",[])),
+ <<"abxyzpqrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","&h&ni&NOS&oHE&M&DW",[global])),
+ <<"abxyzpqrrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","DyO",[])),
+ <<"abxyzpqrrrrabbxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrrabbxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","DyO",[global])),
+ <<"abxyzpqrrrabxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrabxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","nRi\\1FPGQknWL",[])),
+ <<"abxyzpqrrrabxyyyypqAzz">> = iolist_to_binary(re:replace("abxyzpqrrrabxyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","nRi\\1FPGQknWL",[global])),
+ <<"aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Gx\\1lJTyU\\1&dN\\1lmHTg",[])),
+ <<"aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyyyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","Gx\\1lJTyU\\1&dN\\1lmHTg",[global])),
+ <<"aaaabcxyzzzzpqrrrabbbxyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","uX",[])),
+ <<"aaaabcxyzzzzpqrrrabbbxyyypqAzz">> = iolist_to_binary(re:replace("aaaabcxyzzzzpqrrrabbbxyyypqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","uX",[global])),
+ <<"aaabcxyzpqrrrabbxyyyypqqqqqqqAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","uP\\1\\1P",[])),
+ <<"aaabcxyzpqrrrabbxyyyypqqqqqqqAzz">> = iolist_to_binary(re:replace("aaabcxyzpqrrrabbxyyyypqqqqqqqAzz","a*abc?xyz+pqr{3}ab{2,}xy{4,5}pq{0,6}AB{0,}zz","uP\\1\\1P",[global])),
+ <<"AabczzNnWikVeHlabcthmw">> = iolist_to_binary(re:replace("abczz","^(abc){1,2}zz","A&NnWikVeHl\\1thmw",[])),
+ <<"AabczzNnWikVeHlabcthmw">> = iolist_to_binary(re:replace("abczz","^(abc){1,2}zz","A&NnWikVeHl\\1thmw",[global])),
+ <<"ljC">> = iolist_to_binary(re:replace("abcabczz","^(abc){1,2}zz","ljC",[])),
+ <<"ljC">> = iolist_to_binary(re:replace("abcabczz","^(abc){1,2}zz","ljC",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(abc){1,2}zz","H&dW",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(abc){1,2}zz","H&dW",[global])),
+ <<"zz">> = iolist_to_binary(re:replace("zz","^(abc){1,2}zz","NaUG",[])),
+ <<"zz">> = iolist_to_binary(re:replace("zz","^(abc){1,2}zz","NaUG",[global])),
+ <<"abcabcabczz">> = iolist_to_binary(re:replace("abcabcabczz","^(abc){1,2}zz","jed",[])),
+ <<"abcabcabczz">> = iolist_to_binary(re:replace("abcabcabczz","^(abc){1,2}zz","jed",[global])),
+ <<">>abczz">> = iolist_to_binary(re:replace(">>abczz","^(abc){1,2}zz","IfDMCUaBC\\1UiUD",[])),
+ <<">>abczz">> = iolist_to_binary(re:replace(">>abczz","^(abc){1,2}zz","IfDMCUaBC\\1UiUD",[global])),
+ <<"bcaiQbcWXgAtsqFbbcb">> = iolist_to_binary(re:replace("bc","^(b+?|a){1,2}?c","&aiQ&WXgAtsqF\\1&b",[])),
+ <<"bcaiQbcWXgAtsqFbbcb">> = iolist_to_binary(re:replace("bc","^(b+?|a){1,2}?c","&aiQ&WXgAtsqF\\1&b",[global])),
+ <<"SOnbIUtbbcSM">> = iolist_to_binary(re:replace("bbc","^(b+?|a){1,2}?c","SOn\\1IUt&SM",[])),
+ <<"SOnbIUtbbcSM">> = iolist_to_binary(re:replace("bbc","^(b+?|a){1,2}?c","SOn\\1IUt&SM",[global])),
+ <<"Obrubbk">> = iolist_to_binary(re:replace("bbbc","^(b+?|a){1,2}?c","Obru\\1k",[])),
+ <<"Obrubbk">> = iolist_to_binary(re:replace("bbbc","^(b+?|a){1,2}?c","Obru\\1k",[global])),
+ <<"YJSoHCQdPaswf">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","YJSoHCQdP\\1swf",[])),
+ <<"YJSoHCQdPaswf">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","YJSoHCQdP\\1swf",[global])),
+ <<"bbacc">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","&c",[])),
+ <<"bbacc">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","&c",[global])),
+ <<"jcBr">> = iolist_to_binary(re:replace("aac","^(b+?|a){1,2}?c","jcBr",[])),
+ <<"jcBr">> = iolist_to_binary(re:replace("aac","^(b+?|a){1,2}?c","jcBr",[global])),
+ <<"ubbbbbbbbbbboLR">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+?|a){1,2}?c","u\\1oLR",[])),
+ <<"ubbbbbbbbbbboLR">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+?|a){1,2}?c","u\\1oLR",[global])),
+ <<"qVSagCR">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+?|a){1,2}?c","qVS\\1gCR",[])),
+ <<"qVSagCR">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+?|a){1,2}?c","qVS\\1gCR",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+?|a){1,2}?c","e&&lu\\1vX&EjbrQGRD&lv",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+?|a){1,2}?c","e&&lu\\1vX&EjbrQGRD&lv",[global])),
+ <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+?|a){1,2}?c","&ofSdXa",[])),
+ <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+?|a){1,2}?c","&ofSdXa",[global])),
+ <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+?|a){1,2}?c","yeCWNqemq",[])),
+ <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+?|a){1,2}?c","yeCWNqemq",[global])),
+ <<"HvbccsbJrdMbc">> = iolist_to_binary(re:replace("bc","^(b+|a){1,2}c","Hv&cs\\1JrdM&",[])),
+ <<"HvbccsbJrdMbc">> = iolist_to_binary(re:replace("bc","^(b+|a){1,2}c","Hv&cs\\1JrdM&",[global])),
+ <<"qRubbcFTMebbWdERwX">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}c","qRu&FTMe\\1WdERwX",[])),
+ <<"qRubbcFTMebbWdERwX">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}c","qRu&FTMe\\1WdERwX",[global])),
+ <<"bbbcdbbbbcbbbWigSlFD">> = iolist_to_binary(re:replace("bbbc","^(b+|a){1,2}c","&db&\\1WigSlFD",[])),
+ <<"bbbcdbbbbcbbbWigSlFD">> = iolist_to_binary(re:replace("bbbc","^(b+|a){1,2}c","&db&\\1WigSlFD",[global])),
+ <<"jaGWX">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}c","j\\1GWX",[])),
+ <<"jaGWX">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}c","j\\1GWX",[global])),
+ <<"tRXTQuVicYa">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}c","tRXTQuVicY\\1",[])),
+ <<"tRXTQuVicYa">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}c","tRXTQuVicY\\1",[global])),
+ <<"aaacWSaacSaacauTERLsT">> = iolist_to_binary(re:replace("aac","^(b+|a){1,2}c","\\1&WS&S&\\1uTERLsT",[])),
+ <<"aaacWSaacSaacauTERLsT">> = iolist_to_binary(re:replace("aac","^(b+|a){1,2}c","\\1&WS&S&\\1uTERLsT",[global])),
+ <<"DBabbbbbbbbbbbcabbbbbbbbbbbcKcnVC">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+|a){1,2}c","DB&&KcnVC",[])),
+ <<"DBabbbbbbbbbbbcabbbbbbbbbbbcKcnVC">> = iolist_to_binary(re:replace("abbbbbbbbbbbc","^(b+|a){1,2}c","DB&&KcnVC",[global])),
+ <<"EeIDBbbbbbbbbbbbaciagibbbbbbbbbbbacaa">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+|a){1,2}c","EeIDB&i\\1gi&\\1\\1",[])),
+ <<"EeIDBbbbbbbbbbbbaciagibbbbbbbbbbbacaa">> = iolist_to_binary(re:replace("bbbbbbbbbbbac","^(b+|a){1,2}c","EeIDB&i\\1gi&\\1\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+|a){1,2}c","a&o&Hxqiw&jogpDTgJ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b+|a){1,2}c","a&o&Hxqiw&jogpDTgJ",[global])),
+ <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+|a){1,2}c","&G&\\1h\\1wNk&Ywpciljc",[])),
+ <<"aaac">> = iolist_to_binary(re:replace("aaac","^(b+|a){1,2}c","&G&\\1h\\1wNk&Ywpciljc",[global])),
+ <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+|a){1,2}c","HEjJIPg\\1n\\1&kTh",[])),
+ <<"abbbbbbbbbbbac">> = iolist_to_binary(re:replace("abbbbbbbbbbbac","^(b+|a){1,2}c","HEjJIPg\\1n\\1&kTh",[global])),
+ <<"bbcP">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}?bc","&P",[])),
+ <<"bbcP">> = iolist_to_binary(re:replace("bbc","^(b+|a){1,2}?bc","&P",[global])),
+ <<"kGDMabaIlbabcKSq">> = iolist_to_binary(re:replace("babc","^(b*|ba){1,2}?bc","kGDMa\\1Il&KSq",[])),
+ <<"kGDMabaIlbabcKSq">> = iolist_to_binary(re:replace("babc","^(b*|ba){1,2}?bc","kGDMa\\1Il&KSq",[global])),
+ <<"babayLobbabcOLYmIGfTNbbabci">> = iolist_to_binary(re:replace("bbabc","^(b*|ba){1,2}?bc","\\1\\1yLo&OLYmIGfTN&i",[])),
+ <<"babayLobbabcOLYmIGfTNbbabci">> = iolist_to_binary(re:replace("bbabc","^(b*|ba){1,2}?bc","\\1\\1yLo&OLYmIGfTN&i",[global])),
+ <<"pMjVc">> = iolist_to_binary(re:replace("bababc","^(b*|ba){1,2}?bc","pMjVc",[])),
+ <<"pMjVc">> = iolist_to_binary(re:replace("bababc","^(b*|ba){1,2}?bc","pMjVc",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b*|ba){1,2}?bc","wT",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(b*|ba){1,2}?bc","wT",[global])),
+ <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(b*|ba){1,2}?bc","g&dFfWePhsR&XN\\1Vq",[])),
+ <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(b*|ba){1,2}?bc","g&dFfWePhsR&XN\\1Vq",[global])),
+ <<"babababc">> = iolist_to_binary(re:replace("babababc","^(b*|ba){1,2}?bc","\\1",[])),
+ <<"babababc">> = iolist_to_binary(re:replace("babababc","^(b*|ba){1,2}?bc","\\1",[global])),
+ <<"HQbatSN">> = iolist_to_binary(re:replace("babc","^(ba|b*){1,2}?bc","HQ\\1tSN",[])),
+ <<"HQbatSN">> = iolist_to_binary(re:replace("babc","^(ba|b*){1,2}?bc","HQ\\1tSN",[global])),
+ <<"Wba">> = iolist_to_binary(re:replace("bbabc","^(ba|b*){1,2}?bc","W\\1",[])),
+ <<"Wba">> = iolist_to_binary(re:replace("bbabc","^(ba|b*){1,2}?bc","W\\1",[global])),
+ <<"NsH">> = iolist_to_binary(re:replace("bababc","^(ba|b*){1,2}?bc","NsH",[])),
+ <<"NsH">> = iolist_to_binary(re:replace("bababc","^(ba|b*){1,2}?bc","NsH",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ba|b*){1,2}?bc","n\\1QUxH&c\\1vARRpu\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ba|b*){1,2}?bc","n\\1QUxH&c\\1vARRpu\\1",[global])),
+ <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(ba|b*){1,2}?bc","X&pfoImgghpuaCj\\1h\\1T&",[])),
+ <<"bababbc">> = iolist_to_binary(re:replace("bababbc","^(ba|b*){1,2}?bc","X&pfoImgghpuaCj\\1h\\1T&",[global])),
+ <<"babababc">> = iolist_to_binary(re:replace("babababc","^(ba|b*){1,2}?bc","O\\1dyBuNmjs&QHb&",[])),
+ <<"babababc">> = iolist_to_binary(re:replace("babababc","^(ba|b*){1,2}?bc","O\\1dyBuNmjs&QHb&",[global])),
+ <<"MjwccSIya;z;zXkruR">> = iolist_to_binary(re:replace(";z","^\\ca\\cA\\c[;\\c:","MjwccSIy\\1a&&XkruR",[])),
+ <<"MjwccSIya;z;zXkruR">> = iolist_to_binary(re:replace(";z","^\\ca\\cA\\c[;\\c:","MjwccSIy\\1a&&XkruR",[global])),
+ <<"KmseihnaDthing">> = iolist_to_binary(re:replace("athing","^[ab\\]cde]","Kms\\1eihn&D",[])),
+ <<"KmseihnaDthing">> = iolist_to_binary(re:replace("athing","^[ab\\]cde]","Kms\\1eihn&D",[global])),
+ <<"VtYything">> = iolist_to_binary(re:replace("bthing","^[ab\\]cde]","V\\1\\1tYy\\1",[])),
+ <<"VtYything">> = iolist_to_binary(re:replace("bthing","^[ab\\]cde]","V\\1\\1tYy\\1",[global])),
+ <<"BUicE]cTfPthing">> = iolist_to_binary(re:replace("]thing","^[ab\\]cde]","B\\1UicE\\1&cTfP",[])),
+ <<"BUicE]cTfPthing">> = iolist_to_binary(re:replace("]thing","^[ab\\]cde]","B\\1UicE\\1&cTfP",[global])),
+ <<"Jthing">> = iolist_to_binary(re:replace("cthing","^[ab\\]cde]","J",[])),
+ <<"Jthing">> = iolist_to_binary(re:replace("cthing","^[ab\\]cde]","J",[global])),
+ <<"ecfIHwcPLwCQVmthing">> = iolist_to_binary(re:replace("dthing","^[ab\\]cde]","ecfIHwcPLwCQVm",[])),
+ <<"ecfIHwcPLwCQVmthing">> = iolist_to_binary(re:replace("dthing","^[ab\\]cde]","ecfIHwcPLwCQVm",[global])),
+ <<"jthing">> = iolist_to_binary(re:replace("ething","^[ab\\]cde]","j\\1",[])),
+ <<"jthing">> = iolist_to_binary(re:replace("ething","^[ab\\]cde]","j\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[ab\\]cde]","XitEhS",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[ab\\]cde]","XitEhS",[global])),
+ <<"fthing">> = iolist_to_binary(re:replace("fthing","^[ab\\]cde]","jftUvqtHSk&",[])),
+ <<"fthing">> = iolist_to_binary(re:replace("fthing","^[ab\\]cde]","jftUvqtHSk&",[global])),
+ <<"[thing">> = iolist_to_binary(re:replace("[thing","^[ab\\]cde]","BVEV&n",[])),
+ <<"[thing">> = iolist_to_binary(re:replace("[thing","^[ab\\]cde]","BVEV&n",[global])),
+ <<"\\thing">> = iolist_to_binary(re:replace("\\thing","^[ab\\]cde]","&",[])),
+ <<"\\thing">> = iolist_to_binary(re:replace("\\thing","^[ab\\]cde]","&",[global])),
+ <<"CLkR]]rBddXHyi]Hrjthing">> = iolist_to_binary(re:replace("]thing","^[]cde]","CLkR&&rBddXHyi&H\\1\\1rj",[])),
+ <<"CLkR]]rBddXHyi]Hrjthing">> = iolist_to_binary(re:replace("]thing","^[]cde]","CLkR&&rBddXHyi&H\\1\\1rj",[global])),
+ <<"sHqJwDKDjCAxIofXvVthing">> = iolist_to_binary(re:replace("cthing","^[]cde]","s\\1HqJwD\\1KDjCAxIofXvV",[])),
+ <<"sHqJwDKDjCAxIofXvVthing">> = iolist_to_binary(re:replace("cthing","^[]cde]","s\\1HqJwD\\1KDjCAxIofXvV",[global])),
+ <<"hcfONJPTXdthing">> = iolist_to_binary(re:replace("dthing","^[]cde]","hcfONJPTX&",[])),
+ <<"hcfONJPTXdthing">> = iolist_to_binary(re:replace("dthing","^[]cde]","hcfONJPTX&",[global])),
+ <<"eEbyOxFupOoOReKucqkthing">> = iolist_to_binary(re:replace("ething","^[]cde]","&EbyOxFupOoO\\1R&Kucqk",[])),
+ <<"eEbyOxFupOoOReKucqkthing">> = iolist_to_binary(re:replace("ething","^[]cde]","&EbyOxFupOoO\\1R&Kucqk",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[]cde]","ViA&j\\1r&&eE",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[]cde]","ViA&j\\1r&&eE",[global])),
+ <<"athing">> = iolist_to_binary(re:replace("athing","^[]cde]","l\\1m",[])),
+ <<"athing">> = iolist_to_binary(re:replace("athing","^[]cde]","l\\1m",[global])),
+ <<"fthing">> = iolist_to_binary(re:replace("fthing","^[]cde]","&X",[])),
+ <<"fthing">> = iolist_to_binary(re:replace("fthing","^[]cde]","&X",[global])),
+ <<"iexifgnSthing">> = iolist_to_binary(re:replace("fthing","^[^ab\\]cde]","iexi&gnS",[])),
+ <<"iexifgnSthing">> = iolist_to_binary(re:replace("fthing","^[^ab\\]cde]","iexi&gnS",[global])),
+ <<"KbDPthing">> = iolist_to_binary(re:replace("[thing","^[^ab\\]cde]","Kb\\1DP",[])),
+ <<"KbDPthing">> = iolist_to_binary(re:replace("[thing","^[^ab\\]cde]","Kb\\1DP",[global])),
+ <<"qsMjdRastMthing">> = iolist_to_binary(re:replace("\\thing","^[^ab\\]cde]","qsMjd\\1RastM",[])),
+ <<"qsMjdRastMthing">> = iolist_to_binary(re:replace("\\thing","^[^ab\\]cde]","qsMjd\\1RastM",[global])),
+ <<"OMrBm** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^ab\\]cde]","OMrBm",[])),
+ <<"OMrBm** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^ab\\]cde]","OMrBm",[global])),
+ <<"athing">> = iolist_to_binary(re:replace("athing","^[^ab\\]cde]","blc",[])),
+ <<"athing">> = iolist_to_binary(re:replace("athing","^[^ab\\]cde]","blc",[global])),
+ <<"bthing">> = iolist_to_binary(re:replace("bthing","^[^ab\\]cde]","rkdVhImX&Sci\\1srkpB",[])),
+ <<"bthing">> = iolist_to_binary(re:replace("bthing","^[^ab\\]cde]","rkdVhImX&Sci\\1srkpB",[global])),
+ <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^ab\\]cde]","R",[])),
+ <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^ab\\]cde]","R",[global])),
+ <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^ab\\]cde]","MTBI&N\\1Hu&G&vMV&",[])),
+ <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^ab\\]cde]","MTBI&N\\1Hu&G&vMV&",[global])),
+ <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^ab\\]cde]","L&iy\\1&&rL",[])),
+ <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^ab\\]cde]","L&iy\\1&&rL",[global])),
+ <<"ething">> = iolist_to_binary(re:replace("ething","^[^ab\\]cde]","fAG\\1TYq\\1LAa\\1amIUKu",[])),
+ <<"ething">> = iolist_to_binary(re:replace("ething","^[^ab\\]cde]","fAG\\1TYq\\1LAa\\1amIUKu",[global])),
+ <<"gathing">> = iolist_to_binary(re:replace("athing","^[^]cde]","\\1\\1g&\\1",[])),
+ <<"gathing">> = iolist_to_binary(re:replace("athing","^[^]cde]","\\1\\1g&\\1",[global])),
+ <<"XGfAfLNiMaKLathing">> = iolist_to_binary(re:replace("fthing","^[^]cde]","XG&A&LNiMa\\1KLa",[])),
+ <<"XGfAfLNiMaKLathing">> = iolist_to_binary(re:replace("fthing","^[^]cde]","XG&A&LNiMa\\1KLa",[global])),
+ <<"pCXwvleUk*NHE*wG*wiU** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^]cde]","pCXwvleUk&NHE&wG&wiU",[])),
+ <<"pCXwvleUk*NHE*wG*wiU** Failers">> = iolist_to_binary(re:replace("*** Failers","^[^]cde]","pCXwvleUk&NHE&wG&wiU",[global])),
+ <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^]cde]","D\\1mYIuXYOFQyO&Yx&",[])),
+ <<"]thing">> = iolist_to_binary(re:replace("]thing","^[^]cde]","D\\1mYIuXYOFQyO&Yx&",[global])),
+ <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^]cde]","iJI\\1fdd&",[])),
+ <<"cthing">> = iolist_to_binary(re:replace("cthing","^[^]cde]","iJI\\1fdd&",[global])),
+ <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^]cde]","BqndYPF\\1lxs\\1\\1hPxSdgK",[])),
+ <<"dthing">> = iolist_to_binary(re:replace("dthing","^[^]cde]","BqndYPF\\1lxs\\1\\1hPxSdgK",[global])),
+ <<"ething">> = iolist_to_binary(re:replace("ething","^[^]cde]","E",[])),
+ <<"ething">> = iolist_to_binary(re:replace("ething","^[^]cde]","E",[global])),
+ <<"0AMd">> = iolist_to_binary(re:replace("0","^[0-9]+$","&AM\\1\\1d",[])),
+ <<"0AMd">> = iolist_to_binary(re:replace("0","^[0-9]+$","&AM\\1\\1d",[global])),
+ <<"LUfQMm1n">> = iolist_to_binary(re:replace("1","^[0-9]+$","L\\1\\1Uf\\1Q\\1Mm&n",[])),
+ <<"LUfQMm1n">> = iolist_to_binary(re:replace("1","^[0-9]+$","L\\1\\1Uf\\1Q\\1Mm&n",[global])),
+ <<"yty2aJl22M">> = iolist_to_binary(re:replace("2","^[0-9]+$","yty\\1&aJl&\\1&M",[])),
+ <<"yty2aJl22M">> = iolist_to_binary(re:replace("2","^[0-9]+$","yty\\1&aJl&\\1&M",[global])),
+ <<"eX3">> = iolist_to_binary(re:replace("3","^[0-9]+$","eX&",[])),
+ <<"eX3">> = iolist_to_binary(re:replace("3","^[0-9]+$","eX&",[global])),
+ <<"ypukToFRSissUH">> = iolist_to_binary(re:replace("4","^[0-9]+$","ypukToFRSissUH",[])),
+ <<"ypukToFRSissUH">> = iolist_to_binary(re:replace("4","^[0-9]+$","ypukToFRSissUH",[global])),
+ <<"e55dU5aoURF5N">> = iolist_to_binary(re:replace("5","^[0-9]+$","e&&dU&a\\1oURF&N",[])),
+ <<"e55dU5aoURF5N">> = iolist_to_binary(re:replace("5","^[0-9]+$","e&&dU&a\\1oURF&N",[global])),
+ <<"nrnSg6E">> = iolist_to_binary(re:replace("6","^[0-9]+$","nrnSg&\\1\\1E",[])),
+ <<"nrnSg6E">> = iolist_to_binary(re:replace("6","^[0-9]+$","nrnSg&\\1\\1E",[global])),
+ <<"uBv">> = iolist_to_binary(re:replace("7","^[0-9]+$","uBv",[])),
+ <<"uBv">> = iolist_to_binary(re:replace("7","^[0-9]+$","uBv",[global])),
+ <<"R">> = iolist_to_binary(re:replace("8","^[0-9]+$","R",[])),
+ <<"R">> = iolist_to_binary(re:replace("8","^[0-9]+$","R",[global])),
+ <<"t9gys9DIukLiJU9Qb9">> = iolist_to_binary(re:replace("9","^[0-9]+$","t&gys\\1&DIukLiJU&Qb&",[])),
+ <<"t9gys9DIukLiJU9Qb9">> = iolist_to_binary(re:replace("9","^[0-9]+$","t&gys\\1&DIukLiJU&Qb&",[global])),
+ <<"tIOqKYBcuX10">> = iolist_to_binary(re:replace("10","^[0-9]+$","tIOqKYBcuX&",[])),
+ <<"tIOqKYBcuX10">> = iolist_to_binary(re:replace("10","^[0-9]+$","tIOqKYBcuX&",[global])),
+ <<"QfE">> = iolist_to_binary(re:replace("100","^[0-9]+$","QfE",[])),
+ <<"QfE">> = iolist_to_binary(re:replace("100","^[0-9]+$","QfE",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[0-9]+$","UDbN\\1jnxythM\\1\\1sdH&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[0-9]+$","UDbN\\1jnxythM\\1\\1sdH&",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","^[0-9]+$","cUQQDAc",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","^[0-9]+$","cUQQDAc",[global])),
+ <<"CVuenterheUenterWenter">> = iolist_to_binary(re:replace("enter","^.*nter","C\\1Vu&heU&\\1W&",[])),
+ <<"CVuenterheUenterWenter">> = iolist_to_binary(re:replace("enter","^.*nter","C\\1Vu&heU&\\1W&",[global])),
+ <<"IEc">> = iolist_to_binary(re:replace("inter","^.*nter","IEc",[])),
+ <<"IEc">> = iolist_to_binary(re:replace("inter","^.*nter","IEc",[global])),
+ <<"EJPILFHXKDCNvaTC">> = iolist_to_binary(re:replace("uponter","^.*nter","EJPIL\\1FHXKDCNvaTC",[])),
+ <<"EJPILFHXKDCNvaTC">> = iolist_to_binary(re:replace("uponter","^.*nter","EJPIL\\1FHXKDCNvaTC",[global])),
ok.
run1() ->
- <<"Bp">> = iolist_to_binary(re:replace("xxx0","^xxx[0-9]+$","B\\1\\1\\1p",[])),
- <<"Bp">> = iolist_to_binary(re:replace("xxx0","^xxx[0-9]+$","B\\1\\1\\1p",[global])),
- <<"xxx1234okNYhxxx1234tobCxxx1234fg">> = iolist_to_binary(re:replace("xxx1234","^xxx[0-9]+$","&okNYh&tobC\\1&fg",[])),
- <<"xxx1234okNYhxxx1234tobCxxx1234fg">> = iolist_to_binary(re:replace("xxx1234","^xxx[0-9]+$","&okNYh&tobC\\1&fg",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^xxx[0-9]+$","hQ&ULnO\\1\\1\\1nNlLbQ",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^xxx[0-9]+$","hQ&ULnO\\1\\1\\1nNlLbQ",[global])),
- <<"xxx">> = iolist_to_binary(re:replace("xxx","^xxx[0-9]+$","&KwHk\\1a\\1\\1\\1&&i",[])),
- <<"xxx">> = iolist_to_binary(re:replace("xxx","^xxx[0-9]+$","&KwHk\\1a\\1\\1\\1&&i",[global])),
- <<"ohMDx123xpx123mNT">> = iolist_to_binary(re:replace("x123","^.+[0-9][0-9][0-9]$","ohMD&xp\\1&mNT",[])),
- <<"ohMDx123xpx123mNT">> = iolist_to_binary(re:replace("x123","^.+[0-9][0-9][0-9]$","ohMD&xp\\1&mNT",[global])),
- <<"gYaxx123xx123XaaNxx123bNU">> = iolist_to_binary(re:replace("xx123","^.+[0-9][0-9][0-9]$","gYa&&XaaN&bNU",[])),
- <<"gYaxx123xx123XaaNxx123bNU">> = iolist_to_binary(re:replace("xx123","^.+[0-9][0-9][0-9]$","gYa&&XaaN&bNU",[global])),
- <<"iElVtor">> = iolist_to_binary(re:replace("123456","^.+[0-9][0-9][0-9]$","i\\1ElV\\1tor",[])),
- <<"iElVtor">> = iolist_to_binary(re:replace("123456","^.+[0-9][0-9][0-9]$","i\\1ElV\\1tor",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+[0-9][0-9][0-9]$","BWxJ\\1uhGy&vgMLA",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+[0-9][0-9][0-9]$","BWxJ\\1uhGy&vgMLA",[global])),
- <<"123">> = iolist_to_binary(re:replace("123","^.+[0-9][0-9][0-9]$","xTGS&sW\\1G&NlcW",[])),
- <<"123">> = iolist_to_binary(re:replace("123","^.+[0-9][0-9][0-9]$","xTGS&sW\\1G&NlcW",[global])),
- <<"Ix1234IUy">> = iolist_to_binary(re:replace("x1234","^.+[0-9][0-9][0-9]$","I\\1&\\1I\\1Uy",[])),
- <<"Ix1234IUy">> = iolist_to_binary(re:replace("x1234","^.+[0-9][0-9][0-9]$","I\\1&\\1I\\1Uy",[global])),
- <<"DBYEAgkI">> = iolist_to_binary(re:replace("x123","^.+?[0-9][0-9][0-9]$","DBYE\\1AgkI",[])),
- <<"DBYEAgkI">> = iolist_to_binary(re:replace("x123","^.+?[0-9][0-9][0-9]$","DBYE\\1AgkI",[global])),
- <<"EABxx123">> = iolist_to_binary(re:replace("xx123","^.+?[0-9][0-9][0-9]$","EAB&\\1",[])),
- <<"EABxx123">> = iolist_to_binary(re:replace("xx123","^.+?[0-9][0-9][0-9]$","EAB&\\1",[global])),
- <<"w">> = iolist_to_binary(re:replace("123456","^.+?[0-9][0-9][0-9]$","w",[])),
- <<"w">> = iolist_to_binary(re:replace("123456","^.+?[0-9][0-9][0-9]$","w",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+?[0-9][0-9][0-9]$","jiMwkAneSrQ&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+?[0-9][0-9][0-9]$","jiMwkAneSrQ&",[global])),
- <<"123">> = iolist_to_binary(re:replace("123","^.+?[0-9][0-9][0-9]$","pg\\1cjQ&&&",[])),
- <<"123">> = iolist_to_binary(re:replace("123","^.+?[0-9][0-9][0-9]$","pg\\1cjQ&&&",[global])),
- <<"APdx1234Jdelcg">> = iolist_to_binary(re:replace("x1234","^.+?[0-9][0-9][0-9]$","A\\1Pd&Jdelcg",[])),
- <<"APdx1234Jdelcg">> = iolist_to_binary(re:replace("x1234","^.+?[0-9][0-9][0-9]$","A\\1Pd&Jdelcg",[global])),
- <<"abcVE">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","\\1VE",[])),
- <<"abcVE">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","\\1VE",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","ysSa&O\\1ogTi\\1e\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","ysSa&O\\1ogTi\\1e\\1",[global])),
- <<"!pqr=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","eCQWoiG\\1",[])),
- <<"!pqr=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","eCQWoiG\\1",[global])),
- <<"abc!=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","rYbgJDpc",[])),
- <<"abc!=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","rYbgJDpc",[global])),
- <<"abc!pqr=apquxz:ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!pqr=apquxz:ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","vkuwBMsxa",[])),
- <<"abc!pqr=apquxz:ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!pqr=apquxz:ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","vkuwBMsxa",[global])),
- <<"abc!pqr=apquxz.ixr.zzz.ac.ukk">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.ukk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","e\\1KF&BD\\1C&kxH&rwWnu",[])),
- <<"abc!pqr=apquxz.ixr.zzz.ac.ukk">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.ukk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","e\\1KF&BD\\1C&kxH&rwWnu",[global])),
- <<"Well, we need a colongxIksrpvcmlefi:WmR somewhere">> = iolist_to_binary(re:replace("Well, we need a colon: somewhere",":","g\\1xIksrpvcmlefi&WmR",[])),
- <<"Well, we need a colongxIksrpvcmlefi:WmR somewhere">> = iolist_to_binary(re:replace("Well, we need a colon: somewhere",":","g\\1xIksrpvcmlefi&WmR",[global])),
- <<"*** Fail if we don't">> = iolist_to_binary(re:replace("*** Fail if we don't",":","g&BggNgoAXIe&s\\1NH",[])),
- <<"*** Fail if we don't">> = iolist_to_binary(re:replace("*** Fail if we don't",":","g&BggNgoAXIe&s\\1NH",[global])),
- <<"TkV0abcQpF0abci0abcyiC">> = iolist_to_binary(re:replace("0abc","([\\da-f:]+)$","TkV\\1QpF\\1i&yiC",[caseless])),
- <<"TkV0abcQpF0abci0abcyiC">> = iolist_to_binary(re:replace("0abc","([\\da-f:]+)$","TkV\\1QpF\\1i&yiC",[caseless,
- global])),
- <<"gAHIDgPO">> = iolist_to_binary(re:replace("abc","([\\da-f:]+)$","gAHIDgPO",[caseless])),
- <<"gAHIDgPO">> = iolist_to_binary(re:replace("abc","([\\da-f:]+)$","gAHIDgPO",[caseless,
- global])),
- <<"QqLxYfedlXtfedNm">> = iolist_to_binary(re:replace("fed","([\\da-f:]+)$","QqLxY&lXt\\1Nm",[caseless])),
- <<"QqLxYfedlXtfedNm">> = iolist_to_binary(re:replace("fed","([\\da-f:]+)$","QqLxY&lXt\\1Nm",[caseless,
- global])),
- <<"aXaxRLpEPRwSlQEEw">> = iolist_to_binary(re:replace("E","([\\da-f:]+)$","aXaxRLp\\1PRwSlQ\\1\\1w",[caseless])),
- <<"aXaxRLpEPRwSlQEEw">> = iolist_to_binary(re:replace("E","([\\da-f:]+)$","aXaxRLp\\1PRwSlQ\\1\\1w",[caseless,
- global])),
- <<"srXTndsE::::kfsP::LR">> = iolist_to_binary(re:replace("::","([\\da-f:]+)$","srXTndsE&&kfsP&LR",[caseless])),
- <<"srXTndsE::::kfsP::LR">> = iolist_to_binary(re:replace("::","([\\da-f:]+)$","srXTndsE&&kfsP&LR",[caseless,
- global])),
- <<"5f03:12C0::932ejAFV">> = iolist_to_binary(re:replace("5f03:12C0::932e","([\\da-f:]+)$","&jAFV",[caseless])),
- <<"5f03:12C0::932ejAFV">> = iolist_to_binary(re:replace("5f03:12C0::932e","([\\da-f:]+)$","&jAFV",[caseless,
+ <<"P">> = iolist_to_binary(re:replace("xxx0","^xxx[0-9]+$","P",[])),
+ <<"P">> = iolist_to_binary(re:replace("xxx0","^xxx[0-9]+$","P",[global])),
+ <<"eSFOJJrLwTwUxxx1234xxx1234Mqmxxx1234P">> = iolist_to_binary(re:replace("xxx1234","^xxx[0-9]+$","eSFOJJrLwTwU&&Mqm&P",[])),
+ <<"eSFOJJrLwTwUxxx1234xxx1234Mqmxxx1234P">> = iolist_to_binary(re:replace("xxx1234","^xxx[0-9]+$","eSFOJJrLwTwU&&Mqm&P",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^xxx[0-9]+$","rqtBg",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^xxx[0-9]+$","rqtBg",[global])),
+ <<"xxx">> = iolist_to_binary(re:replace("xxx","^xxx[0-9]+$","BC&WMPvffc&kTc",[])),
+ <<"xxx">> = iolist_to_binary(re:replace("xxx","^xxx[0-9]+$","BC&WMPvffc&kTc",[global])),
+ <<"x123lx123x123x123UnCsPMYYkPx123mE">> = iolist_to_binary(re:replace("x123","^.+[0-9][0-9][0-9]$","&l&&&Un\\1CsPMYYkP\\1&mE",[])),
+ <<"x123lx123x123x123UnCsPMYYkPx123mE">> = iolist_to_binary(re:replace("x123","^.+[0-9][0-9][0-9]$","&l&&&Un\\1CsPMYYkP\\1&mE",[global])),
+ <<"IdKDxx123rQnxx123gDqdon">> = iolist_to_binary(re:replace("xx123","^.+[0-9][0-9][0-9]$","IdKD&rQ\\1\\1n&gD\\1qdo\\1n",[])),
+ <<"IdKDxx123rQnxx123gDqdon">> = iolist_to_binary(re:replace("xx123","^.+[0-9][0-9][0-9]$","IdKD&rQ\\1\\1n&gD\\1qdo\\1n",[global])),
+ <<"RkaqCHlxR">> = iolist_to_binary(re:replace("123456","^.+[0-9][0-9][0-9]$","Rk\\1aqCHlxR",[])),
+ <<"RkaqCHlxR">> = iolist_to_binary(re:replace("123456","^.+[0-9][0-9][0-9]$","Rk\\1aqCHlxR",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+[0-9][0-9][0-9]$","cgy\\1xVdgl&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+[0-9][0-9][0-9]$","cgy\\1xVdgl&",[global])),
+ <<"123">> = iolist_to_binary(re:replace("123","^.+[0-9][0-9][0-9]$","CGIYKCWyECIvTQ",[])),
+ <<"123">> = iolist_to_binary(re:replace("123","^.+[0-9][0-9][0-9]$","CGIYKCWyECIvTQ",[global])),
+ <<"FtyEkgTx1234aW">> = iolist_to_binary(re:replace("x1234","^.+[0-9][0-9][0-9]$","FtyEkg\\1T&aW",[])),
+ <<"FtyEkgTx1234aW">> = iolist_to_binary(re:replace("x1234","^.+[0-9][0-9][0-9]$","FtyEkg\\1T&aW",[global])),
+ <<"KeT">> = iolist_to_binary(re:replace("x123","^.+?[0-9][0-9][0-9]$","KeT",[])),
+ <<"KeT">> = iolist_to_binary(re:replace("x123","^.+?[0-9][0-9][0-9]$","KeT",[global])),
+ <<"Lxx123ikqEJxx123xx123">> = iolist_to_binary(re:replace("xx123","^.+?[0-9][0-9][0-9]$","L&ikqEJ\\1&&\\1\\1",[])),
+ <<"Lxx123ikqEJxx123xx123">> = iolist_to_binary(re:replace("xx123","^.+?[0-9][0-9][0-9]$","L&ikqEJ\\1&&\\1\\1",[global])),
+ <<"X123456R">> = iolist_to_binary(re:replace("123456","^.+?[0-9][0-9][0-9]$","X&R",[])),
+ <<"X123456R">> = iolist_to_binary(re:replace("123456","^.+?[0-9][0-9][0-9]$","X&R",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+?[0-9][0-9][0-9]$","tKJBvn",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.+?[0-9][0-9][0-9]$","tKJBvn",[global])),
+ <<"123">> = iolist_to_binary(re:replace("123","^.+?[0-9][0-9][0-9]$","hVg\\1P\\1\\1",[])),
+ <<"123">> = iolist_to_binary(re:replace("123","^.+?[0-9][0-9][0-9]$","hVg\\1P\\1\\1",[global])),
+ <<"Tx1234amxVpJx1234egSsUBIV">> = iolist_to_binary(re:replace("x1234","^.+?[0-9][0-9][0-9]$","T&a\\1mxVpJ\\1&egSsUBIV",[])),
+ <<"Tx1234amxVpJx1234egSsUBIV">> = iolist_to_binary(re:replace("x1234","^.+?[0-9][0-9][0-9]$","T&a\\1mxVpJ\\1&egSsUBIV",[global])),
+ <<"YWynbrCtabcabc">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","YWynbrCt\\1\\1",[])),
+ <<"YWynbrCtabcabc">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","YWynbrCt\\1\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","gXiCw\\1HR&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","gXiCw\\1HR&",[global])),
+ <<"!pqr=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","p&jt\\1a",[])),
+ <<"!pqr=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("!pqr=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","p&jt\\1a",[global])),
+ <<"abc!=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","\\1RDbvMJ&",[])),
+ <<"abc!=apquxz.ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!=apquxz.ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","\\1RDbvMJ&",[global])),
+ <<"abc!pqr=apquxz:ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!pqr=apquxz:ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","I\\1\\1c\\1&\\1AnFPifD&C",[])),
+ <<"abc!pqr=apquxz:ixr.zzz.ac.uk">> = iolist_to_binary(re:replace("abc!pqr=apquxz:ixr.zzz.ac.uk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","I\\1\\1c\\1&\\1AnFPifD&C",[global])),
+ <<"abc!pqr=apquxz.ixr.zzz.ac.ukk">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.ukk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","byM\\1qyusNtwD",[])),
+ <<"abc!pqr=apquxz.ixr.zzz.ac.ukk">> = iolist_to_binary(re:replace("abc!pqr=apquxz.ixr.zzz.ac.ukk","^([^!]+)!(.+)=apquxz\\.ixr\\.zzz\\.ac\\.uk$","byM\\1qyusNtwD",[global])),
+ <<"Well, we need a colonwOsWUYkpQEYQO somewhere">> = iolist_to_binary(re:replace("Well, we need a colon: somewhere",":","wOsWUYkpQEYQO",[])),
+ <<"Well, we need a colonwOsWUYkpQEYQO somewhere">> = iolist_to_binary(re:replace("Well, we need a colon: somewhere",":","wOsWUYkpQEYQO",[global])),
+ <<"*** Fail if we don't">> = iolist_to_binary(re:replace("*** Fail if we don't",":","ehPt&NEI\\1P\\1ceGP",[])),
+ <<"*** Fail if we don't">> = iolist_to_binary(re:replace("*** Fail if we don't",":","ehPt&NEI\\1P\\1ceGP",[global])),
+ <<"u0abcPr0abcfewT0abcqIyT0abcD">> = iolist_to_binary(re:replace("0abc","([\\da-f:]+)$","u\\1Pr&fewT&qIyT\\1D",[caseless])),
+ <<"u0abcPr0abcfewT0abcqIyT0abcD">> = iolist_to_binary(re:replace("0abc","([\\da-f:]+)$","u\\1Pr&fewT&qIyT\\1D",[caseless,
+ global])),
+ <<"rTODdabcvabcKUabc">> = iolist_to_binary(re:replace("abc","([\\da-f:]+)$","rTODd\\1v&KU&",[caseless])),
+ <<"rTODdabcvabcKUabc">> = iolist_to_binary(re:replace("abc","([\\da-f:]+)$","rTODd\\1v&KU&",[caseless,
+ global])),
+ <<"UhjfwcfedwPfedMkfedSM">> = iolist_to_binary(re:replace("fed","([\\da-f:]+)$","Uhjfwc&wP&Mk\\1SM",[caseless])),
+ <<"UhjfwcfedwPfedMkfedSM">> = iolist_to_binary(re:replace("fed","([\\da-f:]+)$","Uhjfwc&wP&Mk\\1SM",[caseless,
+ global])),
+ <<"tsEwEtEEnWpuswMEEv">> = iolist_to_binary(re:replace("E","([\\da-f:]+)$","ts\\1w&t\\1&nWpuswM\\1&v",[caseless])),
+ <<"tsEwEtEEnWpuswMEEv">> = iolist_to_binary(re:replace("E","([\\da-f:]+)$","ts\\1w&t\\1&nWpuswM\\1&v",[caseless,
+ global])),
+ <<"fXlt::X::::f::iL::tsbvQOv">> = iolist_to_binary(re:replace("::","([\\da-f:]+)$","fXlt&X&&f\\1iL&tsbvQOv",[caseless])),
+ <<"fXlt::X::::f::iL::tsbvQOv">> = iolist_to_binary(re:replace("::","([\\da-f:]+)$","fXlt&X&&f\\1iL&tsbvQOv",[caseless,
+ global])),
+ <<"AAW5f03:12C0::932exM">> = iolist_to_binary(re:replace("5f03:12C0::932e","([\\da-f:]+)$","AAW&xM",[caseless])),
+ <<"AAW5f03:12C0::932exM">> = iolist_to_binary(re:replace("5f03:12C0::932e","([\\da-f:]+)$","AAW&xM",[caseless,
+ global])),
+ <<"fed defSdefndefHJy">> = iolist_to_binary(re:replace("fed def","([\\da-f:]+)$","\\1S\\1n&HJy",[caseless])),
+ <<"fed defSdefndefHJy">> = iolist_to_binary(re:replace("fed def","([\\da-f:]+)$","\\1S\\1n&HJy",[caseless,
global])),
- <<"fed yjdefSWAl">> = iolist_to_binary(re:replace("fed def","([\\da-f:]+)$","yj&SWAl",[caseless])),
- <<"fed yjdefSWAl">> = iolist_to_binary(re:replace("fed def","([\\da-f:]+)$","yj&SWAl",[caseless,
- global])),
- <<"Any old stuqffffafSffkdOlpalffuffR">> = iolist_to_binary(re:replace("Any old stuff","([\\da-f:]+)$","q&\\1afS&kdOlpal&u\\1R",[caseless])),
- <<"Any old stuqffffafSffkdOlpalffuffR">> = iolist_to_binary(re:replace("Any old stuff","([\\da-f:]+)$","q&\\1afS&kdOlpal&u\\1R",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","([\\da-f:]+)$","IyKK\\1DBvmhe",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","([\\da-f:]+)$","IyKK\\1DBvmhe",[caseless,
- global])),
- <<"0zzz">> = iolist_to_binary(re:replace("0zzz","([\\da-f:]+)$","rdo\\1x&nKGAa",[caseless])),
- <<"0zzz">> = iolist_to_binary(re:replace("0zzz","([\\da-f:]+)$","rdo\\1x&nKGAa",[caseless,
+ <<"Any old stuPffte">> = iolist_to_binary(re:replace("Any old stuff","([\\da-f:]+)$","P&te",[caseless])),
+ <<"Any old stuPffte">> = iolist_to_binary(re:replace("Any old stuff","([\\da-f:]+)$","P&te",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","([\\da-f:]+)$","\\1RRODRx\\1gQSrTrwC",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","([\\da-f:]+)$","\\1RRODRx\\1gQSrTrwC",[caseless,
+ global])),
+ <<"0zzz">> = iolist_to_binary(re:replace("0zzz","([\\da-f:]+)$","C\\1",[caseless])),
+ <<"0zzz">> = iolist_to_binary(re:replace("0zzz","([\\da-f:]+)$","C\\1",[caseless,
+ global])),
+ <<"gzzz">> = iolist_to_binary(re:replace("gzzz","([\\da-f:]+)$","MtJG&NF\\1PgL&gg\\1",[caseless])),
+ <<"gzzz">> = iolist_to_binary(re:replace("gzzz","([\\da-f:]+)$","MtJG&NF\\1PgL&gg\\1",[caseless,
+ global])),
+ <<"fed ">> = iolist_to_binary(re:replace("fed ","([\\da-f:]+)$","yL&WjLe&\\1NC&GCG\\1xD",[caseless])),
+ <<"fed ">> = iolist_to_binary(re:replace("fed ","([\\da-f:]+)$","yL&WjLe&\\1NC&GCG\\1xD",[caseless,
+ global])),
+ <<"Any old rubbish">> = iolist_to_binary(re:replace("Any old rubbish","([\\da-f:]+)$","bJbtPIaR",[caseless])),
+ <<"Any old rubbish">> = iolist_to_binary(re:replace("Any old rubbish","([\\da-f:]+)$","bJbtPIaR",[caseless,
+ global])),
+ <<"T1">> = iolist_to_binary(re:replace(".1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","T\\1",[])),
+ <<"T1">> = iolist_to_binary(re:replace(".1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","T\\1",[global])),
+ <<"dOdvJFA.12.123.012">> = iolist_to_binary(re:replace("A.12.123.0","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","dOdvJF&\\1",[])),
+ <<"dOdvJFA.12.123.012">> = iolist_to_binary(re:replace("A.12.123.0","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","dOdvJF&\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","hLnol",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","hLnol",[global])),
+ <<".1.2.3333">> = iolist_to_binary(re:replace(".1.2.3333","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","fFUsmk\\1Ltx",[])),
+ <<".1.2.3333">> = iolist_to_binary(re:replace(".1.2.3333","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","fFUsmk\\1Ltx",[global])),
+ <<"1.2.3">> = iolist_to_binary(re:replace("1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","v",[])),
+ <<"1.2.3">> = iolist_to_binary(re:replace("1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","v",[global])),
+ <<"1234.2.3">> = iolist_to_binary(re:replace("1234.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","tcSnhlApa",[])),
+ <<"1234.2.3">> = iolist_to_binary(re:replace("1234.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","tcSnhlApa",[global])),
+ <<"rdN">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","rdN",[])),
+ <<"rdN">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","rdN",[global])),
+ <<"1 IN SOA non-sp1 non-sp2 (nPIbyKLvCyOobyW1RC1 IN SOA non-sp1 non-sp2 (">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2 (","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","&nPIbyKLvCyOobyW\\1RC&",[])),
+ <<"1 IN SOA non-sp1 non-sp2 (nPIbyKLvCyOobyW1RC1 IN SOA non-sp1 non-sp2 (">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2 (","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","&nPIbyKLvCyOobyW\\1RC&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","YYlMHXKMT&K\\1w&sJ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","YYlMHXKMT&K\\1w&sJ",[global])),
+ <<"1IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","L\\1nyk",[])),
+ <<"1IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","L\\1nyk",[global])),
+ <<"rnRluS">> = iolist_to_binary(re:replace("a.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","rnRluS",[])),
+ <<"rnRluS">> = iolist_to_binary(re:replace("a.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","rnRluS",[global])),
+ <<"IfUFYgPEDZ.g">> = iolist_to_binary(re:replace("Z.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","IfUFYg\\1P\\1ED&g",[])),
+ <<"IfUFYgPEDZ.g">> = iolist_to_binary(re:replace("Z.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","IfUFYg\\1P\\1ED&g",[global])),
+ <<"hB">> = iolist_to_binary(re:replace("2.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","\\1hB",[])),
+ <<"hB">> = iolist_to_binary(re:replace("2.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","\\1hB",[global])),
+ <<"Lu">> = iolist_to_binary(re:replace("ab-c.pq-r.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Lu",[])),
+ <<"Lu">> = iolist_to_binary(re:replace("ab-c.pq-r.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Lu",[global])),
+ <<"XY">> = iolist_to_binary(re:replace("sxk.zzz.ac.uk.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","XY",[])),
+ <<"XY">> = iolist_to_binary(re:replace("sxk.zzz.ac.uk.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","XY",[global])),
+ <<"AxgSFCHEmS">> = iolist_to_binary(re:replace("x-.y-.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","AxgSFCHEmS",[])),
+ <<"AxgSFCHEmS">> = iolist_to_binary(re:replace("x-.y-.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","AxgSFCHEmS",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","jAGN",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","jAGN",[global])),
+ <<"-abc.peq.">> = iolist_to_binary(re:replace("-abc.peq.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","OL",[])),
+ <<"-abc.peq.">> = iolist_to_binary(re:replace("-abc.peq.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","OL",[global])),
+ <<"utUWVifAF">> = iolist_to_binary(re:replace("*.a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","\\1u\\1t\\1UWVifAF",[])),
+ <<"utUWVifAF">> = iolist_to_binary(re:replace("*.a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","\\1u\\1t\\1UWVifAF",[global])),
+ <<"IG*.b0-a*.b0-aBgtmNURrKatUh*.b0-aGc">> = iolist_to_binary(re:replace("*.b0-a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","IG&&BgtmNURrKatUh&Gc",[])),
+ <<"IG*.b0-a*.b0-aBgtmNURrKatUh*.b0-aGc">> = iolist_to_binary(re:replace("*.b0-a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","IG&&BgtmNURrKatUh&Gc",[global])),
+ <<"Du3-bV*.c3-b.c3-beGytl3-bhNPYv*.c3-b.c3-bM">> = iolist_to_binary(re:replace("*.c3-b.c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","Du\\1V&\\1eGytl\\1hNPYv&\\1M",[])),
+ <<"Du3-bV*.c3-b.c3-beGytl3-bhNPYv*.c3-b.c3-bM">> = iolist_to_binary(re:replace("*.c3-b.c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","Du\\1V&\\1eGytl\\1hNPYv&\\1M",[global])),
+ <<"gImvCJR-a*.c-a.b-cvbRP">> = iolist_to_binary(re:replace("*.c-a.b-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","gImvCJR\\1&vbRP",[])),
+ <<"gImvCJR-a*.c-a.b-cvbRP">> = iolist_to_binary(re:replace("*.c-a.b-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","gImvCJR\\1&vbRP",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","pRl\\1&\\1j&h&ENE&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","pRl\\1&\\1j&h&ENE&",[global])),
+ <<"*.0">> = iolist_to_binary(re:replace("*.0","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","k\\1\\1LrQNL&",[])),
+ <<"*.0">> = iolist_to_binary(re:replace("*.0","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","k\\1\\1LrQNL&",[global])),
+ <<"*.a-">> = iolist_to_binary(re:replace("*.a-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","&IphIN",[])),
+ <<"*.a-">> = iolist_to_binary(re:replace("*.a-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","&IphIN",[global])),
+ <<"*.a-b.c-">> = iolist_to_binary(re:replace("*.a-b.c-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","tUY",[])),
+ <<"*.a-b.c-">> = iolist_to_binary(re:replace("*.a-b.c-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","tUY",[global])),
+ <<"*.c-a.0-c">> = iolist_to_binary(re:replace("*.c-a.0-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","tspwqyti\\1maFJR\\1Vhlja",[])),
+ <<"*.c-a.0-c">> = iolist_to_binary(re:replace("*.c-a.0-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","tspwqyti\\1maFJR\\1Vhlja",[global])),
+ <<"deabdedeYddeBOpd">> = iolist_to_binary(re:replace("abde","^(?=ab(de))(abd)(e)","\\1&\\1Yd\\1BOpd",[])),
+ <<"deabdedeYddeBOpd">> = iolist_to_binary(re:replace("abde","^(?=ab(de))(abd)(e)","\\1&\\1Yd\\1BOpd",[global])),
+ <<"fP">> = iolist_to_binary(re:replace("abdf","^(?!(ab)de|x)(abd)(f)","fP",[])),
+ <<"fP">> = iolist_to_binary(re:replace("abdf","^(?!(ab)de|x)(abd)(f)","fP",[global])),
+ <<"sAabcdabLioGabcdwHabcdgMvvDIcd">> = iolist_to_binary(re:replace("abcd","^(?=(ab(cd)))(ab)","sA\\1&LioG\\1wH\\1gMvvDI",[])),
+ <<"sAabcdabLioGabcdwHabcdgMvvDIcd">> = iolist_to_binary(re:replace("abcd","^(?=(ab(cd)))(ab)","sA\\1&LioG\\1wH\\1gMvvDI",[global])),
+ <<"D">> = iolist_to_binary(re:replace("a.b.c.d","^[\\da-f](\\.[\\da-f])*$","D",[caseless])),
+ <<"D">> = iolist_to_binary(re:replace("a.b.c.d","^[\\da-f](\\.[\\da-f])*$","D",[caseless,
+ global])),
+ <<"ma.Dy.D">> = iolist_to_binary(re:replace("A.B.C.D","^[\\da-f](\\.[\\da-f])*$","ma\\1y\\1",[caseless])),
+ <<"ma.Dy.D">> = iolist_to_binary(re:replace("A.B.C.D","^[\\da-f](\\.[\\da-f])*$","ma\\1y\\1",[caseless,
+ global])),
+ <<"N.CfP.CXXa.b.c.1.2.3.CYyl">> = iolist_to_binary(re:replace("a.b.c.1.2.3.C","^[\\da-f](\\.[\\da-f])*$","N\\1fP\\1XX&Yyl",[caseless])),
+ <<"N.CfP.CXXa.b.c.1.2.3.CYyl">> = iolist_to_binary(re:replace("a.b.c.1.2.3.C","^[\\da-f](\\.[\\da-f])*$","N\\1fP\\1XX&Yyl",[caseless,
+ global])),
+ <<"hoN">> = iolist_to_binary(re:replace("\"1234\"","^\\\".*\\\"\\s*(;.*)?$","hoN",[])),
+ <<"hoN">> = iolist_to_binary(re:replace("\"1234\"","^\\\".*\\\"\\s*(;.*)?$","hoN",[global])),
+ <<"mAGoxP\"abcd\" ;LTrowOqTtkrS">> = iolist_to_binary(re:replace("\"abcd\" ;","^\\\".*\\\"\\s*(;.*)?$","mAGoxP&LTrowOqTtkrS",[])),
+ <<"mAGoxP\"abcd\" ;LTrowOqTtkrS">> = iolist_to_binary(re:replace("\"abcd\" ;","^\\\".*\\\"\\s*(;.*)?$","mAGoxP&LTrowOqTtkrS",[global])),
+ <<"; rhubarb\"\" ; rhubarbACq; rhubarbJhxa; rhubarb">> = iolist_to_binary(re:replace("\"\" ; rhubarb","^\\\".*\\\"\\s*(;.*)?$","\\1&ACq\\1Jhxa\\1",[])),
+ <<"; rhubarb\"\" ; rhubarbACq; rhubarbJhxa; rhubarb">> = iolist_to_binary(re:replace("\"\" ; rhubarb","^\\\".*\\\"\\s*(;.*)?$","\\1&ACq\\1Jhxa\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\\".*\\\"\\s*(;.*)?$","uuJoIhaVnwJ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\\".*\\\"\\s*(;.*)?$","uuJoIhaVnwJ",[global])),
+ <<"\"1234\" : things">> = iolist_to_binary(re:replace("\"1234\" : things","^\\\".*\\\"\\s*(;.*)?$","&",[])),
+ <<"\"1234\" : things">> = iolist_to_binary(re:replace("\"1234\" : things","^\\\".*\\\"\\s*(;.*)?$","&",[global])),
+ <<"IHpbwDeDoVJ">> = iolist_to_binary(re:replace("","^$","IHpbw\\1DeDoV\\1J",[])),
+ <<"IHpbwDeDoVJ">> = iolist_to_binary(re:replace("","^$","IHpbw\\1DeDoV\\1J",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^$","uhGdgAUnWJEF",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^$","uhGdgAUnWJEF",[global])),
+ <<"ab cab cWr">> = iolist_to_binary(re:replace("ab c"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","&&Wr",[extended])),
+ <<"ab cab cWr">> = iolist_to_binary(re:replace("ab c"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","&&Wr",[extended,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","GGresSs\\1Q&yX",[extended])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","GGresSs\\1Q&yX",[extended,
+ global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","li\\1Qy\\1XfY",[extended])),
+ <<"abc">> = iolist_to_binary(re:replace("abc"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","li\\1Qy\\1XfY",[extended,
+ global])),
+ <<"ab cde">> = iolist_to_binary(re:replace("ab cde"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","c\\1H&",[extended])),
+ <<"ab cde">> = iolist_to_binary(re:replace("ab cde"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","c\\1H&",[extended,
+ global])),
+ <<"fGTimsjSab cRab clKbab cn">> = iolist_to_binary(re:replace("ab c","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","\\1fGTimsjS&R&lK\\1b&\\1n",[])),
+ <<"fGTimsjSab cRab clKbab cn">> = iolist_to_binary(re:replace("ab c","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","\\1fGTimsjS&R&lK\\1b&\\1n",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","BiO\\1OITSCrXtQNI\\1Wkc",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","BiO\\1OITSCrXtQNI\\1Wkc",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","myYnx\\1OS\\1DTaa",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","myYnx\\1OS\\1DTaa",[global])),
+ <<"ab cde">> = iolist_to_binary(re:replace("ab cde","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","nJCbPkJnDbYu&SNbC",[])),
+ <<"ab cde">> = iolist_to_binary(re:replace("ab cde","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","nJCbPkJnDbYu&SNbC",[global])),
+ <<"NkFMbyd">> = iolist_to_binary(re:replace("a bcd","^ a\\ b[c ]d $","NkFMbyd",[extended])),
+ <<"NkFMbyd">> = iolist_to_binary(re:replace("a bcd","^ a\\ b[c ]d $","NkFMbyd",[extended,
+ global])),
+ <<"VEOn">> = iolist_to_binary(re:replace("a b d","^ a\\ b[c ]d $","VEOn",[extended])),
+ <<"VEOn">> = iolist_to_binary(re:replace("a b d","^ a\\ b[c ]d $","VEOn",[extended,
global])),
- <<"gzzz">> = iolist_to_binary(re:replace("gzzz","([\\da-f:]+)$","CUmRDqbGoniV\\1",[caseless])),
- <<"gzzz">> = iolist_to_binary(re:replace("gzzz","([\\da-f:]+)$","CUmRDqbGoniV\\1",[caseless,
- global])),
- <<"fed ">> = iolist_to_binary(re:replace("fed ","([\\da-f:]+)$","bMg\\1\\1Smk",[caseless])),
- <<"fed ">> = iolist_to_binary(re:replace("fed ","([\\da-f:]+)$","bMg\\1\\1Smk",[caseless,
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^ a\\ b[c ]d $","aiLS",[extended])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^ a\\ b[c ]d $","aiLS",[extended,
+ global])),
+ <<"abcd">> = iolist_to_binary(re:replace("abcd","^ a\\ b[c ]d $","&TlY\\1\\1J&VFir",[extended])),
+ <<"abcd">> = iolist_to_binary(re:replace("abcd","^ a\\ b[c ]d $","&TlY\\1\\1J&VFir",[extended,
+ global])),
+ <<"ab d">> = iolist_to_binary(re:replace("ab d","^ a\\ b[c ]d $","EPKW",[extended])),
+ <<"ab d">> = iolist_to_binary(re:replace("ab d","^ a\\ b[c ]d $","EPKW",[extended,
global])),
- <<"Any old rubbish">> = iolist_to_binary(re:replace("Any old rubbish","([\\da-f:]+)$","&NxG\\1osbOqKBX\\1UUxiI",[caseless])),
- <<"Any old rubbish">> = iolist_to_binary(re:replace("Any old rubbish","([\\da-f:]+)$","&NxG\\1osbOqKBX\\1UUxiI",[caseless,
- global])),
- <<"xn1t">> = iolist_to_binary(re:replace(".1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","xn\\1t",[])),
- <<"xn1t">> = iolist_to_binary(re:replace(".1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","xn\\1t",[global])),
- <<"xuA.12.123.0pmID">> = iolist_to_binary(re:replace("A.12.123.0","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","xu&pmID",[])),
- <<"xuA.12.123.0pmID">> = iolist_to_binary(re:replace("A.12.123.0","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","xu&pmID",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","p&&t\\1\\1M&oKI",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","p&&t\\1\\1M&oKI",[global])),
- <<".1.2.3333">> = iolist_to_binary(re:replace(".1.2.3333","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","&p",[])),
- <<".1.2.3333">> = iolist_to_binary(re:replace(".1.2.3333","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","&p",[global])),
- <<"1.2.3">> = iolist_to_binary(re:replace("1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","\\1&LbVkk&K&F&b",[])),
- <<"1.2.3">> = iolist_to_binary(re:replace("1.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","\\1&LbVkk&K&F&b",[global])),
- <<"1234.2.3">> = iolist_to_binary(re:replace("1234.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","Paehh\\1",[])),
- <<"1234.2.3">> = iolist_to_binary(re:replace("1234.2.3","^.*\\.(\\d{1,3})\\.(\\d{1,3})\\.(\\d{1,3})$","Paehh\\1",[global])),
- <<"1LAfJBRwFABikGlQ1 IN SOA non-sp1 non-sp2(jE1 IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","\\1LAfJBRwFABikGlQ&jE&",[])),
- <<"1LAfJBRwFABikGlQ1 IN SOA non-sp1 non-sp2(jE1 IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","\\1LAfJBRwFABikGlQ&jE&",[global])),
- <<"vcbW">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2 (","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","vcbW",[])),
- <<"vcbW">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2 (","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","vcbW",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","N",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","N",[global])),
- <<"1IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","F\\1lEQb&&o&c&&",[])),
- <<"1IN SOA non-sp1 non-sp2(">> = iolist_to_binary(re:replace("1IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","F\\1lEQb&&o&c&&",[global])),
- <<"csJqaGLOa.a.Ca.Ma.ja.r">> = iolist_to_binary(re:replace("a.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","c\\1s\\1JqaGLO&&C&M&j&r",[])),
- <<"csJqaGLOa.a.Ca.Ma.ja.r">> = iolist_to_binary(re:replace("a.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","c\\1s\\1JqaGLO&&C&M&j&r",[global])),
- <<"TBVOOLuZ.Y">> = iolist_to_binary(re:replace("Z.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","TBVOO\\1Lu&Y",[])),
- <<"TBVOOLuZ.Y">> = iolist_to_binary(re:replace("Z.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","TBVOO\\1Lu&Y",[global])),
- <<"lAHLHAaNu2.yfAUu">> = iolist_to_binary(re:replace("2.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","lAH\\1LHAaNu\\1&yfAUu",[])),
- <<"lAHLHAaNu2.yfAUu">> = iolist_to_binary(re:replace("2.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","lAH\\1LHAaNu\\1&yfAUu",[global])),
- <<"EKpab-c.pq-r.">> = iolist_to_binary(re:replace("ab-c.pq-r.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","EKp&",[])),
- <<"EKpab-c.pq-r.">> = iolist_to_binary(re:replace("ab-c.pq-r.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","EKp&",[global])),
- <<"Ersxk.zzz.ac.uk.">> = iolist_to_binary(re:replace("sxk.zzz.ac.uk.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Er&",[])),
- <<"Ersxk.zzz.ac.uk.">> = iolist_to_binary(re:replace("sxk.zzz.ac.uk.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Er&",[global])),
- <<"Xqs">> = iolist_to_binary(re:replace("x-.y-.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Xqs",[])),
- <<"Xqs">> = iolist_to_binary(re:replace("x-.y-.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Xqs",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","&DsB",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","&DsB",[global])),
- <<"-abc.peq.">> = iolist_to_binary(re:replace("-abc.peq.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Kqq&&AIru&&FA\\1gbG",[])),
- <<"-abc.peq.">> = iolist_to_binary(re:replace("-abc.peq.","^[a-zA-Z\\d][a-zA-Z\\d\\-]*(\\.[a-zA-Z\\d][a-zA-z\\d\\-]*)*\\.$","Kqq&&AIru&&FA\\1gbG",[global])),
- <<"OmWMM*.acuHiylpsiKq">> = iolist_to_binary(re:replace("*.a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","\\1OmWMM&cuHiylpsiKq",[])),
- <<"OmWMM*.acuHiylpsiKq">> = iolist_to_binary(re:replace("*.a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","\\1OmWMM&cuHiylpsiKq",[global])),
- <<"j0-a0-aXQ">> = iolist_to_binary(re:replace("*.b0-a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","j\\1\\1XQ",[])),
- <<"j0-a0-aXQ">> = iolist_to_binary(re:replace("*.b0-a","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","j\\1\\1XQ",[global])),
- <<"r3-b">> = iolist_to_binary(re:replace("*.c3-b.c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","r\\1",[])),
- <<"r3-b">> = iolist_to_binary(re:replace("*.c3-b.c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","r\\1",[global])),
- <<"EAXRf*.c-a.b-cpOaqRe*.c-a.b-c-a*.c-a.b-cpGer*.c-a.b-c">> = iolist_to_binary(re:replace("*.c-a.b-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","EAXRf&pOaqRe&\\1&pGer&",[])),
- <<"EAXRf*.c-a.b-cpOaqRe*.c-a.b-c-a*.c-a.b-cpGer*.c-a.b-c">> = iolist_to_binary(re:replace("*.c-a.b-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","EAXRf&pOaqRe&\\1&pGer&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","RmO\\1XAOA\\1p",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","RmO\\1XAOA\\1p",[global])),
- <<"*.0">> = iolist_to_binary(re:replace("*.0","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","&&iBqKyU",[])),
- <<"*.0">> = iolist_to_binary(re:replace("*.0","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","&&iBqKyU",[global])),
- <<"*.a-">> = iolist_to_binary(re:replace("*.a-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","sHEtAniwkH&",[])),
- <<"*.a-">> = iolist_to_binary(re:replace("*.a-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","sHEtAniwkH&",[global])),
- <<"*.a-b.c-">> = iolist_to_binary(re:replace("*.a-b.c-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","qy",[])),
- <<"*.a-b.c-">> = iolist_to_binary(re:replace("*.a-b.c-","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","qy",[global])),
- <<"*.c-a.0-c">> = iolist_to_binary(re:replace("*.c-a.0-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","iH\\1J\\1\\1&iul\\1uosFI",[])),
- <<"*.c-a.0-c">> = iolist_to_binary(re:replace("*.c-a.0-c","^\\*\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?(\\.[a-z]([a-z\\-\\d]*[a-z\\d]+)?)*$","iH\\1J\\1\\1&iul\\1uosFI",[global])),
- <<"RW">> = iolist_to_binary(re:replace("abde","^(?=ab(de))(abd)(e)","RW",[])),
- <<"RW">> = iolist_to_binary(re:replace("abde","^(?=ab(de))(abd)(e)","RW",[global])),
- <<"xrNrabdft">> = iolist_to_binary(re:replace("abdf","^(?!(ab)de|x)(abd)(f)","xrNr&t",[])),
- <<"xrNrabdft">> = iolist_to_binary(re:replace("abdf","^(?!(ab)de|x)(abd)(f)","xrNr&t",[global])),
- <<"PaGpuabSCqabcdabababpbcd">> = iolist_to_binary(re:replace("abcd","^(?=(ab(cd)))(ab)","PaGpu&SCq\\1&&&pb",[])),
- <<"PaGpuabSCqabcdabababpbcd">> = iolist_to_binary(re:replace("abcd","^(?=(ab(cd)))(ab)","PaGpu&SCq\\1&&&pb",[global])),
- <<"eB.d.dgKSFa.b.c.dVO">> = iolist_to_binary(re:replace("a.b.c.d","^[\\da-f](\\.[\\da-f])*$","eB\\1\\1gKSF&VO",[caseless])),
- <<"eB.d.dgKSFa.b.c.dVO">> = iolist_to_binary(re:replace("a.b.c.d","^[\\da-f](\\.[\\da-f])*$","eB\\1\\1gKSF&VO",[caseless,
- global])),
- <<"jpA.B.C.D.Dc.DTWA.B.C.Dl.DKIiy">> = iolist_to_binary(re:replace("A.B.C.D","^[\\da-f](\\.[\\da-f])*$","jp&\\1c\\1TW&l\\1KIiy",[caseless])),
- <<"jpA.B.C.D.Dc.DTWA.B.C.Dl.DKIiy">> = iolist_to_binary(re:replace("A.B.C.D","^[\\da-f](\\.[\\da-f])*$","jp&\\1c\\1TW&l\\1KIiy",[caseless,
- global])),
- <<"NToo.Ca.Ca.b.c.1.2.3.C">> = iolist_to_binary(re:replace("a.b.c.1.2.3.C","^[\\da-f](\\.[\\da-f])*$","NToo\\1a\\1&",[caseless])),
- <<"NToo.Ca.Ca.b.c.1.2.3.C">> = iolist_to_binary(re:replace("a.b.c.1.2.3.C","^[\\da-f](\\.[\\da-f])*$","NToo\\1a\\1&",[caseless,
- global])),
- <<"EftEvTFmRH">> = iolist_to_binary(re:replace("\"1234\"","^\\\".*\\\"\\s*(;.*)?$","\\1\\1EftEvTFmRH",[])),
- <<"EftEvTFmRH">> = iolist_to_binary(re:replace("\"1234\"","^\\\".*\\\"\\s*(;.*)?$","\\1\\1EftEvTFmRH",[global])),
- <<"j\"abcd\" ;Hyx\"abcd\" ;QTtQvYM\"abcd\" ;BK">> = iolist_to_binary(re:replace("\"abcd\" ;","^\\\".*\\\"\\s*(;.*)?$","j&Hyx&QTtQvYM&BK",[])),
- <<"j\"abcd\" ;Hyx\"abcd\" ;QTtQvYM\"abcd\" ;BK">> = iolist_to_binary(re:replace("\"abcd\" ;","^\\\".*\\\"\\s*(;.*)?$","j&Hyx&QTtQvYM&BK",[global])),
- <<"nM">> = iolist_to_binary(re:replace("\"\" ; rhubarb","^\\\".*\\\"\\s*(;.*)?$","nM",[])),
- <<"nM">> = iolist_to_binary(re:replace("\"\" ; rhubarb","^\\\".*\\\"\\s*(;.*)?$","nM",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\\".*\\\"\\s*(;.*)?$","oRWmakO\\1L&pj",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\\".*\\\"\\s*(;.*)?$","oRWmakO\\1L&pj",[global])),
- <<"\"1234\" : things">> = iolist_to_binary(re:replace("\"1234\" : things","^\\\".*\\\"\\s*(;.*)?$","kLuRd&B",[])),
- <<"\"1234\" : things">> = iolist_to_binary(re:replace("\"1234\" : things","^\\\".*\\\"\\s*(;.*)?$","kLuRd&B",[global])),
- <<"ixuQHwgCDVra">> = iolist_to_binary(re:replace("","^$","\\1&i\\1x\\1uQHw&\\1&gCDVra",[])),
- <<"ixuQHwgCDVra">> = iolist_to_binary(re:replace("","^$","\\1&i\\1x\\1uQHw&\\1&gCDVra",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^$","Rg\\1SwLH\\1bP\\1&&S\\1Xa\\1S&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^$","Rg\\1SwLH\\1bP\\1&&S\\1Xa\\1S&",[global])),
- <<"bgab cxhab cxfOtXqErdcf">> = iolist_to_binary(re:replace("ab c"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","bg&xh&xfOtXqE\\1rdcf",[extended])),
- <<"bgab cxhab cxfOtXqErdcf">> = iolist_to_binary(re:replace("ab c"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","bg&xh&xfOtXqE\\1rdcf",[extended,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","kltlQqVmioWPcgb\\1",[extended])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","kltlQqVmioWPcgb\\1",[extended,
- global])),
- <<"abc">> = iolist_to_binary(re:replace("abc"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","F\\1FmlIs\\1\\1A&gEMuW",[extended])),
- <<"abc">> = iolist_to_binary(re:replace("abc"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","F\\1FmlIs\\1\\1A&gEMuW",[extended,
- global])),
- <<"ab cde">> = iolist_to_binary(re:replace("ab cde"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","&wqEXOys\\1L",[extended])),
- <<"ab cde">> = iolist_to_binary(re:replace("ab cde"," ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","&wqEXOys\\1L",[extended,
- global])),
- <<"yxGLPQCju">> = iolist_to_binary(re:replace("ab c","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","yxGLPQCju",[])),
- <<"yxGLPQCju">> = iolist_to_binary(re:replace("ab c","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","yxGLPQCju",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","JqU&Xjf\\1JY\\1c",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","JqU&Xjf\\1JY\\1c",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","ASnRhMlmWOb\\1Y&&",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","ASnRhMlmWOb\\1Y&&",[global])),
- <<"ab cde">> = iolist_to_binary(re:replace("ab cde","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","QcD",[])),
- <<"ab cde">> = iolist_to_binary(re:replace("ab cde","(?x) ^ a (?# begins with a) b\\sc (?# then b c) $ (?# then end)","QcD",[global])),
- <<"yao">> = iolist_to_binary(re:replace("a bcd","^ a\\ b[c ]d $","\\1yao",[extended])),
- <<"yao">> = iolist_to_binary(re:replace("a bcd","^ a\\ b[c ]d $","\\1yao",[extended,
- global])),
- <<"TrwOQA">> = iolist_to_binary(re:replace("a b d","^ a\\ b[c ]d $","TrwOQA",[extended])),
- <<"TrwOQA">> = iolist_to_binary(re:replace("a b d","^ a\\ b[c ]d $","TrwOQA",[extended,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^ a\\ b[c ]d $","&rUS&afjjm&",[extended])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^ a\\ b[c ]d $","&rUS&afjjm&",[extended,
- global])),
- <<"abcd">> = iolist_to_binary(re:replace("abcd","^ a\\ b[c ]d $","L&XB\\1P",[extended])),
- <<"abcd">> = iolist_to_binary(re:replace("abcd","^ a\\ b[c ]d $","L&XB\\1P",[extended,
- global])),
- <<"ab d">> = iolist_to_binary(re:replace("ab d","^ a\\ b[c ]d $","UMS&\\1tPBWwogPDQ&",[extended])),
- <<"ab d">> = iolist_to_binary(re:replace("ab d","^ a\\ b[c ]d $","UMS&\\1tPBWwogPDQ&",[extended,
- global])),
- <<"xToOqchxqabch">> = iolist_to_binary(re:replace("abcdefhijklm","^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$","xToOqchxq\\1h",[])),
- <<"xToOqchxqabch">> = iolist_to_binary(re:replace("abcdefhijklm","^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$","xToOqchxq\\1h",[global])),
+ <<"JabcdefhijklmSJtCtOhgCabcbabce">> = iolist_to_binary(re:replace("abcdefhijklm","^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$","J&SJtCtOhgC\\1b\\1e",[])),
+ <<"JabcdefhijklmSJtCtOhgCabcbabce">> = iolist_to_binary(re:replace("abcdefhijklm","^(a(b(c)))(d(e(f)))(h(i(j)))(k(l(m)))$","J&SJtCtOhgC\\1b\\1e",[global])),
ok.
run2() ->
- <<"LpAcLI">> = iolist_to_binary(re:replace("abcdefhijklm","^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$","LpAcLI",[])),
- <<"LpAcLI">> = iolist_to_binary(re:replace("abcdefhijklm","^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$","LpAcLI",[global])),
- <<"MFa+ Z0+
-QQ">> = iolist_to_binary(re:replace("a+ Z0+
-","^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]","MF\\1&QQ",[])),
- <<"MFa+ Z0+
-QQ">> = iolist_to_binary(re:replace("a+ Z0+
-","^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]","MF\\1&QQ",[global])),
- <<".^$(*+)|{?,?}.^$(*+)|{?,?}suXo">> = iolist_to_binary(re:replace(".^$(*+)|{?,?}","^[.^$|()*+?{,}]+","&&s\\1uX\\1o",[])),
- <<".^$(*+)|{?,?}.^$(*+)|{?,?}suXo">> = iolist_to_binary(re:replace(".^$(*+)|{?,?}","^[.^$|()*+?{,}]+","&&s\\1uX\\1o",[global])),
- <<"KDgPpAUcYEXSK">> = iolist_to_binary(re:replace("z","^a*\\w","KDgP\\1pAUcYEX\\1SK",[])),
- <<"KDgPpAUcYEXSK">> = iolist_to_binary(re:replace("z","^a*\\w","KDgP\\1pAUcYEX\\1SK",[global])),
- <<"slipoLkQ">> = iolist_to_binary(re:replace("az","^a*\\w","slipoLkQ",[])),
- <<"slipoLkQ">> = iolist_to_binary(re:replace("az","^a*\\w","slipoLkQ",[global])),
- <<"ritcgAWBT">> = iolist_to_binary(re:replace("aaaz","^a*\\w","ritcgAWBT",[])),
- <<"ritcgAWBT">> = iolist_to_binary(re:replace("aaaz","^a*\\w","ritcgAWBT",[global])),
- <<"XcRsWQyYNjiYwb">> = iolist_to_binary(re:replace("a","^a*\\w","X\\1cRsWQyYNjiYwb",[])),
- <<"XcRsWQyYNjiYwb">> = iolist_to_binary(re:replace("a","^a*\\w","X\\1cRsWQyYNjiYwb",[global])),
- <<"MaaFKe">> = iolist_to_binary(re:replace("aa","^a*\\w","M&F\\1\\1K\\1e",[])),
- <<"MaaFKe">> = iolist_to_binary(re:replace("aa","^a*\\w","M&F\\1\\1K\\1e",[global])),
- <<"h">> = iolist_to_binary(re:replace("aaaa","^a*\\w","h",[])),
- <<"h">> = iolist_to_binary(re:replace("aaaa","^a*\\w","h",[global])),
- <<"qYN+">> = iolist_to_binary(re:replace("a+","^a*\\w","qYN",[])),
- <<"qYN+">> = iolist_to_binary(re:replace("a+","^a*\\w","qYN",[global])),
- <<"EfVPxKaaaaewBXaaaawUW+">> = iolist_to_binary(re:replace("aa+","^a*\\w","EfVPx\\1K&&ewBX&&wUW",[])),
- <<"EfVPxKaaaaewBXaaaawUW+">> = iolist_to_binary(re:replace("aa+","^a*\\w","EfVPx\\1K&&ewBX&&wUW",[global])),
- <<"hslzzPMpWzzIkdYL">> = iolist_to_binary(re:replace("z","^a*?\\w","hsl&&PMpW&&I\\1kdYL",[])),
- <<"hslzzPMpWzzIkdYL">> = iolist_to_binary(re:replace("z","^a*?\\w","hsl&&PMpW&&I\\1kdYL",[global])),
- <<"RBz">> = iolist_to_binary(re:replace("az","^a*?\\w","R\\1B",[])),
- <<"RBz">> = iolist_to_binary(re:replace("az","^a*?\\w","R\\1B",[global])),
- <<"IvEhVdavyqnaaz">> = iolist_to_binary(re:replace("aaaz","^a*?\\w","IvEhVd&vy\\1qn",[])),
- <<"IvEhVdavyqnaaz">> = iolist_to_binary(re:replace("aaaz","^a*?\\w","IvEhVd&vy\\1qn",[global])),
- <<"JnVaaH">> = iolist_to_binary(re:replace("a","^a*?\\w","JnV&&\\1H\\1",[])),
- <<"JnVaaH">> = iolist_to_binary(re:replace("a","^a*?\\w","JnV&&\\1H\\1",[global])),
- <<"JFfVUa">> = iolist_to_binary(re:replace("aa","^a*?\\w","\\1J\\1FfVU",[])),
- <<"JFfVUa">> = iolist_to_binary(re:replace("aa","^a*?\\w","\\1J\\1FfVU",[global])),
- <<"aDPvxaYarvWrRabShaHaaa">> = iolist_to_binary(re:replace("aaaa","^a*?\\w","aDPvx&Y&rvWrR&bShaH",[])),
- <<"aDPvxaYarvWrRabShaHaaa">> = iolist_to_binary(re:replace("aaaa","^a*?\\w","aDPvx&Y&rvWrR&bShaH",[global])),
- <<"Aih+">> = iolist_to_binary(re:replace("a+","^a*?\\w","Ai\\1h",[])),
- <<"Aih+">> = iolist_to_binary(re:replace("a+","^a*?\\w","Ai\\1h",[global])),
- <<"xbMsOXBdaaAa+">> = iolist_to_binary(re:replace("aa+","^a*?\\w","xbMsOXBd&&A",[])),
- <<"xbMsOXBdaaAa+">> = iolist_to_binary(re:replace("aa+","^a*?\\w","xbMsOXBd&&A",[global])),
- <<"azvPASpIqMtrikazJ">> = iolist_to_binary(re:replace("az","^a+\\w","&vPASpIq\\1Mt\\1r\\1ik&J",[])),
- <<"azvPASpIqMtrikazJ">> = iolist_to_binary(re:replace("az","^a+\\w","&vPASpIq\\1Mt\\1r\\1ik&J",[global])),
- <<"ofnsOlLLpmuNPiXJE">> = iolist_to_binary(re:replace("aaaz","^a+\\w","ofnsOlLLpmuNPiXJE",[])),
- <<"ofnsOlLLpmuNPiXJE">> = iolist_to_binary(re:replace("aaaz","^a+\\w","ofnsOlLLpmuNPiXJE",[global])),
- <<"baaDpxe">> = iolist_to_binary(re:replace("aa","^a+\\w","b&D\\1pxe",[])),
- <<"baaDpxe">> = iolist_to_binary(re:replace("aa","^a+\\w","b&D\\1pxe",[global])),
- <<"blkOVluqr">> = iolist_to_binary(re:replace("aaaa","^a+\\w","b\\1lkOV\\1luqr",[])),
- <<"blkOVluqr">> = iolist_to_binary(re:replace("aaaa","^a+\\w","b\\1lkOV\\1luqr",[global])),
- <<"RNRBD+">> = iolist_to_binary(re:replace("aa+","^a+\\w","RNRBD",[])),
- <<"RNRBD+">> = iolist_to_binary(re:replace("aa+","^a+\\w","RNRBD",[global])),
- <<"CyazerWDQaNazazxDT">> = iolist_to_binary(re:replace("az","^a+?\\w","Cy&\\1erWDQaN&&xDT\\1",[])),
- <<"CyazerWDQaNazazxDT">> = iolist_to_binary(re:replace("az","^a+?\\w","Cy&\\1erWDQaN&&xDT\\1",[global])),
- <<"pqJrRaaNRaz">> = iolist_to_binary(re:replace("aaaz","^a+?\\w","pq\\1J\\1rR&NR",[])),
- <<"pqJrRaaNRaz">> = iolist_to_binary(re:replace("aaaz","^a+?\\w","pq\\1J\\1rR&NR",[global])),
- <<"aaAdj">> = iolist_to_binary(re:replace("aa","^a+?\\w","&Ad\\1j",[])),
- <<"aaAdj">> = iolist_to_binary(re:replace("aa","^a+?\\w","&Ad\\1j",[global])),
- <<"JsRWaaEHmuaaFaaArLaNaaaa">> = iolist_to_binary(re:replace("aaaa","^a+?\\w","JsRW&EHmu&F&\\1ArLaN&",[])),
- <<"JsRWaaEHmuaaFaaArLaNaaaa">> = iolist_to_binary(re:replace("aaaa","^a+?\\w","JsRW&EHmu&F&\\1ArLaN&",[global])),
- <<"hQmeo+">> = iolist_to_binary(re:replace("aa+","^a+?\\w","hQmeo",[])),
- <<"hQmeo+">> = iolist_to_binary(re:replace("aa+","^a+?\\w","hQmeo",[global])),
- <<"tSwgJd1234567890">> = iolist_to_binary(re:replace("1234567890","^\\d{8}\\w{2,}","tSwgJd&",[])),
- <<"tSwgJd1234567890">> = iolist_to_binary(re:replace("1234567890","^\\d{8}\\w{2,}","tSwgJd&",[global])),
- <<"u">> = iolist_to_binary(re:replace("12345678ab","^\\d{8}\\w{2,}","u",[])),
- <<"u">> = iolist_to_binary(re:replace("12345678ab","^\\d{8}\\w{2,}","u",[global])),
- <<"12345678__JvTBhjF">> = iolist_to_binary(re:replace("12345678__","^\\d{8}\\w{2,}","&JvTBhj\\1F",[])),
- <<"12345678__JvTBhjF">> = iolist_to_binary(re:replace("12345678__","^\\d{8}\\w{2,}","&JvTBhj\\1F",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8}\\w{2,}","JQw&GNCBooSB",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8}\\w{2,}","JQw&GNCBooSB",[global])),
- <<"1234567">> = iolist_to_binary(re:replace("1234567","^\\d{8}\\w{2,}","oTp&mFd\\1",[])),
- <<"1234567">> = iolist_to_binary(re:replace("1234567","^\\d{8}\\w{2,}","oTp&mFd\\1",[global])),
- <<"truoieVC">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}$","tr&V\\1\\1C",[])),
- <<"truoieVC">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}$","tr&V\\1\\1C",[global])),
- <<"SIBB1234a">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}$","SIBB\\1&a",[])),
- <<"SIBB1234a">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}$","SIBB\\1&a",[global])),
- <<"12345KiNQWVML12345HyU">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}$","&KiN\\1QWVML&HyU",[])),
- <<"12345KiNQWVML12345HyU">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}$","&KiN\\1QWVML&HyU",[global])),
- <<"hxENo">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}$","\\1hxENo\\1",[])),
- <<"hxENo">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}$","\\1hxENo\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[aeiou\\d]{4,5}$","h&RGpLB\\1hlS&pk\\1&yKh",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[aeiou\\d]{4,5}$","h&RGpLB\\1hlS&pk\\1&yKh",[global])),
- <<"123456">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}$","&\\1rrEfxa\\1mc",[])),
- <<"123456">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}$","&\\1rrEfxa\\1mc",[global])),
- <<"hJscruoieFbuoie">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}?","hJs\\1cr&Fb&",[])),
- <<"hJscruoieFbuoie">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}?","hJs\\1cr&Fb&",[global])),
- <<"OK12341234bV">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}?","OK&&bV",[])),
- <<"OK12341234bV">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}?","OK&&bV",[global])),
- <<"g5">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}?","g\\1",[])),
- <<"g5">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}?","g\\1",[global])),
- <<"MKbLkaaaajjoeeykaaaaa">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}?","MKbLk&jjoeeyk&",[])),
- <<"MKbLkaaaajjoeeykaaaaa">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}?","MKbLk&jjoeeyk&",[global])),
- <<"qExB1234GQ56">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}?","qExB&GQ",[])),
- <<"qExB1234GQ56">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}?","qExB&GQ",[global])),
- <<"abc=abcabcshRMauJabceabcMabcvDjywabcw">> = iolist_to_binary(re:replace("abc=abcabc","\\A(abc|def)=(\\1){2,3}\\Z","&shRMauJ\\1e\\1M\\1vDjyw\\1w",[])),
- <<"abc=abcabcshRMauJabceabcMabcvDjywabcw">> = iolist_to_binary(re:replace("abc=abcabc","\\A(abc|def)=(\\1){2,3}\\Z","&shRMauJ\\1e\\1M\\1vDjyw\\1w",[global])),
- <<"def=defdefdefM">> = iolist_to_binary(re:replace("def=defdefdef","\\A(abc|def)=(\\1){2,3}\\Z","&M",[])),
- <<"def=defdefdefM">> = iolist_to_binary(re:replace("def=defdefdef","\\A(abc|def)=(\\1){2,3}\\Z","&M",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\A(abc|def)=(\\1){2,3}\\Z","\\1ums",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\A(abc|def)=(\\1){2,3}\\Z","\\1ums",[global])),
- <<"abc=defdef">> = iolist_to_binary(re:replace("abc=defdef","\\A(abc|def)=(\\1){2,3}\\Z","DkIJLD&Cwg&\\1kq&tsp&&",[])),
- <<"abc=defdef">> = iolist_to_binary(re:replace("abc=defdef","\\A(abc|def)=(\\1){2,3}\\Z","DkIJLD&Cwg&\\1kq&tsp&&",[global])),
- <<"uaahabcdefghijkcda2aqkRJhtVuiyWJaG">> = iolist_to_binary(re:replace("abcdefghijkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","u\\1ah&\\1qkRJhtVuiyWJaG",[])),
- <<"uaahabcdefghijkcda2aqkRJhtVuiyWJaG">> = iolist_to_binary(re:replace("abcdefghijkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","u\\1ah&\\1qkRJhtVuiyWJaG",[global])),
- <<"lBSDdJXabcdefghijkkkkcda2DPEXjc">> = iolist_to_binary(re:replace("abcdefghijkkkkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","lBSDdJX&DPEXjc",[])),
- <<"lBSDdJXabcdefghijkkkkcda2DPEXjc">> = iolist_to_binary(re:replace("abcdefghijkkkkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","lBSDdJX&DPEXjc",[global])),
- <<"tEYloj">> = iolist_to_binary(re:replace("cataract cataract23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","tEYloj",[])),
- <<"tEYloj">> = iolist_to_binary(re:replace("cataract cataract23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","tEYloj",[global])),
- <<"catatonic catatonic23HiXcatatonic catatonic23">> = iolist_to_binary(re:replace("catatonic catatonic23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","&HiX&",[])),
- <<"catatonic catatonic23HiXcatatonic catatonic23">> = iolist_to_binary(re:replace("catatonic catatonic23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","&HiX&",[global])),
- <<"EtmqcaterpillarvtVmieDAa">> = iolist_to_binary(re:replace("caterpillar caterpillar23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","Etmq\\1vtVmieDAa",[])),
- <<"EtmqcaterpillarvtVmieDAa">> = iolist_to_binary(re:replace("caterpillar caterpillar23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","Etmq\\1vtVmieDAa",[global])),
- <<"rFrom abcd Mon Sep 01 12:33aThFrom abcd Mon Sep 01 12:33rJabcd:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]","r&aTh&rJ\\1",[])),
- <<"rFrom abcd Mon Sep 01 12:33aThFrom abcd Mon Sep 01 12:33rJabcd:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]","r&aTh&rJ\\1",[global])),
- <<"tKjeGYi:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","tKjeGYi",[])),
- <<"tKjeGYi:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","tKjeGYi",[global])),
- <<"From abcd Mon Sep 1 12:33Sep WqBFrom abcd Mon Sep 1 12:33UFrom abcd Mon Sep 1 12:33MHUFrom abcd Mon Sep 1 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 1 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","&\\1WqB&U&MHU&",[])),
- <<"From abcd Mon Sep 1 12:33Sep WqBFrom abcd Mon Sep 1 12:33UFrom abcd Mon Sep 1 12:33MHUFrom abcd Mon Sep 1 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 1 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","&\\1WqB&U&MHU&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","RWw&\\1f",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","RWw&\\1f",[global])),
- <<"From abcd Sep 01 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","lDKNKPmMpd",[])),
- <<"From abcd Sep 01 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","lDKNKPmMpd",[global])),
- <<"eNnWbKP">> = iolist_to_binary(re:replace("12
-34","^12.34","eNnWbK\\1P",[dotall])),
- <<"eNnWbKP">> = iolist_to_binary(re:replace("12
-34","^12.34","eNnWbK\\1P",[dotall,global])),
- <<"fI12 34N">> = iolist_to_binary(re:replace("12 34","^12.34","fI&N\\1",[dotall])),
- <<"fI12 34N">> = iolist_to_binary(re:replace("12 34","^12.34","fI&N\\1",[dotall,
- global])),
- <<"the quick jmlgbrownfrbrownIaXThxdySok fox">> = iolist_to_binary(re:replace("the quick brown fox","\\w+(?=\\t)","j\\1mlg&fr&IaXThxdySok",[])),
- <<"the quick jmlgbrownfrbrownIaXThxdySok fox">> = iolist_to_binary(re:replace("the quick brown fox","\\w+(?=\\t)","j\\1mlg&fr&IaXThxdySok",[global])),
- <<"foobar is vjQvQsKSfoolish see?cmTPlish see?DB">> = iolist_to_binary(re:replace("foobar is foolish see?","foo(?!bar)(.*)","vjQvQsKS&cmTP\\1DB",[])),
- <<"foobar is vjQvQsKSfoolish see?cmTPlish see?DB">> = iolist_to_binary(re:replace("foobar is foolish see?","foo(?!bar)(.*)","vjQvQsKS&cmTP\\1DB",[global])),
- <<"foobar cGBmrowbar etcrowbar etcxPCf etc">> = iolist_to_binary(re:replace("foobar crowbar etc","(?:(?!foo)...|^.{0,2})bar(.*)","GBm&&xPCf\\1",[])),
- <<"foobar cGBmrowbar etcrowbar etcxPCf etc">> = iolist_to_binary(re:replace("foobar crowbar etc","(?:(?!foo)...|^.{0,2})bar(.*)","GBm&&xPCf\\1",[global])),
- <<"GDErP">> = iolist_to_binary(re:replace("barrel","(?:(?!foo)...|^.{0,2})bar(.*)","GDErP",[])),
- <<"GDErP">> = iolist_to_binary(re:replace("barrel","(?:(?!foo)...|^.{0,2})bar(.*)","GDErP",[global])),
- <<"VFDc2barrelqsDrelRKrelbMVIi2barrelb2barrel">> = iolist_to_binary(re:replace("2barrel","(?:(?!foo)...|^.{0,2})bar(.*)","VFDc&qsD\\1RK\\1bMVIi&b&",[])),
- <<"VFDc2barrelqsDrelRKrelbMVIi2barrelb2barrel">> = iolist_to_binary(re:replace("2barrel","(?:(?!foo)...|^.{0,2})bar(.*)","VFDc&qsD\\1RK\\1bMVIi&b&",[global])),
- <<"DreltMOOKlgrelMMOgA barrel">> = iolist_to_binary(re:replace("A barrel","(?:(?!foo)...|^.{0,2})bar(.*)","D\\1tMOOKlg\\1MMOg&",[])),
- <<"DreltMOOKlgrelMMOgA barrel">> = iolist_to_binary(re:replace("A barrel","(?:(?!foo)...|^.{0,2})bar(.*)","D\\1tMOOKlg\\1MMOg&",[global])),
- <<"DiLKve456">> = iolist_to_binary(re:replace("abc456","^(\\D*)(?=\\d)(?!123)","DiLKve",[])),
- <<"DiLKve456">> = iolist_to_binary(re:replace("abc456","^(\\D*)(?=\\d)(?!123)","DiLKve",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","BTbC",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","BTbC",[global])),
- <<"abc123">> = iolist_to_binary(re:replace("abc123","^(\\D*)(?=\\d)(?!123)","DJbM\\1wLxB\\1J&&H\\1&uHc",[])),
- <<"abc123">> = iolist_to_binary(re:replace("abc123","^(\\D*)(?=\\d)(?!123)","DJbM\\1wLxB\\1J&&H\\1&uHc",[global])),
+ <<"vbcbcFLoswabcdefhijklmAEBTabcdefhijklmLxgR">> = iolist_to_binary(re:replace("abcdefhijklm","^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$","v\\1\\1FLosw&AEBT&LxgR",[])),
+ <<"vbcbcFLoswabcdefhijklmAEBTabcdefhijklmLxgR">> = iolist_to_binary(re:replace("abcdefhijklm","^(?:a(b(c)))(?:d(e(f)))(?:h(i(j)))(?:k(l(m)))$","v\\1\\1FLosw&AEBT&LxgR",[global])),
+ <<"rfhXDTtoGIitUa+ Z0+
+aq">> = iolist_to_binary(re:replace("a+ Z0+
+","^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]","rf\\1hXDT\\1toGIitU&aq",[])),
+ <<"rfhXDTtoGIitUa+ Z0+
+aq">> = iolist_to_binary(re:replace("a+ Z0+
+","^[\\w][\\W][\\s][\\S][\\d][\\D][\\b][\\n][\\c]][\\022]","rf\\1hXDT\\1toGIitU&aq",[global])),
+ <<"CU.^$(*+)|{?,?}">> = iolist_to_binary(re:replace(".^$(*+)|{?,?}","^[.^$|()*+?{,}]+","CU\\1&",[])),
+ <<"CU.^$(*+)|{?,?}">> = iolist_to_binary(re:replace(".^$(*+)|{?,?}","^[.^$|()*+?{,}]+","CU\\1&",[global])),
+ <<"YBmuTIAl">> = iolist_to_binary(re:replace("z","^a*\\w","YBmuTIAl",[])),
+ <<"YBmuTIAl">> = iolist_to_binary(re:replace("z","^a*\\w","YBmuTIAl",[global])),
+ <<"oQyLlPbDtbyg">> = iolist_to_binary(re:replace("az","^a*\\w","oQyLlP\\1\\1bDt\\1by\\1g",[])),
+ <<"oQyLlPbDtbyg">> = iolist_to_binary(re:replace("az","^a*\\w","oQyLlP\\1\\1bDt\\1by\\1g",[global])),
+ <<"mWdReExiMyALqM">> = iolist_to_binary(re:replace("aaaz","^a*\\w","mWdReExiMyALqM",[])),
+ <<"mWdReExiMyALqM">> = iolist_to_binary(re:replace("aaaz","^a*\\w","mWdReExiMyALqM",[global])),
+ <<"YxwJd">> = iolist_to_binary(re:replace("a","^a*\\w","Yx\\1wJd",[])),
+ <<"YxwJd">> = iolist_to_binary(re:replace("a","^a*\\w","Yx\\1wJd",[global])),
+ <<"WrOXRQ">> = iolist_to_binary(re:replace("aa","^a*\\w","WrOXRQ\\1",[])),
+ <<"WrOXRQ">> = iolist_to_binary(re:replace("aa","^a*\\w","WrOXRQ\\1",[global])),
+ <<"IUtgwPFjpaaaaax">> = iolist_to_binary(re:replace("aaaa","^a*\\w","IUtgwPFjp&ax",[])),
+ <<"IUtgwPFjpaaaaax">> = iolist_to_binary(re:replace("aaaa","^a*\\w","IUtgwPFjp&ax",[global])),
+ <<"CmcxaBmvbENiCdje+">> = iolist_to_binary(re:replace("a+","^a*\\w","Cmcx&BmvbENiCdje\\1",[])),
+ <<"CmcxaBmvbENiCdje+">> = iolist_to_binary(re:replace("a+","^a*\\w","Cmcx&BmvbENiCdje\\1",[global])),
+ <<"ppr+">> = iolist_to_binary(re:replace("aa+","^a*\\w","ppr",[])),
+ <<"ppr+">> = iolist_to_binary(re:replace("aa+","^a*\\w","ppr",[global])),
+ <<"PzqITvYUDMzBNhfmHb">> = iolist_to_binary(re:replace("z","^a*?\\w","P&qITvYUDM\\1&BNhfm\\1Hb",[])),
+ <<"PzqITvYUDMzBNhfmHb">> = iolist_to_binary(re:replace("z","^a*?\\w","P&qITvYUDM\\1&BNhfm\\1Hb",[global])),
+ <<"xjz">> = iolist_to_binary(re:replace("az","^a*?\\w","\\1xj",[])),
+ <<"xjz">> = iolist_to_binary(re:replace("az","^a*?\\w","\\1xj",[global])),
+ <<"nSGvgEaaz">> = iolist_to_binary(re:replace("aaaz","^a*?\\w","nSGvgE",[])),
+ <<"nSGvgEaaz">> = iolist_to_binary(re:replace("aaaz","^a*?\\w","nSGvgE",[global])),
+ <<"akBYqdpnDpF">> = iolist_to_binary(re:replace("a","^a*?\\w","\\1&\\1kBYqdpnDpF",[])),
+ <<"akBYqdpnDpF">> = iolist_to_binary(re:replace("a","^a*?\\w","\\1&\\1kBYqdpnDpF",[global])),
+ <<"aWWhBaca">> = iolist_to_binary(re:replace("aa","^a*?\\w","aWWhB&c",[])),
+ <<"aWWhBaca">> = iolist_to_binary(re:replace("aa","^a*?\\w","aWWhB&c",[global])),
+ <<"EVKLmPxhaadNVCaaa">> = iolist_to_binary(re:replace("aaaa","^a*?\\w","EVKLmPxh&&dNVC\\1",[])),
+ <<"EVKLmPxhaadNVCaaa">> = iolist_to_binary(re:replace("aaaa","^a*?\\w","EVKLmPxh&&dNVC\\1",[global])),
+ <<"ue+">> = iolist_to_binary(re:replace("a+","^a*?\\w","u\\1e",[])),
+ <<"ue+">> = iolist_to_binary(re:replace("a+","^a*?\\w","u\\1e",[global])),
+ <<"xa+">> = iolist_to_binary(re:replace("aa+","^a*?\\w","x",[])),
+ <<"xa+">> = iolist_to_binary(re:replace("aa+","^a*?\\w","x",[global])),
+ <<"mtSazhiAQKFcLgcy">> = iolist_to_binary(re:replace("az","^a+\\w","mtS&hiAQK\\1FcLgcy",[])),
+ <<"mtSazhiAQKFcLgcy">> = iolist_to_binary(re:replace("az","^a+\\w","mtS&hiAQK\\1FcLgcy",[global])),
+ <<"aaazLYLsP">> = iolist_to_binary(re:replace("aaaz","^a+\\w","&LY\\1LsP",[])),
+ <<"aaazLYLsP">> = iolist_to_binary(re:replace("aaaz","^a+\\w","&LY\\1LsP",[global])),
+ <<"JWV">> = iolist_to_binary(re:replace("aa","^a+\\w","JWV",[])),
+ <<"JWV">> = iolist_to_binary(re:replace("aa","^a+\\w","JWV",[global])),
+ <<"GHYCIRYhTaaaaYk">> = iolist_to_binary(re:replace("aaaa","^a+\\w","GHYC\\1IR\\1YhT&Yk",[])),
+ <<"GHYCIRYhTaaaaYk">> = iolist_to_binary(re:replace("aaaa","^a+\\w","GHYC\\1IR\\1YhT&Yk",[global])),
+ <<"qWLubkoR+">> = iolist_to_binary(re:replace("aa+","^a+\\w","qWLubkoR",[])),
+ <<"qWLubkoR+">> = iolist_to_binary(re:replace("aa+","^a+\\w","qWLubkoR",[global])),
+ <<"QgHtshICxVl">> = iolist_to_binary(re:replace("az","^a+?\\w","QgHt\\1shI\\1CxVl",[])),
+ <<"QgHtshICxVl">> = iolist_to_binary(re:replace("az","^a+?\\w","QgHt\\1shI\\1CxVl",[global])),
+ <<"QAUTaz">> = iolist_to_binary(re:replace("aaaz","^a+?\\w","QAUT",[])),
+ <<"QAUTaz">> = iolist_to_binary(re:replace("aaaz","^a+?\\w","QAUT",[global])),
+ <<"aaNKKDqaaXXJvkgaathj">> = iolist_to_binary(re:replace("aa","^a+?\\w","&NKKDq&XXJvkg&thj",[])),
+ <<"aaNKKDqaaXXJvkgaathj">> = iolist_to_binary(re:replace("aa","^a+?\\w","&NKKDq&XXJvkg&thj",[global])),
+ <<"paajyaNtcaa">> = iolist_to_binary(re:replace("aaaa","^a+?\\w","p\\1&jyaNtc",[])),
+ <<"paajyaNtcaa">> = iolist_to_binary(re:replace("aaaa","^a+?\\w","p\\1&jyaNtc",[global])),
+ <<"eKfjhSmMfKaaaap+">> = iolist_to_binary(re:replace("aa+","^a+?\\w","eKfjhSmMfK&&p",[])),
+ <<"eKfjhSmMfKaaaap+">> = iolist_to_binary(re:replace("aa+","^a+?\\w","eKfjhSmMfK&&p",[global])),
+ <<"fqmX1234567890KYJD1234567890dLdQYNvF12345678901234567890">> = iolist_to_binary(re:replace("1234567890","^\\d{8}\\w{2,}","fqmX&KYJD&dLdQYNvF&&",[])),
+ <<"fqmX1234567890KYJD1234567890dLdQYNvF12345678901234567890">> = iolist_to_binary(re:replace("1234567890","^\\d{8}\\w{2,}","fqmX&KYJD&dLdQYNvF&&",[global])),
+ <<"GNln">> = iolist_to_binary(re:replace("12345678ab","^\\d{8}\\w{2,}","G\\1Nln",[])),
+ <<"GNln">> = iolist_to_binary(re:replace("12345678ab","^\\d{8}\\w{2,}","G\\1Nln",[global])),
+ <<"F12345678__LL12345678__JU12345678__IbAQiv12345678__D">> = iolist_to_binary(re:replace("12345678__","^\\d{8}\\w{2,}","F&LL&JU&IbAQi\\1v&D",[])),
+ <<"F12345678__LL12345678__JU12345678__IbAQiv12345678__D">> = iolist_to_binary(re:replace("12345678__","^\\d{8}\\w{2,}","F&LL&JU&IbAQi\\1v&D",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8}\\w{2,}","iStSHxD&bBUiQjj",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8}\\w{2,}","iStSHxD&bBUiQjj",[global])),
+ <<"1234567">> = iolist_to_binary(re:replace("1234567","^\\d{8}\\w{2,}","EEa",[])),
+ <<"1234567">> = iolist_to_binary(re:replace("1234567","^\\d{8}\\w{2,}","EEa",[global])),
+ <<"uoieprPRCuoie">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}$","&pr\\1PRC&",[])),
+ <<"uoieprPRCuoie">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}$","&pr\\1PRC&",[global])),
+ <<"a1234xXJ1234G1234">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}$","a&xXJ&G&",[])),
+ <<"a1234xXJ1234G1234">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}$","a&xXJ&G&",[global])),
+ <<"GtEhJ12345l">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}$","GtEhJ&l",[])),
+ <<"GtEhJ12345l">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}$","GtEhJ&l",[global])),
+ <<"bJBYcRNEc">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}$","bJBYc\\1RNEc",[])),
+ <<"bJBYcRNEc">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}$","bJBYc\\1RNEc",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[aeiou\\d]{4,5}$","\\1CbAy&Gejrv&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[aeiou\\d]{4,5}$","\\1CbAy&Gejrv&",[global])),
+ <<"123456">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}$","&ftepSatEwgqIL",[])),
+ <<"123456">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}$","&ftepSatEwgqIL",[global])),
+ <<"kJipvPhUNA">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}?","k\\1\\1JipvPhUNA",[])),
+ <<"kJipvPhUNA">> = iolist_to_binary(re:replace("uoie","^[aeiou\\d]{4,5}?","k\\1\\1JipvPhUNA",[global])),
+ <<"yXeJ1234spOtaDGQEa">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}?","yXeJ\\1&spOtaDGQ\\1E\\1a",[])),
+ <<"yXeJ1234spOtaDGQEa">> = iolist_to_binary(re:replace("1234","^[aeiou\\d]{4,5}?","yXeJ\\1&spOtaDGQ\\1E\\1a",[global])),
+ <<"otWuaaL12341234F1234Ej5">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}?","otWuaaL&&F&E\\1\\1j",[])),
+ <<"otWuaaL12341234F1234Ej5">> = iolist_to_binary(re:replace("12345","^[aeiou\\d]{4,5}?","otWuaaL&&F&E\\1\\1j",[global])),
+ <<"OjJFYaaaafaaaaaaaajmxxNEiDa">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}?","\\1OjJFY&f&&jmxxNEiD",[])),
+ <<"OjJFYaaaafaaaaaaaajmxxNEiDa">> = iolist_to_binary(re:replace("aaaaa","^[aeiou\\d]{4,5}?","\\1OjJFY&f&&jmxxNEiD",[global])),
+ <<"xvM1234Anq1234UpiOggGI56">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}?","xv\\1M&Anq&Up\\1iOggGI",[])),
+ <<"xvM1234Anq1234UpiOggGI56">> = iolist_to_binary(re:replace("123456","^[aeiou\\d]{4,5}?","xv\\1M&Anq&Up\\1iOggGI",[global])),
+ <<"Cqabc=abcabcabc=abcabcybabcvabcrabcAgJK">> = iolist_to_binary(re:replace("abc=abcabc","\\A(abc|def)=(\\1){2,3}\\Z","Cq&&yb\\1v\\1r\\1AgJK",[])),
+ <<"Cqabc=abcabcabc=abcabcybabcvabcrabcAgJK">> = iolist_to_binary(re:replace("abc=abcabc","\\A(abc|def)=(\\1){2,3}\\Z","Cq&&yb\\1v\\1r\\1AgJK",[global])),
+ <<"e">> = iolist_to_binary(re:replace("def=defdefdef","\\A(abc|def)=(\\1){2,3}\\Z","e",[])),
+ <<"e">> = iolist_to_binary(re:replace("def=defdefdef","\\A(abc|def)=(\\1){2,3}\\Z","e",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\A(abc|def)=(\\1){2,3}\\Z","LC\\1\\1cX&r\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\A(abc|def)=(\\1){2,3}\\Z","LC\\1\\1cX&r\\1",[global])),
+ <<"abc=defdef">> = iolist_to_binary(re:replace("abc=defdef","\\A(abc|def)=(\\1){2,3}\\Z","W&Oq&\\1",[])),
+ <<"abc=defdef">> = iolist_to_binary(re:replace("abc=defdef","\\A(abc|def)=(\\1){2,3}\\Z","W&Oq&\\1",[global])),
+ <<"RbEDawyPg">> = iolist_to_binary(re:replace("abcdefghijkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","RbED\\1wyPg",[])),
+ <<"RbEDawyPg">> = iolist_to_binary(re:replace("abcdefghijkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","RbED\\1wyPg",[global])),
+ <<"SglXayyabcdefghijkkkkcda2cXHhsvvXdoa">> = iolist_to_binary(re:replace("abcdefghijkkkkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","SglX\\1yy&cXHhsvvXdo\\1",[])),
+ <<"SglXayyabcdefghijkkkkcda2cXHhsvvXdoa">> = iolist_to_binary(re:replace("abcdefghijkkkkcda2","^(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\11*(\\3\\4)\\1(?#)2$","SglX\\1yy&cXHhsvvXdo\\1",[global])),
+ <<"v">> = iolist_to_binary(re:replace("cataract cataract23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","v",[])),
+ <<"v">> = iolist_to_binary(re:replace("cataract cataract23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","v",[global])),
+ <<"acatatonicurmvcatatonic">> = iolist_to_binary(re:replace("catatonic catatonic23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","a\\1urmv\\1",[])),
+ <<"acatatonicurmvcatatonic">> = iolist_to_binary(re:replace("catatonic catatonic23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","a\\1urmv\\1",[global])),
+ <<"XVEjcaterpillar caterpillar23YcaterpillarAnxyWcaterpillarTvYyY">> = iolist_to_binary(re:replace("caterpillar caterpillar23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","XVEj&Y\\1AnxyW\\1TvYyY",[])),
+ <<"XVEjcaterpillar caterpillar23YcaterpillarAnxyWcaterpillarTvYyY">> = iolist_to_binary(re:replace("caterpillar caterpillar23","(cat(a(ract|tonic)|erpillar)) \\1()2(3)","XVEj&Y\\1AnxyW\\1TvYyY",[global])),
+ <<"W:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]","W",[])),
+ <<"W:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From +([^ ]+) +[a-zA-Z][a-zA-Z][a-zA-Z] +[a-zA-Z][a-zA-Z][a-zA-Z] +[0-9]?[0-9] +[0-9][0-9]:[0-9][0-9]","W",[global])),
+ <<"IywFrom abcd Mon Sep 01 12:33From abcd Mon Sep 01 12:33Agja:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","Iyw&&Agja",[])),
+ <<"IywFrom abcd Mon Sep 01 12:33From abcd Mon Sep 01 12:33Agja:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","Iyw&&Agja",[global])),
+ <<"TFrom abcd Mon Sep 1 12:33KLniu:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 1 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","T&KLniu",[])),
+ <<"TFrom abcd Mon Sep 1 12:33KLniu:02 1997">> = iolist_to_binary(re:replace("From abcd Mon Sep 1 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","T&KLniu",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","vYiLq&doiJVeyAm",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","vYiLq&doiJVeyAm",[global])),
+ <<"From abcd Sep 01 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","hfXkAD\\1eyf&\\1T&AE",[])),
+ <<"From abcd Sep 01 12:33:02 1997">> = iolist_to_binary(re:replace("From abcd Sep 01 12:33:02 1997","^From\\s+\\S+\\s+([a-zA-Z]{3}\\s+){2}\\d{1,2}\\s+\\d\\d:\\d\\d","hfXkAD\\1eyf&\\1T&AE",[global])),
+ <<"wgMRV12
+34dXcgTVheaqJ12
+34uR">> = iolist_to_binary(re:replace("12
+34","^12.34","wgMRV&dXcgTVheaqJ&uR",[dotall])),
+ <<"wgMRV12
+34dXcgTVheaqJ12
+34uR">> = iolist_to_binary(re:replace("12
+34","^12.34","wgMRV&dXcgTVheaqJ&uR",[dotall,global])),
+ <<"Nx12 34XXami">> = iolist_to_binary(re:replace("12 34","^12.34","Nx&XXami",[dotall])),
+ <<"Nx12 34XXami">> = iolist_to_binary(re:replace("12 34","^12.34","Nx&XXami",[dotall,
+ global])),
+ <<"the quick IYgNNy fox">> = iolist_to_binary(re:replace("the quick brown fox","\\w+(?=\\t)","IYgNNy",[])),
+ <<"the quick IYgNNy fox">> = iolist_to_binary(re:replace("the quick brown fox","\\w+(?=\\t)","IYgNNy",[global])),
+ <<"foobar is lish see?VpOwivKT">> = iolist_to_binary(re:replace("foobar is foolish see?","foo(?!bar)(.*)","\\1VpOwivKT",[])),
+ <<"foobar is lish see?VpOwivKT">> = iolist_to_binary(re:replace("foobar is foolish see?","foo(?!bar)(.*)","\\1VpOwivKT",[global])),
+ <<"foobar ctmTbrowbar etcUVS etc etc etcVu">> = iolist_to_binary(re:replace("foobar crowbar etc","(?:(?!foo)...|^.{0,2})bar(.*)","tmTb&UVS\\1\\1\\1Vu",[])),
+ <<"foobar ctmTbrowbar etcUVS etc etc etcVu">> = iolist_to_binary(re:replace("foobar crowbar etc","(?:(?!foo)...|^.{0,2})bar(.*)","tmTb&UVS\\1\\1\\1Vu",[global])),
+ <<"relJSQucc">> = iolist_to_binary(re:replace("barrel","(?:(?!foo)...|^.{0,2})bar(.*)","\\1JSQucc",[])),
+ <<"relJSQucc">> = iolist_to_binary(re:replace("barrel","(?:(?!foo)...|^.{0,2})bar(.*)","\\1JSQucc",[global])),
+ <<"rdrSoV">> = iolist_to_binary(re:replace("2barrel","(?:(?!foo)...|^.{0,2})bar(.*)","rdrSoV",[])),
+ <<"rdrSoV">> = iolist_to_binary(re:replace("2barrel","(?:(?!foo)...|^.{0,2})bar(.*)","rdrSoV",[global])),
+ <<"eXfWy">> = iolist_to_binary(re:replace("A barrel","(?:(?!foo)...|^.{0,2})bar(.*)","eXfWy",[])),
+ <<"eXfWy">> = iolist_to_binary(re:replace("A barrel","(?:(?!foo)...|^.{0,2})bar(.*)","eXfWy",[global])),
+ <<"w456">> = iolist_to_binary(re:replace("abc456","^(\\D*)(?=\\d)(?!123)","w",[])),
+ <<"w456">> = iolist_to_binary(re:replace("abc456","^(\\D*)(?=\\d)(?!123)","w",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","K\\1\\1AqfXA&w\\1u",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","K\\1\\1AqfXA&w\\1u",[global])),
+ <<"abc123">> = iolist_to_binary(re:replace("abc123","^(\\D*)(?=\\d)(?!123)","JdWVKM&yVT",[])),
+ <<"abc123">> = iolist_to_binary(re:replace("abc123","^(\\D*)(?=\\d)(?!123)","JdWVKM&yVT",[global])),
ok.
run3() ->
- <<"1234cNbGaCaxuI">> = iolist_to_binary(re:replace("1234","^1234(?# test newlines
- inside)","&cNbGaCaxuI",[])),
- <<"1234cNbGaCaxuI">> = iolist_to_binary(re:replace("1234","^1234(?# test newlines
- inside)","&cNbGaCaxuI",[global])),
- <<"jmCvIAMNV1234nNrfW1234GM">> = iolist_to_binary(re:replace("1234","^1234 #comment in extended re
- ","\\1jmCvIAMNV\\1&nNrfW&GM",[extended])),
- <<"jmCvIAMNV1234nNrfW1234GM">> = iolist_to_binary(re:replace("1234","^1234 #comment in extended re
- ","\\1jmCvIAMNV\\1&nNrfW&GM",[extended,global])),
- <<"YyiILRKFjY">> = iolist_to_binary(re:replace("abcd","#rhubarb
- abcd","YyiILRKFjY",[extended])),
- <<"YyiILRKFjY">> = iolist_to_binary(re:replace("abcd","#rhubarb
- abcd","YyiILRKFjY",[extended,global])),
- <<"XbpsAef">> = iolist_to_binary(re:replace("abcd","^abcd#rhubarb","Xbps\\1Aef",[extended])),
- <<"XbpsAef">> = iolist_to_binary(re:replace("abcd","^abcd#rhubarb","Xbps\\1Aef",[extended,
- global])),
- <<"iPHiDDB">> = iolist_to_binary(re:replace("aaab","^(a)\\1{2,3}(.)","iPHiDDB",[])),
- <<"iPHiDDB">> = iolist_to_binary(re:replace("aaab","^(a)\\1{2,3}(.)","iPHiDDB",[global])),
- <<"IXEQflgnaWgr">> = iolist_to_binary(re:replace("aaaab","^(a)\\1{2,3}(.)","IXEQflgn\\1Wgr",[])),
- <<"IXEQflgnaWgr">> = iolist_to_binary(re:replace("aaaab","^(a)\\1{2,3}(.)","IXEQflgn\\1Wgr",[global])),
- <<"gToJhaaaaaOaaaaaaaaaaaiaaaaaHLaNAWab">> = iolist_to_binary(re:replace("aaaaab","^(a)\\1{2,3}(.)","gToJh&O\\1&&i&HL\\1NAW\\1",[])),
- <<"gToJhaaaaaOaaaaaaaaaaaiaaaaaHLaNAWab">> = iolist_to_binary(re:replace("aaaaab","^(a)\\1{2,3}(.)","gToJh&O\\1&&i&HL\\1NAW\\1",[global])),
- <<"aaaaaaGwEYYdXmTRmaaaaasXab">> = iolist_to_binary(re:replace("aaaaaab","^(a)\\1{2,3}(.)","&\\1GwEYYdXmTRm&sX",[])),
- <<"aaaaaaGwEYYdXmTRmaaaaasXab">> = iolist_to_binary(re:replace("aaaaaab","^(a)\\1{2,3}(.)","&\\1GwEYYdXmTRm&sX",[global])),
- <<"the abcabcLiXhGXmrloabcEfabcAbS">> = iolist_to_binary(re:replace("the abc","(?!^)abc","&&LiXhGXmrlo&Ef&AbS",[])),
- <<"the abcabcLiXhGXmrloabcEfabcAbS">> = iolist_to_binary(re:replace("the abc","(?!^)abc","&&LiXhGXmrlo&Ef&AbS",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?!^)abc","uyPPG",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?!^)abc","uyPPG",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?!^)abc","x\\1sgS\\1tB\\1RcyA\\1enf",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?!^)abc","x\\1sgS\\1tB\\1RcyA\\1enf",[global])),
- <<"abcubl">> = iolist_to_binary(re:replace("abc","(?=^)abc","&ubl",[])),
- <<"abcubl">> = iolist_to_binary(re:replace("abc","(?=^)abc","&ubl",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=^)abc","NPTqioPj",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=^)abc","NPTqioPj",[global])),
- <<"the abc">> = iolist_to_binary(re:replace("the abc","(?=^)abc","\\1pNTRQmK\\1Hj",[])),
- <<"the abc">> = iolist_to_binary(re:replace("the abc","(?=^)abc","\\1pNTRQmK\\1Hj",[global])),
- <<"QpbbCJcbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*|b)","Qp\\1bCJc",[])),
- <<"QpbbCJcbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*|b)","Qp\\1bCJc",[global])),
- <<"PcVuJcWmvIiq">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*|b)","PcVuJcWmvIiq",[])),
- <<"PcVuJcWmvIiq">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*|b)","PcVuJcWmvIiq",[global])),
- <<"fwRaaeKbsaanjaKaUaadaaybbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*?|b)","fwR&eKbs&nj\\1K\\1U&d\\1\\1y",[])),
- <<"fwRaaeKbsaanjaKaUaadaaybbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*?|b)","fwR&eKbs&nj\\1K\\1U&d\\1\\1y",[global])),
- <<"bblQaabbCsbbeeQvYbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*?|b)","\\1\\1lQ&Cs\\1\\1eeQvY",[])),
- <<"bblQaabbCsbbeeQvYbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*?|b)","\\1\\1lQ&Cs\\1\\1eeQvY",[global])),
+ <<"iuO1234wOcoFuHtrEJy">> = iolist_to_binary(re:replace("1234","^1234(?# test newlines
+ inside)","iuO&wOcoFuHtrE\\1Jy",[])),
+ <<"iuO1234wOcoFuHtrEJy">> = iolist_to_binary(re:replace("1234","^1234(?# test newlines
+ inside)","iuO&wOcoFuHtrE\\1Jy",[global])),
+ <<"gJCrEQqo1234JrkS">> = iolist_to_binary(re:replace("1234","^1234 #comment in extended re
+ ","gJC\\1rE\\1Qq\\1o&JrkS",[extended])),
+ <<"gJCrEQqo1234JrkS">> = iolist_to_binary(re:replace("1234","^1234 #comment in extended re
+ ","gJC\\1rE\\1Qq\\1o&JrkS",[extended,global])),
+ <<"MTEpBuVJ">> = iolist_to_binary(re:replace("abcd","#rhubarb
+ abcd","MTEpBuVJ",[extended])),
+ <<"MTEpBuVJ">> = iolist_to_binary(re:replace("abcd","#rhubarb
+ abcd","MTEpBuVJ",[extended,global])),
+ <<"abcdjMyabcdxPHwTRWabcdgliA">> = iolist_to_binary(re:replace("abcd","^abcd#rhubarb","&jMy&xPHwTRW&g\\1liA",[extended])),
+ <<"abcdjMyabcdxPHwTRWabcdgliA">> = iolist_to_binary(re:replace("abcd","^abcd#rhubarb","&jMy&xPHwTRW&g\\1liA",[extended,
+ global])),
+ <<"OaE">> = iolist_to_binary(re:replace("aaab","^(a)\\1{2,3}(.)","O\\1E",[])),
+ <<"OaE">> = iolist_to_binary(re:replace("aaab","^(a)\\1{2,3}(.)","O\\1E",[global])),
+ <<"CapFaBaaaabGaaaabg">> = iolist_to_binary(re:replace("aaaab","^(a)\\1{2,3}(.)","C\\1pF\\1B&G&g",[])),
+ <<"CapFaBaaaabGaaaabg">> = iolist_to_binary(re:replace("aaaab","^(a)\\1{2,3}(.)","C\\1pF\\1B&G&g",[global])),
+ <<"Faaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a)\\1{2,3}(.)","F&",[])),
+ <<"Faaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a)\\1{2,3}(.)","F&",[global])),
+ <<"caaaaaHRiaaaaaCFuIab">> = iolist_to_binary(re:replace("aaaaaab","^(a)\\1{2,3}(.)","c&HRi&CFuI",[])),
+ <<"caaaaaHRiaaaaaCFuIab">> = iolist_to_binary(re:replace("aaaaaab","^(a)\\1{2,3}(.)","c&HRi&CFuI",[global])),
+ <<"the gjabcPpEkyabcIiyEk">> = iolist_to_binary(re:replace("the abc","(?!^)abc","gj&PpEky&Ii\\1yEk",[])),
+ <<"the gjabcPpEkyabcIiyEk">> = iolist_to_binary(re:replace("the abc","(?!^)abc","gj&PpEky&Ii\\1yEk",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?!^)abc","tRf&&sbxQaC",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?!^)abc","tRf&&sbxQaC",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?!^)abc","H\\1BG&fg&PqEB&VP\\1",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?!^)abc","H\\1BG&fg&PqEB&VP\\1",[global])),
+ <<"ybQFSlI">> = iolist_to_binary(re:replace("abc","(?=^)abc","\\1yb\\1QFSlI",[])),
+ <<"ybQFSlI">> = iolist_to_binary(re:replace("abc","(?=^)abc","\\1yb\\1QFSlI",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=^)abc","J",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=^)abc","J",[global])),
+ <<"the abc">> = iolist_to_binary(re:replace("the abc","(?=^)abc","x&",[])),
+ <<"the abc">> = iolist_to_binary(re:replace("the abc","(?=^)abc","x&",[global])),
+ <<"hfsXbvuonxbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*|b)","hfsX\\1vuonx",[])),
+ <<"hfsXbvuonxbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*|b)","hfsX\\1vuonx",[global])),
+ <<"ddI">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*|b)","ddI",[])),
+ <<"ddI">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*|b)","ddI",[global])),
+ <<"abbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*?|b)","\\1",[])),
+ <<"abbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}?(ab*?|b)","\\1",[global])),
+ <<"bRgwsOaabbaabbKBhbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*?|b)","\\1RgwsO&&KBh\\1",[])),
+ <<"bRgwsOaabbaabbKBhbbbb">> = iolist_to_binary(re:replace("aabbbbb","^[ab]{1,3}(ab*?|b)","\\1RgwsO&&KBh\\1",[global])),
<<"Alan Other <user.ain>">> = iolist_to_binary(re:replace("Alan Other <user.ain>"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -960,7 +966,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","SOd&j",[extended])),
+\\) )* # optional trailing comment","KOt\\1Sm",[extended])),
<<"Alan Other <user.ain>">> = iolist_to_binary(re:replace("Alan Other <user.ain>"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -1153,8 +1159,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","SOd&j",[extended,
- global])),
+\\) )* # optional trailing comment","KOt\\1Sm",[extended,
+ global])),
<<"<user.ain>">> = iolist_to_binary(re:replace("<user.ain>"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -1347,7 +1353,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","Rli",[extended])),
+\\) )* # optional trailing comment","\\1",[extended])),
<<"<user.ain>">> = iolist_to_binary(re:replace("<user.ain>"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -1540,8 +1546,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","Rli",[extended,
- global])),
+\\) )* # optional trailing comment","\\1",[extended,
+ global])),
<<"user.ain">> = iolist_to_binary(re:replace("user.ain"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -1734,7 +1740,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","g&TWfEDY",[extended])),
+\\) )* # optional trailing comment","B&N\\1mWiqND\\1Ye",[extended])),
<<"user.ain">> = iolist_to_binary(re:replace("user.ain"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -1927,8 +1933,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","g&TWfEDY",[extended,
- global])),
+\\) )* # optional trailing comment","B&N\\1mWiqND\\1Ye",[extended,
+ global])),
<<"\"A. Other\" <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("\"A. Other\" <user.1234.ain> (a comment)"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -2121,7 +2127,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","Cw",[extended])),
+\\) )* # optional trailing comment","k&&P&fhieC&HuV\\1&",[extended])),
<<"\"A. Other\" <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("\"A. Other\" <user.1234.ain> (a comment)"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -2314,8 +2320,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","Cw",[extended,
- global])),
+\\) )* # optional trailing comment","k&&P&fhieC&HuV\\1&",[extended,
+ global])),
<<"A. Other <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("A. Other <user.1234.ain> (a comment)"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -2508,7 +2514,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","ej",[extended])),
+\\) )* # optional trailing comment","FM",[extended])),
<<"A. Other <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("A. Other <user.1234.ain> (a comment)"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -2701,7 +2707,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","ej",[extended,
+\\) )* # optional trailing comment","FM",[extended,
global])),
<<"\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay">> = iolist_to_binary(re:replace("\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
@@ -2895,7 +2901,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","y\\1D",[extended])),
+\\) )* # optional trailing comment","aIlGG",[extended])),
<<"\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay">> = iolist_to_binary(re:replace("\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -3088,8 +3094,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","y\\1D",[extended,
- global])),
+\\) )* # optional trailing comment","aIlGG",[extended,
+ global])),
<<"A missing angle <user.where">> = iolist_to_binary(re:replace("A missing angle <user.where"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -3282,7 +3288,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","\\1jrwjC",[extended])),
+\\) )* # optional trailing comment","nAjRNoagN&FbIU&T\\1",[extended])),
<<"A missing angle <user.where">> = iolist_to_binary(re:replace("A missing angle <user.where"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -3475,8 +3481,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","\\1jrwjC",[extended,
- global])),
+\\) )* # optional trailing comment","nAjRNoagN&FbIU&T\\1",[extended,
+ global])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -3669,7 +3675,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","&qqjm",[extended])),
+\\) )* # optional trailing comment","WS&e",[extended])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -3862,8 +3868,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","&qqjm",[extended,
- global])),
+\\) )* # optional trailing comment","WS&e",[extended,
+ global])),
<<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -4056,7 +4062,7 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","m\\1K&o&&mg&qC&f\\1V\\1i",[extended])),
+\\) )* # optional trailing comment","jr&XvtMJM\\1kk\\1EUHVx",[extended])),
<<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox"," (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
\\) )* # optional leading comment
@@ -4249,8 +4255,8 @@ run3() ->
# name and address
) (?: [\\040\\t] | \\(
(?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] | \\( (?: [^\\\\\\x80-\\xff\\n\\015()] | \\\\ [^\\x80-\\xff] )* \\) )*
-\\) )* # optional trailing comment","m\\1K&o&&mg&qC&f\\1V\\1i",[extended,
- global])),
+\\) )* # optional trailing comment","jr&XvtMJM\\1kk\\1EUHVx",[extended,
+ global])),
<<"Alan Other <user.ain>">> = iolist_to_binary(re:replace("Alan Other <user.ain>","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -4831,7 +4837,7 @@ run3() ->
# address spec
> # >
# name and address
-)","d\\1&sJD\\1oA\\1Aruv",[extended])),
+)","Q&W&\\1Y\\1xPgs\\1rlH\\1BF",[extended])),
<<"Alan Other <user.ain>">> = iolist_to_binary(re:replace("Alan Other <user.ain>","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -5412,7 +5418,7 @@ run3() ->
# address spec
> # >
# name and address
-)","d\\1&sJD\\1oA\\1Aruv",[extended,global])),
+)","Q&W&\\1Y\\1xPgs\\1rlH\\1BF",[extended,global])),
<<"<user.ain>">> = iolist_to_binary(re:replace("<user.ain>","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -5993,7 +5999,7 @@ run3() ->
# address spec
> # >
# name and address
-)","HuWGl&iF&NPX&",[extended])),
+)","&",[extended])),
<<"<user.ain>">> = iolist_to_binary(re:replace("<user.ain>","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -6574,7 +6580,7 @@ run3() ->
# address spec
> # >
# name and address
-)","HuWGl&iF&NPX&",[extended,global])),
+)","&",[extended,global])),
<<"user.ain">> = iolist_to_binary(re:replace("user.ain","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -7155,7 +7161,7 @@ run3() ->
# address spec
> # >
# name and address
-)","VhK&cYXg&Bq\\1f&F",[extended])),
+)","&i\\1Gf\\1siR\\1e&Dl\\1BkGV",[extended])),
<<"user.ain">> = iolist_to_binary(re:replace("user.ain","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -7736,7 +7742,7 @@ run3() ->
# address spec
> # >
# name and address
-)","VhK&cYXg&Bq\\1f&F",[extended,global])),
+)","&i\\1Gf\\1siR\\1e&Dl\\1BkGV",[extended,global])),
<<"\"A. Other\" <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("\"A. Other\" <user.1234.ain> (a comment)","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -8317,7 +8323,7 @@ run3() ->
# address spec
> # >
# name and address
-)","a\\1&eMwwW",[extended])),
+)","&&CV&S&OMP\\1iO\\1&vbRN",[extended])),
<<"\"A. Other\" <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("\"A. Other\" <user.1234.ain> (a comment)","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -8898,7 +8904,7 @@ run3() ->
# address spec
> # >
# name and address
-)","a\\1&eMwwW",[extended,global])),
+)","&&CV&S&OMP\\1iO\\1&vbRN",[extended,global])),
<<"A. Other <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("A. Other <user.1234.ain> (a comment)","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -9479,7 +9485,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1n\\1nYhyxBv&nk&&Sa",[extended])),
+)","YI&Yg\\1T",[extended])),
<<"A. Other <user.1234.ain> (a comment)">> = iolist_to_binary(re:replace("A. Other <user.1234.ain> (a comment)","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -10060,7 +10066,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1n\\1nYhyxBv&nk&&Sa",[extended,global])),
+)","YI&Yg\\1T",[extended,global])),
<<"\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay">> = iolist_to_binary(re:replace("\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -10641,7 +10647,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1fdORBWKv\\1&",[extended])),
+)","\\1TIeRL\\1UKGJ",[extended])),
<<"\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay">> = iolist_to_binary(re:replace("\"/s=user/ou=host/o=place/prmd=uu.yy/admd= /c=gb/\"-re.lay","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -11222,7 +11228,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1fdORBWKv\\1&",[extended,global])),
+)","\\1TIeRL\\1UKGJ",[extended,global])),
<<"A missing angle <user.where">> = iolist_to_binary(re:replace("A missing angle <user.where","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -11803,7 +11809,7 @@ run3() ->
# address spec
> # >
# name and address
-)","Utb&\\1l&M\\1aori&\\1&W",[extended])),
+)","eHSpF&XJCAH",[extended])),
<<"A missing angle <user.where">> = iolist_to_binary(re:replace("A missing angle <user.where","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -12384,7 +12390,7 @@ run3() ->
# address spec
> # >
# name and address
-)","Utb&\\1l&M\\1aori&\\1&W",[extended,global])),
+)","eHSpF&XJCAH",[extended,global])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -12965,7 +12971,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1&RUPp\\1",[extended])),
+)","&kowbne",[extended])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -13546,7 +13552,7 @@ run3() ->
# address spec
> # >
# name and address
-)","\\1&RUPp\\1",[extended,global])),
+)","&kowbne",[extended,global])),
<<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -14127,7 +14133,7 @@ run3() ->
# address spec
> # >
# name and address
-)","M",[extended])),
+)","Gx\\1NKVD",[extended])),
<<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","[\\040\\t]* # Nab whitespace.
(?:
\\( # (
@@ -14708,805 +14714,784 @@ run3() ->
# address spec
> # >
# name and address
-)","M",[extended,global])),
- <<"abcdefpqrxyz0AB">> = iolist_to_binary(re:replace("abcdefpqrxyz0AB","abc\\0def\\00pqr\\000xyz\\0000AB","\\1\\1giII\\1hWW&bdV&",[])),
- <<"abcdefpqrxyz0AB">> = iolist_to_binary(re:replace("abcdefpqrxyz0AB","abc\\0def\\00pqr\\000xyz\\0000AB","\\1\\1giII\\1hWW&bdV&",[global])),
- <<"abc456 abcdefpqrxyz0ABCDE">> = iolist_to_binary(re:replace("abc456 abcdefpqrxyz0ABCDE","abc\\0def\\00pqr\\000xyz\\0000AB","cc\\1IiVp",[])),
- <<"abc456 abcdefpqrxyz0ABCDE">> = iolist_to_binary(re:replace("abc456 abcdefpqrxyz0ABCDE","abc\\0def\\00pqr\\000xyz\\0000AB","cc\\1IiVp",[global])),
- <<"abc efpqr0xyz00AB">> = iolist_to_binary(re:replace("abc efpqr0xyz00AB","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","prtuhkbIaj&qwHuPpE",[])),
- <<"abc efpqr0xyz00AB">> = iolist_to_binary(re:replace("abc efpqr0xyz00AB","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","prtuhkbIaj&qwHuPpE",[global])),
- <<"abc456 abc efpqr0xyz00ABCDE">> = iolist_to_binary(re:replace("abc456 abc efpqr0xyz00ABCDE","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","&yfjpcn",[])),
- <<"abc456 abc efpqr0xyz00ABCDE">> = iolist_to_binary(re:replace("abc456 abc efpqr0xyz00ABCDE","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","&yfjpcn",[global])),
- <<"A">> = iolist_to_binary(re:replace("A","^[\\000-\\037]","fNpC&qUvThkjHh",[])),
- <<"A">> = iolist_to_binary(re:replace("A","^[\\000-\\037]","fNpC&qUvThkjHh",[global])),
- <<"QyKsB">> = iolist_to_binary(re:replace("B","^[\\000-\\037]","QyKs",[])),
- <<"QyKsB">> = iolist_to_binary(re:replace("B","^[\\000-\\037]","QyKs",[global])),
- <<"ESQC">> = iolist_to_binary(re:replace("C","^[\\000-\\037]","ESQ",[])),
- <<"ESQC">> = iolist_to_binary(re:replace("C","^[\\000-\\037]","ESQ",[global])),
- <<"aTcfAMkUonvqo">> = iolist_to_binary(re:replace("","\\0*","aT&cfAM&\\1kU\\1onvq&o",[])),
- <<"aTcfAMkUonvqo">> = iolist_to_binary(re:replace("","\\0*","aT&cfAM&\\1kU\\1onvq&o",[global])),
- <<"The AZ">> = iolist_to_binary(re:replace("The AZ","A\\x0{2,3}Z","vmgVokP\\1Omhk&",[])),
- <<"The AZ">> = iolist_to_binary(re:replace("The AZ","A\\x0{2,3}Z","vmgVokP\\1Omhk&",[global])),
- <<"An AZ">> = iolist_to_binary(re:replace("An AZ","A\\x0{2,3}Z","VQmaqWv&eULrw\\1glxho",[])),
- <<"An AZ">> = iolist_to_binary(re:replace("An AZ","A\\x0{2,3}Z","VQmaqWv&eULrw\\1glxho",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","A\\x0{2,3}Z","UjPLaoqUhTok\\1&kA\\1G",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","A\\x0{2,3}Z","UjPLaoqUhTok\\1&kA\\1G",[global])),
- <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","\\1&y&cuh&VgTD&wTnGp",[])),
- <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","\\1&y&cuh&VgTD&wTnGp",[global])),
- <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","gEElh\\1ECMKe&HElIjJc",[])),
- <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","gEElh\\1ECMKe&HElIjJc",[global])),
- <<"cowcowbellYcowcowbelludyJcowE">> = iolist_to_binary(re:replace("cowcowbell","^(cow|)\\1(bell)","&Y&udyJ\\1E",[])),
- <<"cowcowbellYcowcowbelludyJcowE">> = iolist_to_binary(re:replace("cowcowbell","^(cow|)\\1(bell)","&Y&udyJ\\1E",[global])),
- <<"XIIG">> = iolist_to_binary(re:replace("bell","^(cow|)\\1(bell)","XIIG\\1",[])),
- <<"XIIG">> = iolist_to_binary(re:replace("bell","^(cow|)\\1(bell)","XIIG\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(cow|)\\1(bell)","FV&UIVc&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(cow|)\\1(bell)","FV&UIVc&",[global])),
- <<"cowbell">> = iolist_to_binary(re:replace("cowbell","^(cow|)\\1(bell)","C&&\\1YwKbOHQIgm&R\\1\\1t",[])),
- <<"cowbell">> = iolist_to_binary(re:replace("cowbell","^(cow|)\\1(bell)","C&&\\1YwKbOHQIgm&R\\1\\1t",[global])),
- <<"ywr abc">> = iolist_to_binary(re:replace(" abc","^\\s","ywr&",[])),
- <<"ywr abc">> = iolist_to_binary(re:replace(" abc","^\\s","ywr&",[global])),
- <<" fRabc">> = iolist_to_binary(re:replace(" abc","^\\s","&fR",[])),
- <<" fRabc">> = iolist_to_binary(re:replace(" abc","^\\s","&fR",[global])),
- <<"CHbSJabc">> = iolist_to_binary(re:replace("
-abc","^\\s","CHbSJ",[])),
- <<"CHbSJabc">> = iolist_to_binary(re:replace("
-abc","^\\s","CHbSJ",[global])),
- <<"nivOFemIauK XVEPabc">> = iolist_to_binary(re:replace(" abc","^\\s","n\\1ivOFemIauK&&XVEP",[])),
- <<"nivOFemIauK XVEPabc">> = iolist_to_binary(re:replace(" abc","^\\s","n\\1ivOFemIauK&&XVEP",[global])),
- <<"Hs Cwabc">> = iolist_to_binary(re:replace(" abc","^\\s","Hs&Cw",[])),
- <<"Hs Cwabc">> = iolist_to_binary(re:replace(" abc","^\\s","Hs&Cw",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\s","wydaKxDrmaSC\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\s","wydaKxDrmaSC\\1",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","^\\s","&mmImPqIRmsQLWtEuv\\1",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","^\\s","&mmImPqIRmsQLWtEuv\\1",[global])),
+)","Gx\\1NKVD",[extended,global])),
+ <<"abcdefpqrxyz0AB">> = iolist_to_binary(re:replace("abcdefpqrxyz0AB","abc\\0def\\00pqr\\000xyz\\0000AB","dkxNTS&f",[])),
+ <<"abcdefpqrxyz0AB">> = iolist_to_binary(re:replace("abcdefpqrxyz0AB","abc\\0def\\00pqr\\000xyz\\0000AB","dkxNTS&f",[global])),
+ <<"abc456 abcdefpqrxyz0ABCDE">> = iolist_to_binary(re:replace("abc456 abcdefpqrxyz0ABCDE","abc\\0def\\00pqr\\000xyz\\0000AB","nJiU&",[])),
+ <<"abc456 abcdefpqrxyz0ABCDE">> = iolist_to_binary(re:replace("abc456 abcdefpqrxyz0ABCDE","abc\\0def\\00pqr\\000xyz\\0000AB","nJiU&",[global])),
+ <<"abc efpqr0xyz00AB">> = iolist_to_binary(re:replace("abc efpqr0xyz00AB","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","V&ijCkR\\1gwPa\\1voR&",[])),
+ <<"abc efpqr0xyz00AB">> = iolist_to_binary(re:replace("abc efpqr0xyz00AB","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","V&ijCkR\\1gwPa\\1voR&",[global])),
+ <<"abc456 abc efpqr0xyz00ABCDE">> = iolist_to_binary(re:replace("abc456 abc efpqr0xyz00ABCDE","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","X\\1\\1wk",[])),
+ <<"abc456 abc efpqr0xyz00ABCDE">> = iolist_to_binary(re:replace("abc456 abc efpqr0xyz00ABCDE","abc\\x0def\\x00pqr\\x000xyz\\x0000AB","X\\1\\1wk",[global])),
+ <<"A">> = iolist_to_binary(re:replace("A","^[\\000-\\037]","tyqFsu&vfUBb&kaQBG",[])),
+ <<"A">> = iolist_to_binary(re:replace("A","^[\\000-\\037]","tyqFsu&vfUBb&kaQBG",[global])),
+ <<"DWjvqBB">> = iolist_to_binary(re:replace("B","^[\\000-\\037]","DWjvqB",[])),
+ <<"DWjvqBB">> = iolist_to_binary(re:replace("B","^[\\000-\\037]","DWjvqB",[global])),
+ <<"ctmC">> = iolist_to_binary(re:replace("C","^[\\000-\\037]","ctm",[])),
+ <<"ctmC">> = iolist_to_binary(re:replace("C","^[\\000-\\037]","ctm",[global])),
+ <<"tQmDpnh">> = iolist_to_binary(re:replace("","\\0*","tQ&mDpnh",[])),
+ <<"tQmDpnh">> = iolist_to_binary(re:replace("","\\0*","tQ&mDpnh",[global])),
+ <<"The AZ">> = iolist_to_binary(re:replace("The AZ","A\\x0{2,3}Z","pmlUUNWGtb",[])),
+ <<"The AZ">> = iolist_to_binary(re:replace("The AZ","A\\x0{2,3}Z","pmlUUNWGtb",[global])),
+ <<"An AZ">> = iolist_to_binary(re:replace("An AZ","A\\x0{2,3}Z","y",[])),
+ <<"An AZ">> = iolist_to_binary(re:replace("An AZ","A\\x0{2,3}Z","y",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","A\\x0{2,3}Z","h&yF&Oe",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","A\\x0{2,3}Z","h&yF&Oe",[global])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","\\1U\\1",[])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","\\1U\\1",[global])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","vlOt\\1DNTdL&T",[])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","A\\x0{2,3}Z","vlOt\\1DNTdL&T",[global])),
+ <<"cowcowbellcowcowbellNBJqwwYkcowuI">> = iolist_to_binary(re:replace("cowcowbell","^(cow|)\\1(bell)","&&NBJqwwYk\\1uI",[])),
+ <<"cowcowbellcowcowbellNBJqwwYkcowuI">> = iolist_to_binary(re:replace("cowcowbell","^(cow|)\\1(bell)","&&NBJqwwYk\\1uI",[global])),
+ <<"VGNLxyRxhavyOhbell">> = iolist_to_binary(re:replace("bell","^(cow|)\\1(bell)","VGNLxyRxhavyOh&",[])),
+ <<"VGNLxyRxhavyOhbell">> = iolist_to_binary(re:replace("bell","^(cow|)\\1(bell)","VGNLxyRxhavyOh&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(cow|)\\1(bell)","Fe&GxeL&lybNB&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(cow|)\\1(bell)","Fe&GxeL&lybNB&",[global])),
+ <<"cowbell">> = iolist_to_binary(re:replace("cowbell","^(cow|)\\1(bell)","Wgx&BGClp",[])),
+ <<"cowbell">> = iolist_to_binary(re:replace("cowbell","^(cow|)\\1(bell)","Wgx&BGClp",[global])),
+ <<"K e BfRGaOUxabc">> = iolist_to_binary(re:replace(" abc","^\\s","K&e&BfRGaOUx",[])),
+ <<"K e BfRGaOUxabc">> = iolist_to_binary(re:replace(" abc","^\\s","K&e&BfRGaOUx",[global])),
+ <<"GrLooFQabc">> = iolist_to_binary(re:replace(" abc","^\\s","GrLooFQ",[])),
+ <<"GrLooFQabc">> = iolist_to_binary(re:replace(" abc","^\\s","GrLooFQ",[global])),
+ <<"
+IaCpCUh
+NCFWKSeQ
+abc">> = iolist_to_binary(re:replace("
+abc","^\\s","&IaCpCUh&N\\1CFWKSeQ&",[])),
+ <<"
+IaCpCUh
+NCFWKSeQ
+abc">> = iolist_to_binary(re:replace("
+abc","^\\s","&IaCpCUh&N\\1CFWKSeQ&",[global])),
+ <<"SAkruTkabc">> = iolist_to_binary(re:replace(" abc","^\\s","SAkr\\1\\1uTk",[])),
+ <<"SAkruTkabc">> = iolist_to_binary(re:replace(" abc","^\\s","SAkr\\1\\1uTk",[global])),
+ <<"yJfqnwmjabc">> = iolist_to_binary(re:replace(" abc","^\\s","yJfqnwmj\\1",[])),
+ <<"yJfqnwmjabc">> = iolist_to_binary(re:replace(" abc","^\\s","yJfqnwmj\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\s","&GwsRTRpcU",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\s","&GwsRTRpcU",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","^\\s","piG\\1AslUT&rVHB&",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","^\\s","piG\\1AslUT&rVHB&",[global])),
ok.
run4() ->
- <<"KvcEQcubkfx">> = iolist_to_binary(re:replace("abc","^a b
- c","KvcEQc\\1\\1ubkfx",[extended])),
- <<"KvcEQcubkfx">> = iolist_to_binary(re:replace("abc","^a b
- c","KvcEQc\\1\\1ubkfx",[extended,global])),
- <<"IEabanuYG">> = iolist_to_binary(re:replace("ab","^(a|)\\1*b","IE&\\1nuYG",[])),
- <<"IEabanuYG">> = iolist_to_binary(re:replace("ab","^(a|)\\1*b","IE&\\1nuYG",[global])),
- <<"oaVSaaaabg">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1*b","o\\1VS&g",[])),
- <<"oaVSaaaabg">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1*b","o\\1VS&g",[global])),
- <<"midgkQDfLoqgoK">> = iolist_to_binary(re:replace("b","^(a|)\\1*b","midgk\\1\\1Q\\1DfLoqgoK",[])),
- <<"midgkQDfLoqgoK">> = iolist_to_binary(re:replace("b","^(a|)\\1*b","midgk\\1\\1Q\\1DfLoqgoK",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1*b","iq\\1HM&PoX",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1*b","iq\\1HM&PoX",[global])),
- <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1*b","pGDNJCvYBCUc&G&\\1\\1nc",[])),
- <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1*b","pGDNJCvYBCUc&G&\\1\\1nc",[global])),
- <<"NFaDYqrUAXIDCar">> = iolist_to_binary(re:replace("aab","^(a|)\\1+b","NFaDYqrUAXIDC\\1r",[])),
- <<"NFaDYqrUAXIDCar">> = iolist_to_binary(re:replace("aab","^(a|)\\1+b","NFaDYqrUAXIDC\\1r",[global])),
- <<"rVeVeoaaaabXIMIhaaaaboaRr">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1+b","rVeVeo&XIMIh&o\\1Rr",[])),
- <<"rVeVeoaaaabXIMIhaaaaboaRr">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1+b","rVeVeo&XIMIh&o\\1Rr",[global])),
- <<"MOSbVKbFIBNV">> = iolist_to_binary(re:replace("b","^(a|)\\1+b","MOS\\1&VKbFIBNV",[])),
- <<"MOSbVKbFIBNV">> = iolist_to_binary(re:replace("b","^(a|)\\1+b","MOS\\1&VKbFIBNV",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1+b","&X\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1+b","&X\\1",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1+b","HAk\\1RB",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1+b","HAk\\1RB",[global])),
- <<"T">> = iolist_to_binary(re:replace("ab","^(a|)\\1?b","T",[])),
- <<"T">> = iolist_to_binary(re:replace("ab","^(a|)\\1?b","T",[global])),
- <<"NpaabpafbAIXVrowk">> = iolist_to_binary(re:replace("aab","^(a|)\\1?b","Np&p\\1fbAIXVrowk",[])),
- <<"NpaabpafbAIXVrowk">> = iolist_to_binary(re:replace("aab","^(a|)\\1?b","Np&p\\1fbAIXVrowk",[global])),
- <<"bTLqWwDhuNEDr">> = iolist_to_binary(re:replace("b","^(a|)\\1?b","&TLqWwDhuNEDr",[])),
- <<"bTLqWwDhuNEDr">> = iolist_to_binary(re:replace("b","^(a|)\\1?b","&TLqWwDhuNEDr",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1?b","k&M&WqVpmLKP",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1?b","k&M&WqVpmLKP",[global])),
- <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1?b","sukwIjuiB",[])),
- <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1?b","sukwIjuiB",[global])),
- <<"rHnDYYvSYMasyvaMyaaabqJ">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2}b","rHnDYYvSYM\\1syv\\1My&qJ",[])),
- <<"rHnDYYvSYMasyvaMyaaabqJ">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2}b","rHnDYYvSYM\\1syv\\1My&qJ",[global])),
- <<"gdeUBJebtvLObDlYQ">> = iolist_to_binary(re:replace("b","^(a|)\\1{2}b","gdeU\\1BJe&tvL\\1ObDlYQ",[])),
- <<"gdeUBJebtvLObDlYQ">> = iolist_to_binary(re:replace("b","^(a|)\\1{2}b","gdeU\\1BJe&tvL\\1ObDlYQ",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2}b","AVUEjXCeg&i\\1T\\1ejtKi",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2}b","AVUEjXCeg&i\\1T\\1ejtKi",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2}b","E\\1YBlG",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2}b","E\\1YBlG",[global])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2}b","&Oq&\\1IcB&LT",[])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2}b","&Oq&\\1IcB&LT",[global])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2}b","Xh",[])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2}b","Xh",[global])),
- <<"gPaMHaaabaaabnaaOMIaVa">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2,3}b","gP\\1MH&&n\\1aOMI\\1Va",[])),
- <<"gPaMHaaabaaabnaaOMIaVa">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2,3}b","gP\\1MH&&n\\1aOMI\\1Va",[global])),
- <<"aaaabWf">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2,3}b","&Wf",[])),
- <<"aaaabWf">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2,3}b","&Wf",[global])),
- <<"KKYfigIbbfyLvtL">> = iolist_to_binary(re:replace("b","^(a|)\\1{2,3}b","KKYfigI&&fyL\\1v\\1tL",[])),
- <<"KKYfigIbbfyLvtL">> = iolist_to_binary(re:replace("b","^(a|)\\1{2,3}b","KKYfigI&&fyL\\1v\\1tL",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2,3}b","NFHl",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2,3}b","NFHl",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2,3}b","ob\\1\\1J&ES\\1av\\1AM",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2,3}b","ob\\1\\1J&ES\\1av\\1AM",[global])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2,3}b","\\1viNfcaQTcNH&ggGt",[])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2,3}b","\\1viNfcaQTcNH&ggGt",[global])),
- <<"aaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a|)\\1{2,3}b","vu",[])),
- <<"aaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a|)\\1{2,3}b","vu",[global])),
- <<"aHJVskcmUR">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","\\1aHJVskcmUR",[])),
- <<"aHJVskcmUR">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","\\1aHJVskcmUR",[global])),
- <<"Rmabbbccackw">> = iolist_to_binary(re:replace("abbbc","ab{1,3}bc","Rm&cackw",[])),
- <<"Rmabbbccackw">> = iolist_to_binary(re:replace("abbbc","ab{1,3}bc","Rm&cackw",[global])),
- <<"VHGaMs">> = iolist_to_binary(re:replace("abbc","ab{1,3}bc","VHGaMs",[])),
- <<"VHGaMs">> = iolist_to_binary(re:replace("abbc","ab{1,3}bc","VHGaMs",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{1,3}bc","UM&MN\\1&vHpV\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{1,3}bc","UM&MN\\1&vHpV\\1",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","ab{1,3}bc","os&Rm\\1akB\\1pkOAH",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","ab{1,3}bc","os&Rm\\1akB\\1pkOAH",[global])),
- <<"abbbbbc">> = iolist_to_binary(re:replace("abbbbbc","ab{1,3}bc","oujXAne\\1\\1JsV&Y&I&",[])),
- <<"abbbbbc">> = iolist_to_binary(re:replace("abbbbbc","ab{1,3}bc","oujXAne\\1\\1JsV&Y&I&",[global])),
- <<"NCkLQtrack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","NCkLQ\\1",[])),
- <<"NCkLQtrack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","NCkLQ\\1",[global])),
- <<"track1.title:TBlah blah blahOtrack1.title:TBlah blah blahwtrack1fuQWtrack1.title:TBlah blah blahStrack1.title:TBlah blah blahkEFVKOH">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","&O&w\\1fuQW&S&kEFVKOH",[caseless])),
- <<"track1.title:TBlah blah blahOtrack1.title:TBlah blah blahwtrack1fuQWtrack1.title:TBlah blah blahStrack1.title:TBlah blah blahkEFVKOH">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","&O&w\\1fuQW&S&kEFVKOH",[caseless,
- global])),
- <<"VWgicEGtrack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[t ]+(.*)","VWgicEG\\1",[caseless])),
- <<"VWgicEGtrack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[t ]+(.*)","VWgicEG\\1",[caseless,
- global])),
- <<"UKrqsWXY_^abcTa">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","UKr\\1\\1qs&Ta",[])),
- <<"UKrqsWXY_^abcTa">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","UKr\\1\\1qs&Ta",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-c]+$","LV\\1&\\1&\\1Je&M\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-c]+$","LV\\1&\\1&\\1Je&M\\1",[global])),
- <<"wxy">> = iolist_to_binary(re:replace("wxy","^[W-c]+$","yqUKKN",[])),
- <<"wxy">> = iolist_to_binary(re:replace("wxy","^[W-c]+$","yqUKKN",[global])),
- <<"MxOWXY_^abcqjWXY_^abcWXY_^abcocGDNJgwU">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","MxO&qj&&ocGDNJgwU",[caseless])),
- <<"MxOWXY_^abcqjWXY_^abcWXY_^abcocGDNJgwU">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","MxO&qj&&ocGDNJgwU",[caseless,
- global])),
- <<"lgkBEwxy_^ABCC">> = iolist_to_binary(re:replace("wxy_^ABC","^[W-c]+$","\\1lgkBE&C\\1",[caseless])),
- <<"lgkBEwxy_^ABCC">> = iolist_to_binary(re:replace("wxy_^ABC","^[W-c]+$","\\1lgkBE&C\\1",[caseless,
- global])),
- <<"QSQrWXY_^abcvBpJUdCPFVxS">> = iolist_to_binary(re:replace("WXY_^abc","^[\\x3f-\\x5F]+$","QSQr&vBpJUdCP\\1F\\1VxS",[caseless])),
- <<"QSQrWXY_^abcvBpJUdCPFVxS">> = iolist_to_binary(re:replace("WXY_^abc","^[\\x3f-\\x5F]+$","QSQr&vBpJUdCP\\1F\\1VxS",[caseless,
- global])),
- <<"tgwxy_^ABChAjHBwxy_^ABC">> = iolist_to_binary(re:replace("wxy_^ABC","^[\\x3f-\\x5F]+$","tg&hAjHB&",[caseless])),
- <<"tgwxy_^ABChAjHBwxy_^ABC">> = iolist_to_binary(re:replace("wxy_^ABC","^[\\x3f-\\x5F]+$","tg&hAjHB&",[caseless,
- global])),
- <<"uyphoJSabcD">> = iolist_to_binary(re:replace("abc","^abc$","uyphoJS&D",[multiline])),
- <<"uyphoJSabcD">> = iolist_to_binary(re:replace("abc","^abc$","uyphoJS&D",[multiline,
- global])),
+ <<"oYnuqock">> = iolist_to_binary(re:replace("abc","^a b
+ c","oYnuq\\1ock",[extended])),
+ <<"oYnuqock">> = iolist_to_binary(re:replace("abc","^a b
+ c","oYnuq\\1ock",[extended,global])),
+ <<"aabixSVYFQoVAIabtuGababab">> = iolist_to_binary(re:replace("ab","^(a|)\\1*b","\\1&ixSVYFQoVAI&tuG&&&",[])),
+ <<"aabixSVYFQoVAIabtuGababab">> = iolist_to_binary(re:replace("ab","^(a|)\\1*b","\\1&ixSVYFQoVAI&tuG&&&",[global])),
+ <<"FvaaaabaIaaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1*b","Fv&\\1I&",[])),
+ <<"FvaaaabaIaaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1*b","Fv&\\1I&",[global])),
+ <<"bCOyfHmNbMpQpaqrGbs">> = iolist_to_binary(re:replace("b","^(a|)\\1*b","bCOyfHmN&MpQpaqrG&s",[])),
+ <<"bCOyfHmNbMpQpaqrGbs">> = iolist_to_binary(re:replace("b","^(a|)\\1*b","bCOyfHmN&MpQpaqrG&s",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1*b","Ni&\\1\\1&nB\\1Jh&&&fOjpr",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1*b","Ni&\\1\\1&nB\\1Jh&&&fOjpr",[global])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1*b","w\\1GCswa&ex\\1JpP&&u",[])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1*b","w\\1GCswa&ex\\1JpP&&u",[global])),
+ <<"fplaYSyrA">> = iolist_to_binary(re:replace("aab","^(a|)\\1+b","fplaYSyrA",[])),
+ <<"fplaYSyrA">> = iolist_to_binary(re:replace("aab","^(a|)\\1+b","fplaYSyrA",[global])),
+ <<"q">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1+b","q",[])),
+ <<"q">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1+b","q",[global])),
+ <<"bGdqs">> = iolist_to_binary(re:replace("b","^(a|)\\1+b","&Gdq\\1s",[])),
+ <<"bGdqs">> = iolist_to_binary(re:replace("b","^(a|)\\1+b","&Gdq\\1s",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1+b","EmUWBUOM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1+b","EmUWBUOM",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1+b","\\1",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1+b","\\1",[global])),
+ <<"VaaU">> = iolist_to_binary(re:replace("ab","^(a|)\\1?b","V\\1\\1U",[])),
+ <<"VaaU">> = iolist_to_binary(re:replace("ab","^(a|)\\1?b","V\\1\\1U",[global])),
+ <<"yRFaHEaabgaguAOyRdwa">> = iolist_to_binary(re:replace("aab","^(a|)\\1?b","yRF\\1HE&g\\1guAOyRdw\\1",[])),
+ <<"yRFaHEaabgaguAOyRdwa">> = iolist_to_binary(re:replace("aab","^(a|)\\1?b","yRF\\1HE&g\\1guAOyRdw\\1",[global])),
+ <<"jdes">> = iolist_to_binary(re:replace("b","^(a|)\\1?b","j\\1des",[])),
+ <<"jdes">> = iolist_to_binary(re:replace("b","^(a|)\\1?b","j\\1des",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1?b","TIrmv",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1?b","TIrmv",[global])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1?b","S\\1iKv&guYQgKcq",[])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","^(a|)\\1?b","S\\1iKv&guYQgKcq",[global])),
+ <<"TRaaabaaabGJaaabeeaaabreHRnfrtKb">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2}b","TR&&GJ&ee&reHRnfrtKb",[])),
+ <<"TRaaabaaabGJaaabeeaaabreHRnfrtKb">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2}b","TR&&GJ&ee&reHRnfrtKb",[global])),
+ <<"ALqjMQmcPDj">> = iolist_to_binary(re:replace("b","^(a|)\\1{2}b","ALqjMQ\\1mcPDj",[])),
+ <<"ALqjMQmcPDj">> = iolist_to_binary(re:replace("b","^(a|)\\1{2}b","ALqjMQ\\1mcPDj",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2}b","\\1\\1Xdd&Y\\1&e",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2}b","\\1\\1Xdd&Y\\1&e",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2}b","qeS\\1gi",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2}b","qeS\\1gi",[global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2}b","nwCRrci\\1RdOBbhlx",[])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2}b","nwCRrci\\1RdOBbhlx",[global])),
+ <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2}b","Lg&\\1XeI\\1Nyj",[])),
+ <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2}b","Lg&\\1XeI\\1Nyj",[global])),
+ <<"GOaaabaaag">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2,3}b","GO&\\1\\1\\1g",[])),
+ <<"GOaaabaaag">> = iolist_to_binary(re:replace("aaab","^(a|)\\1{2,3}b","GO&\\1\\1\\1g",[global])),
+ <<"lxmKaaaabaaaabaaaabeXuoa">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2,3}b","lxmK&&&eXuo\\1",[])),
+ <<"lxmKaaaabaaaabaaaabeXuoa">> = iolist_to_binary(re:replace("aaaab","^(a|)\\1{2,3}b","lxmK&&&eXuo\\1",[global])),
+ <<"TvbwJ">> = iolist_to_binary(re:replace("b","^(a|)\\1{2,3}b","Tv&wJ\\1",[])),
+ <<"TvbwJ">> = iolist_to_binary(re:replace("b","^(a|)\\1{2,3}b","Tv&wJ\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2,3}b","ab\\1bOcVb&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a|)\\1{2,3}b","ab\\1bOcVb&",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2,3}b","WMYjIOMVqCgU\\1GVPH",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a|)\\1{2,3}b","WMYjIOMVqCgU\\1GVPH",[global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2,3}b","EjtNGCa",[])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^(a|)\\1{2,3}b","EjtNGCa",[global])),
+ <<"aaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a|)\\1{2,3}b","R\\1VC\\1vdVw",[])),
+ <<"aaaaab">> = iolist_to_binary(re:replace("aaaaab","^(a|)\\1{2,3}b","R\\1VC\\1vdVw",[global])),
+ <<"VkSvabbbbcabbbbcAabbbbcO">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","Vk\\1Sv&&A&O",[])),
+ <<"VkSvabbbbcabbbbcAabbbbcO">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","Vk\\1Sv&&A&O",[global])),
+ <<"EYabbbcWLBYcabbbcPiCg">> = iolist_to_binary(re:replace("abbbc","ab{1,3}bc","EY&WLBYc&PiCg",[])),
+ <<"EYabbbcWLBYcabbbcPiCg">> = iolist_to_binary(re:replace("abbbc","ab{1,3}bc","EY&WLBYc&PiCg",[global])),
+ <<"gGY">> = iolist_to_binary(re:replace("abbc","ab{1,3}bc","gG\\1Y",[])),
+ <<"gGY">> = iolist_to_binary(re:replace("abbc","ab{1,3}bc","gG\\1Y",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{1,3}bc","TXERvv\\1HEnguTRN",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{1,3}bc","TXERvv\\1HEnguTRN",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","ab{1,3}bc","jQE&DJFGc\\1\\1b\\1c\\1&&XBX",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","ab{1,3}bc","jQE&DJFGc\\1\\1b\\1c\\1&&XBX",[global])),
+ <<"abbbbbc">> = iolist_to_binary(re:replace("abbbbbc","ab{1,3}bc","WQWQvwRSQle&",[])),
+ <<"abbbbbc">> = iolist_to_binary(re:replace("abbbbbc","ab{1,3}bc","WQWQvwRSQle&",[global])),
+ <<"BUftrack1BsOeN">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","BUf\\1BsOeN",[])),
+ <<"BUftrack1BsOeN">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","BUf\\1BsOeN",[global])),
+ <<"NpupceROgJW">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","NpupceROgJW",[caseless])),
+ <<"NpupceROgJW">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[T ]+(.*)","NpupceROgJW",[caseless,
+ global])),
+ <<"DxJtrack1rCNtrack1.title:TBlah blah blahKXmSNktrack1Strack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[t ]+(.*)","DxJ\\1rCN&KXmSNk\\1S\\1",[caseless])),
+ <<"DxJtrack1rCNtrack1.title:TBlah blah blahKXmSNktrack1Strack1">> = iolist_to_binary(re:replace("track1.title:TBlah blah blah","([^.]*)\\.([^:]*):[t ]+(.*)","DxJ\\1rCN&KXmSNk\\1S\\1",[caseless,
+ global])),
+ <<"HHLLlESKV">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","HHLLlESKV",[])),
+ <<"HHLLlESKV">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","HHLLlESKV",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-c]+$","wLJlupvA\\1\\1kNnalxEwVh",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-c]+$","wLJlupvA\\1\\1kNnalxEwVh",[global])),
+ <<"wxy">> = iolist_to_binary(re:replace("wxy","^[W-c]+$","JvOAObw\\1pP\\1",[])),
+ <<"wxy">> = iolist_to_binary(re:replace("wxy","^[W-c]+$","JvOAObw\\1pP\\1",[global])),
+ <<"gwuwm">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","gwuwm",[caseless])),
+ <<"gwuwm">> = iolist_to_binary(re:replace("WXY_^abc","^[W-c]+$","gwuwm",[caseless,
+ global])),
+ <<"wxy_^ABCxkqVcwxy_^ABCaE">> = iolist_to_binary(re:replace("wxy_^ABC","^[W-c]+$","&xk\\1qVc&aE",[caseless])),
+ <<"wxy_^ABCxkqVcwxy_^ABCaE">> = iolist_to_binary(re:replace("wxy_^ABC","^[W-c]+$","&xk\\1qVc&aE",[caseless,
+ global])),
+ <<"WWXY_^abcOgKgjfsLWNy">> = iolist_to_binary(re:replace("WXY_^abc","^[\\x3f-\\x5F]+$","\\1W\\1&Og\\1Kgj\\1fsLWNy",[caseless])),
+ <<"WWXY_^abcOgKgjfsLWNy">> = iolist_to_binary(re:replace("WXY_^abc","^[\\x3f-\\x5F]+$","\\1W\\1&Og\\1Kgj\\1fsLWNy",[caseless,
+ global])),
+ <<"egunTysOf">> = iolist_to_binary(re:replace("wxy_^ABC","^[\\x3f-\\x5F]+$","egunT\\1\\1y\\1sOf",[caseless])),
+ <<"egunTysOf">> = iolist_to_binary(re:replace("wxy_^ABC","^[\\x3f-\\x5F]+$","egunT\\1\\1y\\1sOf",[caseless,
+ global])),
+ <<"CPTKOdIA">> = iolist_to_binary(re:replace("abc","^abc$","CPTKOdI\\1A",[multiline])),
+ <<"CPTKOdIA">> = iolist_to_binary(re:replace("abc","^abc$","CPTKOdI\\1A",[multiline,
+ global])),
<<"qqq
-wupoAabcauHHyGGVeUwVabc">> = iolist_to_binary(re:replace("qqq
-abc","^abc$","wupoA&au\\1HHyGGVeUwV&",[multiline])),
+bQdPqCFxabcndDcFfikPvc">> = iolist_to_binary(re:replace("qqq
+abc","^abc$","bQdPqCFx&ndDcFfikPvc",[multiline])),
<<"qqq
-wupoAabcauHHyGGVeUwVabc">> = iolist_to_binary(re:replace("qqq
-abc","^abc$","wupoA&au\\1HHyGGVeUwV&",[multiline,global])),
- <<"gfEviFcl
+bQdPqCFxabcndDcFfikPvc">> = iolist_to_binary(re:replace("qqq
+abc","^abc$","bQdPqCFx&ndDcFfikPvc",[multiline,global])),
+ <<"IhabcKXoLYabce
zzz">> = iolist_to_binary(re:replace("abc
-zzz","^abc$","gf\\1EviFcl",[multiline])),
- <<"gfEviFcl
+zzz","^abc$","Ih&KX\\1oLY&e",[multiline])),
+ <<"IhabcKXoLYabce
zzz">> = iolist_to_binary(re:replace("abc
-zzz","^abc$","gf\\1EviFcl",[multiline,global])),
+zzz","^abc$","Ih&KX\\1oLY&e",[multiline,global])),
<<"qqq
-jwoabcabcBysLOHCR
+v
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","^abc$","jwo&&BysLOHC\\1R",[multiline])),
+zzz","^abc$","v",[multiline])),
<<"qqq
-jwoabcabcBysLOHCR
+v
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","^abc$","jwo&&BysLOHC\\1R",[multiline,global])),
- <<"fPMabcFHNJXabcJChQyabcU">> = iolist_to_binary(re:replace("abc","^abc$","fPM&FHNJX&JCh\\1Qy&U",[])),
- <<"fPMabcFHNJXabcJChQyabcU">> = iolist_to_binary(re:replace("abc","^abc$","fPM&FHNJX&JCh\\1Qy&U",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&\\1&R\\1oixQQMrImGsd&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&\\1&R\\1oixQQMrImGsd&",[global])),
+zzz","^abc$","v",[multiline,global])),
+ <<"rsDabcabcSRpKNvKVJ">> = iolist_to_binary(re:replace("abc","^abc$","rsD&&SRpKNvKVJ",[])),
+ <<"rsDabcabcSRpKNvKVJ">> = iolist_to_binary(re:replace("abc","^abc$","rsD&&SRpKNvKVJ",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","yVq",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","yVq",[global])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","^abc$","rAUAF&gmNHyoIX\\1ymqk",[])),
+abc","^abc$","snXy",[])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","^abc$","rAUAF&gmNHyoIX\\1ymqk",[global])),
+abc","^abc$","snXy",[global])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","^abc$","&&qL\\1YUdNN\\1\\1\\1O\\1",[])),
+zzz","^abc$","&f\\1dlb\\1EAWc&",[])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","^abc$","&&qL\\1YUdNN\\1\\1\\1O\\1",[global])),
+zzz","^abc$","&f\\1dlb\\1EAWc&",[global])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","^abc$","u",[])),
+zzz","^abc$","cSNFGiC",[])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","^abc$","u",[global])),
- <<"abcRqIabcuWabcabcFN">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","&\\1RqI&uW&&F\\1N",[multiline])),
- <<"abcRqIabcuWabcabcFN">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","&\\1RqI&uW&&F\\1N",[multiline,
- global])),
- <<"abciwrfICONabcYabc">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","&iwrf\\1ICON&\\1Y&\\1\\1",[multiline])),
- <<"abciwrfICONabcYabc">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","&iwrf\\1ICON&\\1Y&\\1\\1",[multiline,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\Z","RsIorq&kLBrJVt&Dq",[multiline])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\Z","RsIorq&kLBrJVt&Dq",[multiline,
- global])),
+zzz","^abc$","cSNFGiC",[global])),
+ <<"lCoBH">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","lC\\1o\\1BH\\1",[multiline])),
+ <<"lCoBH">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","lC\\1o\\1BH\\1",[multiline,
+ global])),
+ <<"JVdoPUmabcxTP">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","JVd\\1oP\\1Um&xTP",[multiline])),
+ <<"JVdoPUmabcxTP">> = iolist_to_binary(re:replace("abc","\\Aabc\\Z","JVd\\1oP\\1Um&xTP",[multiline,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\Z","cEqLBiFmo&YRu&QCAvtf",[multiline])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\Z","cEqLBiFmo&YRu&QCAvtf",[multiline,
+ global])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","\\Aabc\\Z","bByD\\1yC\\1hlr",[multiline])),
+abc","\\Aabc\\Z","kc&H\\1Pd\\1PDS",[multiline])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","\\Aabc\\Z","bByD\\1yC\\1hlr",[multiline,global])),
+abc","\\Aabc\\Z","kc&H\\1Pd\\1PDS",[multiline,global])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","\\Aabc\\Z","AuwHER\\1cj\\1XMx\\1jBcr&u",[multiline])),
+zzz","\\Aabc\\Z","XQVTFMq",[multiline])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","\\Aabc\\Z","AuwHER\\1cj\\1XMx\\1jBcr&u",[multiline,
- global])),
+zzz","\\Aabc\\Z","XQVTFMq",[multiline,global])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","\\Aabc\\Z","kiYxAVR&jFLIO&t\\1to&",[multiline])),
+zzz","\\Aabc\\Z","J\\1fh",[multiline])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","\\Aabc\\Z","kiYxAVR&jFLIO&t\\1to&",[multiline,global])),
- <<"DGWRrfDctbIpuofabc
-defabc
-defHPf">> = iolist_to_binary(re:replace("abc
-def","\\A(.)*\\Z","DGWRr\\1DctbIpuo\\1&&HPf",[dotall])),
- <<"DGWRrfDctbIpuofabc
-defabc
-defHPf">> = iolist_to_binary(re:replace("abc
-def","\\A(.)*\\Z","DGWRr\\1DctbIpuo\\1&&HPf",[dotall,global])),
- <<"XsHV*** FailerstLRmsk*** FailersMPy">> = iolist_to_binary(re:replace("*** Failers","\\A(.)*\\Z","XsHV&tLRm\\1k&MPy",[multiline])),
- <<"XsHV*** FailerstLRmsk*** FailersMPy">> = iolist_to_binary(re:replace("*** Failers","\\A(.)*\\Z","XsHV&tLRm\\1k&MPy",[multiline,
- global])),
+zzz","\\Aabc\\Z","J\\1fh",[multiline,global])),
+ <<"o">> = iolist_to_binary(re:replace("abc
+def","\\A(.)*\\Z","o",[dotall])),
+ <<"o">> = iolist_to_binary(re:replace("abc
+def","\\A(.)*\\Z","o",[dotall,global])),
+ <<"*** FailersssD">> = iolist_to_binary(re:replace("*** Failers","\\A(.)*\\Z","&\\1\\1D",[multiline])),
+ <<"*** FailersssD">> = iolist_to_binary(re:replace("*** Failers","\\A(.)*\\Z","&\\1\\1D",[multiline,
+ global])),
<<"abc
def">> = iolist_to_binary(re:replace("abc
-def","\\A(.)*\\Z","v",[multiline])),
+def","\\A(.)*\\Z","&FyyfdbkSw",[multiline])),
<<"abc
def">> = iolist_to_binary(re:replace("abc
-def","\\A(.)*\\Z","v",[multiline,global])),
- <<"RmbbMhEEp::c">> = iolist_to_binary(re:replace("b::c","(?:b)|(?::+)","Rmb&MhEEp",[])),
- <<"RmbbMhEEpRmb::MhEEpc">> = iolist_to_binary(re:replace("b::c","(?:b)|(?::+)","Rmb&MhEEp",[global])),
- <<"cYDT::rLb">> = iolist_to_binary(re:replace("c::b","(?:b)|(?::+)","YDT\\1&rL",[])),
- <<"cYDT::rLYDTbrL">> = iolist_to_binary(re:replace("c::b","(?:b)|(?::+)","YDT\\1&rL",[global])),
- <<"ehR">> = iolist_to_binary(re:replace("az-","[-az]+","ehR",[])),
- <<"ehR">> = iolist_to_binary(re:replace("az-","[-az]+","ehR",[global])),
- <<"*** FsaiTaeaWvwilers">> = iolist_to_binary(re:replace("*** Failers","[-az]+","s&\\1iT\\1&eaWvw",[])),
- <<"*** FsaiTaeaWvwilers">> = iolist_to_binary(re:replace("*** Failers","[-az]+","s&\\1iT\\1&eaWvw",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","[-az]+","mdHw",[])),
- <<"b">> = iolist_to_binary(re:replace("b","[-az]+","mdHw",[global])),
+def","\\A(.)*\\Z","&FyyfdbkSw",[multiline,global])),
+ <<"JbDSWbbCxetpbHwOmBy::c">> = iolist_to_binary(re:replace("b::c","(?:b)|(?::+)","J&DSW&bCxetp&HwOmBy",[])),
+ <<"JbDSWbbCxetpbHwOmByJ::DSW::bCxetp::HwOmByc">> = iolist_to_binary(re:replace("b::c","(?:b)|(?::+)","J&DSW&bCxetp&HwOmBy",[global])),
+ <<"cVMqgmhvamVbb">> = iolist_to_binary(re:replace("c::b","(?:b)|(?::+)","VMqgmh\\1vamVb",[])),
+ <<"cVMqgmhvamVbVMqgmhvamVb">> = iolist_to_binary(re:replace("c::b","(?:b)|(?::+)","VMqgmh\\1vamVb",[global])),
+ <<"az-Oaz-Taz-rDxaz-rN">> = iolist_to_binary(re:replace("az-","[-az]+","&O&\\1T&rDx&r\\1N",[])),
+ <<"az-Oaz-Taz-rDxaz-rN">> = iolist_to_binary(re:replace("az-","[-az]+","&O&\\1T&rDx&r\\1N",[global])),
+ <<"*** FEaJakaDTgMFYQIVaTilers">> = iolist_to_binary(re:replace("*** Failers","[-az]+","\\1E&JakaDTgMFY\\1QIV&T",[])),
+ <<"*** FEaJakaDTgMFYQIVaTilers">> = iolist_to_binary(re:replace("*** Failers","[-az]+","\\1E&JakaDTgMFY\\1QIV&T",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","[-az]+","okQx\\1K\\1KgjAExrmhx",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","[-az]+","okQx\\1K\\1KgjAExrmhx",[global])),
ok.
run5() ->
- <<"EDUoLiFaCJDko">> = iolist_to_binary(re:replace("za-","[az-]+","EDUoL\\1i\\1FaCJ\\1Dko",[])),
- <<"EDUoLiFaCJDko">> = iolist_to_binary(re:replace("za-","[az-]+","EDUoL\\1i\\1FaCJ\\1Dko",[global])),
- <<"*** FapAfSayQoaaFksilers">> = iolist_to_binary(re:replace("*** Failers","[az-]+","&\\1pAfS&yQo&&Fks\\1",[])),
- <<"*** FapAfSayQoaaFksilers">> = iolist_to_binary(re:replace("*** Failers","[az-]+","&\\1pAfS&yQo&&Fks\\1",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","[az-]+","\\1LDAG\\1JLRNo",[])),
- <<"b">> = iolist_to_binary(re:replace("b","[az-]+","\\1LDAG\\1JLRNo",[global])),
- <<"">> = iolist_to_binary(re:replace("a-z","[a\\-z]+","\\1",[])),
- <<"">> = iolist_to_binary(re:replace("a-z","[a\\-z]+","\\1",[global])),
- <<"*** FvVgilers">> = iolist_to_binary(re:replace("*** Failers","[a\\-z]+","vVg",[])),
- <<"*** FvVgilers">> = iolist_to_binary(re:replace("*** Failers","[a\\-z]+","vVg",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","[a\\-z]+","bfgfonbXIj",[])),
- <<"b">> = iolist_to_binary(re:replace("b","[a\\-z]+","bfgfonbXIj",[global])),
- <<"QYKd">> = iolist_to_binary(re:replace("abcdxyz","[a-z]+","Q\\1\\1Y\\1Kd\\1",[])),
- <<"QYKd">> = iolist_to_binary(re:replace("abcdxyz","[a-z]+","Q\\1\\1Y\\1Kd\\1",[global])),
- <<"UYmP12-3412-34">> = iolist_to_binary(re:replace("12-34","[\\d-]+","U\\1\\1YmP&&",[])),
- <<"UYmP12-3412-34">> = iolist_to_binary(re:replace("12-34","[\\d-]+","U\\1\\1YmP&&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-]+","JWPgf\\1Eng\\1E\\1n",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-]+","JWPgf\\1Eng\\1E\\1n",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-]+","sRhgqdg&E",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-]+","sRhgqdg&E",[global])),
- <<"efmQUhkdSK12-34zR12-34z12-34zTb">> = iolist_to_binary(re:replace("12-34z","[\\d-z]+","ef\\1mQUh\\1kdSK&R&&Tb",[])),
- <<"efmQUhkdSK12-34zR12-34z12-34zTb">> = iolist_to_binary(re:replace("12-34z","[\\d-z]+","ef\\1mQUh\\1kdSK&R&&Tb",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-z]+","PJaMxeM",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-z]+","PJaMxeM",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-z]+","My\\1Kbyr&\\1",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-z]+","My\\1Kbyr&\\1",[global])),
- <<"QpJFT\\cphXBPQ ">> = iolist_to_binary(re:replace("\\ ","\\x5c","QpJF\\1T&cphXBPQ\\1",[])),
- <<"QpJFT\\cphXBPQ ">> = iolist_to_binary(re:replace("\\ ","\\x5c","QpJF\\1T&cphXBPQ\\1",[global])),
- <<"theHwjgWjRYr ZofH ZkBtIoo">> = iolist_to_binary(re:replace("the Zoo","\\x20Z","HwjgWjRYr&\\1ofH&kBtI",[])),
- <<"theHwjgWjRYr ZofH ZkBtIoo">> = iolist_to_binary(re:replace("the Zoo","\\x20Z","HwjgWjRYr&\\1ofH&kBtI",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\x20Z","&STbBPwwLA",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\x20Z","&STbBPwwLA",[global])),
- <<"Zulu">> = iolist_to_binary(re:replace("Zulu","\\x20Z","buG&ki&QEXQhj\\1\\1W",[])),
- <<"Zulu">> = iolist_to_binary(re:replace("Zulu","\\x20Z","buG&ki&QEXQhj\\1\\1W",[global])),
- <<"bhNKmH">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","bhNKmH",[caseless])),
- <<"bhNKmH">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","bhNKmH",[caseless,
- global])),
- <<"jdFUGABCabcjABCabc">> = iolist_to_binary(re:replace("ABCabc","(abc)\\1","jdFUG&j&",[caseless])),
- <<"jdFUGABCabcjABCabc">> = iolist_to_binary(re:replace("ABCabc","(abc)\\1","jdFUG&j&",[caseless,
- global])),
- <<"YSEabcsfRWrD">> = iolist_to_binary(re:replace("abcABC","(abc)\\1","YSE\\1sfRWrD",[caseless])),
- <<"YSEabcsfRWrD">> = iolist_to_binary(re:replace("abcABC","(abc)\\1","YSE\\1sfRWrD",[caseless,
- global])),
- <<"CbQoKIFQqeNT">> = iolist_to_binary(re:replace("ab{3cd","ab{3cd","CbQoKIFQqeNT\\1",[])),
- <<"CbQoKIFQqeNT">> = iolist_to_binary(re:replace("ab{3cd","ab{3cd","CbQoKIFQqeNT\\1",[global])),
- <<"rhgUEyXbklwXmp">> = iolist_to_binary(re:replace("ab{3,cd","ab{3,cd","rhgUEyXbk\\1lwXmp",[])),
- <<"rhgUEyXbklwXmp">> = iolist_to_binary(re:replace("ab{3,cd","ab{3,cd","rhgUEyXbk\\1lwXmp",[global])),
- <<"Xlab{3,4a}cdcbaPbaKyKQGBb">> = iolist_to_binary(re:replace("ab{3,4a}cd","ab{3,4a}cd","Xl&cbaPbaKyKQG\\1Bb",[])),
- <<"Xlab{3,4a}cdcbaPbaKyKQGBb">> = iolist_to_binary(re:replace("ab{3,4a}cd","ab{3,4a}cd","Xl&cbaPbaKyKQG\\1Bb",[global])),
- <<"bSQWjrSvge">> = iolist_to_binary(re:replace("{4,5a}bc","{4,5a}bc","b\\1SQWjr\\1\\1Svge",[])),
- <<"bSQWjrSvge">> = iolist_to_binary(re:replace("{4,5a}bc","{4,5a}bc","b\\1SQWjr\\1\\1Svge",[global])),
- <<"SLxoL">> = iolist_to_binary(re:replace("abc","abc$","SLxoL",[])),
- <<"SLxoL">> = iolist_to_binary(re:replace("abc","abc$","SLxoL",[global])),
- <<"RJabcnabcqnisabctgJA">> = iolist_to_binary(re:replace("abc","abc$","RJ&n&qnis&tgJA",[])),
- <<"RJabcnabcqnisabctgJA">> = iolist_to_binary(re:replace("abc","abc$","RJ&n&qnis&tgJA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","cEO&P&qRklP&Nlb\\1H\\1K",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","cEO&P&qRklP&Nlb\\1H\\1K",[global])),
+ <<"BUiIgkpFguybl">> = iolist_to_binary(re:replace("za-","[az-]+","BU\\1iIgkpFguybl",[])),
+ <<"BUiIgkpFguybl">> = iolist_to_binary(re:replace("za-","[az-]+","BU\\1iIgkpFguybl",[global])),
+ <<"*** FVSpIRyVilers">> = iolist_to_binary(re:replace("*** Failers","[az-]+","VSpIRyV",[])),
+ <<"*** FVSpIRyVilers">> = iolist_to_binary(re:replace("*** Failers","[az-]+","VSpIRyV",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","[az-]+","\\1rfMIWIp\\1eA\\1BK",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","[az-]+","\\1rfMIWIp\\1eA\\1BK",[global])),
+ <<"fuJua">> = iolist_to_binary(re:replace("a-z","[a\\-z]+","fuJua",[])),
+ <<"fuJua">> = iolist_to_binary(re:replace("a-z","[a\\-z]+","fuJua",[global])),
+ <<"*** Fwpjilers">> = iolist_to_binary(re:replace("*** Failers","[a\\-z]+","wpj",[])),
+ <<"*** Fwpjilers">> = iolist_to_binary(re:replace("*** Failers","[a\\-z]+","wpj",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","[a\\-z]+","nf&cDP\\1\\1Gu\\1b\\1xqHex",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","[a\\-z]+","nf&cDP\\1\\1Gu\\1b\\1xqHex",[global])),
+ <<"HabcdxyzdykWGVxyCbA">> = iolist_to_binary(re:replace("abcdxyz","[a-z]+","H&dykWGVx\\1yC\\1\\1b\\1A",[])),
+ <<"HabcdxyzdykWGVxyCbA">> = iolist_to_binary(re:replace("abcdxyz","[a-z]+","H&dykWGVx\\1yC\\1\\1b\\1A",[global])),
+ <<"Ge12-34A12-34s12-34wEDOs12-34a12-34">> = iolist_to_binary(re:replace("12-34","[\\d-]+","Ge&A&s&wED\\1Os&\\1a\\1&",[])),
+ <<"Ge12-34A12-34s12-34wEDOs12-34a12-34">> = iolist_to_binary(re:replace("12-34","[\\d-]+","Ge&A&s&wED\\1Os&\\1a\\1&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-]+","\\1GK&npQ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-]+","\\1GK&npQ",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-]+","&&IDTvQkHC\\1klFHnC\\1",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-]+","&&IDTvQkHC\\1klFHnC\\1",[global])),
+ <<"XbYl12-34z12-34zDmCQVrbP">> = iolist_to_binary(re:replace("12-34z","[\\d-z]+","X\\1bYl&&Dm\\1CQVr\\1bP",[])),
+ <<"XbYl12-34z12-34zDmCQVrbP">> = iolist_to_binary(re:replace("12-34z","[\\d-z]+","X\\1bYl&&Dm\\1CQVr\\1bP",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-z]+","PTn&XmiYqAKkS&BW&&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\d-z]+","PTn&XmiYqAKkS&BW&&",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-z]+","WReIgpFjW&A",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","[\\d-z]+","WReIgpFjW&A",[global])),
+ <<"VYdXtmOgjmuYAiVjA\\ ">> = iolist_to_binary(re:replace("\\ ","\\x5c","VYdXtmOgjmuYAiVjA&",[])),
+ <<"VYdXtmOgjmuYAiVjA\\ ">> = iolist_to_binary(re:replace("\\ ","\\x5c","VYdXtmOgjmuYAiVjA&",[global])),
+ <<"theiljDu ZIwQuwEoo">> = iolist_to_binary(re:replace("the Zoo","\\x20Z","iljDu&Iw\\1Q\\1uwE\\1",[])),
+ <<"theiljDu ZIwQuwEoo">> = iolist_to_binary(re:replace("the Zoo","\\x20Z","iljDu&Iw\\1Q\\1uwE\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\x20Z","\\1ojkRRJFT\\1hV\\1xv",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\x20Z","\\1ojkRRJFT\\1hV\\1xv",[global])),
+ <<"Zulu">> = iolist_to_binary(re:replace("Zulu","\\x20Z","uaSyVYwn",[])),
+ <<"Zulu">> = iolist_to_binary(re:replace("Zulu","\\x20Z","uaSyVYwn",[global])),
+ <<"h">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","h",[caseless])),
+ <<"h">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","h",[caseless,
+ global])),
+ <<"yvNMtIABClHrnq">> = iolist_to_binary(re:replace("ABCabc","(abc)\\1","yvNMtI\\1lHrnq",[caseless])),
+ <<"yvNMtIABClHrnq">> = iolist_to_binary(re:replace("ABCabc","(abc)\\1","yvNMtI\\1lHrnq",[caseless,
+ global])),
+ <<"TVabcABCGmabcJabcABCKIEp">> = iolist_to_binary(re:replace("abcABC","(abc)\\1","TV&Gm\\1J&KIEp",[caseless])),
+ <<"TVabcABCGmabcJabcABCKIEp">> = iolist_to_binary(re:replace("abcABC","(abc)\\1","TV&Gm\\1J&KIEp",[caseless,
+ global])),
+ <<"nuHYndp">> = iolist_to_binary(re:replace("ab{3cd","ab{3cd","nuHYndp",[])),
+ <<"nuHYndp">> = iolist_to_binary(re:replace("ab{3cd","ab{3cd","nuHYndp",[global])),
+ <<"yab{3,cdohtmab{3,cdhlKJyab{3,cdx">> = iolist_to_binary(re:replace("ab{3,cd","ab{3,cd","y&ohtm&\\1hlKJy&x",[])),
+ <<"yab{3,cdohtmab{3,cdhlKJyab{3,cdx">> = iolist_to_binary(re:replace("ab{3,cd","ab{3,cd","y&ohtm&\\1hlKJy&x",[global])),
+ <<"EmVUOVQKbyOvWq">> = iolist_to_binary(re:replace("ab{3,4a}cd","ab{3,4a}cd","EmV\\1UO\\1VQKbyO\\1vW\\1q",[])),
+ <<"EmVUOVQKbyOvWq">> = iolist_to_binary(re:replace("ab{3,4a}cd","ab{3,4a}cd","EmV\\1UO\\1VQKbyO\\1vW\\1q",[global])),
+ <<"DsOhHFoWiLok{4,5a}bcVgG">> = iolist_to_binary(re:replace("{4,5a}bc","{4,5a}bc","DsOhH\\1FoWiLok&V\\1gG",[])),
+ <<"DsOhHFoWiLok{4,5a}bcVgG">> = iolist_to_binary(re:replace("{4,5a}bc","{4,5a}bc","DsOhH\\1FoWiLok&V\\1gG",[global])),
+ <<"iWchabcX">> = iolist_to_binary(re:replace("abc","abc$","iW\\1ch&X",[])),
+ <<"iWchabcX">> = iolist_to_binary(re:replace("abc","abc$","iW\\1ch&X",[global])),
+ <<"plBoHLBabcb">> = iolist_to_binary(re:replace("abc","abc$","plBoHLB&b",[])),
+ <<"plBoHLBabcb">> = iolist_to_binary(re:replace("abc","abc$","plBoHLB&b",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","EM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","EM",[global])),
<<"abc
def">> = iolist_to_binary(re:replace("abc
-def","abc$","h&&nb\\1&NBSkhYb",[])),
+def","abc$","\\1aguwNOw&Q&p&",[])),
<<"abc
def">> = iolist_to_binary(re:replace("abc
-def","abc$","h&&nb\\1&NBSkhYb",[global])),
- <<"trlaTa">> = iolist_to_binary(re:replace("abcS","(abc)\\123","trlaTa",[])),
- <<"trlaTa">> = iolist_to_binary(re:replace("abcS","(abc)\\123","trlaTa",[global])),
- <<"Oabc“MWabcjRDvJhyeF">> = iolist_to_binary(re:replace("abc“","(abc)\\223","O&MW\\1jRDvJhyeF",[])),
- <<"Oabc“MWabcjRDvJhyeF">> = iolist_to_binary(re:replace("abc“","(abc)\\223","O&MW\\1jRDvJhyeF",[global])),
- <<"uLBUEpabcÓabcjn">> = iolist_to_binary(re:replace("abcÓ","(abc)\\323","uLBUEp&\\1jn",[])),
- <<"uLBUEpabcÓabcjn">> = iolist_to_binary(re:replace("abcÓ","(abc)\\323","uLBUEp&\\1jn",[global])),
- <<"Pi">> = iolist_to_binary(re:replace("abc@","(abc)\\100","Pi",[])),
- <<"Pi">> = iolist_to_binary(re:replace("abc@","(abc)\\100","Pi",[global])),
- <<"NLS">> = iolist_to_binary(re:replace("abc@","(abc)\\100","NLS",[])),
- <<"NLS">> = iolist_to_binary(re:replace("abc@","(abc)\\100","NLS",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","gshb&NCwCI&\\1&O\\1Y&OU",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","gshb&NCwCI&\\1&O\\1Y&OU",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","wfQfG",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","wfQfG",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","nlTLMMuUL\\1dek",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","nlTLMMuUL\\1dek",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","VP\\1&nVqym",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","VP\\1&nVqym",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","YmKMMo",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","YmKMMo",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","POFFExkEtjS",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","POFFExkEtjS",[global])),
- <<"abc81">> = iolist_to_binary(re:replace("abc81","abc\\81","FLXryNI\\1vKW\\1l",[])),
- <<"abc81">> = iolist_to_binary(re:replace("abc81","abc\\81","FLXryNI\\1vKW\\1l",[global])),
- <<"abc81">> = iolist_to_binary(re:replace("abc81","abc\\81","xwedFGU&&joLFV",[])),
- <<"abc81">> = iolist_to_binary(re:replace("abc81","abc\\81","xwedFGU&&joLFV",[global])),
- <<"abc91">> = iolist_to_binary(re:replace("abc91","abc\\91","QiTym",[])),
- <<"abc91">> = iolist_to_binary(re:replace("abc91","abc\\91","QiTym",[global])),
- <<"abc91">> = iolist_to_binary(re:replace("abc91","abc\\91","r",[])),
- <<"abc91">> = iolist_to_binary(re:replace("abc91","abc\\91","r",[global])),
+def","abc$","\\1aguwNOw&Q&p&",[global])),
+ <<"abcSuqabcSwabcabcSabcsxWGOk">> = iolist_to_binary(re:replace("abcS","(abc)\\123","&uq&w\\1&\\1sxWGOk",[])),
+ <<"abcSuqabcSwabcabcSabcsxWGOk">> = iolist_to_binary(re:replace("abcS","(abc)\\123","&uq&w\\1&\\1sxWGOk",[global])),
+ <<"dMwabc“Xqyabc“abc“i">> = iolist_to_binary(re:replace("abc“","(abc)\\223","dMw&Xqy&&i",[])),
+ <<"dMwabc“Xqyabc“abc“i">> = iolist_to_binary(re:replace("abc“","(abc)\\223","dMw&Xqy&&i",[global])),
+ <<"MiqonlGabcÓYdXabcf">> = iolist_to_binary(re:replace("abcÓ","(abc)\\323","MiqonlG&YdX\\1f",[])),
+ <<"MiqonlGabcÓYdXabcf">> = iolist_to_binary(re:replace("abcÓ","(abc)\\323","MiqonlG&YdX\\1f",[global])),
+ <<"mTlabc@bdhBATwW">> = iolist_to_binary(re:replace("abc@","(abc)\\100","mTl&bdhBATwW",[])),
+ <<"mTlabc@bdhBATwW">> = iolist_to_binary(re:replace("abc@","(abc)\\100","mTl&bdhBATwW",[global])),
+ <<"QabcRSbUabc@Rabc@abc@fabckabcWabc">> = iolist_to_binary(re:replace("abc@","(abc)\\100","Q\\1RSbU&R&&f\\1k\\1W\\1",[])),
+ <<"QabcRSbUabc@Rabc@abc@fabckabcWabc">> = iolist_to_binary(re:replace("abc@","(abc)\\100","Q\\1RSbU&R&&f\\1k\\1W\\1",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","LCsN",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","LCsN",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","cotASR\\1IJoJ\\1r\\1k",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","cotASR\\1IJoJ\\1r\\1k",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","&",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","&",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","gUfvqdMO&FeVgh&\\1K",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","gUfvqdMO&FeVgh&\\1K",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","foMAR\\1CWg&y&dngF&EL\\1",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","foMAR\\1CWg&y&dngF&EL\\1",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","\\1muHsU&g",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1000","\\1muHsU&g",[global])),
+ <<"AABCDEFGHIHIwisSqVPABCDEFGHIHIfM">> = iolist_to_binary(re:replace("ABCDEFGHIHI","^(A)(B)(C)(D)(E)(F)(G)(H)(I)\\8\\9$","\\1&wisSqVP&fM",[])),
+ <<"AABCDEFGHIHIwisSqVPABCDEFGHIHIfM">> = iolist_to_binary(re:replace("ABCDEFGHIHI","^(A)(B)(C)(D)(E)(F)(G)(H)(I)\\8\\9$","\\1&wisSqVP&fM",[global])),
ok.
run6() ->
- <<"JavrrCGIJrabcdefghijkllSabcdefghijkllSRCgujabcdefghijkllSnS">> = iolist_to_binary(re:replace("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123","J\\1vrrCGIJr&&RCguj&nS",[])),
- <<"JavrrCGIJrabcdefghijkllSabcdefghijkllSRCgujabcdefghijkllSnS">> = iolist_to_binary(re:replace("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123","J\\1vrrCGIJr&&RCguj&nS",[global])),
- <<"Iabcdefghijk
-SoGoIaaBybRYC">> = iolist_to_binary(re:replace("abcdefghijk
-S","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\12\\123","I&oGoI\\1\\1BybRYC",[])),
- <<"Iabcdefghijk
-SoGoIaaBybRYC">> = iolist_to_binary(re:replace("abcdefghijk
-S","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\12\\123","I&oGoI\\1\\1BybRYC",[global])),
- <<"RGabidefuGO">> = iolist_to_binary(re:replace("abidef","ab\\idef","RG&u\\1G\\1O",[])),
- <<"RGabidefuGO">> = iolist_to_binary(re:replace("abidef","ab\\idef","RG&u\\1G\\1O",[global])),
- <<"khlnfNEs">> = iolist_to_binary(re:replace("bc","a{0}bc","khlnfNEs",[])),
- <<"khlnfNEs">> = iolist_to_binary(re:replace("bc","a{0}bc","khlnfNEs",[global])),
- <<"rqJj">> = iolist_to_binary(re:replace("xyz","(a|(bc)){0,0}?xyz","rqJj",[])),
- <<"rqJj">> = iolist_to_binary(re:replace("xyz","(a|(bc)){0,0}?xyz","rqJj",[global])),
- <<"lSP">> = iolist_to_binary(re:replace("abcde","abc[\\10]de","lSP",[])),
- <<"lSP">> = iolist_to_binary(re:replace("abcde","abc[\\10]de","lSP",[global])),
- <<"CKJxmayjvTnPabcdeFvA">> = iolist_to_binary(re:replace("abcde","abc[\\1]de","CKJxmayjvTnP&FvA",[])),
- <<"CKJxmayjvTnPabcdeFvA">> = iolist_to_binary(re:replace("abcde","abc[\\1]de","CKJxmayjvTnP&FvA",[global])),
- <<"WyBabcdeCxJkWabcdeipq">> = iolist_to_binary(re:replace("abcde","(abc)[\\1]de","WyB&CxJkW&ipq",[])),
- <<"WyBabcdeCxJkWabcdeipq">> = iolist_to_binary(re:replace("abcde","(abc)[\\1]de","WyB&CxJkW&ipq",[global])),
- <<"Ua
-bXVska
-bg">> = iolist_to_binary(re:replace("a
-b","(?s)a.b","U&XVsk&g",[])),
- <<"Ua
-bXVska
-bg">> = iolist_to_binary(re:replace("a
-b","(?s)a.b","U&XVsk&g",[global])),
- <<"WgjbaNOTcccckIbd">> = iolist_to_binary(re:replace("baNOTccccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","Wgj&kI\\1",[])),
- <<"WgjbaNOTcccckIbd">> = iolist_to_binary(re:replace("baNOTccccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","Wgj&kI\\1",[global])),
- <<"DoCtbaMWiqd">> = iolist_to_binary(re:replace("baNOTcccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","DoCt\\1aMWiq",[])),
- <<"DoCtbaMWiqd">> = iolist_to_binary(re:replace("baNOTcccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","DoCt\\1aMWiq",[global])),
- <<"thYPIiibbhwYvfLkd">> = iolist_to_binary(re:replace("baNOTccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","thYPIii\\1bhwYvfLk",[])),
- <<"thYPIiibbhwYvfLkd">> = iolist_to_binary(re:replace("baNOTccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","thYPIii\\1bhwYvfLk",[global])),
- <<"RibMcQxAKFpd">> = iolist_to_binary(re:replace("bacccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","Ri\\1McQxAKFp",[])),
- <<"RibMcQxAKFpd">> = iolist_to_binary(re:replace("bacccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","Ri\\1McQxAKFp",[global])),
- <<"vQUa">> = iolist_to_binary(re:replace("*** Failers","^([^a])([^\\b])([^c]*)([^d]{3,4})","vQUa",[])),
- <<"vQUa">> = iolist_to_binary(re:replace("*** Failers","^([^a])([^\\b])([^c]*)([^d]{3,4})","vQUa",[global])),
- <<"anything">> = iolist_to_binary(re:replace("anything","^([^a])([^\\b])([^c]*)([^d]{3,4})","bR\\1Bb&yOfWxBSieYBnJ",[])),
- <<"anything">> = iolist_to_binary(re:replace("anything","^([^a])([^\\b])([^c]*)([^d]{3,4})","bR\\1Bb&yOfWxBSieYBnJ",[global])),
- <<"bc">> = iolist_to_binary(re:replace("bc","^([^a])([^\\b])([^c]*)([^d]{3,4})","W\\1i\\1DbDlQDP&rWwmD&",[])),
- <<"bc">> = iolist_to_binary(re:replace("bc","^([^a])([^\\b])([^c]*)([^d]{3,4})","W\\1i\\1DbDlQDP&rWwmD&",[global])),
- <<"baccd">> = iolist_to_binary(re:replace("baccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ICMQ\\1pRu",[])),
- <<"baccd">> = iolist_to_binary(re:replace("baccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ICMQ\\1pRu",[global])),
- <<"eUfAADRbc">> = iolist_to_binary(re:replace("Abc","[^a]","\\1\\1e\\1Uf&&\\1DR",[])),
- <<"eUfAADReUfbbDReUfccDR">> = iolist_to_binary(re:replace("Abc","[^a]","\\1\\1e\\1Uf&&\\1DR",[global])),
- <<"AbGc">> = iolist_to_binary(re:replace("Abc","[^a]","\\1&G\\1",[caseless])),
- <<"AbGcG">> = iolist_to_binary(re:replace("Abc","[^a]","\\1&G\\1",[caseless,
- global])),
- <<"AAAGAAAIXPHIaAbc">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","&G&I\\1XPHI\\1",[])),
- <<"AAAGAAAIXPHIaAbcGAbcIXPHI">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","&G&I\\1XPHI\\1",[global])),
- <<"AAAaAIxSfS">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","IxSf\\1S",[caseless])),
- <<"AAAaAIxSfS">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","IxSf\\1S",[caseless,
- global])),
- <<"AfTCbbb
-cccEbbb
-cccfDUfwWtHuS">> = iolist_to_binary(re:replace("bbb
-ccc","[^a]+","AfTC&E&fDUfwWtH\\1uS",[])),
- <<"AfTCbbb
-cccEbbb
-cccfDUfwWtHuS">> = iolist_to_binary(re:replace("bbb
-ccc","[^a]+","AfTC&E&fDUfwWtH\\1uS",[global])),
- <<"abUUudTcI">> = iolist_to_binary(re:replace("abc","[^k]$","UUud\\1TcI",[])),
- <<"abUUudTcI">> = iolist_to_binary(re:replace("abc","[^k]$","UUud\\1TcI",[global])),
- <<"*** FailerAiOYV">> = iolist_to_binary(re:replace("*** Failers","[^k]$","AiOYV",[])),
- <<"*** FailerAiOYV">> = iolist_to_binary(re:replace("*** Failers","[^k]$","AiOYV",[global])),
- <<"abk">> = iolist_to_binary(re:replace("abk","[^k]$","UV&w&TjG&\\1O\\1m",[])),
- <<"abk">> = iolist_to_binary(re:replace("abk","[^k]$","UV&w&TjG&\\1O\\1m",[global])),
- <<"cabcH">> = iolist_to_binary(re:replace("abc","[^k]{2,3}$","\\1c&\\1H",[])),
- <<"cabcH">> = iolist_to_binary(re:replace("abc","[^k]{2,3}$","\\1c&\\1H",[global])),
- <<"kUyCfbcubJVf">> = iolist_to_binary(re:replace("kbc","[^k]{2,3}$","UyCf&\\1\\1ub\\1JVf",[])),
- <<"kUyCfbcubJVf">> = iolist_to_binary(re:replace("kbc","[^k]{2,3}$","UyCf&\\1\\1ub\\1JVf",[global])),
- <<"kgiGjY">> = iolist_to_binary(re:replace("kabc","[^k]{2,3}$","giGj\\1\\1\\1Y",[])),
- <<"kgiGjY">> = iolist_to_binary(re:replace("kabc","[^k]{2,3}$","giGj\\1\\1\\1Y",[global])),
- <<"*** FailWjNDersauWgsT">> = iolist_to_binary(re:replace("*** Failers","[^k]{2,3}$","WjND&auWgsT",[])),
- <<"*** FailWjNDersauWgsT">> = iolist_to_binary(re:replace("*** Failers","[^k]{2,3}$","WjND&auWgsT",[global])),
- <<"abk">> = iolist_to_binary(re:replace("abk","[^k]{2,3}$","Gu\\1",[])),
- <<"abk">> = iolist_to_binary(re:replace("abk","[^k]{2,3}$","Gu\\1",[global])),
- <<"akb">> = iolist_to_binary(re:replace("akb","[^k]{2,3}$","a&Wrx\\1hniTRTJRP\\1",[])),
- <<"akb">> = iolist_to_binary(re:replace("akb","[^k]{2,3}$","a&Wrx\\1hniTRTJRP\\1",[global])),
- <<"akk">> = iolist_to_binary(re:replace("akk","[^k]{2,3}$","AkLa&fhMYWpv",[])),
- <<"akk">> = iolist_to_binary(re:replace("akk","[^k]{2,3}$","AkLa&fhMYWpv",[global])),
- <<"12345678.b.c.d">> = iolist_to_binary(re:replace("12345678.b.c.d","^\\d{8,}\\@.+[^k]$","HDxYDn",[])),
- <<"12345678.b.c.d">> = iolist_to_binary(re:replace("12345678.b.c.d","^\\d{8,}\\@.+[^k]$","HDxYDn",[global])),
- <<"123456789.y.z">> = iolist_to_binary(re:replace("123456789.y.z","^\\d{8,}\\@.+[^k]$","VU\\1D",[])),
- <<"123456789.y.z">> = iolist_to_binary(re:replace("123456789.y.z","^\\d{8,}\\@.+[^k]$","VU\\1D",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8,}\\@.+[^k]$","GeBqm\\1Dmbs&G\\1vR",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8,}\\@.+[^k]$","GeBqm\\1Dmbs&G\\1vR",[global])),
- <<"12345678.y.uk">> = iolist_to_binary(re:replace("12345678.y.uk","^\\d{8,}\\@.+[^k]$","a&VS\\1&BvR",[])),
- <<"12345678.y.uk">> = iolist_to_binary(re:replace("12345678.y.uk","^\\d{8,}\\@.+[^k]$","a&VS\\1&BvR",[global])),
- <<"1234567.b.c.d">> = iolist_to_binary(re:replace("1234567.b.c.d","^\\d{8,}\\@.+[^k]$","A&Ex&\\1\\1M\\1",[])),
- <<"1234567.b.c.d">> = iolist_to_binary(re:replace("1234567.b.c.d","^\\d{8,}\\@.+[^k]$","A&Ex&\\1\\1M\\1",[global])),
- <<"UNaaaaaaaaaASae">> = iolist_to_binary(re:replace("aaaaaaaaa","(a)\\1{8,}","UN&AS\\1e",[])),
- <<"UNaaaaaaaaaASae">> = iolist_to_binary(re:replace("aaaaaaaaa","(a)\\1{8,}","UN&AS\\1e",[global])),
- <<"tceAbivVhQav">> = iolist_to_binary(re:replace("aaaaaaaaaa","(a)\\1{8,}","tceAbivVhQ\\1v",[])),
- <<"tceAbivVhQav">> = iolist_to_binary(re:replace("aaaaaaaaaa","(a)\\1{8,}","tceAbivVhQ\\1v",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a)\\1{8,}","&\\1CR\\1G\\1lXwnVv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a)\\1{8,}","&\\1CR\\1G\\1lXwnVv",[global])),
- <<"aaaaaaa">> = iolist_to_binary(re:replace("aaaaaaa","(a)\\1{8,}","\\1okyxc\\1yX\\1vEJ&&",[])),
- <<"aaaaaaa">> = iolist_to_binary(re:replace("aaaaaaa","(a)\\1{8,}","\\1okyxc\\1yX\\1vEJ&&",[global])),
- <<"aaaaXxrcd">> = iolist_to_binary(re:replace("aaaabcd","[^a]","Xxr",[])),
- <<"aaaaXxrXxrXxr">> = iolist_to_binary(re:replace("aaaabcd","[^a]","Xxr",[global])),
- <<"aaarLbBCUOMivTWabcd">> = iolist_to_binary(re:replace("aaAabcd","[^a]","arLbBC\\1UOMivTW",[])),
- <<"aaarLbBCUOMivTWaarLbBCUOMivTWarLbBCUOMivTWarLbBCUOMivTW">> = iolist_to_binary(re:replace("aaAabcd","[^a]","arLbBC\\1UOMivTW",[global])),
+ <<"ntA8B9CNSA8B9CLRL">> = iolist_to_binary(re:replace("A8B9C","^[A\\8B\\9C]+$","nt\\1&NS\\1&LRL",[])),
+ <<"ntA8B9CNSA8B9CLRL">> = iolist_to_binary(re:replace("A8B9C","^[A\\8B\\9C]+$","nt\\1&NS\\1&LRL",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[A\\8B\\9C]+$","YwqNG",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[A\\8B\\9C]+$","YwqNG",[global])),
+ <<"k">> = iolist_to_binary(re:replace("A8B9C","^[A\\8B\\9C]+$","k",[])),
+ <<"k">> = iolist_to_binary(re:replace("A8B9C","^[A\\8B\\9C]+$","k",[global])),
+ <<"KwWOabcdefghijkllSabcdefghijkllSvstprfvanSvjsa">> = iolist_to_binary(re:replace("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123","KwWO&&vstprfv\\1nSvjs\\1",[])),
+ <<"KwWOabcdefghijkllSabcdefghijkllSvstprfvanSvjsa">> = iolist_to_binary(re:replace("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123","KwWO&&vstprfv\\1nSvjs\\1",[global])),
+ <<"abcdefghijk
+SDuSaDcpmCspdNx">> = iolist_to_binary(re:replace("abcdefghijk
+S","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\12\\123","&DuSaDcpmCspdNx",[])),
+ <<"abcdefghijk
+SDuSaDcpmCspdNx">> = iolist_to_binary(re:replace("abcdefghijk
+S","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)\\12\\123","&DuSaDcpmCspdNx",[global])),
+ <<"abidefabidefvPJabidefabidefVKxVnKE">> = iolist_to_binary(re:replace("abidef","ab\\idef","\\1&&vPJ&&VKxVnKE",[])),
+ <<"abidefabidefvPJabidefabidefVKxVnKE">> = iolist_to_binary(re:replace("abidef","ab\\idef","\\1&&vPJ&&VKxVnKE",[global])),
+ <<"gkpETbcFhESR">> = iolist_to_binary(re:replace("bc","a{0}bc","gkpET&F\\1hESR",[])),
+ <<"gkpETbcFhESR">> = iolist_to_binary(re:replace("bc","a{0}bc","gkpET&F\\1hESR",[global])),
+ <<"wpngtyXvInxyzIb">> = iolist_to_binary(re:replace("xyz","(a|(bc)){0,0}?xyz","wpngtyXvIn&Ib",[])),
+ <<"wpngtyXvInxyzIb">> = iolist_to_binary(re:replace("xyz","(a|(bc)){0,0}?xyz","wpngtyXvIn&Ib",[global])),
+ <<"CdxabcdeJtWN">> = iolist_to_binary(re:replace("abcde","abc[\\10]de","Cdx\\1&JtWN",[])),
+ <<"CdxabcdeJtWN">> = iolist_to_binary(re:replace("abcde","abc[\\10]de","Cdx\\1&JtWN",[global])),
+ <<"nXabcdeLWqofabcdeabcdeM">> = iolist_to_binary(re:replace("abcde","abc[\\1]de","nX&LWqof&&M",[])),
+ <<"nXabcdeLWqofabcdeabcdeM">> = iolist_to_binary(re:replace("abcde","abc[\\1]de","nX&LWqof&&M",[global])),
+ <<"cxVabcdeXabcdeUabcdeabcdeabcIT">> = iolist_to_binary(re:replace("abcde","(abc)[\\1]de","cxV&X&U&&\\1IT",[])),
+ <<"cxVabcdeXabcdeUabcdeabcdeabcIT">> = iolist_to_binary(re:replace("abcde","(abc)[\\1]de","cxV&X&U&&\\1IT",[global])),
+ <<"nDa
+bOua
+bEE">> = iolist_to_binary(re:replace("a
+b","(?s)a.b","nD&Ou&EE",[])),
+ <<"nDa
+bOua
+bEE">> = iolist_to_binary(re:replace("a
+b","(?s)a.b","nD&Ou&EE",[global])),
+ <<"ytBjWJbyKhvRd">> = iolist_to_binary(re:replace("baNOTccccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ytBjWJ\\1yKhvR",[])),
+ <<"ytBjWJbyKhvRd">> = iolist_to_binary(re:replace("baNOTccccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ytBjWJ\\1yKhvR",[global])),
+ <<"rKbaNOTcccNsPd">> = iolist_to_binary(re:replace("baNOTcccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","rK&NsP",[])),
+ <<"rKbaNOTcccNsPd">> = iolist_to_binary(re:replace("baNOTcccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","rK&NsP",[global])),
+ <<"ADtLINvwgrd">> = iolist_to_binary(re:replace("baNOTccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ADtLINvwgr",[])),
+ <<"ADtLINvwgrd">> = iolist_to_binary(re:replace("baNOTccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","ADtLINvwgr",[global])),
+ <<"XbbLidrbacccJbacccbQdd">> = iolist_to_binary(re:replace("bacccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","X\\1\\1Lidr&J&\\1Qd",[])),
+ <<"XbbLidrbacccJbacccbQdd">> = iolist_to_binary(re:replace("bacccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","X\\1\\1Lidr&J&\\1Qd",[global])),
+ <<"QAX">> = iolist_to_binary(re:replace("*** Failers","^([^a])([^\\b])([^c]*)([^d]{3,4})","QAX",[])),
+ <<"QAX">> = iolist_to_binary(re:replace("*** Failers","^([^a])([^\\b])([^c]*)([^d]{3,4})","QAX",[global])),
+ <<"anything">> = iolist_to_binary(re:replace("anything","^([^a])([^\\b])([^c]*)([^d]{3,4})","\\1nMgDDeE&j\\1IL",[])),
+ <<"anything">> = iolist_to_binary(re:replace("anything","^([^a])([^\\b])([^c]*)([^d]{3,4})","\\1nMgDDeE&j\\1IL",[global])),
+ <<"bc">> = iolist_to_binary(re:replace("bc","^([^a])([^\\b])([^c]*)([^d]{3,4})","WSh\\1fvByAl&",[])),
+ <<"bc">> = iolist_to_binary(re:replace("bc","^([^a])([^\\b])([^c]*)([^d]{3,4})","WSh\\1fvByAl&",[global])),
+ <<"baccd">> = iolist_to_binary(re:replace("baccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","BQkU&N&sI\\1M&Aaxu",[])),
+ <<"baccd">> = iolist_to_binary(re:replace("baccd","^([^a])([^\\b])([^c]*)([^d]{3,4})","BQkU&N&sI\\1M&Aaxu",[global])),
+ <<"AyfrxEdFbc">> = iolist_to_binary(re:replace("Abc","[^a]","&yfrxEdF",[])),
+ <<"AyfrxEdFbyfrxEdFcyfrxEdF">> = iolist_to_binary(re:replace("Abc","[^a]","&yfrxEdF",[global])),
+ <<"AOuc">> = iolist_to_binary(re:replace("Abc","[^a]","Ou",[caseless])),
+ <<"AOuOu">> = iolist_to_binary(re:replace("Abc","[^a]","Ou",[caseless,
+ global])),
+ <<"AAAqCQCkBIVIMNQHYaAbc">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","&qCQCkBIVIMN\\1QHY",[])),
+ <<"AAAqCQCkBIVIMNQHYaAbcqCQCkBIVIMNQHY">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","&qCQCkBIVIMN\\1QHY",[global])),
+ <<"AAAaABepbcHkVKbcFjuIYfIMUy">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","Bep&HkVK&FjuIYfIMUy",[caseless])),
+ <<"AAAaABepbcHkVKbcFjuIYfIMUy">> = iolist_to_binary(re:replace("AAAaAbc","[^a]+","Bep&HkVK&FjuIYfIMUy",[caseless,
+ global])),
+ <<"VUQibbb
+cccJFuaTHwoAPgw">> = iolist_to_binary(re:replace("bbb
+ccc","[^a]+","VUQi&\\1\\1JFuaTHwoAPgw",[])),
+ <<"VUQibbb
+cccJFuaTHwoAPgw">> = iolist_to_binary(re:replace("bbb
+ccc","[^a]+","VUQi&\\1\\1JFuaTHwoAPgw",[global])),
+ <<"abwR">> = iolist_to_binary(re:replace("abc","[^k]$","wR",[])),
+ <<"abwR">> = iolist_to_binary(re:replace("abc","[^k]$","wR",[global])),
+ <<"*** FailerrJBXyKAos">> = iolist_to_binary(re:replace("*** Failers","[^k]$","rJBXyKAo\\1&",[])),
+ <<"*** FailerrJBXyKAos">> = iolist_to_binary(re:replace("*** Failers","[^k]$","rJBXyKAo\\1&",[global])),
+ <<"abk">> = iolist_to_binary(re:replace("abk","[^k]$","\\1tMfh\\1rw&&X&",[])),
+ <<"abk">> = iolist_to_binary(re:replace("abk","[^k]$","\\1tMfh\\1rw&&X&",[global])),
+ <<"BabcMabcBstTttabcC">> = iolist_to_binary(re:replace("abc","[^k]{2,3}$","B&M\\1&B\\1stTtt&C",[])),
+ <<"BabcMabcBstTttabcC">> = iolist_to_binary(re:replace("abc","[^k]{2,3}$","B&M\\1&B\\1stTtt&C",[global])),
+ <<"kGmnpTVRbbcthURLl">> = iolist_to_binary(re:replace("kbc","[^k]{2,3}$","Gmnp\\1TVRb&thURLl",[])),
+ <<"kGmnpTVRbbcthURLl">> = iolist_to_binary(re:replace("kbc","[^k]{2,3}$","Gmnp\\1TVRb&thURLl",[global])),
+ <<"kSwSBmFSuyEabcic">> = iolist_to_binary(re:replace("kabc","[^k]{2,3}$","SwSBmFSu\\1yE&ic",[])),
+ <<"kSwSBmFSuyEabcic">> = iolist_to_binary(re:replace("kabc","[^k]{2,3}$","SwSBmFSu\\1yE&ic",[global])),
+ <<"*** FailmVk">> = iolist_to_binary(re:replace("*** Failers","[^k]{2,3}$","mVk\\1",[])),
+ <<"*** FailmVk">> = iolist_to_binary(re:replace("*** Failers","[^k]{2,3}$","mVk\\1",[global])),
+ <<"abk">> = iolist_to_binary(re:replace("abk","[^k]{2,3}$","f",[])),
+ <<"abk">> = iolist_to_binary(re:replace("abk","[^k]{2,3}$","f",[global])),
+ <<"akb">> = iolist_to_binary(re:replace("akb","[^k]{2,3}$","XISfG\\1L&Yg",[])),
+ <<"akb">> = iolist_to_binary(re:replace("akb","[^k]{2,3}$","XISfG\\1L&Yg",[global])),
+ <<"akk">> = iolist_to_binary(re:replace("akk","[^k]{2,3}$","JnS\\1Snscc\\1\\1WP\\1\\1",[])),
+ <<"akk">> = iolist_to_binary(re:replace("akk","[^k]{2,3}$","JnS\\1Snscc\\1\\1WP\\1\\1",[global])),
+ <<"12345678.b.c.d">> = iolist_to_binary(re:replace("12345678.b.c.d","^\\d{8,}\\@.+[^k]$","uF&rXNLErr\\1yUY",[])),
+ <<"12345678.b.c.d">> = iolist_to_binary(re:replace("12345678.b.c.d","^\\d{8,}\\@.+[^k]$","uF&rXNLErr\\1yUY",[global])),
+ <<"123456789.y.z">> = iolist_to_binary(re:replace("123456789.y.z","^\\d{8,}\\@.+[^k]$","YFlP&",[])),
+ <<"123456789.y.z">> = iolist_to_binary(re:replace("123456789.y.z","^\\d{8,}\\@.+[^k]$","YFlP&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8,}\\@.+[^k]$","twTFob&o&kbYfyf&N",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\d{8,}\\@.+[^k]$","twTFob&o&kbYfyf&N",[global])),
+ <<"12345678.y.uk">> = iolist_to_binary(re:replace("12345678.y.uk","^\\d{8,}\\@.+[^k]$","iN&UAvL",[])),
+ <<"12345678.y.uk">> = iolist_to_binary(re:replace("12345678.y.uk","^\\d{8,}\\@.+[^k]$","iN&UAvL",[global])),
+ <<"1234567.b.c.d">> = iolist_to_binary(re:replace("1234567.b.c.d","^\\d{8,}\\@.+[^k]$","r&h\\1PJBc&xhdRAd&",[])),
+ <<"1234567.b.c.d">> = iolist_to_binary(re:replace("1234567.b.c.d","^\\d{8,}\\@.+[^k]$","r&h\\1PJBc&xhdRAd&",[global])),
+ <<"JUaaaaaaaaaakaaaaaaaaaaJByoSTnBssaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","(a)\\1{8,}","JUa&k\\1&JByoSTnBss&",[])),
+ <<"JUaaaaaaaaaakaaaaaaaaaaJByoSTnBssaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","(a)\\1{8,}","JUa&k\\1&JByoSTnBss&",[global])),
+ <<"haoaaaaaaaaaacp">> = iolist_to_binary(re:replace("aaaaaaaaaa","(a)\\1{8,}","hao&cp",[])),
+ <<"haoaaaaaaaaaacp">> = iolist_to_binary(re:replace("aaaaaaaaaa","(a)\\1{8,}","hao&cp",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a)\\1{8,}","Ns",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a)\\1{8,}","Ns",[global])),
+ <<"aaaaaaa">> = iolist_to_binary(re:replace("aaaaaaa","(a)\\1{8,}","Ye\\1kfvX&&crmMcd",[])),
+ <<"aaaaaaa">> = iolist_to_binary(re:replace("aaaaaaa","(a)\\1{8,}","Ye\\1kfvX&&crmMcd",[global])),
ok.
run7() ->
- <<"aaaapwMAbnNcRDBcd">> = iolist_to_binary(re:replace("aaaabcd","[^a]","pwMA&\\1n\\1NcRDB",[caseless])),
- <<"aaaapwMAbnNcRDBpwMAcnNcRDBpwMAdnNcRDB">> = iolist_to_binary(re:replace("aaaabcd","[^a]","pwMA&\\1n\\1NcRDB",[caseless,
- global])),
- <<"aaAaUjWwoTQoHtojaVMGDcd">> = iolist_to_binary(re:replace("aaAabcd","[^a]","UjWwoTQoHtoja\\1\\1VMGD\\1",[caseless])),
- <<"aaAaUjWwoTQoHtojaVMGDUjWwoTQoHtojaVMGDUjWwoTQoHtojaVMGD">> = iolist_to_binary(re:replace("aaAabcd","[^a]","UjWwoTQoHtoja\\1\\1VMGD\\1",[caseless,
- global])),
- <<"aaaapmJHbuyrGSgPWcd">> = iolist_to_binary(re:replace("aaaabcd","[^az]","pmJH&uyr\\1GSgPW",[])),
- <<"aaaapmJHbuyrGSgPWpmJHcuyrGSgPWpmJHduyrGSgPW">> = iolist_to_binary(re:replace("aaaabcd","[^az]","pmJH&uyr\\1GSgPW",[global])),
- <<"aaYcjbFRuBabcd">> = iolist_to_binary(re:replace("aaAabcd","[^az]","Y\\1cjbFRu\\1B",[])),
- <<"aaYcjbFRuBaYcjbFRuBYcjbFRuBYcjbFRuB">> = iolist_to_binary(re:replace("aaAabcd","[^az]","Y\\1cjbFRu\\1B",[global])),
- <<"aaaaBbjBVQSSpboacd">> = iolist_to_binary(re:replace("aaaabcd","[^az]","\\1B&jB\\1VQSSp&\\1\\1o\\1a",[caseless])),
- <<"aaaaBbjBVQSSpboaBcjBVQSSpcoaBdjBVQSSpdoa">> = iolist_to_binary(re:replace("aaaabcd","[^az]","\\1B&jB\\1VQSSp&\\1\\1o\\1a",[caseless,
- global])),
- <<"aaAaibNcd">> = iolist_to_binary(re:replace("aaAabcd","[^az]","i&N",[caseless])),
- <<"aaAaibNicNidN">> = iolist_to_binary(re:replace("aaAabcd","[^az]","i&N",[caseless,
- global])),
- <<"xxxxxxxxxxxyxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,6}?LL","y",[])),
- <<"xxxxxxxxxxxyxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,6}?LL","y",[global])),
- <<"xxxxxxxxxxxPSTAIREISLLQxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,}?LL","&Q",[])),
- <<"xxxxxxxxxxxPSTAIREISLLQxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,}?LL","&Q",[global])),
- <<"1uJmu.23V.23UHIOGab">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d[1-9]?)\\d+","uJmu\\1V\\1UHIOGab",[])),
- <<"1uJmu.23V.23UHIOGab">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d[1-9]?)\\d+","uJmu\\1V\\1UHIOGab",[global])),
- <<"1DI.875.875000282NK.875000282.875j">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d[1-9]?)\\d+","DI\\1&NK&\\1j",[])),
- <<"1DI.875.875000282NK.875000282.875j">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d[1-9]?)\\d+","DI\\1&NK&\\1j",[global])),
- <<"1L.235.23HWQNY.23KfHhq.235.23ggY">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d[1-9]?)\\d+","L&\\1HWQNY\\1KfHhq&\\1ggY",[])),
- <<"1L.235.23HWQNY.23KfHhq.235.23ggY">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d[1-9]?)\\d+","L&\\1HWQNY\\1KfHhq&\\1ggY",[global])),
- <<"1DSE0003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d((?=0)|\\d(?=\\d)))","DSE",[])),
- <<"1DSE0003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d((?=0)|\\d(?=\\d)))","DSE",[global])),
- <<"1LaUySoWUFF.875.875.875000282">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d((?=0)|\\d(?=\\d)))","LaUySoWUFF&&\\1",[])),
- <<"1LaUySoWUFF.875.875.875000282">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d((?=0)|\\d(?=\\d)))","LaUySoWUFF&&\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\.\\d\\d((?=0)|\\d(?=\\d)))","tRWNXmOIDc\\1&GGpOuk",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\.\\d\\d((?=0)|\\d(?=\\d)))","tRWNXmOIDc\\1&GGpOuk",[global])),
- <<"1.235">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d((?=0)|\\d(?=\\d)))","lYmo&PAOYv",[])),
- <<"1.235">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d((?=0)|\\d(?=\\d)))","lYmo&PAOYv",[global])),
- <<"reSOwDabTAGPdSa">> = iolist_to_binary(re:replace("ab","a(?)b","reSOwD\\1&TAGPdSa",[])),
- <<"reSOwDabTAGPdSa">> = iolist_to_binary(re:replace("ab","a(?)b","reSOwD\\1&TAGPdSa",[global])),
- <<"Food is on the OvbQHtTuN">> = iolist_to_binary(re:replace("Food is on the foo table","\\b(foo)\\s+(\\w+)","OvbQHtTuN",[caseless])),
- <<"Food is on the OvbQHtTuN">> = iolist_to_binary(re:replace("Food is on the foo table","\\b(foo)\\s+(\\w+)","OvbQHtTuN",[caseless,
- global])),
- <<"The jd is under the bar in the d is under the bar in the food is under the bar in the barRfood is under the bar in the barfood is under the bar in the barjESIDd is under the bar in the GWBDn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*)bar","j\\1\\1&R&&jESID\\1GWBD",[])),
- <<"The jd is under the bar in the d is under the bar in the food is under the bar in the barRfood is under the bar in the barfood is under the bar in the barjESIDd is under the bar in the GWBDn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*)bar","j\\1\\1&R&&jESID\\1GWBD",[global])),
- <<"The Mtfood is under the bard is under the sCjcC in the barn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*?)bar","Mt&\\1sCjcC",[])),
- <<"The Mtfood is under the bard is under the sCjcC in the barn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*?)bar","Mt&\\1sCjcC",[global])),
- <<"II have 2 numbers: 53147sQEJI have 2 numbers: 53147I have 2 numbers: 53147QI have 2 numbers: 53147I have 2 numbers: 53147Y">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d*)","I&sQEJ\\1\\1Q\\1\\1Y",[])),
- <<"II have 2 numbers: 53147sQEJI have 2 numbers: 53147I have 2 numbers: 53147QI have 2 numbers: 53147I have 2 numbers: 53147YIsQEJQY">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d*)","I&sQEJ\\1\\1Q\\1\\1Y",[global])),
- <<"BjeLtTBnKKfmuI have 2 numbers: 53147Q">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)","BjeLtTBnKKfmu&Q",[])),
- <<"BjeLtTBnKKfmuI have 2 numbers: 53147Q">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)","BjeLtTBnKKfmu&Q",[global])),
- <<"XjUoIVWVCosccRPCI have 2 numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d*)","XjUoIVW\\1VCosccRPC&&",[])),
- <<"XjUoIVWVCosccRPCXjUoIVWIVCosccRPCIIXjUoIVWVCosccRPCXjUoIVW VCosccRPC XjUoIVWVCosccRPCXjUoIVWhVCosccRPChhXjUoIVWVCosccRPCXjUoIVWaVCosccRPCaaXjUoIVWVCosccRPCXjUoIVWvVCosccRPCvvXjUoIVWVCosccRPCXjUoIVWeVCosccRPCeeXjUoIVWVCosccRPCXjUoIVW VCosccRPC 2 2XjUoIVWVCosccRPCXjUoIVW VCosccRPC XjUoIVWVCosccRPCXjUoIVWnVCosccRPCnnXjUoIVWVCosccRPCXjUoIVWuVCosccRPCuuXjUoIVWVCosccRPCXjUoIVWmVCosccRPCmmXjUoIVWVCosccRPCXjUoIVWbVCosccRPCbbXjUoIVWVCosccRPCXjUoIVWeVCosccRPCeeXjUoIVWVCosccRPCXjUoIVWrVCosccRPCrrXjUoIVWVCosccRPCXjUoIVWsVCosccRPCssXjUoIVWVCosccRPCXjUoIVW:VCosccRPC::XjUoIVWVCosccRPCXjUoIVW VCosccRPC 53147 53147XjUoIVWVCosccRPC">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d*)","XjUoIVW\\1VCosccRPC&&",[global])),
- <<"LnetbRUI have woRN numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)","LnetbRU\\1woRN",[])),
- <<"LnetbRUI have woRNLnetbRU numbers: woRN">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)","LnetbRU\\1woRN",[global])),
- <<"dD">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)$","dD",[])),
- <<"dD">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)$","dD",[global])),
- <<"I have 2 numbers: vpu">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)$","\\1vpu",[])),
- <<"I have 2 numbers: vpu">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)$","\\1vpu",[global])),
- <<"rEcQnOiThojYmI have 2 numbers: ysnN">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)\\b(\\d+)$","rEcQnOiThojYm\\1ysnN",[])),
- <<"rEcQnOiThojYmI have 2 numbers: ysnN">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)\\b(\\d+)$","rEcQnOiThojYm\\1ysnN",[global])),
- <<"DI have 2 numbers: 53147WrwmlgEQLiI have 2 numbers: 53147NE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*\\D)(\\d+)$","D&WrwmlgEQLi&NE",[])),
- <<"DI have 2 numbers: 53147WrwmlgEQLiI have 2 numbers: 53147NE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*\\D)(\\d+)$","D&WrwmlgEQLi&NE",[global])),
+ <<"aaaaltSVkYwcd">> = iolist_to_binary(re:replace("aaaabcd","[^a]","ltSVkYw\\1",[])),
+ <<"aaaaltSVkYwltSVkYwltSVkYw">> = iolist_to_binary(re:replace("aaaabcd","[^a]","ltSVkYw\\1",[global])),
+ <<"aasDabcd">> = iolist_to_binary(re:replace("aaAabcd","[^a]","sD",[])),
+ <<"aasDasDsDsD">> = iolist_to_binary(re:replace("aaAabcd","[^a]","sD",[global])),
+ <<"aaaaRlocpcd">> = iolist_to_binary(re:replace("aaaabcd","[^a]","Rlocp",[caseless])),
+ <<"aaaaRlocpRlocpRlocp">> = iolist_to_binary(re:replace("aaaabcd","[^a]","Rlocp",[caseless,
+ global])),
+ <<"aaAakvpCtRfJcd">> = iolist_to_binary(re:replace("aaAabcd","[^a]","kvpCtRfJ",[caseless])),
+ <<"aaAakvpCtRfJkvpCtRfJkvpCtRfJ">> = iolist_to_binary(re:replace("aaAabcd","[^a]","kvpCtRfJ",[caseless,
+ global])),
+ <<"aaaaHKcd">> = iolist_to_binary(re:replace("aaaabcd","[^az]","HK",[])),
+ <<"aaaaHKHKHK">> = iolist_to_binary(re:replace("aaaabcd","[^az]","HK",[global])),
+ <<"aaGTgGQtMuEWBAASqhabcd">> = iolist_to_binary(re:replace("aaAabcd","[^az]","GTgGQtMuEWB&&Sqh",[])),
+ <<"aaGTgGQtMuEWBAASqhaGTgGQtMuEWBbbSqhGTgGQtMuEWBccSqhGTgGQtMuEWBddSqh">> = iolist_to_binary(re:replace("aaAabcd","[^az]","GTgGQtMuEWB&&Sqh",[global])),
+ <<"aaaaJbKddOBcd">> = iolist_to_binary(re:replace("aaaabcd","[^az]","\\1J&KddOB",[caseless])),
+ <<"aaaaJbKddOBJcKddOBJdKddOB">> = iolist_to_binary(re:replace("aaaabcd","[^az]","\\1J&KddOB",[caseless,
+ global])),
+ <<"aaAasOBrbksjdVYVcd">> = iolist_to_binary(re:replace("aaAabcd","[^az]","sO\\1Br&ksjdVYV",[caseless])),
+ <<"aaAasOBrbksjdVYVsOBrcksjdVYVsOBrdksjdVYV">> = iolist_to_binary(re:replace("aaAabcd","[^az]","sO\\1Br&ksjdVYV",[caseless,
+ global])),
+ <<"xxxxxxxxxxxIWxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,6}?LL","IW",[])),
+ <<"xxxxxxxxxxxIWxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,6}?LL","IW",[global])),
+ <<"xxxxxxxxxxxguMkfUyxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,}?LL","\\1guMkfU\\1y",[])),
+ <<"xxxxxxxxxxxguMkfUyxxxxxxxxx">> = iolist_to_binary(re:replace("xxxxxxxxxxxPSTAIREISLLxxxxxxxxx","P[^*]TAIRE[^*]{1,}?LL","\\1guMkfU\\1y",[global])),
+ <<"1ELdCrl.23X.230003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d[1-9]?)\\d+","ELdCrl\\1X&",[])),
+ <<"1ELdCrl.23X.230003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d[1-9]?)\\d+","ELdCrl\\1X&",[global])),
+ <<"1bq">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d[1-9]?)\\d+","bq",[])),
+ <<"1bq">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d[1-9]?)\\d+","bq",[global])),
+ <<"1ODL">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d[1-9]?)\\d+","ODL",[])),
+ <<"1ODL">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d[1-9]?)\\d+","ODL",[global])),
+ <<"1ncD0003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d((?=0)|\\d(?=\\d)))","ncD",[])),
+ <<"1ncD0003938">> = iolist_to_binary(re:replace("1.230003938","(\\.\\d\\d((?=0)|\\d(?=\\d)))","ncD",[global])),
+ <<"1qgBuDW.875yC000282">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d((?=0)|\\d(?=\\d)))","qgBuDW\\1yC",[])),
+ <<"1qgBuDW.875yC000282">> = iolist_to_binary(re:replace("1.875000282","(\\.\\d\\d((?=0)|\\d(?=\\d)))","qgBuDW\\1yC",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\.\\d\\d((?=0)|\\d(?=\\d)))","X&Y",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\.\\d\\d((?=0)|\\d(?=\\d)))","X&Y",[global])),
+ <<"1.235">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d((?=0)|\\d(?=\\d)))","\\1luUxXVR&J\\1&\\1",[])),
+ <<"1.235">> = iolist_to_binary(re:replace("1.235","(\\.\\d\\d((?=0)|\\d(?=\\d)))","\\1luUxXVR&J\\1&\\1",[global])),
+ <<"Qko">> = iolist_to_binary(re:replace("ab","a(?)b","\\1Qko",[])),
+ <<"Qko">> = iolist_to_binary(re:replace("ab","a(?)b","\\1Qko",[global])),
+ <<"Food is on the dfoo tablefoofoo tabledfoofoofoo tablelEfooUAnHX">> = iolist_to_binary(re:replace("Food is on the foo table","\\b(foo)\\s+(\\w+)","d&\\1&d\\1\\1&lE\\1UAnHX",[caseless])),
+ <<"Food is on the dfoo tablefoofoo tabledfoofoofoo tablelEfooUAnHX">> = iolist_to_binary(re:replace("Food is on the foo table","\\b(foo)\\s+(\\w+)","d&\\1&d\\1\\1&lE\\1UAnHX",[caseless,
+ global])),
+ <<"The vUTXiRfood is under the bar in the bardPCn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*)bar","vUTXiR&dPC",[])),
+ <<"The vUTXiRfood is under the bar in the bardPCn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*)bar","vUTXiR&dPC",[global])),
+ <<"The PYYEJfood is under the barYsN in the barn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*?)bar","PYYEJ&YsN",[])),
+ <<"The PYYEJfood is under the barYsN in the barn.">> = iolist_to_binary(re:replace("The food is under the bar in the barn.","foo(.*?)bar","PYYEJ&YsN",[global])),
+ <<"HHotxYrI have 2 numbers: 53147MmBIIeE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d*)","HHotxYr&MmBIIeE",[])),
+ <<"HHotxYrI have 2 numbers: 53147MmBIIeEHHotxYrMmBIIeE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d*)","HHotxYr&MmBIIeE",[global])),
+ <<"qDOVI have 2 numbers: 53147omApQI have 2 numbers: 5314sBev">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)","qDOV&omApQ\\1sBev",[])),
+ <<"qDOVI have 2 numbers: 53147omApQI have 2 numbers: 5314sBev">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)","qDOV&omApQ\\1sBev",[global])),
+ <<"RvAXeRffNRsnI have 2 numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d*)","Rv&AXeR&f&fNRsn&",[])),
+ <<"RvAXeRffNRsnRvIAXeRIfIfNRsnIRvAXeRffNRsnRv AXeR f fNRsn RvAXeRffNRsnRvhAXeRhfhfNRsnhRvAXeRffNRsnRvaAXeRafafNRsnaRvAXeRffNRsnRvvAXeRvfvfNRsnvRvAXeRffNRsnRveAXeRefefNRsneRvAXeRffNRsnRv 2AXeR 2f 2fNRsn 2RvAXeRffNRsnRv AXeR f fNRsn RvAXeRffNRsnRvnAXeRnfnfNRsnnRvAXeRffNRsnRvuAXeRufufNRsnuRvAXeRffNRsnRvmAXeRmfmfNRsnmRvAXeRffNRsnRvbAXeRbfbfNRsnbRvAXeRffNRsnRveAXeRefefNRsneRvAXeRffNRsnRvrAXeRrfrfNRsnrRvAXeRffNRsnRvsAXeRsfsfNRsnsRvAXeRffNRsnRv:AXeR:f:fNRsn:RvAXeRffNRsnRv 53147AXeR 53147f 53147fNRsn 53147RvAXeRffNRsn">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d*)","Rv&AXeR&f&fNRsn&",[global])),
+ <<"TOVi numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)","TOVi",[])),
+ <<"TOViTOVi">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)","TOVi",[global])),
+ <<"CAI have 2 numbers: 5314I have 2 numbers: 5314OgviGuI have 2 numbers: 53147nI have 2 numbers: 53147G">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)$","CA\\1\\1OgviGu&n&G",[])),
+ <<"CAI have 2 numbers: 5314I have 2 numbers: 5314OgviGuI have 2 numbers: 53147nI have 2 numbers: 53147G">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)(\\d+)$","CA\\1\\1OgviGu&n&G",[global])),
+ <<"uMVspI have 2 numbers: 53147VVs">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)$","uMVsp&VVs",[])),
+ <<"uMVspI have 2 numbers: 53147VVs">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*?)(\\d+)$","uMVsp&VVs",[global])),
+ <<"exxLI have 2 numbers: 53147KHfPaoE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)\\b(\\d+)$","exxL&KHfPaoE",[])),
+ <<"exxLI have 2 numbers: 53147KHfPaoE">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*)\\b(\\d+)$","exxL&KHfPaoE",[global])),
ok.
run8() ->
- <<"ABcsqUeQdAAByYxNC123">> = iolist_to_binary(re:replace("ABC123","^\\D*(?!123)","&csq\\1UeQdA&yYxN",[])),
- <<"ABcsqUeQdAAByYxNC123">> = iolist_to_binary(re:replace("ABC123","^\\D*(?!123)","&csq\\1UeQdA&yYxN",[global])),
- <<"KABCABCBP445">> = iolist_to_binary(re:replace("ABC445","^(\\D*)(?=\\d)(?!123)","K\\1&BP",[])),
- <<"KABCABCBP445">> = iolist_to_binary(re:replace("ABC445","^(\\D*)(?=\\d)(?!123)","K\\1&BP",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","kBiY&gp\\1BUO\\1l",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","kBiY&gp\\1BUO\\1l",[global])),
- <<"ABC123">> = iolist_to_binary(re:replace("ABC123","^(\\D*)(?=\\d)(?!123)","\\1YYe",[])),
- <<"ABC123">> = iolist_to_binary(re:replace("ABC123","^(\\D*)(?=\\d)(?!123)","\\1YYe",[global])),
- <<"W46]pbAIEqJRW46]W46]cNuYW46]789">> = iolist_to_binary(re:replace("W46]789","^[W-]46]","&pbAIEqJ\\1R&&cNuY&",[])),
- <<"W46]pbAIEqJRW46]W46]cNuYW46]789">> = iolist_to_binary(re:replace("W46]789","^[W-]46]","&pbAIEqJ\\1R&&cNuY&",[global])),
- <<"AXCFhT-46]LP-46]gILH-46]rA789">> = iolist_to_binary(re:replace("-46]789","^[W-]46]","AXCFhT&LP&gIL\\1H&rA",[])),
- <<"AXCFhT-46]LP-46]gILH-46]rA789">> = iolist_to_binary(re:replace("-46]789","^[W-]46]","AXCFhT&LP&gIL\\1H&rA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-]46]","ke&s",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-]46]","ke&s",[global])),
- <<"Wall">> = iolist_to_binary(re:replace("Wall","^[W-]46]","\\1C\\1VS&grCoMvM\\1",[])),
- <<"Wall">> = iolist_to_binary(re:replace("Wall","^[W-]46]","\\1C\\1VS&grCoMvM\\1",[global])),
- <<"Zebra">> = iolist_to_binary(re:replace("Zebra","^[W-]46]","G\\1\\1",[])),
- <<"Zebra">> = iolist_to_binary(re:replace("Zebra","^[W-]46]","G\\1\\1",[global])),
- <<"42">> = iolist_to_binary(re:replace("42","^[W-]46]","k\\1p&\\1&E&OlmU",[])),
- <<"42">> = iolist_to_binary(re:replace("42","^[W-]46]","k\\1p&\\1&E&OlmU",[global])),
- <<"[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-]46]","BHuM&QWt&V&Fw&R\\1",[])),
- <<"[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-]46]","BHuM&QWt&V&Fw&R\\1",[global])),
- <<"]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-]46]","bm\\1kBng&&HJv",[])),
- <<"]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-]46]","bm\\1kBng&&HJv",[global])),
- <<"YiVQVvgWY46]789">> = iolist_to_binary(re:replace("W46]789","^[W-\\]46]","Yi\\1VQVv\\1g&Y",[])),
- <<"YiVQVvgWY46]789">> = iolist_to_binary(re:replace("W46]789","^[W-\\]46]","Yi\\1VQVv\\1g&Y",[global])),
- <<"KJall">> = iolist_to_binary(re:replace("Wall","^[W-\\]46]","K\\1J",[])),
- <<"KJall">> = iolist_to_binary(re:replace("Wall","^[W-\\]46]","K\\1J",[global])),
- <<"ghebra">> = iolist_to_binary(re:replace("Zebra","^[W-\\]46]","gh",[])),
- <<"ghebra">> = iolist_to_binary(re:replace("Zebra","^[W-\\]46]","gh",[global])),
- <<"TQpylophone">> = iolist_to_binary(re:replace("Xylophone","^[W-\\]46]","TQp\\1",[])),
- <<"TQpylophone">> = iolist_to_binary(re:replace("Xylophone","^[W-\\]46]","TQp\\1",[global])),
- <<"4yTdgOXvDDmWf2">> = iolist_to_binary(re:replace("42","^[W-\\]46]","&y\\1TdgOXvDDm\\1Wf",[])),
- <<"4yTdgOXvDDmWf2">> = iolist_to_binary(re:replace("42","^[W-\\]46]","&y\\1TdgOXvDDm\\1Wf",[global])),
- <<"[OVexyXabcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-\\]46]","&OVexyX",[])),
- <<"[OVexyXabcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-\\]46]","&OVexyX",[global])),
- <<"HparACpuFCvG]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-\\]46]","HparACp\\1uFCvG&",[])),
- <<"HparACpuFCvG]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-\\]46]","HparACp\\1uFCvG&",[global])),
- <<"HQnantyI\\wNbackslash">> = iolist_to_binary(re:replace("\\backslash","^[W-\\]46]","HQnantyI&wN",[])),
- <<"HQnantyI\\wNbackslash">> = iolist_to_binary(re:replace("\\backslash","^[W-\\]46]","HQnantyI&wN",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-\\]46]","AMd&J\\1SokjY\\1\\1nK",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-\\]46]","AMd&J\\1SokjY\\1\\1nK",[global])),
- <<"-46]789">> = iolist_to_binary(re:replace("-46]789","^[W-\\]46]","RyY&cCj",[])),
- <<"-46]789">> = iolist_to_binary(re:replace("-46]789","^[W-\\]46]","RyY&cCj",[global])),
- <<"well">> = iolist_to_binary(re:replace("well","^[W-\\]46]","XPRm\\1VTejwB",[])),
- <<"well">> = iolist_to_binary(re:replace("well","^[W-\\]46]","XPRm\\1VTejwB",[global])),
- <<"oroGlaQAqnbI">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?:[a-zA-Z0-9]+ ){0,10}otherword","oroGlaQAqnbI",[])),
- <<"oroGlaQAqnbI">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?:[a-zA-Z0-9]+ ){0,10}otherword","oroGlaQAqnbI",[global])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?:[a-zA-Z0-9]+ ){0,10}otherword","&E\\1",[])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?:[a-zA-Z0-9]+ ){0,10}otherword","&E\\1",[global])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?:[a-zA-Z0-9]+ ){0,300}otherword","b\\1sLq\\1\\1P",[])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?:[a-zA-Z0-9]+ ){0,300}otherword","b\\1sLq\\1\\1P",[global])),
- <<"fPbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,0}","fP",[])),
- <<"fPbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,0}","fP",[global])),
- <<"jFVHnjWvnETRabc">> = iolist_to_binary(re:replace("abc","^(a){0,0}","jFVHn&j&WvnETR",[])),
- <<"jFVHnjWvnETRabc">> = iolist_to_binary(re:replace("abc","^(a){0,0}","jFVHn&j&WvnETR",[global])),
- <<"NDaab">> = iolist_to_binary(re:replace("aab","^(a){0,0}","ND",[])),
- <<"NDaab">> = iolist_to_binary(re:replace("aab","^(a){0,0}","ND",[global])),
- <<"RNIIKIcNvfeSEvtOPRObcd">> = iolist_to_binary(re:replace("bcd","^(a){0,1}","RNIIKIcNvfeSEvtO\\1PRO",[])),
- <<"RNIIKIcNvfeSEvtOPRObcd">> = iolist_to_binary(re:replace("bcd","^(a){0,1}","RNIIKIcNvfeSEvtO\\1PRO",[global])),
- <<"dDaaaaCaSvbc">> = iolist_to_binary(re:replace("abc","^(a){0,1}","dD&&&&C&Sv",[])),
- <<"dDaaaaCaSvbc">> = iolist_to_binary(re:replace("abc","^(a){0,1}","dD&&&&C&Sv",[global])),
- <<"cBbGtgJQnrojHMab">> = iolist_to_binary(re:replace("aab","^(a){0,1}","cBbGtgJQnrojHM",[])),
- <<"cBbGtgJQnrojHMab">> = iolist_to_binary(re:replace("aab","^(a){0,1}","cBbGtgJQnrojHM",[global])),
- <<"Mhbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,2}","\\1&M\\1h",[])),
- <<"Mhbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,2}","\\1&M\\1h",[global])),
- <<"aauJmduMieraXgHfaobc">> = iolist_to_binary(re:replace("abc","^(a){0,2}","&&uJmduMier\\1XgHf&o",[])),
- <<"aauJmduMieraXgHfaobc">> = iolist_to_binary(re:replace("abc","^(a){0,2}","&&uJmduMier\\1XgHf&o",[global])),
- <<"aaunb">> = iolist_to_binary(re:replace("aab","^(a){0,2}","&un",[])),
- <<"aaunb">> = iolist_to_binary(re:replace("aab","^(a){0,2}","&un",[global])),
- <<"osculgsNbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,3}","osculg&s&N&",[])),
- <<"osculgsNbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,3}","osculg&s&N&",[global])),
- <<"gerhgaeJRbnhIdabc">> = iolist_to_binary(re:replace("abc","^(a){0,3}","gerhg&eJRbnhId&",[])),
- <<"gerhgaeJRbnhIdabc">> = iolist_to_binary(re:replace("abc","^(a){0,3}","gerhg&eJRbnhId&",[global])),
- <<"emmqaaaesYb">> = iolist_to_binary(re:replace("aab","^(a){0,3}","emmq&\\1esY",[])),
- <<"emmqaaaesYb">> = iolist_to_binary(re:replace("aab","^(a){0,3}","emmq&\\1esY",[global])),
- <<"Rfafau">> = iolist_to_binary(re:replace("aaa","^(a){0,3}","Rf\\1f\\1u",[])),
- <<"Rfafau">> = iolist_to_binary(re:replace("aaa","^(a){0,3}","Rf\\1f\\1u",[global])),
- <<"Bbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,}","B",[])),
- <<"Bbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,}","B",[global])),
- <<"aOlCbc">> = iolist_to_binary(re:replace("abc","^(a){0,}","\\1OlC",[])),
- <<"aOlCbc">> = iolist_to_binary(re:replace("abc","^(a){0,}","\\1OlC",[global])),
- <<"ab">> = iolist_to_binary(re:replace("aab","^(a){0,}","\\1",[])),
- <<"ab">> = iolist_to_binary(re:replace("aab","^(a){0,}","\\1",[global])),
- <<"ECTqSuTCy">> = iolist_to_binary(re:replace("aaa","^(a){0,}","ECTqSuTCy",[])),
- <<"ECTqSuTCy">> = iolist_to_binary(re:replace("aaa","^(a){0,}","ECTqSuTCy",[global])),
- <<"WQhDeFb">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){0,}","WQhDeFb",[])),
- <<"WQhDeFb">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){0,}","WQhDeFb",[global])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,1}","k&&&pAWV&FHAQeCpc",[])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,1}","k&&&pAWV&FHAQeCpc",[global])),
- <<"rorUbgMQXaSaYGambc">> = iolist_to_binary(re:replace("abc","^(a){1,1}","rorUbgMQX&S\\1YG\\1m",[])),
- <<"rorUbgMQXaSaYGambc">> = iolist_to_binary(re:replace("abc","^(a){1,1}","rorUbgMQX&S\\1YG\\1m",[global])),
- <<"aNaaab">> = iolist_to_binary(re:replace("aab","^(a){1,1}","aN&\\1",[])),
- <<"aNaaab">> = iolist_to_binary(re:replace("aab","^(a){1,1}","aN&\\1",[global])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,2}","j\\1w\\1UDgbH",[])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,2}","j\\1w\\1UDgbH",[global])),
- <<"kNacaAaaHgaaWTaWaubc">> = iolist_to_binary(re:replace("abc","^(a){1,2}","kN\\1c\\1Aa&Hg\\1&WT&W&u",[])),
- <<"kNacaAaaHgaaWTaWaubc">> = iolist_to_binary(re:replace("abc","^(a){1,2}","kN\\1c\\1Aa&Hg\\1&WT&W&u",[global])),
- <<"AjaaammeJIb">> = iolist_to_binary(re:replace("aab","^(a){1,2}","Aj&\\1mmeJI",[])),
- <<"AjaaammeJIb">> = iolist_to_binary(re:replace("aab","^(a){1,2}","Aj&\\1mmeJI",[global])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,3}","&&TTjl\\1nt",[])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,3}","&&TTjl\\1nt",[global])),
- <<"UeMuRbc">> = iolist_to_binary(re:replace("abc","^(a){1,3}","UeMuR",[])),
- <<"UeMuRbc">> = iolist_to_binary(re:replace("abc","^(a){1,3}","UeMuR",[global])),
- <<"vFaaaSDjb">> = iolist_to_binary(re:replace("aab","^(a){1,3}","vF\\1&SDj",[])),
- <<"vFaaaSDjb">> = iolist_to_binary(re:replace("aab","^(a){1,3}","vF\\1&SDj",[global])),
- <<"CNwXaaa">> = iolist_to_binary(re:replace("aaa","^(a){1,3}","CNwX&",[])),
- <<"CNwXaaa">> = iolist_to_binary(re:replace("aaa","^(a){1,3}","CNwX&",[global])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,}","E\\1eK",[])),
- <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,}","E\\1eK",[global])),
- <<"IWaNYMwyOaJnfoPPMbc">> = iolist_to_binary(re:replace("abc","^(a){1,}","IW&NYMwyO\\1JnfoPPM",[])),
- <<"IWaNYMwyOaJnfoPPMbc">> = iolist_to_binary(re:replace("abc","^(a){1,}","IW&NYMwyO\\1JnfoPPM",[global])),
- <<"SaaafHrCab">> = iolist_to_binary(re:replace("aab","^(a){1,}","S&\\1fHrCa",[])),
- <<"SaaafHrCab">> = iolist_to_binary(re:replace("aab","^(a){1,}","S&\\1fHrCa",[global])),
- <<"MaYaaaRaAXUO">> = iolist_to_binary(re:replace("aaa","^(a){1,}","M\\1Y&R\\1AXUO",[])),
- <<"MaYaaaRaAXUO">> = iolist_to_binary(re:replace("aaa","^(a){1,}","M\\1Y&R\\1AXUO",[global])),
- <<"BsHaS">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){1,}","BsH\\1S",[])),
- <<"BsHaS">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){1,}","BsH\\1S",[global])),
- <<"borfle
-nJEnJAvwAybib.gifXvq
-no">> = iolist_to_binary(re:replace("borfle
-bib.gif
-no",".*\\.gif","nJEnJAvwAy&Xvq\\1",[])),
+ <<"GI have 2 numbers: 53147wBxahbWqKI have 2 numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*\\D)(\\d+)$","G&wBxahbWqK&",[])),
+ <<"GI have 2 numbers: 53147wBxahbWqKI have 2 numbers: 53147">> = iolist_to_binary(re:replace("I have 2 numbers: 53147","(.*\\D)(\\d+)$","G&wBxahbWqK&",[global])),
+ <<"ooXOkmSKHJC123">> = iolist_to_binary(re:replace("ABC123","^\\D*(?!123)","ooXOkm\\1SKHJ",[])),
+ <<"ooXOkmSKHJC123">> = iolist_to_binary(re:replace("ABC123","^\\D*(?!123)","ooXOkm\\1SKHJ",[global])),
+ <<"SABCIvPvMFj445">> = iolist_to_binary(re:replace("ABC445","^(\\D*)(?=\\d)(?!123)","S\\1IvPvMFj",[])),
+ <<"SABCIvPvMFj445">> = iolist_to_binary(re:replace("ABC445","^(\\D*)(?=\\d)(?!123)","S\\1IvPvMFj",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","AUFFK&dgWBBmewQfx&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\D*)(?=\\d)(?!123)","AUFFK&dgWBBmewQfx&",[global])),
+ <<"ABC123">> = iolist_to_binary(re:replace("ABC123","^(\\D*)(?=\\d)(?!123)","MHrweJqRiSN&vMX",[])),
+ <<"ABC123">> = iolist_to_binary(re:replace("ABC123","^(\\D*)(?=\\d)(?!123)","MHrweJqRiSN&vMX",[global])),
+ <<"dykX789">> = iolist_to_binary(re:replace("W46]789","^[W-]46]","dyk\\1X",[])),
+ <<"dykX789">> = iolist_to_binary(re:replace("W46]789","^[W-]46]","dyk\\1X",[global])),
+ <<"-46]-46]rksdKohP789">> = iolist_to_binary(re:replace("-46]789","^[W-]46]","&&rksdKohP",[])),
+ <<"-46]-46]rksdKohP789">> = iolist_to_binary(re:replace("-46]789","^[W-]46]","&&rksdKohP",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-]46]","kRw",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-]46]","kRw",[global])),
+ <<"Wall">> = iolist_to_binary(re:replace("Wall","^[W-]46]","abc&\\1NpH\\1&iHWAa&",[])),
+ <<"Wall">> = iolist_to_binary(re:replace("Wall","^[W-]46]","abc&\\1NpH\\1&iHWAa&",[global])),
+ <<"Zebra">> = iolist_to_binary(re:replace("Zebra","^[W-]46]","g",[])),
+ <<"Zebra">> = iolist_to_binary(re:replace("Zebra","^[W-]46]","g",[global])),
+ <<"42">> = iolist_to_binary(re:replace("42","^[W-]46]","Uj",[])),
+ <<"42">> = iolist_to_binary(re:replace("42","^[W-]46]","Uj",[global])),
+ <<"[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-]46]","lIXi\\1\\1GIq",[])),
+ <<"[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-]46]","lIXi\\1\\1GIq",[global])),
+ <<"]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-]46]","ALpo\\1E\\1X\\1Acu&",[])),
+ <<"]abcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-]46]","ALpo\\1E\\1X\\1Acu&",[global])),
+ <<"ltduUrjtoW46]789">> = iolist_to_binary(re:replace("W46]789","^[W-\\]46]","ltduU\\1rj\\1to&",[])),
+ <<"ltduUrjtoW46]789">> = iolist_to_binary(re:replace("W46]789","^[W-\\]46]","ltduU\\1rj\\1to&",[global])),
+ <<"HeHall">> = iolist_to_binary(re:replace("Wall","^[W-\\]46]","H\\1eH",[])),
+ <<"HeHall">> = iolist_to_binary(re:replace("Wall","^[W-\\]46]","H\\1eH",[global])),
+ <<"uebra">> = iolist_to_binary(re:replace("Zebra","^[W-\\]46]","u",[])),
+ <<"uebra">> = iolist_to_binary(re:replace("Zebra","^[W-\\]46]","u",[global])),
+ <<"ysQfXpOVCXaylophone">> = iolist_to_binary(re:replace("Xylophone","^[W-\\]46]","ysQf\\1&pO\\1VC&a",[])),
+ <<"ysQfXpOVCXaylophone">> = iolist_to_binary(re:replace("Xylophone","^[W-\\]46]","ysQf\\1&pO\\1VC&a",[global])),
+ <<"BX4UMd4MBxorPoSKMb2">> = iolist_to_binary(re:replace("42","^[W-\\]46]","\\1BX&UMd&MBxorPoSK\\1Mb",[])),
+ <<"BX4UMd4MBxorPoSKMb2">> = iolist_to_binary(re:replace("42","^[W-\\]46]","\\1BX&UMd&MBxorPoSK\\1Mb",[global])),
+ <<"S[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-\\]46]","\\1S&",[])),
+ <<"S[abcd]">> = iolist_to_binary(re:replace("[abcd]","^[W-\\]46]","\\1S&",[global])),
+ <<"XKhbeUQxIlabcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-\\]46]","X\\1K\\1hb\\1e\\1\\1UQxIl",[])),
+ <<"XKhbeUQxIlabcd[">> = iolist_to_binary(re:replace("]abcd[","^[W-\\]46]","X\\1K\\1hb\\1e\\1\\1UQxIl",[global])),
+ <<"dXqbackslash">> = iolist_to_binary(re:replace("\\backslash","^[W-\\]46]","\\1dXq",[])),
+ <<"dXqbackslash">> = iolist_to_binary(re:replace("\\backslash","^[W-\\]46]","\\1dXq",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-\\]46]","HOyNFM\\1mIhSgQdQ&K\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[W-\\]46]","HOyNFM\\1mIhSgQdQ&K\\1",[global])),
+ <<"-46]789">> = iolist_to_binary(re:replace("-46]789","^[W-\\]46]","rh&&Of\\1hH",[])),
+ <<"-46]789">> = iolist_to_binary(re:replace("-46]789","^[W-\\]46]","rh&&Of\\1hH",[global])),
+ <<"well">> = iolist_to_binary(re:replace("well","^[W-\\]46]","cbWVIYcxbQg\\1",[])),
+ <<"well">> = iolist_to_binary(re:replace("well","^[W-\\]46]","cbWVIYcxbQg\\1",[global])),
+ <<"NArawword cat dog elephant mussel cow horse canary baboon snake shark otherwordQ">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?:[a-zA-Z0-9]+ ){0,10}otherword","NAraw&\\1Q",[])),
+ <<"NArawword cat dog elephant mussel cow horse canary baboon snake shark otherwordQ">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?:[a-zA-Z0-9]+ ){0,10}otherword","NAraw&\\1Q",[global])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?:[a-zA-Z0-9]+ ){0,10}otherword","&&NApA\\1v\\1\\1cnExjYTArB",[])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?:[a-zA-Z0-9]+ ){0,10}otherword","&&NApA\\1v\\1\\1cnExjYTArB",[global])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?:[a-zA-Z0-9]+ ){0,300}otherword","A&qAIOCV",[])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?:[a-zA-Z0-9]+ ){0,300}otherword","A&qAIOCV",[global])),
+ <<"KqTqEDmbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,0}","KqTqEDm",[])),
+ <<"KqTqEDmbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,0}","KqTqEDm",[global])),
+ <<"ioXlXnsoNabc">> = iolist_to_binary(re:replace("abc","^(a){0,0}","&ioXlXns&oN\\1",[])),
+ <<"ioXlXnsoNabc">> = iolist_to_binary(re:replace("abc","^(a){0,0}","&ioXlXns&oN\\1",[global])),
+ <<"kwaab">> = iolist_to_binary(re:replace("aab","^(a){0,0}","kw",[])),
+ <<"kwaab">> = iolist_to_binary(re:replace("aab","^(a){0,0}","kw",[global])),
+ <<"UcTyIixbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,1}","Uc&TyI&ix",[])),
+ <<"UcTyIixbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,1}","Uc&TyI&ix",[global])),
+ <<"mIikbc">> = iolist_to_binary(re:replace("abc","^(a){0,1}","mIik",[])),
+ <<"mIikbc">> = iolist_to_binary(re:replace("abc","^(a){0,1}","mIik",[global])),
+ <<"dqceagxefBaadIOab">> = iolist_to_binary(re:replace("aab","^(a){0,1}","dqce&gxefB\\1\\1dIO",[])),
+ <<"dqceagxefBaadIOab">> = iolist_to_binary(re:replace("aab","^(a){0,1}","dqce&gxefB\\1\\1dIO",[global])),
+ <<"wLwgjiEJTwmbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,2}","w&L&wg&ji&EJTwm",[])),
+ <<"wLwgjiEJTwmbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,2}","w&L&wg&ji&EJTwm",[global])),
+ <<"YaanaRwaEjbc">> = iolist_to_binary(re:replace("abc","^(a){0,2}","Y&&n\\1Rw\\1Ej",[])),
+ <<"YaanaRwaEjbc">> = iolist_to_binary(re:replace("abc","^(a){0,2}","Y&&n\\1Rw\\1Ej",[global])),
+ <<"xXpYPTdeIaeCaaamaIb">> = iolist_to_binary(re:replace("aab","^(a){0,2}","xXpYPTdeI\\1eC&\\1maI",[])),
+ <<"xXpYPTdeIaeCaaamaIb">> = iolist_to_binary(re:replace("aab","^(a){0,2}","xXpYPTdeI\\1eC&\\1maI",[global])),
+ <<"rbRgYffbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,3}","rbRgYff",[])),
+ <<"rbRgYffbcd">> = iolist_to_binary(re:replace("bcd","^(a){0,3}","rbRgYff",[global])),
+ <<"qFVJLbc">> = iolist_to_binary(re:replace("abc","^(a){0,3}","qFVJL",[])),
+ <<"qFVJLbc">> = iolist_to_binary(re:replace("abc","^(a){0,3}","qFVJL",[global])),
+ <<"QtqBOxb">> = iolist_to_binary(re:replace("aab","^(a){0,3}","QtqBOx",[])),
+ <<"QtqBOxb">> = iolist_to_binary(re:replace("aab","^(a){0,3}","QtqBOx",[global])),
+ <<"tXNokRjRKvXaaaIaaaaWSIA">> = iolist_to_binary(re:replace("aaa","^(a){0,3}","tXNokRjRKvX&I\\1&WSIA",[])),
+ <<"tXNokRjRKvXaaaIaaaaWSIA">> = iolist_to_binary(re:replace("aaa","^(a){0,3}","tXNokRjRKvX&I\\1&WSIA",[global])),
+ <<"eopBsGmBubcd">> = iolist_to_binary(re:replace("bcd","^(a){0,}","eopBsGmB&u\\1",[])),
+ <<"eopBsGmBubcd">> = iolist_to_binary(re:replace("bcd","^(a){0,}","eopBsGmB&u\\1",[global])),
+ <<"XGaKIdSoshwbLyuUaEbc">> = iolist_to_binary(re:replace("abc","^(a){0,}","XG&KIdSoshwbLyuU&E",[])),
+ <<"XGaKIdSoshwbLyuUaEbc">> = iolist_to_binary(re:replace("abc","^(a){0,}","XG&KIdSoshwbLyuU&E",[global])),
+ <<"QVBStnKyKwiFaarwKKaKtb">> = iolist_to_binary(re:replace("aab","^(a){0,}","QVBStnKyKwiF&rwKK\\1Kt",[])),
+ <<"QVBStnKyKwiFaarwKKaKtb">> = iolist_to_binary(re:replace("aab","^(a){0,}","QVBStnKyKwiF&rwKK\\1Kt",[global])),
+ <<"aaafFGmLJOyaxg">> = iolist_to_binary(re:replace("aaa","^(a){0,}","&fFGmLJOy\\1xg",[])),
+ <<"aaafFGmLJOyaxg">> = iolist_to_binary(re:replace("aaa","^(a){0,}","&fFGmLJOy\\1xg",[global])),
+ <<"vvdaSSUIVja">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){0,}","vvd\\1SSUIVj\\1",[])),
+ <<"vvdaSSUIVja">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){0,}","vvd\\1SSUIVj\\1",[global])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,1}","\\1cU",[])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,1}","\\1cU",[global])),
+ <<"aXagESUEcdbc">> = iolist_to_binary(re:replace("abc","^(a){1,1}","\\1X&gESUEcd",[])),
+ <<"aXagESUEcdbc">> = iolist_to_binary(re:replace("abc","^(a){1,1}","\\1X&gESUEcd",[global])),
+ <<"XMYab">> = iolist_to_binary(re:replace("aab","^(a){1,1}","XMY",[])),
+ <<"XMYab">> = iolist_to_binary(re:replace("aab","^(a){1,1}","XMY",[global])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,2}","tGJ&&",[])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,2}","tGJ&&",[global])),
+ <<"aduQQOassaHGbc">> = iolist_to_binary(re:replace("abc","^(a){1,2}","\\1duQQO&ss\\1HG",[])),
+ <<"aduQQOassaHGbc">> = iolist_to_binary(re:replace("abc","^(a){1,2}","\\1duQQO&ss\\1HG",[global])),
+ <<"acmBfjb">> = iolist_to_binary(re:replace("aab","^(a){1,2}","\\1cmBfj",[])),
+ <<"acmBfjb">> = iolist_to_binary(re:replace("aab","^(a){1,2}","\\1cmBfj",[global])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,3}","tQ&ktkv\\1VkD&K",[])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,3}","tQ&ktkv\\1VkD&K",[global])),
+ <<"chaaBsFRlbc">> = iolist_to_binary(re:replace("abc","^(a){1,3}","ch&\\1BsFRl",[])),
+ <<"chaaBsFRlbc">> = iolist_to_binary(re:replace("abc","^(a){1,3}","ch&\\1BsFRl",[global])),
+ <<"USb">> = iolist_to_binary(re:replace("aab","^(a){1,3}","US",[])),
+ <<"USb">> = iolist_to_binary(re:replace("aab","^(a){1,3}","US",[global])),
+ <<"QUVwfLaFRTxkapVJd">> = iolist_to_binary(re:replace("aaa","^(a){1,3}","QUVwfL\\1FRTxk\\1pVJd",[])),
+ <<"QUVwfLaFRTxkapVJd">> = iolist_to_binary(re:replace("aaa","^(a){1,3}","QUVwfL\\1FRTxk\\1pVJd",[global])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,}","xN\\1mi",[])),
+ <<"bcd">> = iolist_to_binary(re:replace("bcd","^(a){1,}","xN\\1mi",[global])),
+ <<"aCauataXanaETbc">> = iolist_to_binary(re:replace("abc","^(a){1,}","&C&u&t&X&n&ET",[])),
+ <<"aCauataXanaETbc">> = iolist_to_binary(re:replace("abc","^(a){1,}","&C&u&t&X&n&ET",[global])),
+ <<"Bb">> = iolist_to_binary(re:replace("aab","^(a){1,}","B",[])),
+ <<"Bb">> = iolist_to_binary(re:replace("aab","^(a){1,}","B",[global])),
+ <<"XFykuakPaulQTqER">> = iolist_to_binary(re:replace("aaa","^(a){1,}","XFyku\\1kP\\1ulQTqER",[])),
+ <<"XFykuakPaulQTqER">> = iolist_to_binary(re:replace("aaa","^(a){1,}","XFyku\\1kP\\1ulQTqER",[global])),
+ <<"uaaaaaaaasAaaaaaaaaiaaaaaaaaObkaQXXqLaPgaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){1,}","u&sA&i&Obk\\1QXXqL\\1Pg&",[])),
+ <<"uaaaaaaaasAaaaaaaaaiaaaaaaaaObkaQXXqLaPgaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a){1,}","u&sA&i&Obk\\1QXXqL\\1Pg&",[global])),
<<"borfle
-nJEnJAvwAybib.gifXvq
+JMhXbib.gifxEbib.gifhBlXkR
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","nJEnJAvwAy&Xvq\\1",[global])),
+no",".*\\.gif","JMhX&xE&hBl\\1Xk\\1R",[])),
<<"borfle
-Nmmq
+JMhXbib.gifxEbib.gifhBlXkR
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".{0,}\\.gif","Nmmq",[])),
+no",".*\\.gif","JMhX&xE&hBl\\1Xk\\1R",[global])),
<<"borfle
-Nmmq
+riUNlLbib.giff
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".{0,}\\.gif","Nmmq",[global])),
+no",".{0,}\\.gif","riUNlL&f",[])),
<<"borfle
-BVKBwIDwbib.gifjgEqWxbib.gifEW
+riUNlLbib.giff
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","BVKBwIDw&jgEqW\\1x&EW",[multiline])),
+no",".{0,}\\.gif","riUNlL&f",[global])),
<<"borfle
-BVKBwIDwbib.gifjgEqWxbib.gifEW
+GuWxO
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","BVKBwIDw&jgEqW\\1x&EW",[multiline,global])),
+no",".*\\.gif","GuWxO",[multiline])),
<<"borfle
-bib.giffF
+GuWxO
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","&fF",[dotall])),
- <<"borfle
-bib.giffF
-no">> = iolist_to_binary(re:replace("borfle
-bib.gif
-no",".*\\.gif","&fF",[dotall,global])),
+no",".*\\.gif","GuWxO",[multiline,global])),
ok.
run9() ->
- <<"ARdLYmTSnXAA
+ <<"PMnborfle
+bib.gifborfle
+bib.gifPMt
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","AR\\1dLYmTSnXAA",[multiline,dotall])),
- <<"ARdLYmTSnXAA
+no",".*\\.gif","PMn&&PMt",[dotall])),
+ <<"PMnborfle
+bib.gifborfle
+bib.gifPMt
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*\\.gif","AR\\1dLYmTSnXAA",[multiline,dotall,global])),
- <<"borfle
-bib.gif
-anoc">> = iolist_to_binary(re:replace("borfle
-bib.gif
-no",".*$","a&c",[])),
- <<"borfle
-bib.gif
-anocac">> = iolist_to_binary(re:replace("borfle
-bib.gif
-no",".*$","a&c",[global])),
- <<"fborfleDas
+no",".*\\.gif","PMn&&PMt",[dotall,global])),
+ <<"rxywwborfle
bib.gif
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","f&Das",[multiline])),
- <<"fborfleDasfDas
-fbib.gifDasfDas
-fnoDasfDas">> = iolist_to_binary(re:replace("borfle
-bib.gif
-no",".*$","f&Das",[multiline,global])),
- <<"eUveborfle
+no",".*\\.gif","rx\\1\\1yww&",[multiline,dotall])),
+ <<"rxywwborfle
bib.gif
-nopjBhborfle
-bib.gif
-noEXborfle
-bib.gif
-nodborfle
-bib.gif
-noiGXw">> = iolist_to_binary(re:replace("borfle
+no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","eUve&pjBh&EX&d&iGXw",[dotall])),
- <<"eUveborfle
+no",".*\\.gif","rx\\1\\1yww&",[multiline,dotall,global])),
+ <<"borfle
bib.gif
-nopjBhborfle
+fEMAOjEdetPXRnocBSck">> = iolist_to_binary(re:replace("borfle
bib.gif
-noEXborfle
+no",".*$","fEMAOjEdetPXR&cBSck",[])),
+ <<"borfle
bib.gif
-nodborfle
+fEMAOjEdetPXRnocBSckfEMAOjEdetPXRcBSck">> = iolist_to_binary(re:replace("borfle
bib.gif
-noiGXweUvepjBhEXdiGXw">> = iolist_to_binary(re:replace("borfle
+no",".*$","fEMAOjEdetPXR&cBSck",[global])),
+ <<"FdiFlvyqFlWRsa
bib.gif
-no",".*$","eUve&pjBh&EX&d&iGXw",[dotall,global])),
- <<"RIMAHborfle
+no">> = iolist_to_binary(re:replace("borfle
bib.gif
-norborfle
+no",".*$","\\1FdiFlvyqFlW\\1Rsa",[multiline])),
+ <<"FdiFlvyqFlWRsaFdiFlvyqFlWRsa
+FdiFlvyqFlWRsaFdiFlvyqFlWRsa
+FdiFlvyqFlWRsaFdiFlvyqFlWRsa">> = iolist_to_binary(re:replace("borfle
bib.gif
-no">> = iolist_to_binary(re:replace("borfle
+no",".*$","\\1FdiFlvyqFlW\\1Rsa",[multiline,global])),
+ <<"n">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","R\\1IMAH&\\1r&",[multiline,dotall])),
- <<"RIMAHborfle
+no",".*$","n",[dotall])),
+ <<"nn">> = iolist_to_binary(re:replace("borfle
bib.gif
-norborfle
+no",".*$","n",[dotall,global])),
+ <<"xbTBQedCtvvd">> = iolist_to_binary(re:replace("borfle
bib.gif
-noRIMAHr">> = iolist_to_binary(re:replace("borfle
+no",".*$","xbTBQe\\1dCtvvd",[multiline,dotall])),
+ <<"xbTBQedCtvvdxbTBQedCtvvd">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","R\\1IMAH&\\1r&",[multiline,dotall,global])),
+no",".*$","xbTBQe\\1dCtvvd",[multiline,dotall,global])),
<<"borfle
bib.gif
-IXHXnoNO">> = iolist_to_binary(re:replace("borfle
+snononoKyt">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","IXHX&NO",[])),
+no",".*$","s&&&Kyt",[])),
<<"borfle
bib.gif
-IXHXnoNOIXHXNO">> = iolist_to_binary(re:replace("borfle
+snononoKytsKyt">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","IXHX&NO",[global])),
- <<"iGCnBCJborfleUborflenLutTYS
+no",".*$","s&&&Kyt",[global])),
+ <<"BrborflevYCe
bib.gif
no">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","\\1iGCnBC\\1J&U&nL\\1utTYS",[multiline])),
- <<"iGCnBCJborfleUborflenLutTYSiGCnBCJUnLutTYS
-iGCnBCJbib.gifUbib.gifnLutTYSiGCnBCJUnLutTYS
-iGCnBCJnoUnonLutTYSiGCnBCJUnLutTYS">> = iolist_to_binary(re:replace("borfle
+no",".*$","Br&vYCe",[multiline])),
+ <<"BrborflevYCeBrvYCe
+Brbib.gifvYCeBrvYCe
+BrnovYCeBrvYCe">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","\\1iGCnBC\\1J&U&nL\\1utTYS",[multiline,global])),
- <<"dkaborfle
+no",".*$","Br&vYCe",[multiline,global])),
+ <<"gborfle
bib.gif
-nocxpCSRwborfle
+noPQFusOgmXaynmLborfle
bib.gif
-noJQHcx">> = iolist_to_binary(re:replace("borfle
+noS">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","dka&cxpCSRw&JQ\\1Hc\\1x",[dotall])),
- <<"dkaborfle
+no",".*$","g&PQFusOgmXayn\\1mL&S",[dotall])),
+ <<"gborfle
bib.gif
-nocxpCSRwborfle
+noPQFusOgmXaynmLborfle
bib.gif
-noJQHcxdkacxpCSRwJQHcx">> = iolist_to_binary(re:replace("borfle
+noSgPQFusOgmXaynmLS">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","dka&cxpCSRw&JQ\\1Hc\\1x",[dotall,global])),
- <<"tnQDxLEhTFjTiWwouU">> = iolist_to_binary(re:replace("borfle
+no",".*$","g&PQFusOgmXayn\\1mL&S",[dotall,global])),
+ <<"yVEV">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","tnQDxLEhTF\\1jTiWwouU",[multiline,dotall])),
- <<"tnQDxLEhTFjTiWwouUtnQDxLEhTFjTiWwouU">> = iolist_to_binary(re:replace("borfle
+no",".*$","yVEV",[multiline,dotall])),
+ <<"yVEVyVEV">> = iolist_to_binary(re:replace("borfle
bib.gif
-no",".*$","tnQDxLEhTF\\1jTiWwouU",[multiline,dotall,global])),
+no",".*$","yVEV",[multiline,dotall,global])),
<<"abcde
-fSiqVi1234Xw1234XWyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","fSiqVi&w\\1W",[])),
+1234XP1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","\\1P&",[])),
<<"abcde
-fSiqVi1234Xw1234XWyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","fSiqVi&w\\1W",[global])),
- <<"apCVoPCVMeDBpBBarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","apCVoPCVMeD&p\\1&",[])),
- <<"apCVoPCVMeDBpBBarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","apCVoPCVMeD&p\\1&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","FiTmKNSyXk",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","FiTmKNSyXk",[global])),
+1234XP1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","\\1P&",[global])),
+ <<"qarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","q",[])),
+ <<"qarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","q",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","&PNmWin\\1XCGPwUmQi",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","&PNmWin\\1XCGPwUmQi",[global])),
<<"abcde
Bar">> = iolist_to_binary(re:replace("abcde
Bar","(.*X|^B)","&",[])),
@@ -15514,2627 +15499,2637 @@ Bar","(.*X|^B)","&",[])),
Bar">> = iolist_to_binary(re:replace("abcde
Bar","(.*X|^B)","&",[global])),
<<"abcde
-1234XY1234X1234X1234XiJfcfLjk1234Xyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","&Y\\1\\1\\1iJfcfLjk\\1",[multiline])),
+1234Xk1234XSbVXyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","\\1k&SbVX",[multiline])),
<<"abcde
-1234XY1234X1234X1234XiJfcfLjk1234Xyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","&Y\\1\\1\\1iJfcfLjk\\1",[multiline,global])),
- <<"BUrWBJarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","&UrW\\1J",[multiline])),
- <<"BUrWBJarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","&UrW\\1J",[multiline,
- global])),
+1234Xk1234XSbVXyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","\\1k&SbVX",[multiline,global])),
+ <<"BLBjHdCBpTarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","BL\\1jHdC&pT",[multiline])),
+ <<"BLBjHdCBpTarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","BL\\1jHdC&pT",[multiline,
+ global])),
<<"abcde
-vpiar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","vpi",[multiline])),
+AOBrLBaBuLgKctar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","AO&rL\\1a&uLgKct",[multiline])),
<<"abcde
-vpiar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","vpi",[multiline,global])),
+AOBrLBaBuLgKctar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","AO&rL\\1a&uLgKct",[multiline,global])),
+ <<"IhhXeabcde
+1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","IhhXe\\1",[dotall])),
+ <<"IhhXeabcde
+1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","IhhXe\\1",[dotall,global])),
+ <<"NfmmMjBGBBShBiBBqABfarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","NfmmMj\\1G&&Sh\\1i&&qA\\1f",[dotall])),
+ <<"NfmmMjBGBBShBiBBqABfarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","NfmmMj\\1G&&Sh\\1i&&qA\\1f",[dotall,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","fDWQoN&&DK\\1X\\1QE&hqEG",[dotall])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","fDWQoN&&DK\\1X\\1QE&hqEG",[dotall,
+ global])),
<<"abcde
-1234Xabcde
-1234Xabcde
-1234XOwvyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","\\1\\1&Owv",[dotall])),
+Bar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","sSxs",[dotall])),
<<"abcde
+Bar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","sSxs",[dotall,global])),
+ <<"svIYJDEofMMvabcde
+1234XDCabcde
+1234Xeabcde
1234Xabcde
+1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","svIYJDEofMMv&DC\\1e&\\1",[multiline,dotall])),
+ <<"svIYJDEofMMvabcde
+1234XDCabcde
+1234Xeabcde
1234Xabcde
-1234XOwvyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","\\1\\1&Owv",[dotall,global])),
- <<"csBOSrLyBynarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","cs\\1OSrLy\\1yn",[dotall])),
- <<"csBOSrLyBynarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","cs\\1OSrLy\\1yn",[dotall,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","\\1qVOKf\\1jqa",[dotall])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(.*X|^B)","\\1qVOKf\\1jqa",[dotall,
+1234Xyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(.*X|^B)","svIYJDEofMMv&DC\\1e&\\1",[multiline,dotall,
+ global])),
+ <<"APkjMTOkxTRvMqaBjpxarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","APkjMTOkxTRvMqa&jpx",[multiline,
+ dotall])),
+ <<"APkjMTOkxTRvMqaBjpxarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","APkjMTOkxTRvMqa&jpx",[multiline,
+ dotall,
global])),
<<"abcde
-Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","p",[dotall])),
- <<"abcde
-Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","p",[dotall,global])),
- <<"YiHiyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","YiHi",[multiline,dotall])),
- <<"YiHiyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(.*X|^B)","YiHi",[multiline,dotall,global])),
- <<"DDQRgXBHBBSBcHarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","DDQRgXBH&&S\\1cH",[multiline,
- dotall])),
- <<"DDQRgXBHBBSBcHarFoo">> = iolist_to_binary(re:replace("BarFoo","(.*X|^B)","DDQRgXBH&&S\\1cH",[multiline,
- dotall,
- global])),
- <<"abcde
-KTLNdCWtmar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","KTLNdCWtm",[multiline,dotall])),
+gLgBDTusNbxpABaVxar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","gLg\\1DTusNbxpA\\1aVx",[multiline,dotall])),
<<"abcde
-KTLNdCWtmar">> = iolist_to_binary(re:replace("abcde
-Bar","(.*X|^B)","KTLNdCWtm",[multiline,dotall,global])),
- <<"UnqSIGfraCIjabcde
-1234Xlyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(?s)(.*X|^B)","UnqSIGfraCIj&l",[])),
- <<"UnqSIGfraCIjabcde
-1234Xlyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(?s)(.*X|^B)","UnqSIGfraCIj&l",[global])),
- <<"aDBarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s)(.*X|^B)","aDB",[])),
- <<"aDBarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s)(.*X|^B)","aDB",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s)(.*X|^B)","hbfv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s)(.*X|^B)","hbfv",[global])),
+gLgBDTusNbxpABaVxar">> = iolist_to_binary(re:replace("abcde
+Bar","(.*X|^B)","gLg\\1DTusNbxpA\\1aVx",[multiline,dotall,global])),
+ <<"jvVabcde
+1234XIabcde
+1234XLsYyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(?s)(.*X|^B)","jvV\\1I&LsY",[])),
+ <<"jvVabcde
+1234XIabcde
+1234XLsYyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(?s)(.*X|^B)","jvV\\1I&LsY",[global])),
+ <<"TlTBebymLLEyQBarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s)(.*X|^B)","TlT\\1ebymLLEyQ\\1",[])),
+ <<"TlTBebymLLEyQBarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s)(.*X|^B)","TlT\\1ebymLLEyQ\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s)(.*X|^B)","jrpMnKp\\1&LavAr&vf\\1o",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s)(.*X|^B)","jrpMnKp\\1&LavAr&vf\\1o",[global])),
<<"abcde
Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(?s)(.*X|^B)","&UWQV\\1&\\1\\1E",[])),
+Bar","(?s)(.*X|^B)","MB\\1k&&iuX\\1\\1\\1DJKoRl",[])),
<<"abcde
Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(?s)(.*X|^B)","&UWQV\\1&\\1\\1E",[global])),
- <<"KYpUjyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(?s:.*X|^B)","KY\\1\\1pUj\\1",[])),
- <<"KYpUjyz">> = iolist_to_binary(re:replace("abcde
-1234Xyz","(?s:.*X|^B)","KY\\1\\1pUj\\1",[global])),
- <<"BSkyfarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s:.*X|^B)","\\1BSk\\1y\\1\\1f",[])),
- <<"BSkyfarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s:.*X|^B)","\\1BSk\\1y\\1\\1f",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s:.*X|^B)","IG\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s:.*X|^B)","IG\\1",[global])),
+Bar","(?s)(.*X|^B)","MB\\1k&&iuX\\1\\1\\1DJKoRl",[global])),
+ <<"rPUccTvabcde
+1234XyMyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(?s:.*X|^B)","rPUccT\\1v&yM",[])),
+ <<"rPUccTvabcde
+1234XyMyz">> = iolist_to_binary(re:replace("abcde
+1234Xyz","(?s:.*X|^B)","rPUccT\\1v&yM",[global])),
+ <<"ybPFHwvSYTarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s:.*X|^B)","y\\1bPF\\1HwvSYT",[])),
+ <<"ybPFHwvSYTarFoo">> = iolist_to_binary(re:replace("BarFoo","(?s:.*X|^B)","y\\1bPF\\1HwvSYT",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s:.*X|^B)","cM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s:.*X|^B)","cM",[global])),
<<"abcde
Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(?s:.*X|^B)","&OchEkLBdrDrxVm&",[])),
+Bar","(?s:.*X|^B)","YwekY\\1N&cbCoStuYolo",[])),
<<"abcde
Bar">> = iolist_to_binary(re:replace("abcde
-Bar","(?s:.*X|^B)","&OchEkLBdrDrxVm&",[global])),
- <<"**** Failers">> = iolist_to_binary(re:replace("**** Failers","^.*B","cYoDF\\1rwds&i&y&&XoFT",[])),
- <<"**** Failers">> = iolist_to_binary(re:replace("**** Failers","^.*B","cYoDF\\1rwds&i&y&&XoFT",[global])),
+Bar","(?s:.*X|^B)","YwekY\\1N&cbCoStuYolo",[global])),
+ <<"**** Failers">> = iolist_to_binary(re:replace("**** Failers","^.*B","Sf",[])),
+ <<"**** Failers">> = iolist_to_binary(re:replace("**** Failers","^.*B","Sf",[global])),
<<"abc
B">> = iolist_to_binary(re:replace("abc
-B","^.*B","gXmgvN\\1oh",[])),
+B","^.*B","&uu\\1L\\1JdE",[])),
<<"abc
B">> = iolist_to_binary(re:replace("abc
-B","^.*B","gXmgvN\\1oh",[global])),
- <<"EQuXabc
-Babc
-BcTMO">> = iolist_to_binary(re:replace("abc
-B","(?s)^.*B","EQuX&&\\1cTMO",[])),
- <<"EQuXabc
-Babc
-BcTMO">> = iolist_to_binary(re:replace("abc
-B","(?s)^.*B","EQuX&&\\1cTMO",[global])),
- <<"abc
-gtvPyITnci">> = iolist_to_binary(re:replace("abc
-B","(?m)^.*B","\\1gtvPyIT\\1\\1nci\\1",[])),
+B","^.*B","&uu\\1L\\1JdE",[global])),
+ <<"vveCq">> = iolist_to_binary(re:replace("abc
+B","(?s)^.*B","vveC\\1q\\1",[])),
+ <<"vveCq">> = iolist_to_binary(re:replace("abc
+B","(?s)^.*B","vveC\\1q\\1",[global])),
<<"abc
-gtvPyITnci">> = iolist_to_binary(re:replace("abc
-B","(?m)^.*B","\\1gtvPyIT\\1\\1nci\\1",[global])),
- <<"Xiabc
-BFQs">> = iolist_to_binary(re:replace("abc
-B","(?ms)^.*B","Xi&FQs",[])),
- <<"Xiabc
-BFQs">> = iolist_to_binary(re:replace("abc
-B","(?ms)^.*B","Xi&FQs",[global])),
+AIykFFUtx">> = iolist_to_binary(re:replace("abc
+B","(?m)^.*B","AIykFFUtx",[])),
<<"abc
-KEQlgWBJydBXBMDBU">> = iolist_to_binary(re:replace("abc
-B","(?ms)^B","KEQlgW&Jy\\1d&X&\\1\\1MD&U",[])),
- <<"abc
-KEQlgWBJydBXBMDBU">> = iolist_to_binary(re:replace("abc
-B","(?ms)^B","KEQlgW&Jy\\1d&X&\\1\\1MD&U",[global])),
+AIykFFUtx">> = iolist_to_binary(re:replace("abc
+B","(?m)^.*B","AIykFFUtx",[global])),
+ <<"tmabc
+BkwwOabc
+B">> = iolist_to_binary(re:replace("abc
+B","(?ms)^.*B","tm&k\\1wwO\\1&",[])),
+ <<"tmabc
+BkwwOabc
+B">> = iolist_to_binary(re:replace("abc
+B","(?ms)^.*B","tm&k\\1wwO\\1&",[global])),
ok.
run10() ->
- <<"eucnXdJhktgj">> = iolist_to_binary(re:replace("B","(?s)B$","eucnXd\\1Jhktgj",[])),
- <<"eucnXdJhktgj">> = iolist_to_binary(re:replace("B","(?s)B$","eucnXd\\1Jhktgj",[global])),
- <<"huCb">> = iolist_to_binary(re:replace("123456654321","^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]","huCb",[])),
- <<"huCb">> = iolist_to_binary(re:replace("123456654321","^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]","huCb",[global])),
- <<"X123456654321">> = iolist_to_binary(re:replace("123456654321","^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d","X&",[])),
- <<"X123456654321">> = iolist_to_binary(re:replace("123456654321","^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d","X&",[global])),
- <<"TYfrdKv123456654321eOFnwwLVc">> = iolist_to_binary(re:replace("123456654321","^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]","TY\\1frdK\\1\\1v&eOFnwwLVc",[])),
- <<"TYfrdKv123456654321eOFnwwLVc">> = iolist_to_binary(re:replace("123456654321","^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]","TY\\1frdK\\1\\1v&eOFnwwLVc",[global])),
- <<"ARvxabcabcabcabcbhP">> = iolist_to_binary(re:replace("abcabcabcabc","^[abc]{12}","ARvx&bhP",[])),
- <<"ARvxabcabcabcabcbhP">> = iolist_to_binary(re:replace("abcabcabcabc","^[abc]{12}","ARvx&bhP",[global])),
- <<"VtabcabcabcabcaabcabcabcabcoPm">> = iolist_to_binary(re:replace("abcabcabcabc","^[a-c]{12}","V\\1t&a&oPm",[])),
- <<"VtabcabcabcabcaabcabcabcabcoPm">> = iolist_to_binary(re:replace("abcabcabcabc","^[a-c]{12}","V\\1t&a&oPm",[global])),
- <<"XSAxPcCWabcabcabcabccaabcabcabcabcC">> = iolist_to_binary(re:replace("abcabcabcabc","^(a|b|c){12}","XSAxPcCW&\\1a&C",[])),
- <<"XSAxPcCWabcabcabcabccaabcabcabcabcC">> = iolist_to_binary(re:replace("abcabcabcabc","^(a|b|c){12}","XSAxPcCW&\\1a&C",[global])),
- <<"KlnPsQA">> = iolist_to_binary(re:replace("n","^[abcdefghijklmnopqrstuvwxy0123456789]","Kl&\\1PsQA",[])),
- <<"KlnPsQA">> = iolist_to_binary(re:replace("n","^[abcdefghijklmnopqrstuvwxy0123456789]","Kl&\\1PsQA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[abcdefghijklmnopqrstuvwxy0123456789]","\\1fJAGtEidKGXUnys",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[abcdefghijklmnopqrstuvwxy0123456789]","\\1fJAGtEidKGXUnys",[global])),
- <<"z">> = iolist_to_binary(re:replace("z","^[abcdefghijklmnopqrstuvwxy0123456789]","\\1rHkd&\\1jm&b&RxM\\1SHJ",[])),
- <<"z">> = iolist_to_binary(re:replace("z","^[abcdefghijklmnopqrstuvwxy0123456789]","\\1rHkd&\\1jm&b&RxM\\1SHJ",[global])),
- <<"imcGUm">> = iolist_to_binary(re:replace("abcd","abcde{0,0}","imcGUm",[])),
- <<"imcGUm">> = iolist_to_binary(re:replace("abcd","abcde{0,0}","imcGUm",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abcde{0,0}","Tqn",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abcde{0,0}","Tqn",[global])),
- <<"abce">> = iolist_to_binary(re:replace("abce","abcde{0,0}","&vfSkYqj",[])),
- <<"abce">> = iolist_to_binary(re:replace("abce","abcde{0,0}","&vfSkYqj",[global])),
- <<"DvcVJ">> = iolist_to_binary(re:replace("abe","ab[cd]{0,0}e","D\\1vc\\1VJ",[])),
- <<"DvcVJ">> = iolist_to_binary(re:replace("abe","ab[cd]{0,0}e","D\\1vc\\1VJ",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab[cd]{0,0}e","fqC",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab[cd]{0,0}e","fqC",[global])),
- <<"abcde">> = iolist_to_binary(re:replace("abcde","ab[cd]{0,0}e","EVGlB",[])),
- <<"abcde">> = iolist_to_binary(re:replace("abcde","ab[cd]{0,0}e","EVGlB",[global])),
- <<"ttqYHXMabdKMHbogw">> = iolist_to_binary(re:replace("abd","ab(c){0,0}d","ttqY\\1HXM&KMHbo\\1gw",[])),
- <<"ttqYHXMabdKMHbogw">> = iolist_to_binary(re:replace("abd","ab(c){0,0}d","ttqY\\1HXM&KMHbo\\1gw",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab(c){0,0}d","UO\\1n&&dgD&x&puRS\\1PEE",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab(c){0,0}d","UO\\1n&&dgD&x&puRS\\1PEE",[global])),
- <<"abcd">> = iolist_to_binary(re:replace("abcd","ab(c){0,0}d","AnMJgUHAxI\\1ekAaM",[])),
- <<"abcd">> = iolist_to_binary(re:replace("abcd","ab(c){0,0}d","AnMJgUHAxI\\1ekAaM",[global])),
- <<"OXylllC">> = iolist_to_binary(re:replace("a","a(b*)","OX\\1ylllC",[])),
- <<"OXylllC">> = iolist_to_binary(re:replace("a","a(b*)","OX\\1ylllC",[global])),
- <<"BDoOabpX">> = iolist_to_binary(re:replace("ab","a(b*)","BDoO&pX",[])),
- <<"BDoOabpX">> = iolist_to_binary(re:replace("ab","a(b*)","BDoO&pX",[global])),
- <<"WumvpDmPRlDEFbbbbbbbbw">> = iolist_to_binary(re:replace("abbbb","a(b*)","WumvpDmPRlDEF\\1\\1w",[])),
- <<"WumvpDmPRlDEFbbbbbbbbw">> = iolist_to_binary(re:replace("abbbb","a(b*)","WumvpDmPRlDEF\\1\\1w",[global])),
- <<"*** FXEpRailers">> = iolist_to_binary(re:replace("*** Failers","a(b*)","XEpR&",[])),
- <<"*** FXEpRailers">> = iolist_to_binary(re:replace("*** Failers","a(b*)","XEpR&",[global])),
- <<"bbbbb">> = iolist_to_binary(re:replace("bbbbb","a(b*)","oxX\\1mji\\1R&A",[])),
- <<"bbbbb">> = iolist_to_binary(re:replace("bbbbb","a(b*)","oxX\\1mji\\1R&A",[global])),
- <<"nabehjEWAKJbF">> = iolist_to_binary(re:replace("abe","ab\\d{0}e","n&hjEWA\\1\\1KJbF",[])),
- <<"nabehjEWAKJbF">> = iolist_to_binary(re:replace("abe","ab\\d{0}e","n&hjEWA\\1\\1KJbF",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab\\d{0}e","IK\\1nN\\1xr",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab\\d{0}e","IK\\1nN\\1xr",[global])),
- <<"ab1e">> = iolist_to_binary(re:replace("ab1e","ab\\d{0}e","S\\1HX\\1V\\1hjKR",[])),
- <<"ab1e">> = iolist_to_binary(re:replace("ab1e","ab\\d{0}e","S\\1HX\\1V\\1hjKR",[global])),
- <<"the quickf\"quick\"cqEH\"quick\"quickWsS brown fox">> = iolist_to_binary(re:replace("the \"quick\" brown fox","\"([^\\\\\"]+|\\\\.)*\"","\\1f&cqEH&\\1WsS",[])),
- <<"the quickf\"quick\"cqEH\"quick\"quickWsS brown fox">> = iolist_to_binary(re:replace("the \"quick\" brown fox","\"([^\\\\\"]+|\\\\.)*\"","\\1f&cqEH&\\1WsS",[global])),
- <<"mRaOvRxI">> = iolist_to_binary(re:replace("\"the \\\"quick\\\" brown fox\"","\"([^\\\\\"]+|\\\\.)*\"","mRaOvRxI",[])),
- <<"mRaOvRxI">> = iolist_to_binary(re:replace("\"the \\\"quick\\\" brown fox\"","\"([^\\\\\"]+|\\\\.)*\"","mRaOvRxI",[global])),
- <<"OVRmBCabc">> = iolist_to_binary(re:replace("abc","","OVR&m&BC",[])),
- <<"OVRmBCaOVRmBCbOVRmBCcOVRmBC">> = iolist_to_binary(re:replace("abc","","OVR&m&BC",[global])),
- <<"lMTacbbGqK">> = iolist_to_binary(re:replace("acb","a[^a]b","lMT&bGq\\1K",[])),
- <<"lMTacbbGqK">> = iolist_to_binary(re:replace("acb","a[^a]b","lMT&bGq\\1K",[global])),
- <<"a
-ba
-bLxcQMea
-bHjqB">> = iolist_to_binary(re:replace("a
-b","a[^a]b","\\1\\1&&LxcQMe&Hj\\1qB",[])),
- <<"a
-ba
-bLxcQMea
-bHjqB">> = iolist_to_binary(re:replace("a
-b","a[^a]b","\\1\\1&&LxcQMe&Hj\\1qB",[global])),
- <<"acbVVpcHAOaqv">> = iolist_to_binary(re:replace("acb","a.b","&VVpcHAOaqv",[])),
- <<"acbVVpcHAOaqv">> = iolist_to_binary(re:replace("acb","a.b","&VVpcHAOaqv",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.b","rP",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.b","rP",[global])),
+ <<"abc
+sIBCmqcRbBEopSkFr">> = iolist_to_binary(re:replace("abc
+B","(?ms)^B","sI&\\1CmqcRb&EopSkFr",[])),
+ <<"abc
+sIBCmqcRbBEopSkFr">> = iolist_to_binary(re:replace("abc
+B","(?ms)^B","sI&\\1CmqcRb&EopSkFr",[global])),
+ <<"cDRlERYdxLVljB">> = iolist_to_binary(re:replace("B","(?s)B$","cDRlERYdx\\1LVlj&\\1",[])),
+ <<"cDRlERYdxLVljB">> = iolist_to_binary(re:replace("B","(?s)B$","cDRlERYdx\\1LVlj&\\1",[global])),
+ <<"ojREj">> = iolist_to_binary(re:replace("123456654321","^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]","o\\1jREj",[])),
+ <<"ojREj">> = iolist_to_binary(re:replace("123456654321","^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]","o\\1jREj",[global])),
+ <<"123456654321el">> = iolist_to_binary(re:replace("123456654321","^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d","&\\1el",[])),
+ <<"123456654321el">> = iolist_to_binary(re:replace("123456654321","^\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d\\d","&\\1el",[global])),
+ <<"lb123456654321x123456654321V">> = iolist_to_binary(re:replace("123456654321","^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]","lb&x&V",[])),
+ <<"lb123456654321x123456654321V">> = iolist_to_binary(re:replace("123456654321","^[\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d][\\d]","lb&x&V",[global])),
+ <<"XpabcabcabcabcAyWDhuR">> = iolist_to_binary(re:replace("abcabcabcabc","^[abc]{12}","Xp&Ay\\1WDhuR",[])),
+ <<"XpabcabcabcabcAyWDhuR">> = iolist_to_binary(re:replace("abcabcabcabc","^[abc]{12}","Xp&Ay\\1WDhuR",[global])),
+ <<"u">> = iolist_to_binary(re:replace("abcabcabcabc","^[a-c]{12}","u",[])),
+ <<"u">> = iolist_to_binary(re:replace("abcabcabcabc","^[a-c]{12}","u",[global])),
+ <<"xmIAabcabcabcabcacHwppQabcabcabcabccscvp">> = iolist_to_binary(re:replace("abcabcabcabc","^(a|b|c){12}","xmIA&a\\1HwppQ&cs\\1vp",[])),
+ <<"xmIAabcabcabcabcacHwppQabcabcabcabccscvp">> = iolist_to_binary(re:replace("abcabcabcabc","^(a|b|c){12}","xmIA&a\\1HwppQ&cs\\1vp",[global])),
+ <<"nDhnL">> = iolist_to_binary(re:replace("n","^[abcdefghijklmnopqrstuvwxy0123456789]","&Dh&L",[])),
+ <<"nDhnL">> = iolist_to_binary(re:replace("n","^[abcdefghijklmnopqrstuvwxy0123456789]","&Dh&L",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[abcdefghijklmnopqrstuvwxy0123456789]","TPu\\1&wb",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[abcdefghijklmnopqrstuvwxy0123456789]","TPu\\1&wb",[global])),
+ <<"z">> = iolist_to_binary(re:replace("z","^[abcdefghijklmnopqrstuvwxy0123456789]","OJhKNSyPeRoI&Wnp",[])),
+ <<"z">> = iolist_to_binary(re:replace("z","^[abcdefghijklmnopqrstuvwxy0123456789]","OJhKNSyPeRoI&Wnp",[global])),
+ <<"K">> = iolist_to_binary(re:replace("abcd","abcde{0,0}","K",[])),
+ <<"K">> = iolist_to_binary(re:replace("abcd","abcde{0,0}","K",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abcde{0,0}","E\\1\\1toPe\\1lGQK",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abcde{0,0}","E\\1\\1toPe\\1lGQK",[global])),
+ <<"abce">> = iolist_to_binary(re:replace("abce","abcde{0,0}","Ki&aBhP&lDx",[])),
+ <<"abce">> = iolist_to_binary(re:replace("abce","abcde{0,0}","Ki&aBhP&lDx",[global])),
+ <<"iQiLCUpSr">> = iolist_to_binary(re:replace("abe","ab[cd]{0,0}e","iQiLCUpSr",[])),
+ <<"iQiLCUpSr">> = iolist_to_binary(re:replace("abe","ab[cd]{0,0}e","iQiLCUpSr",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab[cd]{0,0}e","Hr&PimCU",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab[cd]{0,0}e","Hr&PimCU",[global])),
+ <<"abcde">> = iolist_to_binary(re:replace("abcde","ab[cd]{0,0}e","DC&KnrfLxyCvn&",[])),
+ <<"abcde">> = iolist_to_binary(re:replace("abcde","ab[cd]{0,0}e","DC&KnrfLxyCvn&",[global])),
+ <<"LabdiARUDvV">> = iolist_to_binary(re:replace("abd","ab(c){0,0}d","\\1L\\1\\1&iARUDvV",[])),
+ <<"LabdiARUDvV">> = iolist_to_binary(re:replace("abd","ab(c){0,0}d","\\1L\\1\\1&iARUDvV",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab(c){0,0}d","&\\1Mgf\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab(c){0,0}d","&\\1Mgf\\1",[global])),
+ <<"abcd">> = iolist_to_binary(re:replace("abcd","ab(c){0,0}d","&jO\\1aGGc",[])),
+ <<"abcd">> = iolist_to_binary(re:replace("abcd","ab(c){0,0}d","&jO\\1aGGc",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","a(b*)","&",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","a(b*)","&",[global])),
+ <<"tBTI">> = iolist_to_binary(re:replace("ab","a(b*)","tBTI",[])),
+ <<"tBTI">> = iolist_to_binary(re:replace("ab","a(b*)","tBTI",[global])),
+ <<"habbbbquabbbbbbbbabbbbmjPabbbbiabbbbqU">> = iolist_to_binary(re:replace("abbbb","a(b*)","h&qu&\\1&mjP&i&qU",[])),
+ <<"habbbbquabbbbbbbbabbbbmjPabbbbiabbbbqU">> = iolist_to_binary(re:replace("abbbb","a(b*)","h&qu&\\1&mjP&i&qU",[global])),
+ <<"*** FmYIhaIbaacAjQLailers">> = iolist_to_binary(re:replace("*** Failers","a(b*)","mYIhaIb&acAjQLa",[])),
+ <<"*** FmYIhaIbaacAjQLailers">> = iolist_to_binary(re:replace("*** Failers","a(b*)","mYIhaIb&acAjQLa",[global])),
+ <<"bbbbb">> = iolist_to_binary(re:replace("bbbbb","a(b*)","VG&iplC",[])),
+ <<"bbbbb">> = iolist_to_binary(re:replace("bbbbb","a(b*)","VG&iplC",[global])),
+ <<"al">> = iolist_to_binary(re:replace("abe","ab\\d{0}e","al",[])),
+ <<"al">> = iolist_to_binary(re:replace("abe","ab\\d{0}e","al",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab\\d{0}e","SDV\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab\\d{0}e","SDV\\1",[global])),
+ <<"ab1e">> = iolist_to_binary(re:replace("ab1e","ab\\d{0}e","C&p&eF\\1QF&mi\\1&",[])),
+ <<"ab1e">> = iolist_to_binary(re:replace("ab1e","ab\\d{0}e","C&p&eF\\1QF&mi\\1&",[global])),
+ <<"the LsC\"quick\"v\"quick\"NOdFhYFVvFQ brown fox">> = iolist_to_binary(re:replace("the \"quick\" brown fox","\"([^\\\\\"]+|\\\\.)*\"","LsC&v&NOdFhYFVvFQ",[])),
+ <<"the LsC\"quick\"v\"quick\"NOdFhYFVvFQ brown fox">> = iolist_to_binary(re:replace("the \"quick\" brown fox","\"([^\\\\\"]+|\\\\.)*\"","LsC&v&NOdFhYFVvFQ",[global])),
+ <<"Bymi\"the \\\"quick\\\" brown fox\"OuWN">> = iolist_to_binary(re:replace("\"the \\\"quick\\\" brown fox\"","\"([^\\\\\"]+|\\\\.)*\"","Bymi&OuWN",[])),
+ <<"Bymi\"the \\\"quick\\\" brown fox\"OuWN">> = iolist_to_binary(re:replace("\"the \\\"quick\\\" brown fox\"","\"([^\\\\\"]+|\\\\.)*\"","Bymi&OuWN",[global])),
+ <<"Cyabc">> = iolist_to_binary(re:replace("abc","","Cy",[])),
+ <<"CyaCybCycCy">> = iolist_to_binary(re:replace("abc","","Cy",[global])),
+ <<"cVsDacbW">> = iolist_to_binary(re:replace("acb","a[^a]b","\\1cVsD&W",[])),
+ <<"cVsDacbW">> = iolist_to_binary(re:replace("acb","a[^a]b","\\1cVsD&W",[global])),
+ <<"wa
+bojyKixPq">> = iolist_to_binary(re:replace("a
+b","a[^a]b","w&ojyKixPq",[])),
+ <<"wa
+bojyKixPq">> = iolist_to_binary(re:replace("a
+b","a[^a]b","w&ojyKixPq",[global])),
+ <<"DXPqrDQ">> = iolist_to_binary(re:replace("acb","a.b","\\1DX\\1Pqr\\1\\1DQ",[])),
+ <<"DXPqrDQ">> = iolist_to_binary(re:replace("acb","a.b","\\1DX\\1Pqr\\1\\1DQ",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.b","x&dFsqqlLfIA",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.b","x&dFsqqlLfIA",[global])),
<<"a
b">> = iolist_to_binary(re:replace("a
-b","a.b","rUNVcR\\1i\\1S",[])),
+b","a.b","P&jObNmClO",[])),
<<"a
b">> = iolist_to_binary(re:replace("a
-b","a.b","rUNVcR\\1i\\1S",[global])),
- <<"UHo">> = iolist_to_binary(re:replace("acb","a[^a]b","UHo",[dotall])),
- <<"UHo">> = iolist_to_binary(re:replace("acb","a[^a]b","UHo",[dotall,
- global])),
- <<"muQa
-bDGfm">> = iolist_to_binary(re:replace("a
-b","a[^a]b","muQ&DGfm",[dotall])),
- <<"muQa
-bDGfm">> = iolist_to_binary(re:replace("a
-b","a[^a]b","muQ&DGfm",[dotall,global])),
- <<"mPIfJVBacbQacbtacbVacb">> = iolist_to_binary(re:replace("acb","a.b","m\\1PIfJVB&Q&t\\1&V&",[dotall])),
- <<"mPIfJVBacbQacbtacbVacb">> = iolist_to_binary(re:replace("acb","a.b","m\\1PIfJVB&Q&t\\1&V&",[dotall,
- global])),
- <<"aNa
-bBIrkip">> = iolist_to_binary(re:replace("a
-b","a.b","aN&BIrkip",[dotall])),
- <<"aNa
-bBIrkip">> = iolist_to_binary(re:replace("a
-b","a.b","aN&BIrkip",[dotall,global])),
+b","a.b","P&jObNmClO",[global])),
+ <<"xacbpLkf">> = iolist_to_binary(re:replace("acb","a[^a]b","x&pLkf",[dotall])),
+ <<"xacbpLkf">> = iolist_to_binary(re:replace("acb","a[^a]b","x&pLkf",[dotall,
+ global])),
+ <<"FEa
+bcWUa
+bpdda
+ba
+bALbNurmn">> = iolist_to_binary(re:replace("a
+b","a[^a]b","FE&cWU&pdd&&ALbNurmn",[dotall])),
+ <<"FEa
+bcWUa
+bpdda
+ba
+bALbNurmn">> = iolist_to_binary(re:replace("a
+b","a[^a]b","FE&cWU&pdd&&ALbNurmn",[dotall,global])),
ok.
run11() ->
- <<"vhgx">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","vhgx",[])),
- <<"vhgx">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","vhgx",[global])),
- <<"ybvbbac">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","ybv&",[])),
- <<"ybvbbac">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","ybv&",[global])),
- <<"KDBmQaFUbbbbacKDvahagVH">> = iolist_to_binary(re:replace("bbbac","^(b+?|a){1,2}?c","KDBmQ\\1FUb&KDv\\1h\\1gVH",[])),
- <<"KDBmQaFUbbbbacKDvahagVH">> = iolist_to_binary(re:replace("bbbac","^(b+?|a){1,2}?c","KDBmQ\\1FUb&KDv\\1h\\1gVH",[global])),
- <<"uPboDyBKbbbbaccsL">> = iolist_to_binary(re:replace("bbbbac","^(b+?|a){1,2}?c","uPboDyBK&csL",[])),
- <<"uPboDyBKbbbbaccsL">> = iolist_to_binary(re:replace("bbbbac","^(b+?|a){1,2}?c","uPboDyBK&csL",[global])),
- <<"QeDbbbbbacbbbbbacXxKbbbbbacTlGRhFObbbbbaccF">> = iolist_to_binary(re:replace("bbbbbac","^(b+?|a){1,2}?c","QeD&&XxK&TlGRhFO&cF",[])),
- <<"QeDbbbbbacbbbbbacXxKbbbbbacTlGRhFObbbbbaccF">> = iolist_to_binary(re:replace("bbbbbac","^(b+?|a){1,2}?c","QeD&&XxK&TlGRhFO&cF",[global])),
- <<"bacUbacihaieDLiAIBbacGLD">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}?c","&U&ih\\1ieDLiAIB&GLD",[])),
- <<"bacUbacihaieDLiAIBbacGLD">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}?c","&U&ih\\1ieDLiAIB&GLD",[global])),
- <<"YFsyGywxuIMvbbacmaha">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}?c","YFsyGywxuIMv&m\\1h\\1",[])),
- <<"YFsyGywxuIMvbbacmaha">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}?c","YFsyGywxuIMv&m\\1h\\1",[global])),
- <<"qbbbacaLIOdWFbbbacbbbacJBItjgaqJ">> = iolist_to_binary(re:replace("bbbac","^(b+|a){1,2}?c","q&\\1LIOdWF&&JBItjg\\1qJ",[])),
- <<"qbbbacaLIOdWFbbbacbbbacJBItjgaqJ">> = iolist_to_binary(re:replace("bbbac","^(b+|a){1,2}?c","q&\\1LIOdWF&&JBItjg\\1qJ",[global])),
- <<"QqiEfi">> = iolist_to_binary(re:replace("bbbbac","^(b+|a){1,2}?c","QqiEfi",[])),
- <<"QqiEfi">> = iolist_to_binary(re:replace("bbbbac","^(b+|a){1,2}?c","QqiEfi",[global])),
- <<"YDPanLeWvajbbbbbacabnHyjk">> = iolist_to_binary(re:replace("bbbbbac","^(b+|a){1,2}?c","YDPanLeWv\\1j&\\1bnHyjk",[])),
- <<"YDPanLeWvajbbbbbacabnHyjk">> = iolist_to_binary(re:replace("bbbbbac","^(b+|a){1,2}?c","YDPanLeWv\\1j&\\1bnHyjk",[global])),
+ <<"GXcllkWrIacbBG">> = iolist_to_binary(re:replace("acb","a.b","\\1GXcllkWrI&\\1BG",[dotall])),
+ <<"GXcllkWrIacbBG">> = iolist_to_binary(re:replace("acb","a.b","\\1GXcllkWrI&\\1BG",[dotall,
+ global])),
+ <<"bmMeaNSa
+bVvJW">> = iolist_to_binary(re:replace("a
+b","a.b","bmMeaNS&VvJW",[dotall])),
+ <<"bmMeaNSa
+bVvJW">> = iolist_to_binary(re:replace("a
+b","a.b","bmMeaNS&VvJW",[dotall,global])),
+ <<"FabacNvbacaGaWYRb">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","F\\1&Nv&\\1G\\1WYRb",[])),
+ <<"FabacNvbacaGaWYRb">> = iolist_to_binary(re:replace("bac","^(b+?|a){1,2}?c","F\\1&Nv&\\1G\\1WYRb",[global])),
+ <<"WGbbacksaSqpuabXCRDoMob">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","WG&ks\\1Sqpu\\1bXCRDoMob",[])),
+ <<"WGbbacksaSqpuabXCRDoMob">> = iolist_to_binary(re:replace("bbac","^(b+?|a){1,2}?c","WG&ks\\1Sqpu\\1bXCRDoMob",[global])),
+ <<"aya">> = iolist_to_binary(re:replace("bbbac","^(b+?|a){1,2}?c","\\1y\\1",[])),
+ <<"aya">> = iolist_to_binary(re:replace("bbbac","^(b+?|a){1,2}?c","\\1y\\1",[global])),
+ <<"bbbbacjqGxgxaVAbbbbacSKEda">> = iolist_to_binary(re:replace("bbbbac","^(b+?|a){1,2}?c","&jqGxgx\\1VA&SKEd\\1",[])),
+ <<"bbbbacjqGxgxaVAbbbbacSKEda">> = iolist_to_binary(re:replace("bbbbac","^(b+?|a){1,2}?c","&jqGxgx\\1VA&SKEd\\1",[global])),
+ <<"nCebbbbbacpljEau">> = iolist_to_binary(re:replace("bbbbbac","^(b+?|a){1,2}?c","nCe&pljE\\1u",[])),
+ <<"nCebbbbbacpljEau">> = iolist_to_binary(re:replace("bbbbbac","^(b+?|a){1,2}?c","nCe&pljE\\1u",[global])),
+ <<"aehaicAQxGvl">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}?c","\\1ehaicAQxGvl",[])),
+ <<"aehaicAQxGvl">> = iolist_to_binary(re:replace("bac","^(b+|a){1,2}?c","\\1ehaicAQxGvl",[global])),
+ <<"ggbbactWBanbbacPcVaBlWkC">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}?c","gg&tWB\\1n&PcV\\1BlWkC",[])),
+ <<"ggbbactWBanbbacPcVaBlWkC">> = iolist_to_binary(re:replace("bbac","^(b+|a){1,2}?c","gg&tWB\\1n&PcV\\1BlWkC",[global])),
+ <<"bbbbacaRcabbbacS">> = iolist_to_binary(re:replace("bbbac","^(b+|a){1,2}?c","b&\\1Rc\\1&S",[])),
+ <<"bbbbacaRcabbbacS">> = iolist_to_binary(re:replace("bbbac","^(b+|a){1,2}?c","b&\\1Rc\\1&S",[global])),
+ <<"lrNbbbbacMarFghJVbbbbac">> = iolist_to_binary(re:replace("bbbbac","^(b+|a){1,2}?c","lrN&M\\1rFghJV&",[])),
+ <<"lrNbbbbacMarFghJVbbbbac">> = iolist_to_binary(re:replace("bbbbac","^(b+|a){1,2}?c","lrN&M\\1rFghJV&",[global])),
+ <<"aybajbbbbbacli">> = iolist_to_binary(re:replace("bbbbbac","^(b+|a){1,2}?c","\\1yb\\1j&li",[])),
+ <<"aybajbbbbbacli">> = iolist_to_binary(re:replace("bbbbbac","^(b+|a){1,2}?c","\\1yb\\1j&li",[global])),
<<"x
b">> = iolist_to_binary(re:replace("x
-b","(?!\\A)x","TB&e&lCSta",[multiline])),
+b","(?!\\A)x","qdtT&xXSc",[multiline])),
<<"x
b">> = iolist_to_binary(re:replace("x
-b","(?!\\A)x","TB&e&lCSta",[multiline,global])),
- <<"axHTxRqfqP">> = iolist_to_binary(re:replace("ax","(?!\\A)x","&HT&\\1Rq\\1fqP",[multiline])),
- <<"axHTxRqfqP">> = iolist_to_binary(re:replace("ax","(?!\\A)x","&HT&\\1Rq\\1fqP",[multiline,
- global])),
- <<"{ab}">> = iolist_to_binary(re:replace("{ab}","\\x0{ab}","nqnNdxgun\\1T",[])),
- <<"{ab}">> = iolist_to_binary(re:replace("{ab}","\\x0{ab}","nqnNdxgun\\1T",[global])),
- <<"OrUCDJnCTtDo">> = iolist_to_binary(re:replace("CD","(A|B)*?CD","OrU&J\\1nCTtDo",[])),
- <<"OrUCDJnCTtDo">> = iolist_to_binary(re:replace("CD","(A|B)*?CD","OrU&J\\1nCTtDo",[global])),
- <<"MkLtcbirH">> = iolist_to_binary(re:replace("CD","(A|B)*CD","MkLtcbirH",[])),
- <<"MkLtcbirH">> = iolist_to_binary(re:replace("CD","(A|B)*CD","MkLtcbirH",[global])),
- <<"ABABrABABomDFFpAABABSfrABGABVAB">> = iolist_to_binary(re:replace("ABABAB","(AB)*?\\1","\\1\\1r&omDFFpA&Sfr\\1G\\1V",[])),
- <<"ABABrABABomDFFpAABABSfrABGABVAB">> = iolist_to_binary(re:replace("ABABAB","(AB)*?\\1","\\1\\1r&omDFFpA&Sfr\\1G\\1V",[global])),
- <<"NpABABABGmqeABABABABrmlyABABABdq">> = iolist_to_binary(re:replace("ABABAB","(AB)*\\1","Np&Gmqe\\1&rmly&dq",[])),
- <<"NpABABABGmqeABABABABrmlyABABABdq">> = iolist_to_binary(re:replace("ABABAB","(AB)*\\1","Np&Gmqe\\1&rmly&dq",[global])),
- <<"qRqrQeDLnUtUIooiI">> = iolist_to_binary(re:replace("foo","(?<!bar)foo","q\\1RqrQeDLn\\1UtUIoo\\1iI",[])),
- <<"qRqrQeDLnUtUIooiI">> = iolist_to_binary(re:replace("foo","(?<!bar)foo","q\\1RqrQeDLn\\1UtUIoo\\1iI",[global])),
- <<"catOdXBXoDHfooHbldUpfood">> = iolist_to_binary(re:replace("catfood","(?<!bar)foo","OdXBXoDH&HbldUp&",[])),
- <<"catOdXBXoDHfooHbldUpfood">> = iolist_to_binary(re:replace("catfood","(?<!bar)foo","OdXBXoDH&HbldUp&",[global])),
- <<"arDtle">> = iolist_to_binary(re:replace("arfootle","(?<!bar)foo","D",[])),
- <<"arDtle">> = iolist_to_binary(re:replace("arfootle","(?<!bar)foo","D",[global])),
- <<"rYPYoYugCsh">> = iolist_to_binary(re:replace("rfoosh","(?<!bar)foo","YPYoYug\\1C",[])),
- <<"rYPYoYugCsh">> = iolist_to_binary(re:replace("rfoosh","(?<!bar)foo","YPYoYug\\1C",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<!bar)foo","i",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<!bar)foo","i",[global])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<!bar)foo","cbUElrx&&\\1\\1YM\\1aBcUl",[])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<!bar)foo","cbUElrx&&\\1\\1YM\\1aBcUl",[global])),
- <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","(?<!bar)foo","saPM\\1\\1OgLT\\1h\\1KWyOtmQ",[])),
- <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","(?<!bar)foo","saPM\\1\\1OgLT\\1h\\1KWyOtmQ",[global])),
- <<"EPmld">> = iolist_to_binary(re:replace("catfood","\\w{3}(?<!bar)foo","EPml",[])),
- <<"EPmld">> = iolist_to_binary(re:replace("catfood","\\w{3}(?<!bar)foo","EPml",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\w{3}(?<!bar)foo","MhJ&dGwUuIb\\1JIoqE",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\w{3}(?<!bar)foo","MhJ&dGwUuIb\\1JIoqE",[global])),
- <<"foo">> = iolist_to_binary(re:replace("foo","\\w{3}(?<!bar)foo","&wjHKW&gb",[])),
- <<"foo">> = iolist_to_binary(re:replace("foo","\\w{3}(?<!bar)foo","&wjHKW&gb",[global])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","\\w{3}(?<!bar)foo","B",[])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","\\w{3}(?<!bar)foo","B",[global])),
- <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","\\w{3}(?<!bar)foo","Jspqw\\1R\\1ldUs",[])),
- <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","\\w{3}(?<!bar)foo","Jspqw\\1R\\1ldUs",[global])),
- <<"fooarfooVALbarfooUbfooCrGfoobarhbarlfu">> = iolist_to_binary(re:replace("fooabar","(?<=(foo)a)bar","r\\1VAL&\\1Ub\\1CrG\\1&h&lfu",[])),
- <<"fooarfooVALbarfooUbfooCrGfoobarhbarlfu">> = iolist_to_binary(re:replace("fooabar","(?<=(foo)a)bar","r\\1VAL&\\1Ub\\1CrG\\1&h&lfu",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo)a)bar","Xup&&F\\1h\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo)a)bar","Xup&&F\\1h\\1",[global])),
- <<"bar">> = iolist_to_binary(re:replace("bar","(?<=(foo)a)bar","IyyUVRu\\1&J&EmI&",[])),
- <<"bar">> = iolist_to_binary(re:replace("bar","(?<=(foo)a)bar","IyyUVRu\\1&J&EmI&",[global])),
- <<"foobbar">> = iolist_to_binary(re:replace("foobbar","(?<=(foo)a)bar","yUdI",[])),
- <<"foobbar">> = iolist_to_binary(re:replace("foobbar","(?<=(foo)a)bar","yUdI",[global])),
- <<"TjyabckVlQOnp">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","Tjy&kVlQOnp",[multiline])),
- <<"TjyabckVlQOnp">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","Tjy&kVlQOnp",[multiline,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\z","jAW\\1V&Gcxh&iaRsV\\1",[multiline])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\z","jAW\\1V&Gcxh&iaRsV\\1",[multiline,
- global])),
- <<"xQWabcHT">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","\\1xQW&H\\1T",[multiline])),
- <<"xQWabcHT">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","\\1xQW&H\\1T",[multiline,
- global])),
+b","(?!\\A)x","qdtT&xXSc",[multiline,global])),
+ <<"axa">> = iolist_to_binary(re:replace("ax","(?!\\A)x","&a",[multiline])),
+ <<"axa">> = iolist_to_binary(re:replace("ax","(?!\\A)x","&a",[multiline,
+ global])),
+ <<"{ab}">> = iolist_to_binary(re:replace("{ab}","\\x0{ab}","&aQi\\1rM&TR&\\1e",[])),
+ <<"{ab}">> = iolist_to_binary(re:replace("{ab}","\\x0{ab}","&aQi\\1rM&TR&\\1e",[global])),
+ <<"KNDG">> = iolist_to_binary(re:replace("CD","(A|B)*?CD","K\\1NDG",[])),
+ <<"KNDG">> = iolist_to_binary(re:replace("CD","(A|B)*?CD","K\\1NDG",[global])),
+ <<"AgdCDyU">> = iolist_to_binary(re:replace("CD","(A|B)*CD","Agd&\\1yU",[])),
+ <<"AgdCDyU">> = iolist_to_binary(re:replace("CD","(A|B)*CD","Agd&\\1yU",[global])),
+ <<"KNLvABjABABKKABABAB">> = iolist_to_binary(re:replace("ABABAB","(AB)*?\\1","KNLv\\1j&KK&",[])),
+ <<"KNLvABjABABKKABABAB">> = iolist_to_binary(re:replace("ABABAB","(AB)*?\\1","KNLv\\1j&KK&",[global])),
+ <<"GnM">> = iolist_to_binary(re:replace("ABABAB","(AB)*\\1","GnM",[])),
+ <<"GnM">> = iolist_to_binary(re:replace("ABABAB","(AB)*\\1","GnM",[global])),
+ <<"fooRBfoomXVc">> = iolist_to_binary(re:replace("foo","(?<!bar)foo","&RB&mXVc",[])),
+ <<"fooRBfoomXVc">> = iolist_to_binary(re:replace("foo","(?<!bar)foo","&RB&mXVc",[global])),
+ <<"catjWUnJUSd">> = iolist_to_binary(re:replace("catfood","(?<!bar)foo","jWUnJUS",[])),
+ <<"catjWUnJUSd">> = iolist_to_binary(re:replace("catfood","(?<!bar)foo","jWUnJUS",[global])),
+ <<"arPgBuMtle">> = iolist_to_binary(re:replace("arfootle","(?<!bar)foo","PgBuM",[])),
+ <<"arPgBuMtle">> = iolist_to_binary(re:replace("arfootle","(?<!bar)foo","PgBuM",[global])),
+ <<"rfoorKCsmwsrXilqsh">> = iolist_to_binary(re:replace("rfoosh","(?<!bar)foo","&rKCsmwsrXilq",[])),
+ <<"rfoorKCsmwsrXilqsh">> = iolist_to_binary(re:replace("rfoosh","(?<!bar)foo","&rKCsmwsrXilq",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<!bar)foo","\\1aT&&Wgmx",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<!bar)foo","\\1aT&&Wgmx",[global])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<!bar)foo","ljtkcC",[])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<!bar)foo","ljtkcC",[global])),
+ <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","(?<!bar)foo","&&\\1Tmj\\1aBVw&Su\\1nww\\1",[])),
+ <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","(?<!bar)foo","&&\\1Tmj\\1aBVw&Su\\1nww\\1",[global])),
+ <<"ogelleKhJPBRcatfooBpBd">> = iolist_to_binary(re:replace("catfood","\\w{3}(?<!bar)foo","ogel\\1leKhJPBR\\1&B\\1pB",[])),
+ <<"ogelleKhJPBRcatfooBpBd">> = iolist_to_binary(re:replace("catfood","\\w{3}(?<!bar)foo","ogel\\1leKhJPBR\\1&B\\1pB",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\w{3}(?<!bar)foo","DfK&xr&sMv&&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\w{3}(?<!bar)foo","DfK&xr&sMv&&",[global])),
+ <<"foo">> = iolist_to_binary(re:replace("foo","\\w{3}(?<!bar)foo","&DDDKoimlSswYrm&w",[])),
+ <<"foo">> = iolist_to_binary(re:replace("foo","\\w{3}(?<!bar)foo","&DDDKoimlSswYrm&w",[global])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","\\w{3}(?<!bar)foo","iBoc&&NxWYj\\1xympSmB",[])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","\\w{3}(?<!bar)foo","iBoc&&NxWYj\\1xympSmB",[global])),
+ <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","\\w{3}(?<!bar)foo","u&dq&",[])),
+ <<"towbarfoo">> = iolist_to_binary(re:replace("towbarfoo","\\w{3}(?<!bar)foo","u&dq&",[global])),
+ <<"fooalCkfooPbarqRySQfoobarYHrF">> = iolist_to_binary(re:replace("fooabar","(?<=(foo)a)bar","lCk\\1P&qRySQ\\1&YHrF",[])),
+ <<"fooalCkfooPbarqRySQfoobarYHrF">> = iolist_to_binary(re:replace("fooabar","(?<=(foo)a)bar","lCk\\1P&qRySQ\\1&YHrF",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo)a)bar","QkbJD&bLtir&fa",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo)a)bar","QkbJD&bLtir&fa",[global])),
+ <<"bar">> = iolist_to_binary(re:replace("bar","(?<=(foo)a)bar","&J\\1DGniTa",[])),
+ <<"bar">> = iolist_to_binary(re:replace("bar","(?<=(foo)a)bar","&J\\1DGniTa",[global])),
+ <<"foobbar">> = iolist_to_binary(re:replace("foobbar","(?<=(foo)a)bar","\\1bfWxNNO\\1\\1uiB",[])),
+ <<"foobbar">> = iolist_to_binary(re:replace("foobbar","(?<=(foo)a)bar","\\1bfWxNNO\\1\\1uiB",[global])),
+ <<"inSfgh">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","inSf\\1\\1gh",[multiline])),
+ <<"inSfgh">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","inSf\\1\\1gh",[multiline,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\z","&JtcOT\\1qU",[multiline])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Aabc\\z","&JtcOT\\1qU",[multiline,
+ global])),
+ <<"fEQ">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","fEQ",[multiline])),
+ <<"fEQ">> = iolist_to_binary(re:replace("abc","\\Aabc\\z","fEQ",[multiline,
+ global])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","\\Aabc\\z","Y\\1YcwSrGNHt&\\1bI&",[multiline])),
+abc","\\Aabc\\z","ilQoSPAJ",[multiline])),
<<"qqq
abc">> = iolist_to_binary(re:replace("qqq
-abc","\\Aabc\\z","Y\\1YcwSrGNHt&\\1bI&",[multiline,global])),
+abc","\\Aabc\\z","ilQoSPAJ",[multiline,global])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","\\Aabc\\z","hxWEtDjrfttJGQ",[multiline])),
+zzz","\\Aabc\\z","sOIiDw\\1U\\1Mul&\\1NN\\1",[multiline])),
<<"abc
zzz">> = iolist_to_binary(re:replace("abc
-zzz","\\Aabc\\z","hxWEtDjrfttJGQ",[multiline,global])),
+zzz","\\Aabc\\z","sOIiDw\\1U\\1Mul&\\1NN\\1",[multiline,
+ global])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","\\Aabc\\z","\\1AYG&TDth",[multiline])),
+zzz","\\Aabc\\z","&On&obtglyVw",[multiline])),
<<"qqq
abc
zzz">> = iolist_to_binary(re:replace("qqq
abc
-zzz","\\Aabc\\z","\\1AYG&TDth",[multiline,global])),
- <<"1D">> = iolist_to_binary(re:replace("1.230003938","(?>(\\.\\d\\d[1-9]?))\\d+","D",[])),
- <<"1D">> = iolist_to_binary(re:replace("1.230003938","(?>(\\.\\d\\d[1-9]?))\\d+","D",[global])),
- <<"1.875Vkl.875egB.875000282cg">> = iolist_to_binary(re:replace("1.875000282","(?>(\\.\\d\\d[1-9]?))\\d+","\\1Vkl\\1egB&cg",[])),
- <<"1.875Vkl.875egB.875000282cg">> = iolist_to_binary(re:replace("1.875000282","(?>(\\.\\d\\d[1-9]?))\\d+","\\1Vkl\\1egB&cg",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>(\\.\\d\\d[1-9]?))\\d+","d&&VkB&QYebMC",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>(\\.\\d\\d[1-9]?))\\d+","d&&VkB&QYebMC",[global])),
- <<"1.235">> = iolist_to_binary(re:replace("1.235","(?>(\\.\\d\\d[1-9]?))\\d+","i\\1S\\1\\1&Yq&Pg&J&\\1",[])),
- <<"1.235">> = iolist_to_binary(re:replace("1.235","(?>(\\.\\d\\d[1-9]?))\\d+","i\\1S\\1\\1&Yq&Pg&J&\\1",[global])),
- <<"cjqYdkkpartyparty">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^((?>\\w+)|(?>\\s+))*$","cjqYdkk\\1\\1",[])),
- <<"cjqYdkkpartyparty">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^((?>\\w+)|(?>\\s+))*$","cjqYdkk\\1\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((?>\\w+)|(?>\\s+))*$","BK",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((?>\\w+)|(?>\\s+))*$","BK",[global])),
- <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^((?>\\w+)|(?>\\s+))*$","sakHEC\\1tyC",[])),
- <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^((?>\\w+)|(?>\\s+))*$","sakHEC\\1tyC",[global])),
- <<"a12345ax12345a">> = iolist_to_binary(re:replace("12345a","(\\d+)(\\w)","a&x&",[])),
- <<"a12345ax12345a">> = iolist_to_binary(re:replace("12345a","(\\d+)(\\w)","a&x&",[global])),
- <<"12345Mx1234LDmSq+">> = iolist_to_binary(re:replace("12345+","(\\d+)(\\w)","&Mx\\1LDmSq",[])),
- <<"12345Mx1234LDmSq+">> = iolist_to_binary(re:replace("12345+","(\\d+)(\\w)","&Mx\\1LDmSq",[global])),
- <<"kx12345GkJIBKkR12345aIDW12345ar">> = iolist_to_binary(re:replace("12345a","((?>\\d+))(\\w)","kx\\1GkJIBKkR&IDW&r",[])),
- <<"kx12345GkJIBKkR12345aIDW12345ar">> = iolist_to_binary(re:replace("12345a","((?>\\d+))(\\w)","kx\\1GkJIBKkR&IDW&r",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?>\\d+))(\\w)","AFie\\1JMiAGf&BhuHi\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?>\\d+))(\\w)","AFie\\1JMiAGf&BhuHi\\1",[global])),
- <<"12345+">> = iolist_to_binary(re:replace("12345+","((?>\\d+))(\\w)","l&&bFVdpjaGHV",[])),
- <<"12345+">> = iolist_to_binary(re:replace("12345+","((?>\\d+))(\\w)","l&&bFVdpjaGHV",[global])),
- <<"EqHtaaabaaabaaabSwdBiGUaaab">> = iolist_to_binary(re:replace("aaab","(?>a+)b","EqHt&&&SwdBiGU&",[])),
- <<"EqHtaaabaaabaaabSwdBiGUaaab">> = iolist_to_binary(re:replace("aaab","(?>a+)b","EqHt&&&SwdBiGU&",[global])),
- <<"SfjgLalqtcaaabaaablpXe">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","SfjgLalqtc\\1&lpXe",[])),
- <<"SfjgLalqtcaaabaaablpXe">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","SfjgLalqtc\\1&lpXe",[global])),
+zzz","\\Aabc\\z","&On&obtglyVw",[multiline,global])),
+ <<"1p.23">> = iolist_to_binary(re:replace("1.230003938","(?>(\\.\\d\\d[1-9]?))\\d+","p\\1",[])),
+ <<"1p.23">> = iolist_to_binary(re:replace("1.230003938","(?>(\\.\\d\\d[1-9]?))\\d+","p\\1",[global])),
+ <<"1.875ShDPcSaaE.875000282">> = iolist_to_binary(re:replace("1.875000282","(?>(\\.\\d\\d[1-9]?))\\d+","\\1ShDPcSaaE&",[])),
+ <<"1.875ShDPcSaaE.875000282">> = iolist_to_binary(re:replace("1.875000282","(?>(\\.\\d\\d[1-9]?))\\d+","\\1ShDPcSaaE&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>(\\.\\d\\d[1-9]?))\\d+","kgx\\1&RsUCY",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>(\\.\\d\\d[1-9]?))\\d+","kgx\\1&RsUCY",[global])),
+ <<"1.235">> = iolist_to_binary(re:replace("1.235","(?>(\\.\\d\\d[1-9]?))\\d+","\\1OwWeWH",[])),
+ <<"1.235">> = iolist_to_binary(re:replace("1.235","(?>(\\.\\d\\d[1-9]?))\\d+","\\1OwWeWH",[global])),
+ <<"RKNdIe">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^((?>\\w+)|(?>\\s+))*$","RKNdIe",[])),
+ <<"RKNdIe">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^((?>\\w+)|(?>\\s+))*$","RKNdIe",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((?>\\w+)|(?>\\s+))*$","&dYBP",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((?>\\w+)|(?>\\s+))*$","&dYBP",[global])),
+ <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^((?>\\w+)|(?>\\s+))*$","cGurgcY\\1oWHq&qXicAl",[])),
+ <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^((?>\\w+)|(?>\\s+))*$","cGurgcY\\1oWHq&qXicAl",[global])),
+ <<"hXTky12345aEl12345aGX12345kFf">> = iolist_to_binary(re:replace("12345a","(\\d+)(\\w)","hXTky&El&GX\\1kFf",[])),
+ <<"hXTky12345aEl12345aGX12345kFf">> = iolist_to_binary(re:replace("12345a","(\\d+)(\\w)","hXTky&El&GX\\1kFf",[global])),
+ <<"hd1234x+">> = iolist_to_binary(re:replace("12345+","(\\d+)(\\w)","hd\\1x",[])),
+ <<"hd1234x+">> = iolist_to_binary(re:replace("12345+","(\\d+)(\\w)","hd\\1x",[global])),
+ <<"12345">> = iolist_to_binary(re:replace("12345a","((?>\\d+))(\\w)","\\1",[])),
+ <<"12345">> = iolist_to_binary(re:replace("12345a","((?>\\d+))(\\w)","\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?>\\d+))(\\w)","aGjfXar",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?>\\d+))(\\w)","aGjfXar",[global])),
+ <<"12345+">> = iolist_to_binary(re:replace("12345+","((?>\\d+))(\\w)","DmEP\\1AVjI&r",[])),
+ <<"12345+">> = iolist_to_binary(re:replace("12345+","((?>\\d+))(\\w)","DmEP\\1AVjI&r",[global])),
+ <<"TaaabtTxSOuYhbPTaaabFKp">> = iolist_to_binary(re:replace("aaab","(?>a+)b","T&tTxS\\1O\\1uYhbPT&\\1FKp",[])),
+ <<"TaaabtTxSOuYhbPTaaabFKp">> = iolist_to_binary(re:replace("aaab","(?>a+)b","T&tTxS\\1O\\1uYhbPT&\\1FKp",[global])),
ok.
run12() ->
- <<"uUMJaaabSIfpB">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","uUMJ&SIfpB",[])),
- <<"uUMJaaabSIfpB">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","uUMJ&SIfpB",[global])),
- <<"aaaYgHODtKiOcNErSSbbbccc">> = iolist_to_binary(re:replace("aaabbbccc","(?>b)+","YgHODtKiOcNErSS&\\1",[])),
- <<"aaaYgHODtKiOcNErSSbbbccc">> = iolist_to_binary(re:replace("aaabbbccc","(?>b)+","YgHODtKiOcNErSS&\\1",[global])),
- <<"oaaabbbbcaaabbbbcEpdElkPiPeaeLnncccd">> = iolist_to_binary(re:replace("aaabbbbccccd","(?>a+|b+|c+)*c","o\\1&&EpdEl\\1kPiPeaeLnn",[])),
- <<"oaaabbbbcaaabbbbcEpdElkPiPeaeLnnoccEpdElkPiPeaeLnnoccEpdElkPiPeaeLnnoccEpdElkPiPeaeLnnd">> = iolist_to_binary(re:replace("aaabbbbccccd","(?>a+|b+|c+)*c","o\\1&&EpdEl\\1kPiPeaeLnn",[global])),
- <<"((HxYTsih">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","HxYTsih",[])),
- <<"((HxYTsih">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","HxYTsih",[global])),
- <<"iJnuXdUjqgsabcM(abc)OUgSEW">> = iolist_to_binary(re:replace("(abc)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","iJnuXdUjqgs\\1M&OUgSEW",[])),
- <<"iJnuXdUjqgsabcM(abc)OUgSEW">> = iolist_to_binary(re:replace("(abc)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","iJnuXdUjqgs\\1M&OUgSEW",[global])),
- <<"oxyzdq">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","o\\1dq",[])),
- <<"oxyzdq">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","o\\1dq",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(((?>[^()]+)|\\([^()]+\\))+\\)","RViX",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(((?>[^()]+)|\\([^()]+\\))+\\)","RViX",[global])),
- <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(((?>[^()]+)|\\([^()]+\\))+\\)","H",[])),
- <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(((?>[^()]+)|\\([^()]+\\))+\\)","H",[global])),
- <<"tbhUMBhabLFA">> = iolist_to_binary(re:replace("ab","a(?-i)b","tbhUMBh&\\1LFA",[caseless])),
- <<"tbhUMBhabLFA">> = iolist_to_binary(re:replace("ab","a(?-i)b","tbhUMBh&\\1LFA",[caseless,
- global])),
- <<"QUAETVEmTTESUWK">> = iolist_to_binary(re:replace("Ab","a(?-i)b","QUAETVEmTT\\1\\1ESUWK",[caseless])),
- <<"QUAETVEmTTESUWK">> = iolist_to_binary(re:replace("Ab","a(?-i)b","QUAETVEmTT\\1\\1ESUWK",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?-i)b","\\1UHB",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?-i)b","\\1UHB",[caseless,
- global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","a(?-i)b","\\1\\1tHVtVAphgcPH",[caseless])),
- <<"aB">> = iolist_to_binary(re:replace("aB","a(?-i)b","\\1\\1tHVtVAphgcPH",[caseless,
+ <<"LhIrrFgkHmaaabfdaaaboY">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","LhIrrFgkHm&fd\\1oY",[])),
+ <<"LhIrrFgkHmaaabfdaaaboY">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","LhIrrFgkHm&fd\\1oY",[global])),
+ <<"ImaaaaaacADcaaabpHh">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","Im\\1\\1cADc&pHh",[])),
+ <<"ImaaaaaacADcaaabpHh">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","Im\\1\\1cADc&pHh",[global])),
+ <<"aaatKEdbbbccc">> = iolist_to_binary(re:replace("aaabbbccc","(?>b)+","tKEd&\\1",[])),
+ <<"aaatKEdbbbccc">> = iolist_to_binary(re:replace("aaabbbccc","(?>b)+","tKEd&\\1",[global])),
+ <<"mnyiaaabbbbcEwbrLGfNMcccd">> = iolist_to_binary(re:replace("aaabbbbccccd","(?>a+|b+|c+)*c","m\\1nyi&EwbrLGfNM",[])),
+ <<"mnyiaaabbbbcEwbrLGfNMmnyicEwbrLGfNMmnyicEwbrLGfNMmnyicEwbrLGfNMd">> = iolist_to_binary(re:replace("aaabbbbccccd","(?>a+|b+|c+)*c","m\\1nyi&EwbrLGfNM",[global])),
+ <<"((Iqlkabc(ade)ufh()()xbhmeIrGmiGmVd">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","Iqlk&bhmeIrGmiGmVd",[])),
+ <<"((Iqlkabc(ade)ufh()()xbhmeIrGmiGmVd">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","Iqlk&bhmeIrGmiGmVd",[global])),
+ <<"CIsFJQabcgcRrp">> = iolist_to_binary(re:replace("(abc)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","CIsFJQ\\1gcRrp",[])),
+ <<"CIsFJQabcgcRrp">> = iolist_to_binary(re:replace("(abc)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","CIsFJQ\\1gcRrp",[global])),
+ <<"lmHuxyzxyzCxyzBxyzfyc">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","lmHu\\1\\1C\\1B\\1fyc",[])),
+ <<"lmHuxyzxyzCxyzBxyzfyc">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(((?>[^()]+)|\\([^()]+\\))+\\)","lmHu\\1\\1C\\1B\\1fyc",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(((?>[^()]+)|\\([^()]+\\))+\\)","GQrbsavAq",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(((?>[^()]+)|\\([^()]+\\))+\\)","GQrbsavAq",[global])),
+ <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(((?>[^()]+)|\\([^()]+\\))+\\)","\\1TXU&lHlMOA&&\\1EB&EF",[])),
+ <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(((?>[^()]+)|\\([^()]+\\))+\\)","\\1TXU&lHlMOA&&\\1EB&EF",[global])),
+ <<"idabiAQbk">> = iolist_to_binary(re:replace("ab","a(?-i)b","id\\1&iAQbk",[caseless])),
+ <<"idabiAQbk">> = iolist_to_binary(re:replace("ab","a(?-i)b","id\\1&iAQbk",[caseless,
+ global])),
+ <<"ymJEoJHMVXAbpfeH">> = iolist_to_binary(re:replace("Ab","a(?-i)b","ymJEo\\1JHMVX&pfeH",[caseless])),
+ <<"ymJEoJHMVXAbpfeH">> = iolist_to_binary(re:replace("Ab","a(?-i)b","ymJEo\\1JHMVX&pfeH",[caseless,
global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","a(?-i)b","EHcIhNYa\\1KSgqWOK",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("AB","a(?-i)b","EHcIhNYa\\1KSgqWOK",[caseless,
- global])),
- <<"FILLIygQ">> = iolist_to_binary(re:replace("a bcd e","(a (?x)b c)d e","FILLIygQ",[])),
- <<"FILLIygQ">> = iolist_to_binary(re:replace("a bcd e","(a (?x)b c)d e","FILLIygQ",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a (?x)b c)d e","wJGN&cKBOuESq\\1&Wj",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a (?x)b c)d e","wJGN&cKBOuESq\\1&Wj",[global])),
- <<"a b cd e">> = iolist_to_binary(re:replace("a b cd e","(a (?x)b c)d e","A\\1AwoRg&BJXQG",[])),
- <<"a b cd e">> = iolist_to_binary(re:replace("a b cd e","(a (?x)b c)d e","A\\1AwoRg&BJXQG",[global])),
- <<"abcd e">> = iolist_to_binary(re:replace("abcd e","(a (?x)b c)d e","u",[])),
- <<"abcd e">> = iolist_to_binary(re:replace("abcd e","(a (?x)b c)d e","u",[global])),
- <<"a bcde">> = iolist_to_binary(re:replace("a bcde","(a (?x)b c)d e","oNi\\1yapjj\\1GmPvu\\1Y\\1qv",[])),
- <<"a bcde">> = iolist_to_binary(re:replace("a bcde","(a (?x)b c)d e","oNi\\1yapjj\\1GmPvu\\1Y\\1qv",[global])),
- <<"Aa bcde fa bcde faa bcde fEL">> = iolist_to_binary(re:replace("a bcde f","(a b(?x)c d (?-x)e f)","A&&a&EL",[])),
- <<"Aa bcde fa bcde faa bcde fEL">> = iolist_to_binary(re:replace("a bcde f","(a b(?x)c d (?-x)e f)","A&&a&EL",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a b(?x)c d (?-x)e f)","tNNP\\1V&C",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a b(?x)c d (?-x)e f)","tNNP\\1V&C",[global])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","(a b(?x)c d (?-x)e f)","ty&TPg&J\\1hrKvQIX\\1",[])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","(a b(?x)c d (?-x)e f)","ty&TPg&J\\1hrKvQIX\\1",[global])),
- <<"Bfe">> = iolist_to_binary(re:replace("abc","(a(?i)b)c","Bfe",[])),
- <<"Bfe">> = iolist_to_binary(re:replace("abc","(a(?i)b)c","Bfe",[global])),
- <<"aBaBeoqaBaBdaIDJFJSKhel">> = iolist_to_binary(re:replace("aBc","(a(?i)b)c","\\1\\1eoq\\1\\1daIDJFJSKhel",[])),
- <<"aBaBeoqaBaBdaIDJFJSKhel">> = iolist_to_binary(re:replace("aBc","(a(?i)b)c","\\1\\1eoq\\1\\1daIDJFJSKhel",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)b)c","RRCuLD&CCSP&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)b)c","RRCuLD&CCSP&",[global])),
- <<"abC">> = iolist_to_binary(re:replace("abC","(a(?i)b)c","&YVGhj",[])),
- <<"abC">> = iolist_to_binary(re:replace("abC","(a(?i)b)c","&YVGhj",[global])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","(a(?i)b)c","&\\1ABy\\1Tud",[])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","(a(?i)b)c","&\\1ABy\\1Tud",[global])),
- <<"Abc">> = iolist_to_binary(re:replace("Abc","(a(?i)b)c","vHc&EssOdEtsm",[])),
- <<"Abc">> = iolist_to_binary(re:replace("Abc","(a(?i)b)c","vHc&EssOdEtsm",[global])),
- <<"ABc">> = iolist_to_binary(re:replace("ABc","(a(?i)b)c","&&O",[])),
- <<"ABc">> = iolist_to_binary(re:replace("ABc","(a(?i)b)c","&&O",[global])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","(a(?i)b)c","&&&G\\1GLMkRej\\1y\\1aOQ",[])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","(a(?i)b)c","&&&G\\1GLMkRej\\1y\\1aOQ",[global])),
- <<"AbC">> = iolist_to_binary(re:replace("AbC","(a(?i)b)c","ajN\\1emNFkTh&UCTlp&Y",[])),
- <<"AbC">> = iolist_to_binary(re:replace("AbC","(a(?i)b)c","ajN\\1emNFkTh&UCTlp&Y",[global])),
- <<"fabcabcccGlcVpJl">> = iolist_to_binary(re:replace("abc","a(?i:b)c","f&&ccGlcVpJl",[])),
- <<"fabcabcccGlcVpJl">> = iolist_to_binary(re:replace("abc","a(?i:b)c","f&&ccGlcVpJl",[global])),
- <<"NeHDaBcCVyaBcpFA">> = iolist_to_binary(re:replace("aBc","a(?i:b)c","Ne\\1\\1\\1HD&C\\1Vy&pFA",[])),
- <<"NeHDaBcCVyaBcpFA">> = iolist_to_binary(re:replace("aBc","a(?i:b)c","Ne\\1\\1\\1HD&C\\1Vy&pFA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)c","Sqq",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)c","Sqq",[global])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","a(?i:b)c","&FRMp\\1nIrrC\\1IVSckPvd",[])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","a(?i:b)c","&FRMp\\1nIrrC\\1IVSckPvd",[global])),
- <<"abC">> = iolist_to_binary(re:replace("abC","a(?i:b)c","x\\1WM&dj&&KIBo",[])),
- <<"abC">> = iolist_to_binary(re:replace("abC","a(?i:b)c","x\\1WM&dj&&KIBo",[global])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)c","XiKEHtEtj",[])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)c","XiKEHtEtj",[global])),
- <<"SjNSaBcGWaBcwcaBcTf">> = iolist_to_binary(re:replace("aBc","a(?i:b)*c","\\1\\1SjNS&GW&wc&Tf",[])),
- <<"SjNSaBcGWaBcwcaBcTf">> = iolist_to_binary(re:replace("aBc","a(?i:b)*c","\\1\\1SjNS&GW&wc&Tf",[global])),
- <<"rOaBBckjJDolGaBBcie">> = iolist_to_binary(re:replace("aBBc","a(?i:b)*c","rO&kjJDolG&\\1ie",[])),
- <<"rOaBBckjJDolGaBBcie">> = iolist_to_binary(re:replace("aBBc","a(?i:b)*c","rO&kjJDolG&\\1ie",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)*c","rnHfd\\1uJBJn",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)*c","rnHfd\\1uJBJn",[global])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)*c","T",[])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)*c","T",[global])),
- <<"aBBC">> = iolist_to_binary(re:replace("aBBC","a(?i:b)*c","qC&IV\\1WPwD&&raPOEJG",[])),
- <<"aBBC">> = iolist_to_binary(re:replace("aBBC","a(?i:b)*c","qC&IV\\1WPwD&&raPOEJG",[global])),
- <<"fxbDabcdcebhuXknd">> = iolist_to_binary(re:replace("abcd","a(?=b(?i)c)\\w\\wd","fxbD&cebhuX\\1knd",[])),
- <<"fxbDabcdcebhuXknd">> = iolist_to_binary(re:replace("abcd","a(?=b(?i)c)\\w\\wd","fxbD&cebhuX\\1knd",[global])),
- <<"hmNjfiwabCdOns">> = iolist_to_binary(re:replace("abCd","a(?=b(?i)c)\\w\\wd","hmN\\1jfiw&On\\1s",[])),
- <<"hmNjfiwabCdOns">> = iolist_to_binary(re:replace("abCd","a(?=b(?i)c)\\w\\wd","hmN\\1jfiw&On\\1s",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?=b(?i)c)\\w\\wd","l",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?=b(?i)c)\\w\\wd","l",[global])),
- <<"aBCd">> = iolist_to_binary(re:replace("aBCd","a(?=b(?i)c)\\w\\wd","QVfGTQBraI&PoV&&B\\1B",[])),
- <<"aBCd">> = iolist_to_binary(re:replace("aBCd","a(?=b(?i)c)\\w\\wd","QVfGTQBraI&PoV&&B\\1B",[global])),
- <<"abcD">> = iolist_to_binary(re:replace("abcD","a(?=b(?i)c)\\w\\wd","WTVxdU\\1Ql&Ori\\1DCqn&",[])),
- <<"abcD">> = iolist_to_binary(re:replace("abcD","a(?=b(?i)c)\\w\\wd","WTVxdU\\1Ql&Ori\\1DCqn&",[global])),
- <<"yHdfkVmore than millionmore than millione">> = iolist_to_binary(re:replace("more than million","(?s-i:more.*than).*million","yHd\\1fkV&&e\\1",[caseless])),
- <<"yHdfkVmore than millionmore than millione">> = iolist_to_binary(re:replace("more than million","(?s-i:more.*than).*million","yHd\\1fkV&&e\\1",[caseless,
- global])),
- <<"mQsFkPLr">> = iolist_to_binary(re:replace("more than MILLION","(?s-i:more.*than).*million","mQsFkPLr",[caseless])),
- <<"mQsFkPLr">> = iolist_to_binary(re:replace("more than MILLION","(?s-i:more.*than).*million","mQsFkPLr",[caseless,
- global])),
- <<"mvDmore
- than MillionmVTJEmore
- than MillionTJNmore
- than MillionLwu">> = iolist_to_binary(re:replace("more
- than Million","(?s-i:more.*than).*million","mvD&mVTJE&TJN&Lwu",[caseless])),
- <<"mvDmore
- than MillionmVTJEmore
- than MillionTJNmore
- than MillionLwu">> = iolist_to_binary(re:replace("more
- than Million","(?s-i:more.*than).*million","mvD&mVTJE&TJN&Lwu",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s-i:more.*than).*million","t\\1vYtKJq&frCR\\1",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s-i:more.*than).*million","t\\1vYtKJq&frCR\\1",[caseless,
- global])),
- <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?s-i:more.*than).*million","\\1gn&G\\1&",[caseless])),
- <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?s-i:more.*than).*million","\\1gn&G\\1&",[caseless,
- global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?-i)b","vPR\\1TpFC\\1FV",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?-i)b","vPR\\1TpFC\\1FV",[caseless,
+ global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","a(?-i)b","&",[caseless])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","a(?-i)b","&",[caseless,
+ global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","a(?-i)b","&\\1VTAYjnm&anO",[caseless])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","a(?-i)b","&\\1VTAYjnm&anO",[caseless,
+ global])),
+ <<"wa bcd eNsa bcd eU">> = iolist_to_binary(re:replace("a bcd e","(a (?x)b c)d e","w&Ns&U",[])),
+ <<"wa bcd eNsa bcd eU">> = iolist_to_binary(re:replace("a bcd e","(a (?x)b c)d e","w&Ns&U",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a (?x)b c)d e","J\\1\\1&\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a (?x)b c)d e","J\\1\\1&\\1",[global])),
+ <<"a b cd e">> = iolist_to_binary(re:replace("a b cd e","(a (?x)b c)d e","kmHqh\\1V&xPLo&d\\1kD&c\\1",[])),
+ <<"a b cd e">> = iolist_to_binary(re:replace("a b cd e","(a (?x)b c)d e","kmHqh\\1V&xPLo&d\\1kD&c\\1",[global])),
+ <<"abcd e">> = iolist_to_binary(re:replace("abcd e","(a (?x)b c)d e","JeuSTa",[])),
+ <<"abcd e">> = iolist_to_binary(re:replace("abcd e","(a (?x)b c)d e","JeuSTa",[global])),
+ <<"a bcde">> = iolist_to_binary(re:replace("a bcde","(a (?x)b c)d e","rGvPufM&S",[])),
+ <<"a bcde">> = iolist_to_binary(re:replace("a bcde","(a (?x)b c)d e","rGvPufM&S",[global])),
+ <<"Ta bcde fa bcde fUmmu">> = iolist_to_binary(re:replace("a bcde f","(a b(?x)c d (?-x)e f)","T\\1\\1Ummu",[])),
+ <<"Ta bcde fa bcde fUmmu">> = iolist_to_binary(re:replace("a bcde f","(a b(?x)c d (?-x)e f)","T\\1\\1Ummu",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a b(?x)c d (?-x)e f)","IRrlhH\\1TBy\\1hR&SlYv",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a b(?x)c d (?-x)e f)","IRrlhH\\1TBy\\1hR&SlYv",[global])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","(a b(?x)c d (?-x)e f)","&W&QjaDduHuWkQDe&f",[])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","(a b(?x)c d (?-x)e f)","&W&QjaDduHuWkQDe&f",[global])),
+ <<"nPOwabcHbn">> = iolist_to_binary(re:replace("abc","(a(?i)b)c","nPOw&Hbn",[])),
+ <<"nPOwabcHbn">> = iolist_to_binary(re:replace("abc","(a(?i)b)c","nPOw&Hbn",[global])),
+ <<"lUDErmsSNiolx">> = iolist_to_binary(re:replace("aBc","(a(?i)b)c","lUDErmsSNiolx",[])),
+ <<"lUDErmsSNiolx">> = iolist_to_binary(re:replace("aBc","(a(?i)b)c","lUDErmsSNiolx",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)b)c","\\1nnmRyE\\1TDu\\1gSpew&lo",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)b)c","\\1nnmRyE\\1TDu\\1gSpew&lo",[global])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","(a(?i)b)c","\\1yod\\1Yx&CeJlaBW",[])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","(a(?i)b)c","\\1yod\\1Yx&CeJlaBW",[global])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","(a(?i)b)c","&SAguoo",[])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","(a(?i)b)c","&SAguoo",[global])),
+ <<"Abc">> = iolist_to_binary(re:replace("Abc","(a(?i)b)c","gK&",[])),
+ <<"Abc">> = iolist_to_binary(re:replace("Abc","(a(?i)b)c","gK&",[global])),
+ <<"ABc">> = iolist_to_binary(re:replace("ABc","(a(?i)b)c","VqTSha",[])),
+ <<"ABc">> = iolist_to_binary(re:replace("ABc","(a(?i)b)c","VqTSha",[global])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","(a(?i)b)c","umIMCIf&IcUxswr\\1PAle",[])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","(a(?i)b)c","umIMCIf&IcUxswr\\1PAle",[global])),
+ <<"AbC">> = iolist_to_binary(re:replace("AbC","(a(?i)b)c","IrRia&&\\1\\1xxN",[])),
+ <<"AbC">> = iolist_to_binary(re:replace("AbC","(a(?i)b)c","IrRia&&\\1\\1xxN",[global])),
+ <<"BhNg">> = iolist_to_binary(re:replace("abc","a(?i:b)c","B\\1hNg",[])),
+ <<"BhNg">> = iolist_to_binary(re:replace("abc","a(?i:b)c","B\\1hNg",[global])),
+ <<"ksleilaBcnaBcgaBcckag">> = iolist_to_binary(re:replace("aBc","a(?i:b)c","ksleil\\1&n&\\1g&ckag",[])),
+ <<"ksleilaBcnaBcgaBcckag">> = iolist_to_binary(re:replace("aBc","a(?i:b)c","ksleil\\1&n&\\1g&ckag",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)c","HOFVAgJOK&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)c","HOFVAgJOK&",[global])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","a(?i:b)c","AqQnVO",[])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","a(?i:b)c","AqQnVO",[global])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","a(?i:b)c","vnKNXwp\\1rp\\1JxY",[])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","a(?i:b)c","vnKNXwp\\1rp\\1JxY",[global])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)c","&&l&\\1CMbjHlAnNY",[])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)c","&&l&\\1CMbjHlAnNY",[global])),
+ <<"CrbBlrjAUcQReBRN">> = iolist_to_binary(re:replace("aBc","a(?i:b)*c","CrbBlrjAUcQReBRN",[])),
+ <<"CrbBlrjAUcQReBRN">> = iolist_to_binary(re:replace("aBc","a(?i:b)*c","CrbBlrjAUcQReBRN",[global])),
+ <<"FTHvDKUVGaBBcJaBBca">> = iolist_to_binary(re:replace("aBBc","a(?i:b)*c","FT\\1HvDKUVG&J\\1&\\1a",[])),
+ <<"FTHvDKUVGaBBcJaBBca">> = iolist_to_binary(re:replace("aBBc","a(?i:b)*c","FT\\1HvDKUVG&J\\1&\\1a",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)*c","qHE\\1PBQLSx",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?i:b)*c","qHE\\1PBQLSx",[global])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)*c","ceuREb\\1nlQIA\\1tjv",[])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","a(?i:b)*c","ceuREb\\1nlQIA\\1tjv",[global])),
+ <<"aBBC">> = iolist_to_binary(re:replace("aBBC","a(?i:b)*c","\\1xa&d\\1\\1\\1&y",[])),
+ <<"aBBC">> = iolist_to_binary(re:replace("aBBC","a(?i:b)*c","\\1xa&d\\1\\1\\1&y",[global])),
+ <<"ulvseXcnAHfTux">> = iolist_to_binary(re:replace("abcd","a(?=b(?i)c)\\w\\wd","\\1ulvseXc\\1nAHf\\1Tux",[])),
+ <<"ulvseXcnAHfTux">> = iolist_to_binary(re:replace("abcd","a(?=b(?i)c)\\w\\wd","\\1ulvseXc\\1nAHf\\1Tux",[global])),
+ <<"JabCdfEqTKkUYCsYRBa">> = iolist_to_binary(re:replace("abCd","a(?=b(?i)c)\\w\\wd","J&fEqTKkUYCsYR\\1Ba",[])),
+ <<"JabCdfEqTKkUYCsYRBa">> = iolist_to_binary(re:replace("abCd","a(?=b(?i)c)\\w\\wd","J&fEqTKkUYCsYR\\1Ba",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?=b(?i)c)\\w\\wd","&ucD&KTCpy&hM\\1JmdG\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?=b(?i)c)\\w\\wd","&ucD&KTCpy&hM\\1JmdG\\1",[global])),
+ <<"aBCd">> = iolist_to_binary(re:replace("aBCd","a(?=b(?i)c)\\w\\wd","un&fMos&GsMoI\\1IOOgT\\1",[])),
+ <<"aBCd">> = iolist_to_binary(re:replace("aBCd","a(?=b(?i)c)\\w\\wd","un&fMos&GsMoI\\1IOOgT\\1",[global])),
+ <<"abcD">> = iolist_to_binary(re:replace("abcD","a(?=b(?i)c)\\w\\wd","\\1TX&",[])),
+ <<"abcD">> = iolist_to_binary(re:replace("abcD","a(?=b(?i)c)\\w\\wd","\\1TX&",[global])),
+ <<"more than millionxmore than millionDMymore than millionvobHjfHmore than millionHqL">> = iolist_to_binary(re:replace("more than million","(?s-i:more.*than).*million","&x&DMy&vobHjfH&HqL",[caseless])),
+ <<"more than millionxmore than millionDMymore than millionvobHjfHmore than millionHqL">> = iolist_to_binary(re:replace("more than million","(?s-i:more.*than).*million","&x&DMy&vobHjfH&HqL",[caseless,
+ global])),
+ <<"more than MILLIONKImore than MILLIONmore than MILLIONuDxH">> = iolist_to_binary(re:replace("more than MILLION","(?s-i:more.*than).*million","\\1&\\1KI&&uDxH",[caseless])),
+ <<"more than MILLIONKImore than MILLIONmore than MILLIONuDxH">> = iolist_to_binary(re:replace("more than MILLION","(?s-i:more.*than).*million","\\1&\\1KI&&uDxH",[caseless,
+ global])),
+ <<"DIwUfD">> = iolist_to_binary(re:replace("more
+ than Million","(?s-i:more.*than).*million","DIwU\\1fD",[caseless])),
+ <<"DIwUfD">> = iolist_to_binary(re:replace("more
+ than Million","(?s-i:more.*than).*million","DIwU\\1fD",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s-i:more.*than).*million","&&m&lYA",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?s-i:more.*than).*million","&&m&lYA",[caseless,
+ global])),
+ <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?s-i:more.*than).*million","hC\\1c\\1QaE\\1ejLMkpMbOoW",[caseless])),
+ <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?s-i:more.*than).*million","hC\\1c\\1QaE\\1ejLMkpMbOoW",[caseless,
+ global])),
<<"more
than
million">> = iolist_to_binary(re:replace("more
than
- million","(?s-i:more.*than).*million","WmlNcmK\\1\\1DMpX\\1WToOHF",[caseless])),
+ million","(?s-i:more.*than).*million","hU\\1&DhqAQkrYaH",[caseless])),
<<"more
than
million">> = iolist_to_binary(re:replace("more
than
- million","(?s-i:more.*than).*million","WmlNcmK\\1\\1DMpX\\1WToOHF",[caseless,
- global])),
- <<"psmore than millionTuKupIvfmRjB">> = iolist_to_binary(re:replace("more than million","(?:(?s-i)more.*than).*million","ps&T\\1uKupIvfmRjB",[caseless])),
- <<"psmore than millionTuKupIvfmRjB">> = iolist_to_binary(re:replace("more than million","(?:(?s-i)more.*than).*million","ps&T\\1uKupIvfmRjB",[caseless,
+ million","(?s-i:more.*than).*million","hU\\1&DhqAQkrYaH",[caseless,
+ global])),
+ <<"rBTLmore than millionY">> = iolist_to_binary(re:replace("more than million","(?:(?s-i)more.*than).*million","rBTL&Y",[caseless])),
+ <<"rBTLmore than millionY">> = iolist_to_binary(re:replace("more than million","(?:(?s-i)more.*than).*million","rBTL&Y",[caseless,
+ global])),
+ <<"SmyMhdAN">> = iolist_to_binary(re:replace("more than MILLION","(?:(?s-i)more.*than).*million","S\\1myMhdAN",[caseless])),
+ <<"SmyMhdAN">> = iolist_to_binary(re:replace("more than MILLION","(?:(?s-i)more.*than).*million","S\\1myMhdAN",[caseless,
+ global])),
+ <<"VCDSmcyPWmore
+ than Milliondg">> = iolist_to_binary(re:replace("more
+ than Million","(?:(?s-i)more.*than).*million","VCDSmcyPW\\1&dg",[caseless])),
+ <<"VCDSmcyPWmore
+ than Milliondg">> = iolist_to_binary(re:replace("more
+ than Million","(?:(?s-i)more.*than).*million","VCDSmcyPW\\1&dg",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?s-i)more.*than).*million","\\1B&",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?s-i)more.*than).*million","\\1B&",[caseless,
+ global])),
+ <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?:(?s-i)more.*than).*million","\\1R&\\1IUeeXdQa&",[caseless])),
+ <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?:(?s-i)more.*than).*million","\\1R&\\1IUeeXdQa&",[caseless,
global])),
- <<"IhKcRCpQge">> = iolist_to_binary(re:replace("more than MILLION","(?:(?s-i)more.*than).*million","I\\1\\1hKcRCpQg\\1e",[caseless])),
- <<"IhKcRCpQge">> = iolist_to_binary(re:replace("more than MILLION","(?:(?s-i)more.*than).*million","I\\1\\1hKcRCpQg\\1e",[caseless,
- global])),
- <<"more
- than MillionOISUnAOTGvtRakU">> = iolist_to_binary(re:replace("more
- than Million","(?:(?s-i)more.*than).*million","&OISU\\1nAOTGvtRakU\\1",[caseless])),
- <<"more
- than MillionOISUnAOTGvtRakU">> = iolist_to_binary(re:replace("more
- than Million","(?:(?s-i)more.*than).*million","&OISU\\1nAOTGvtRakU\\1",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?s-i)more.*than).*million","TNips\\1&J\\1mqnbuyC",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?s-i)more.*than).*million","TNips\\1&J\\1mqnbuyC",[caseless,
- global])),
- <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?:(?s-i)more.*than).*million","\\1qCci&VKLJ&QtwPOr",[caseless])),
- <<"MORE THAN MILLION">> = iolist_to_binary(re:replace("MORE THAN MILLION","(?:(?s-i)more.*than).*million","\\1qCci&VKLJ&QtwPOr",[caseless,
- global])),
<<"more
than
million">> = iolist_to_binary(re:replace("more
than
- million","(?:(?s-i)more.*than).*million","N",[caseless])),
+ million","(?:(?s-i)more.*than).*million","QA\\1&",[caseless])),
<<"more
than
million">> = iolist_to_binary(re:replace("more
than
- million","(?:(?s-i)more.*than).*million","N",[caseless,global])),
- <<"dAgcabcrYrHG">> = iolist_to_binary(re:replace("abc","(?>a(?i)b+)+c","dAgc&rYrH\\1\\1G",[])),
- <<"dAgcabcrYrHG">> = iolist_to_binary(re:replace("abc","(?>a(?i)b+)+c","dAgc&rYrH\\1\\1G",[global])),
- <<"fXy">> = iolist_to_binary(re:replace("aBbc","(?>a(?i)b+)+c","fXy",[])),
- <<"fXy">> = iolist_to_binary(re:replace("aBbc","(?>a(?i)b+)+c","fXy",[global])),
- <<"y">> = iolist_to_binary(re:replace("aBBc","(?>a(?i)b+)+c","y",[])),
- <<"y">> = iolist_to_binary(re:replace("aBBc","(?>a(?i)b+)+c","y",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>a(?i)b+)+c","riGTl\\1gCN&tFIx",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>a(?i)b+)+c","riGTl\\1gCN&tFIx",[global])),
- <<"Abc">> = iolist_to_binary(re:replace("Abc","(?>a(?i)b+)+c","QnNFHC\\1\\1AJpJokFLyM",[])),
- <<"Abc">> = iolist_to_binary(re:replace("Abc","(?>a(?i)b+)+c","QnNFHC\\1\\1AJpJokFLyM",[global])),
- <<"abAb">> = iolist_to_binary(re:replace("abAb","(?>a(?i)b+)+c","yrdamBD",[])),
- <<"abAb">> = iolist_to_binary(re:replace("abAb","(?>a(?i)b+)+c","yrdamBD",[global])),
- <<"abbC">> = iolist_to_binary(re:replace("abbC","(?>a(?i)b+)+c","\\1&a&x",[])),
- <<"abbC">> = iolist_to_binary(re:replace("abbC","(?>a(?i)b+)+c","\\1&a&x",[global])),
- <<"WnabchdOabcXw">> = iolist_to_binary(re:replace("abc","(?=a(?i)b)\\w\\wc","Wn\\1\\1&hdO&Xw",[])),
- <<"WnabchdOabcXw">> = iolist_to_binary(re:replace("abc","(?=a(?i)b)\\w\\wc","Wn\\1\\1&hdO&Xw",[global])),
- <<"NUnsaGHpA">> = iolist_to_binary(re:replace("aBc","(?=a(?i)b)\\w\\wc","NUnsaGHp\\1A",[])),
- <<"NUnsaGHpA">> = iolist_to_binary(re:replace("aBc","(?=a(?i)b)\\w\\wc","NUnsaGHp\\1A",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=a(?i)b)\\w\\wc","J",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=a(?i)b)\\w\\wc","J",[global])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?=a(?i)b)\\w\\wc","rA\\1tmLWYJdpHtIJ\\1",[])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?=a(?i)b)\\w\\wc","rA\\1tmLWYJdpHtIJ\\1",[global])),
- <<"abC">> = iolist_to_binary(re:replace("abC","(?=a(?i)b)\\w\\wc","O",[])),
- <<"abC">> = iolist_to_binary(re:replace("abC","(?=a(?i)b)\\w\\wc","O",[global])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","(?=a(?i)b)\\w\\wc","xrOeHr\\1Ws\\1FvkVpoU",[])),
- <<"aBC">> = iolist_to_binary(re:replace("aBC","(?=a(?i)b)\\w\\wc","xrOeHr\\1Ws\\1FvkVpoU",[global])),
- <<"abcFSPxxcxxctgbJkxxNdQS">> = iolist_to_binary(re:replace("abxxc","(?<=a(?i)b)(\\w\\w)c","cFSP&&tgbJk\\1NdQS",[])),
- <<"abcFSPxxcxxctgbJkxxNdQS">> = iolist_to_binary(re:replace("abxxc","(?<=a(?i)b)(\\w\\w)c","cFSP&&tgbJk\\1NdQS",[global])),
- <<"aBQNAt">> = iolist_to_binary(re:replace("aBxxc","(?<=a(?i)b)(\\w\\w)c","QNAt",[])),
- <<"aBQNAt">> = iolist_to_binary(re:replace("aBxxc","(?<=a(?i)b)(\\w\\w)c","QNAt",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a(?i)b)(\\w\\w)c","inxwegNttyrc",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a(?i)b)(\\w\\w)c","inxwegNttyrc",[global])),
- <<"Abxxc">> = iolist_to_binary(re:replace("Abxxc","(?<=a(?i)b)(\\w\\w)c","YUsRHD&",[])),
- <<"Abxxc">> = iolist_to_binary(re:replace("Abxxc","(?<=a(?i)b)(\\w\\w)c","YUsRHD&",[global])),
- <<"ABxxc">> = iolist_to_binary(re:replace("ABxxc","(?<=a(?i)b)(\\w\\w)c","CXJBefD\\1kemWbn&fyJ",[])),
- <<"ABxxc">> = iolist_to_binary(re:replace("ABxxc","(?<=a(?i)b)(\\w\\w)c","CXJBefD\\1kemWbn&fyJ",[global])),
- <<"abxxC">> = iolist_to_binary(re:replace("abxxC","(?<=a(?i)b)(\\w\\w)c","UjT\\1hGcc&\\1K",[])),
- <<"abxxC">> = iolist_to_binary(re:replace("abxxC","(?<=a(?i)b)(\\w\\w)c","UjT\\1hGcc&\\1K",[global])),
- <<"e">> = iolist_to_binary(re:replace("aA","(?:(a)|b)(?(1)A|B)","e",[])),
- <<"e">> = iolist_to_binary(re:replace("aA","(?:(a)|b)(?(1)A|B)","e",[global])),
- <<"NMcPpQyHaNfjCbBaD">> = iolist_to_binary(re:replace("bB","(?:(a)|b)(?(1)A|B)","\\1NMcPpQyHaNfjC&aD",[])),
- <<"NMcPpQyHaNfjCbBaD">> = iolist_to_binary(re:replace("bB","(?:(a)|b)(?(1)A|B)","\\1NMcPpQyHaNfjC&aD",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(a)|b)(?(1)A|B)","\\1Q",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(a)|b)(?(1)A|B)","\\1Q",[global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?:(a)|b)(?(1)A|B)","&SMEo&XGCCInDGmiby",[])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?:(a)|b)(?(1)A|B)","&SMEo&XGCCInDGmiby",[global])),
- <<"bA">> = iolist_to_binary(re:replace("bA","(?:(a)|b)(?(1)A|B)","UUW&\\1&SC\\1",[])),
- <<"bA">> = iolist_to_binary(re:replace("bA","(?:(a)|b)(?(1)A|B)","UUW&\\1&SC\\1",[global])),
- <<"FeSwwOaSaLaaSV">> = iolist_to_binary(re:replace("aa","^(a)?(?(1)a|b)+$","FeSwwO\\1S\\1L&SV",[])),
- <<"FeSwwOaSaLaaSV">> = iolist_to_binary(re:replace("aa","^(a)?(?(1)a|b)+$","FeSwwO\\1S\\1L&SV",[global])),
- <<"JTW">> = iolist_to_binary(re:replace("b","^(a)?(?(1)a|b)+$","JTW",[])),
- <<"JTW">> = iolist_to_binary(re:replace("b","^(a)?(?(1)a|b)+$","JTW",[global])),
- <<"rbbbbmbfbxJobbhlCHbbbbdR">> = iolist_to_binary(re:replace("bb","^(a)?(?(1)a|b)+$","r&&mbfbxJo&hlCH&&dR\\1",[])),
- <<"rbbbbmbfbxJobbhlCHbbbbdR">> = iolist_to_binary(re:replace("bb","^(a)?(?(1)a|b)+$","r&&mbfbxJo&hlCH&&dR\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","RLV&s",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","RLV&s",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a)?(?(1)a|b)+$","QoxGv\\1Pa&\\1mowml",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","^(a)?(?(1)a|b)+$","QoxGv\\1Pa&\\1mowml",[global])),
- <<"cfabc:abc:">> = iolist_to_binary(re:replace("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$","cf&&",[])),
- <<"cfabc:abc:">> = iolist_to_binary(re:replace("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$","cf&&",[global])),
- <<"IKeMxScgslGf">> = iolist_to_binary(re:replace("12","^(?(?=abc)\\w{3}:|\\d\\d)$","IKeMxScgsl\\1\\1Gf",[])),
- <<"IKeMxScgslGf">> = iolist_to_binary(re:replace("12","^(?(?=abc)\\w{3}:|\\d\\d)$","IKeMxScgsl\\1\\1Gf",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?=abc)\\w{3}:|\\d\\d)$","cCGveJFFUHnS\\1S",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?=abc)\\w{3}:|\\d\\d)$","cCGveJFFUHnS\\1S",[global])),
- <<"123">> = iolist_to_binary(re:replace("123","^(?(?=abc)\\w{3}:|\\d\\d)$","kudsG&Hdk",[])),
- <<"123">> = iolist_to_binary(re:replace("123","^(?(?=abc)\\w{3}:|\\d\\d)$","kudsG&Hdk",[global])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$","&kyqj\\1U\\1\\1\\1",[])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$","&kyqj\\1U\\1\\1\\1",[global])),
+ million","(?:(?s-i)more.*than).*million","QA\\1&",[caseless,global])),
+ <<"DxMdabcH">> = iolist_to_binary(re:replace("abc","(?>a(?i)b+)+c","DxMd&H",[])),
+ <<"DxMdabcH">> = iolist_to_binary(re:replace("abc","(?>a(?i)b+)+c","DxMd&H",[global])),
+ <<"GBQiDroaaBbcF">> = iolist_to_binary(re:replace("aBbc","(?>a(?i)b+)+c","GBQiDroa&F\\1",[])),
+ <<"GBQiDroaaBbcF">> = iolist_to_binary(re:replace("aBbc","(?>a(?i)b+)+c","GBQiDroa&F\\1",[global])),
+ <<"daBBcvQhyA">> = iolist_to_binary(re:replace("aBBc","(?>a(?i)b+)+c","d&vQhyA",[])),
+ <<"daBBcvQhyA">> = iolist_to_binary(re:replace("aBBc","(?>a(?i)b+)+c","d&vQhyA",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>a(?i)b+)+c","htKB",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>a(?i)b+)+c","htKB",[global])),
+ <<"Abc">> = iolist_to_binary(re:replace("Abc","(?>a(?i)b+)+c","vR&jLCa\\1y\\1cD",[])),
+ <<"Abc">> = iolist_to_binary(re:replace("Abc","(?>a(?i)b+)+c","vR&jLCa\\1y\\1cD",[global])),
+ <<"abAb">> = iolist_to_binary(re:replace("abAb","(?>a(?i)b+)+c","lG",[])),
+ <<"abAb">> = iolist_to_binary(re:replace("abAb","(?>a(?i)b+)+c","lG",[global])),
+ <<"abbC">> = iolist_to_binary(re:replace("abbC","(?>a(?i)b+)+c","cb&\\1",[])),
+ <<"abbC">> = iolist_to_binary(re:replace("abbC","(?>a(?i)b+)+c","cb&\\1",[global])),
+ <<"QBObvsfLS">> = iolist_to_binary(re:replace("abc","(?=a(?i)b)\\w\\wc","QBObvsfLS",[])),
+ <<"QBObvsfLS">> = iolist_to_binary(re:replace("abc","(?=a(?i)b)\\w\\wc","QBObvsfLS",[global])),
+ <<"muFQTEaBcEaBcPEBB">> = iolist_to_binary(re:replace("aBc","(?=a(?i)b)\\w\\wc","mu\\1FQ\\1TE&E&P\\1EBB\\1",[])),
+ <<"muFQTEaBcEaBcPEBB">> = iolist_to_binary(re:replace("aBc","(?=a(?i)b)\\w\\wc","mu\\1FQ\\1TE&E&P\\1EBB\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=a(?i)b)\\w\\wc","drqTU\\1pJ\\1&vsu&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?=a(?i)b)\\w\\wc","drqTU\\1pJ\\1&vsu&",[global])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?=a(?i)b)\\w\\wc","w&t\\1S\\1Q&",[])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?=a(?i)b)\\w\\wc","w&t\\1S\\1Q&",[global])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","(?=a(?i)b)\\w\\wc","BU\\1mgeWbSPrmQu\\1h",[])),
+ <<"abC">> = iolist_to_binary(re:replace("abC","(?=a(?i)b)\\w\\wc","BU\\1mgeWbSPrmQu\\1h",[global])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","(?=a(?i)b)\\w\\wc","Ahi\\1D",[])),
+ <<"aBC">> = iolist_to_binary(re:replace("aBC","(?=a(?i)b)\\w\\wc","Ahi\\1D",[global])),
+ <<"abxJwrB">> = iolist_to_binary(re:replace("abxxc","(?<=a(?i)b)(\\w\\w)c","xJwrB",[])),
+ <<"abxJwrB">> = iolist_to_binary(re:replace("abxxc","(?<=a(?i)b)(\\w\\w)c","xJwrB",[global])),
+ <<"aBWqYokXSFmo">> = iolist_to_binary(re:replace("aBxxc","(?<=a(?i)b)(\\w\\w)c","WqYokXSFmo",[])),
+ <<"aBWqYokXSFmo">> = iolist_to_binary(re:replace("aBxxc","(?<=a(?i)b)(\\w\\w)c","WqYokXSFmo",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a(?i)b)(\\w\\w)c","ViVjAQCNIlGCB\\1RW\\1Ks",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a(?i)b)(\\w\\w)c","ViVjAQCNIlGCB\\1RW\\1Ks",[global])),
+ <<"Abxxc">> = iolist_to_binary(re:replace("Abxxc","(?<=a(?i)b)(\\w\\w)c","c&\\1y&",[])),
+ <<"Abxxc">> = iolist_to_binary(re:replace("Abxxc","(?<=a(?i)b)(\\w\\w)c","c&\\1y&",[global])),
+ <<"ABxxc">> = iolist_to_binary(re:replace("ABxxc","(?<=a(?i)b)(\\w\\w)c","U",[])),
+ <<"ABxxc">> = iolist_to_binary(re:replace("ABxxc","(?<=a(?i)b)(\\w\\w)c","U",[global])),
+ <<"abxxC">> = iolist_to_binary(re:replace("abxxC","(?<=a(?i)b)(\\w\\w)c","\\1qT\\1bjyP\\1\\1Ki\\1iMujiN",[])),
+ <<"abxxC">> = iolist_to_binary(re:replace("abxxC","(?<=a(?i)b)(\\w\\w)c","\\1qT\\1bjyP\\1\\1Ki\\1iMujiN",[global])),
+ <<"PLaeaJqVIraaAoco">> = iolist_to_binary(re:replace("aA","(?:(a)|b)(?(1)A|B)","PLae\\1JqVIra&oco",[])),
+ <<"PLaeaJqVIraaAoco">> = iolist_to_binary(re:replace("aA","(?:(a)|b)(?(1)A|B)","PLae\\1JqVIra&oco",[global])),
+ <<"GsAhcAqbBHmjdSmKbBt">> = iolist_to_binary(re:replace("bB","(?:(a)|b)(?(1)A|B)","GsAhcAq&HmjdSm\\1K&t",[])),
+ <<"GsAhcAqbBHmjdSmKbBt">> = iolist_to_binary(re:replace("bB","(?:(a)|b)(?(1)A|B)","GsAhcAq&HmjdSm\\1K&t",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(a)|b)(?(1)A|B)","jMnYwcU\\1q\\1D\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(a)|b)(?(1)A|B)","jMnYwcU\\1q\\1D\\1",[global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?:(a)|b)(?(1)A|B)","B&\\1\\1fcB\\1IWxCjS&liri",[])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?:(a)|b)(?(1)A|B)","B&\\1\\1fcB\\1IWxCjS&liri",[global])),
+ <<"bA">> = iolist_to_binary(re:replace("bA","(?:(a)|b)(?(1)A|B)","wN&v\\1em",[])),
+ <<"bA">> = iolist_to_binary(re:replace("bA","(?:(a)|b)(?(1)A|B)","wN&v\\1em",[global])),
+ <<"oX">> = iolist_to_binary(re:replace("aa","^(a)?(?(1)a|b)+$","oX",[])),
+ <<"oX">> = iolist_to_binary(re:replace("aa","^(a)?(?(1)a|b)+$","oX",[global])),
+ <<"EjqBbBji">> = iolist_to_binary(re:replace("b","^(a)?(?(1)a|b)+$","Ej\\1qB&Bj\\1i",[])),
+ <<"EjqBbBji">> = iolist_to_binary(re:replace("b","^(a)?(?(1)a|b)+$","Ej\\1qB&Bj\\1i",[global])),
+ <<"">> = iolist_to_binary(re:replace("bb","^(a)?(?(1)a|b)+$","\\1",[])),
+ <<"">> = iolist_to_binary(re:replace("bb","^(a)?(?(1)a|b)+$","\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","ra",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","ra",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a)?(?(1)a|b)+$","EHLgXekX",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","^(a)?(?(1)a|b)+$","EHLgXekX",[global])),
ok.
run13() ->
- <<"yLejabc:ClvDam">> = iolist_to_binary(re:replace("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$","yLej&C\\1lvDa\\1m",[])),
- <<"yLejabc:ClvDam">> = iolist_to_binary(re:replace("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$","yLej&C\\1lvDa\\1m",[global])),
- <<"eH12Ase">> = iolist_to_binary(re:replace("12","^(?(?!abc)\\d\\d|\\w{3}:)$","e\\1H&A\\1s\\1\\1e",[])),
- <<"eH12Ase">> = iolist_to_binary(re:replace("12","^(?(?!abc)\\d\\d|\\w{3}:)$","e\\1H&A\\1s\\1\\1e",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?!abc)\\d\\d|\\w{3}:)$","SMtlNLKd\\1Va",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?!abc)\\d\\d|\\w{3}:)$","SMtlNLKd\\1Va",[global])),
- <<"123">> = iolist_to_binary(re:replace("123","^(?(?!abc)\\d\\d|\\w{3}:)$","VsMY&We",[])),
- <<"123">> = iolist_to_binary(re:replace("123","^(?(?!abc)\\d\\d|\\w{3}:)$","VsMY&We",[global])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?!abc)\\d\\d|\\w{3}:)$","j&k\\1tUeAYRn",[])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?!abc)\\d\\d|\\w{3}:)$","j&k\\1tUeAYRn",[global])),
- <<"fooS">> = iolist_to_binary(re:replace("foobar","(?(?<=foo)bar|cat)","S\\1",[])),
- <<"fooS">> = iolist_to_binary(re:replace("foobar","(?(?<=foo)bar|cat)","S\\1",[global])),
- <<"catdEUboccGWTaRjQo">> = iolist_to_binary(re:replace("cat","(?(?<=foo)bar|cat)","&dEU\\1boccGWTaRjQo\\1",[])),
- <<"catdEUboccGWTaRjQo">> = iolist_to_binary(re:replace("cat","(?(?<=foo)bar|cat)","&dEU\\1boccGWTaRjQo\\1",[global])),
- <<"fcatrspJwF">> = iolist_to_binary(re:replace("fcat","(?(?<=foo)bar|cat)","\\1&rs\\1pJwF",[])),
- <<"fcatrspJwF">> = iolist_to_binary(re:replace("fcat","(?(?<=foo)bar|cat)","\\1&rs\\1pJwF",[global])),
- <<"foncatePTv">> = iolist_to_binary(re:replace("focat","(?(?<=foo)bar|cat)","n&ePTv",[])),
- <<"foncatePTv">> = iolist_to_binary(re:replace("focat","(?(?<=foo)bar|cat)","n&ePTv",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<=foo)bar|cat)","jI",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<=foo)bar|cat)","jI",[global])),
- <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<=foo)bar|cat)","\\1qBlA\\1veXv",[])),
- <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<=foo)bar|cat)","\\1qBlA\\1veXv",[global])),
- <<"fooYHnkCeSOb">> = iolist_to_binary(re:replace("foobar","(?(?<!foo)cat|bar)","YHnkCeSOb",[])),
- <<"fooYHnkCeSOb">> = iolist_to_binary(re:replace("foobar","(?(?<!foo)cat|bar)","YHnkCeSOb",[global])),
- <<"catcatQAKgfdmvWBVj">> = iolist_to_binary(re:replace("cat","(?(?<!foo)cat|bar)","&&QAK\\1gfdmvWBVj",[])),
- <<"catcatQAKgfdmvWBVj">> = iolist_to_binary(re:replace("cat","(?(?<!foo)cat|bar)","&&QAK\\1gfdmvWBVj",[global])),
- <<"fPR">> = iolist_to_binary(re:replace("fcat","(?(?<!foo)cat|bar)","PR",[])),
- <<"fPR">> = iolist_to_binary(re:replace("fcat","(?(?<!foo)cat|bar)","PR",[global])),
- <<"fo">> = iolist_to_binary(re:replace("focat","(?(?<!foo)cat|bar)","\\1",[])),
- <<"fo">> = iolist_to_binary(re:replace("focat","(?(?<!foo)cat|bar)","\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<!foo)cat|bar)","qsIpnmEbaYk\\1H",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<!foo)cat|bar)","qsIpnmEbaYk\\1H",[global])),
- <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<!foo)cat|bar)","B",[])),
- <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<!foo)cat|bar)","B",[global])),
- <<"bclabcdfaLGxBabcdHtjFC">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) |) ","bcl&faLGxB\\1&HtjFC",[extended])),
- <<"bclabcdfaLGxBabcdHtjFC">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) |) ","bcl&faLGxB\\1&HtjFC",[extended,
- global])),
- <<"JpguAHp((E(AF(">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) |) ","JpguAHp\\1\\1E\\1AF\\1",[extended])),
- <<"JpguAHp((E(AF(">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) |) ","JpguAHp\\1\\1E\\1AF\\1",[extended,
- global])),
- <<"yBpRsrthe quick Nr(abcd) fox">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) |) ","yBpRsr&Nr\\1",[extended])),
- <<"yBpRsrthe quick NryBpRsr(abcd)Nr(yBpRsr foxNr">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) |) ","yBpRsr&Nr\\1",[extended,
- global])),
- <<"(dfabcdMfidabcdORabcdXp">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) |) ","df&Mfid\\1\\1&OR&Xp",[extended])),
- <<"(dfabcdMfidabcdORabcdXp">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) |) ","df&Mfid\\1\\1&OR&Xp",[extended,
- global])),
- <<"NEKtshVcSbEQreXJUgabcd">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) ) ","NEKtshVcSbEQre\\1XJUg&",[extended])),
- <<"NEKtshVcSbEQreXJUgabcd">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) ) ","NEKtshVcSbEQre\\1XJUg&",[extended,
- global])),
- <<"C">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) ) ","C",[extended])),
- <<"C">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) ) ","C",[extended,
+ <<"rabc:abc:Kabc:rcuwyQBhDRgB">> = iolist_to_binary(re:replace("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$","r&&K&\\1rcuwyQBhD\\1RgB",[])),
+ <<"rabc:abc:Kabc:rcuwyQBhDRgB">> = iolist_to_binary(re:replace("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$","r&&K&\\1rcuwyQBhD\\1RgB",[global])),
+ <<"DMbrBdk">> = iolist_to_binary(re:replace("12","^(?(?=abc)\\w{3}:|\\d\\d)$","DM\\1br\\1Bdk",[])),
+ <<"DMbrBdk">> = iolist_to_binary(re:replace("12","^(?(?=abc)\\w{3}:|\\d\\d)$","DM\\1br\\1Bdk",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?=abc)\\w{3}:|\\d\\d)$","XeCprJu&qUw\\1Af&&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?=abc)\\w{3}:|\\d\\d)$","XeCprJu&qUw\\1Af&&",[global])),
+ <<"123">> = iolist_to_binary(re:replace("123","^(?(?=abc)\\w{3}:|\\d\\d)$","r\\1jcw",[])),
+ <<"123">> = iolist_to_binary(re:replace("123","^(?(?=abc)\\w{3}:|\\d\\d)$","r\\1jcw",[global])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$","\\1usowFJ\\1EG\\1MYM",[])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$","\\1usowFJ\\1EG\\1MYM",[global])),
+ <<"Aabc:Fabc:tlJ">> = iolist_to_binary(re:replace("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$","A&F&tlJ",[])),
+ <<"Aabc:Fabc:tlJ">> = iolist_to_binary(re:replace("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$","A&F&tlJ",[global])),
+ <<"iX">> = iolist_to_binary(re:replace("12","^(?(?!abc)\\d\\d|\\w{3}:)$","iX",[])),
+ <<"iX">> = iolist_to_binary(re:replace("12","^(?(?!abc)\\d\\d|\\w{3}:)$","iX",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?!abc)\\d\\d|\\w{3}:)$","j&&J\\1&I",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(?!abc)\\d\\d|\\w{3}:)$","j&&J\\1&I",[global])),
+ <<"123">> = iolist_to_binary(re:replace("123","^(?(?!abc)\\d\\d|\\w{3}:)$","kj\\1lukbPh&su\\1Cghlveb",[])),
+ <<"123">> = iolist_to_binary(re:replace("123","^(?(?!abc)\\d\\d|\\w{3}:)$","kj\\1lukbPh&su\\1Cghlveb",[global])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?!abc)\\d\\d|\\w{3}:)$","uXqdQvfv&\\1tC\\1ipRP",[])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","^(?(?!abc)\\d\\d|\\w{3}:)$","uXqdQvfv&\\1tC\\1ipRP",[global])),
+ <<"foopoYUMCLsWcRfrX">> = iolist_to_binary(re:replace("foobar","(?(?<=foo)bar|cat)","poYUMCLsWcR\\1fr\\1X\\1",[])),
+ <<"foopoYUMCLsWcRfrX">> = iolist_to_binary(re:replace("foobar","(?(?<=foo)bar|cat)","poYUMCLsWcR\\1fr\\1X\\1",[global])),
+ <<"EcatihCGRgMPqq">> = iolist_to_binary(re:replace("cat","(?(?<=foo)bar|cat)","E&ihCGRgMPqq\\1",[])),
+ <<"EcatihCGRgMPqq">> = iolist_to_binary(re:replace("cat","(?(?<=foo)bar|cat)","E&ihCGRgMPqq\\1",[global])),
+ <<"fQRocatSScatcat">> = iolist_to_binary(re:replace("fcat","(?(?<=foo)bar|cat)","QRo&SS&&",[])),
+ <<"fQRocatSScatcat">> = iolist_to_binary(re:replace("fcat","(?(?<=foo)bar|cat)","QRo&SS&&",[global])),
+ <<"foDk">> = iolist_to_binary(re:replace("focat","(?(?<=foo)bar|cat)","D\\1k\\1",[])),
+ <<"foDk">> = iolist_to_binary(re:replace("focat","(?(?<=foo)bar|cat)","D\\1k\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<=foo)bar|cat)","soL&R\\1GSAmJChxOln",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<=foo)bar|cat)","soL&R\\1GSAmJChxOln",[global])),
+ <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<=foo)bar|cat)","y&e",[])),
+ <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<=foo)bar|cat)","y&e",[global])),
+ <<"fookbarnSruMXTFCE">> = iolist_to_binary(re:replace("foobar","(?(?<!foo)cat|bar)","k\\1&nSruMXTFCE\\1",[])),
+ <<"fookbarnSruMXTFCE">> = iolist_to_binary(re:replace("foobar","(?(?<!foo)cat|bar)","k\\1&nSruMXTFCE\\1",[global])),
+ <<"ynvicatccatYCXYPUdcatHi">> = iolist_to_binary(re:replace("cat","(?(?<!foo)cat|bar)","\\1y\\1\\1nvi&c&YCXYPUd&Hi",[])),
+ <<"ynvicatccatYCXYPUdcatHi">> = iolist_to_binary(re:replace("cat","(?(?<!foo)cat|bar)","\\1y\\1\\1nvi&c&YCXYPUd&Hi",[global])),
+ <<"fGOpcatbyuUbSQjcatV">> = iolist_to_binary(re:replace("fcat","(?(?<!foo)cat|bar)","GOp&by\\1uUbSQj&V",[])),
+ <<"fGOpcatbyuUbSQjcatV">> = iolist_to_binary(re:replace("fcat","(?(?<!foo)cat|bar)","GOp&by\\1uUbSQj&V",[global])),
+ <<"foU">> = iolist_to_binary(re:replace("focat","(?(?<!foo)cat|bar)","U",[])),
+ <<"foU">> = iolist_to_binary(re:replace("focat","(?(?<!foo)cat|bar)","U",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<!foo)cat|bar)","NglUgPv\\1IB&\\1XMXPO",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?<!foo)cat|bar)","NglUgPv\\1IB&\\1XMXPO",[global])),
+ <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<!foo)cat|bar)","&tLnp",[])),
+ <<"foocat">> = iolist_to_binary(re:replace("foocat","(?(?<!foo)cat|bar)","&tLnp",[global])),
+ <<"vF">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) |) ","vF",[extended])),
+ <<"vF">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) |) ","vF",[extended,
global])),
- <<"VsQthe quick tPGwwMthe quick WRxuthe quick (abcd) fox">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) ) ","VsQ&tP\\1Gww\\1M&WRxu&",[extended])),
- <<"VsQthe quick tPGwwMthe quick WRxuthe quick VsQ(abcd)tP(Gww(M(abcd)WRxu(abcd)VsQ foxtPGwwM foxWRxu fox">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) ) ","VsQ&tP\\1Gww\\1M&WRxu&",[extended,
- global])),
- <<"(BxtHoabcdhwabcdMSlPc">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) ) ","BxtHo&hw&MSlPc",[extended])),
- <<"(BxtHoabcdhwabcdMSlPc">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) ) ","BxtHo&hw&MSlPc",[extended,
- global])),
- <<"112MIb11212MLRT11">> = iolist_to_binary(re:replace("12","^(?(2)a|(1)(2))+$","\\1&MIb\\1&&MLRT\\1\\1",[])),
- <<"112MIb11212MLRT11">> = iolist_to_binary(re:replace("12","^(?(2)a|(1)(2))+$","\\1&MIb\\1&&MLRT\\1\\1",[global])),
- <<"NKCJyodsYQD">> = iolist_to_binary(re:replace("12a","^(?(2)a|(1)(2))+$","NKCJyodsYQD",[])),
- <<"NKCJyodsYQD">> = iolist_to_binary(re:replace("12a","^(?(2)a|(1)(2))+$","NKCJyodsYQD",[global])),
- <<"12aarChjGgkuN">> = iolist_to_binary(re:replace("12aa","^(?(2)a|(1)(2))+$","&rChjGgkuN",[])),
- <<"12aarChjGgkuN">> = iolist_to_binary(re:replace("12aa","^(?(2)a|(1)(2))+$","&rChjGgkuN",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(2)a|(1)(2))+$","\\1\\1be\\1ix",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(2)a|(1)(2))+$","\\1\\1be\\1ix",[global])),
- <<"1234">> = iolist_to_binary(re:replace("1234","^(?(2)a|(1)(2))+$","cLDE&D",[])),
- <<"1234">> = iolist_to_binary(re:replace("1234","^(?(2)a|(1)(2))+$","cLDE&D",[global])),
- <<"kNHtojblahPblahcuUuarKNnoK">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+\\1","kNHtoj\\1P\\1cuUuarKNnoK",[])),
- <<"kNHtojblahPblahcuUuarKNnoK">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+\\1","kNHtoj\\1P\\1cuUuarKNnoK",[global])),
- <<"eNBLAHlXaMBLAH BLAH">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+\\1","eN\\1lXaM&",[])),
- <<"eNBLAHlXaMBLAH BLAH">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+\\1","eN\\1lXaM&",[global])),
- <<"rBlah BlahSGW">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+\\1","r&SGW",[])),
- <<"rBlah BlahSGW">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+\\1","r&SGW",[global])),
- <<"fUTblaH blaHblaH blaHtHeblaH blaHDlblaH blaHwQonyN">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+\\1","fUT&&tHe&Dl&wQonyN",[])),
- <<"fUTblaH blaHblaH blaHtHeblaH blaHDlblaH blaHwQonyN">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+\\1","fUT&&tHe&Dl&wQonyN",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)blah)\\s+\\1","rjKWYO&gqg",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)blah)\\s+\\1","rjKWYO&gqg",[global])),
- <<"blah BLAH">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+\\1","\\1PJEx&&NqPQ",[])),
- <<"blah BLAH">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+\\1","\\1PJEx&&NqPQ",[global])),
- <<"Blah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+\\1","&IAtxxKcfurkyev\\1nvDJ",[])),
- <<"Blah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+\\1","&IAtxxKcfurkyev\\1nvDJ",[global])),
- <<"blaH blah">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+\\1","\\1\\1H&YJdrM\\1qcj&&",[])),
- <<"blaH blah">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+\\1","\\1\\1H&YJdrM\\1qcj&&",[global])),
- <<"QROIQmblah blahmblahblah blahDWblahJ">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+(?i:\\1)","QROIQm&m\\1&DW\\1J",[])),
- <<"QROIQmblah blahmblahblah blahDWblahJ">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+(?i:\\1)","QROIQm&m\\1&DW\\1J",[global])),
- <<"vmvjMIXCFx">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+(?i:\\1)","vmvjMIXCFx",[])),
- <<"vmvjMIXCFx">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+(?i:\\1)","vmvjMIXCFx",[global])),
- <<"FBlahSrBlah BlahfdMtkYBlah Blah">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+(?i:\\1)","F\\1Sr&fdMtkY&",[])),
- <<"FBlahSrBlah BlahfdMtkYBlah Blah">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+(?i:\\1)","F\\1Sr&fdMtkY&",[global])),
- <<"cblaH blaHfGEblaHwablaH blaHDGblaH blaHblaH blaHLcblaHVyTC">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+(?i:\\1)","c&fGE\\1wa&DG&&Lc\\1VyTC",[])),
- <<"cblaH blaHfGEblaHwablaH blaHDGblaH blaHblaH blaHLcblaHVyTC">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+(?i:\\1)","c&fGE\\1wa&DG&&Lc\\1VyTC",[global])),
- <<"blahaefgWblah">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+(?i:\\1)","\\1aefgW\\1",[])),
- <<"blahaefgWblah">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+(?i:\\1)","\\1aefgW\\1",[global])),
- <<"Blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+(?i:\\1)","\\1",[])),
- <<"Blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+(?i:\\1)","\\1",[global])),
- <<"RXsblaHe">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+(?i:\\1)","RXs\\1e",[])),
- <<"RXsblaHe">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+(?i:\\1)","RXs\\1e",[global])),
- <<"lanoXtvE">> = iolist_to_binary(re:replace("a","(?>a*)*","lano\\1Xt\\1vE",[])),
- <<"lanoXtvElanoXtvE">> = iolist_to_binary(re:replace("a","(?>a*)*","lano\\1Xt\\1vE",[global])),
- <<"EfuiyyaaybkaaVI">> = iolist_to_binary(re:replace("aa","(?>a*)*","Ef\\1uiyy&ybk&VI",[])),
- <<"EfuiyyaaybkaaVIEfuiyyybkVI">> = iolist_to_binary(re:replace("aa","(?>a*)*","Ef\\1uiyy&ybk&VI",[global])),
- <<"DFPlAS">> = iolist_to_binary(re:replace("aaaa","(?>a*)*","DFPlAS",[])),
- <<"DFPlASDFPlAS">> = iolist_to_binary(re:replace("aaaa","(?>a*)*","DFPlAS",[global])),
- <<"swvEIpc">> = iolist_to_binary(re:replace("abc","(abc|)+","sw\\1vEIpc",[])),
- <<"swvEIpcswvEIpc">> = iolist_to_binary(re:replace("abc","(abc|)+","sw\\1vEIpc",[global])),
- <<"Vm">> = iolist_to_binary(re:replace("abcabc","(abc|)+","Vm",[])),
- <<"VmVm">> = iolist_to_binary(re:replace("abcabc","(abc|)+","Vm",[global])),
- <<"vabcabcabcIecAabcabcabcvabcabcabcabcabcabcPMS">> = iolist_to_binary(re:replace("abcabcabc","(abc|)+","v&\\1IecA&v\\1&&PMS",[])),
- <<"vabcabcabcIecAabcabcabcvabcabcabcabcabcabcPMSvIecAvPMS">> = iolist_to_binary(re:replace("abcabcabc","(abc|)+","v&\\1IecA&v\\1&&PMS",[global])),
- <<"YpHLvbPebgHxyz">> = iolist_to_binary(re:replace("xyz","(abc|)+","YpH&LvbPebgH\\1",[])),
- <<"YpHLvbPebgHxYpHLvbPebgHyYpHLvbPebgHzYpHLvbPebgH">> = iolist_to_binary(re:replace("xyz","(abc|)+","YpH&LvbPebgH\\1",[global])),
- <<"aaUe">> = iolist_to_binary(re:replace("a","([a]*)*","&&Ue",[])),
- <<"aaUeUe">> = iolist_to_binary(re:replace("a","([a]*)*","&&Ue",[global])),
- <<"PaaaaapgFufTSYIkBuaaaaabKYVD">> = iolist_to_binary(re:replace("aaaaa","([a]*)*","P&pgFufTSYIkBu&bKYVD",[])),
- <<"PaaaaapgFufTSYIkBuaaaaabKYVDPpgFufTSYIkBubKYVD">> = iolist_to_binary(re:replace("aaaaa","([a]*)*","P&pgFufTSYIkBu&bKYVD",[global])),
- <<"qFRFDX">> = iolist_to_binary(re:replace("a","([ab]*)*","qFRFDX",[])),
- <<"qFRFDXqFRFDX">> = iolist_to_binary(re:replace("a","([ab]*)*","qFRFDX",[global])),
- <<"rcPIcjqP">> = iolist_to_binary(re:replace("b","([ab]*)*","rcP\\1IcjqP",[])),
- <<"rcPIcjqPrcPIcjqP">> = iolist_to_binary(re:replace("b","([ab]*)*","rcP\\1IcjqP",[global])),
- <<"sRJuN">> = iolist_to_binary(re:replace("ababab","([ab]*)*","s\\1R\\1JuN",[])),
- <<"sRJuNsRJuN">> = iolist_to_binary(re:replace("ababab","([ab]*)*","s\\1R\\1JuN",[global])),
- <<"GIaaaabFaYFbcde">> = iolist_to_binary(re:replace("aaaabcde","([ab]*)*","GI&FaYFb",[])),
- <<"GIaaaabFaYFbGIFaYFbcGIFaYFbdGIFaYFbeGIFaYFb">> = iolist_to_binary(re:replace("aaaabcde","([ab]*)*","GI&FaYFb",[global])),
- <<"meTmwKOIyGCbbbbANbbbbbbbbH">> = iolist_to_binary(re:replace("bbbb","([ab]*)*","meTmwK\\1OIy\\1GC&AN&&H",[])),
- <<"meTmwKOIyGCbbbbANbbbbbbbbHmeTmwKOIyGCANH">> = iolist_to_binary(re:replace("bbbb","([ab]*)*","meTmwK\\1OIy\\1GC&AN&&H",[global])),
- <<"nbjCbhrDRrlgSUiVJ">> = iolist_to_binary(re:replace("b","([^a]*)*","nbjC&hrDRrlgSUiV\\1J",[])),
- <<"nbjCbhrDRrlgSUiVJnbjChrDRrlgSUiVJ">> = iolist_to_binary(re:replace("b","([^a]*)*","nbjC&hrDRrlgSUiV\\1J",[global])),
- <<"EDtjVbbbbKGDbbbbmbbbbwKLjiR">> = iolist_to_binary(re:replace("bbbb","([^a]*)*","EDtjV&KGD&m&wK\\1Lj\\1iR",[])),
- <<"EDtjVbbbbKGDbbbbmbbbbwKLjiREDtjVKGDmwKLjiR">> = iolist_to_binary(re:replace("bbbb","([^a]*)*","EDtjV&KGD&m&wK\\1Lj\\1iR",[global])),
- <<"HlaUYcKUiWycCnKHNaaa">> = iolist_to_binary(re:replace("aaa","([^a]*)*","HlaUYcKUiWycCnKH\\1N",[])),
- <<"HlaUYcKUiWycCnKHNaHlaUYcKUiWycCnKHNaHlaUYcKUiWycCnKHNaHlaUYcKUiWycCnKHN">> = iolist_to_binary(re:replace("aaa","([^a]*)*","HlaUYcKUiWycCnKH\\1N",[global])),
- <<"eaccccgCccccOYNUlccccTcccc">> = iolist_to_binary(re:replace("cccc","([^ab]*)*","ea&g\\1C&OYNUl&\\1T&",[])),
- <<"eaccccgCccccOYNUlccccTcccceagCOYNUlT">> = iolist_to_binary(re:replace("cccc","([^ab]*)*","ea&g\\1C&OYNUl&\\1T&",[global])),
- <<"JyKBqDRhnabab">> = iolist_to_binary(re:replace("abab","([^ab]*)*","Jy&\\1KBqDRhn",[])),
- <<"JyKBqDRhnaJyKBqDRhnbJyKBqDRhnaJyKBqDRhnbJyKBqDRhn">> = iolist_to_binary(re:replace("abab","([^ab]*)*","Jy&\\1KBqDRhn",[global])),
- <<"vnligHISDuDiBa">> = iolist_to_binary(re:replace("a","([a]*?)*","v\\1nli&\\1gHISDuD\\1iB",[])),
- <<"vnligHISDuDiBvnliagHISDuDiBvnligHISDuDiB">> = iolist_to_binary(re:replace("a","([a]*?)*","v\\1nli&\\1gHISDuD\\1iB",[global])),
- <<"CrarAftguXnYNULohKyaaaa">> = iolist_to_binary(re:replace("aaaa","([a]*?)*","CrarAftguXnYN&ULohKy",[])),
- <<"CrarAftguXnYNULohKyCrarAftguXnYNaULohKyCrarAftguXnYNULohKyCrarAftguXnYNaULohKyCrarAftguXnYNULohKyCrarAftguXnYNaULohKyCrarAftguXnYNULohKyCrarAftguXnYNaULohKyCrarAftguXnYNULohKy">> = iolist_to_binary(re:replace("aaaa","([a]*?)*","CrarAftguXnYN&ULohKy",[global])),
- <<"BOfINa">> = iolist_to_binary(re:replace("a","([ab]*?)*","B&OfIN&",[])),
- <<"BOfINBaOfINaBOfIN">> = iolist_to_binary(re:replace("a","([ab]*?)*","B&OfIN&",[global])),
- <<"HBxFab">> = iolist_to_binary(re:replace("b","([ab]*?)*","H\\1\\1BxF\\1a",[])),
- <<"HBxFaHBxFaHBxFa">> = iolist_to_binary(re:replace("b","([ab]*?)*","H\\1\\1BxF\\1a",[global])),
- <<"rkuWEckrabab">> = iolist_to_binary(re:replace("abab","([ab]*?)*","rkuWEc\\1kr",[])),
- <<"rkuWEckrrkuWEckrrkuWEckrrkuWEckrrkuWEckrrkuWEckrrkuWEckrrkuWEckrrkuWEckr">> = iolist_to_binary(re:replace("abab","([ab]*?)*","rkuWEc\\1kr",[global])),
- <<"dedrbsbaba">> = iolist_to_binary(re:replace("baba","([ab]*?)*","dedrbs",[])),
- <<"dedrbsdedrbsdedrbsdedrbsdedrbsdedrbsdedrbsdedrbsdedrbs">> = iolist_to_binary(re:replace("baba","([ab]*?)*","dedrbs",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","([^a]*?)*","\\1",[])),
- <<"">> = iolist_to_binary(re:replace("b","([^a]*?)*","\\1",[global])),
- <<"rrARQqtjsbbbb">> = iolist_to_binary(re:replace("bbbb","([^a]*?)*","rr&ARQq\\1\\1tjs",[])),
- <<"rrARQqtjsrrbARQqtjsrrARQqtjsrrbARQqtjsrrARQqtjsrrbARQqtjsrrARQqtjsrrbARQqtjsrrARQqtjs">> = iolist_to_binary(re:replace("bbbb","([^a]*?)*","rr&ARQq\\1\\1tjs",[global])),
- <<"PGcsmlReJQeaaa">> = iolist_to_binary(re:replace("aaa","([^a]*?)*","PGcsm&&lReJQe&",[])),
- <<"PGcsmlReJQeaPGcsmlReJQeaPGcsmlReJQeaPGcsmlReJQe">> = iolist_to_binary(re:replace("aaa","([^a]*?)*","PGcsm&&lReJQe&",[global])),
- <<"nuspMpmvVOsyyChRc">> = iolist_to_binary(re:replace("c","([^ab]*?)*","nusp&Mp\\1mvVOsyyChR",[])),
- <<"nuspMpmvVOsyyChRnuspcMpmvVOsyyChRnuspMpmvVOsyyChR">> = iolist_to_binary(re:replace("c","([^ab]*?)*","nusp&Mp\\1mvVOsyyChR",[global])),
- <<"GbhjrQmJMQvcccc">> = iolist_to_binary(re:replace("cccc","([^ab]*?)*","Gbhj&rQmJMQv",[])),
- <<"GbhjrQmJMQvGbhjcrQmJMQvGbhjrQmJMQvGbhjcrQmJMQvGbhjrQmJMQvGbhjcrQmJMQvGbhjrQmJMQvGbhjcrQmJMQvGbhjrQmJMQv">> = iolist_to_binary(re:replace("cccc","([^ab]*?)*","Gbhj&rQmJMQv",[global])),
- <<"qlNFbaba">> = iolist_to_binary(re:replace("baba","([^ab]*?)*","qlNF",[])),
- <<"qlNFbqlNFaqlNFbqlNFaqlNF">> = iolist_to_binary(re:replace("baba","([^ab]*?)*","qlNF",[global])),
- <<"KQaNecIrOxNy">> = iolist_to_binary(re:replace("a","(?>a*)*","KQ\\1&NecIrOxNy",[])),
- <<"KQaNecIrOxNyKQNecIrOxNy">> = iolist_to_binary(re:replace("a","(?>a*)*","KQ\\1&NecIrOxNy",[global])),
- <<"VSaaaJEKwmaaaUrFoAmveCbcde">> = iolist_to_binary(re:replace("aaabcde","(?>a*)*","VS&JEKwm&UrFoAmv\\1eC",[])),
- <<"VSaaaJEKwmaaaUrFoAmveCVSJEKwmUrFoAmveCbVSJEKwmUrFoAmveCcVSJEKwmUrFoAmveCdVSJEKwmUrFoAmveCeVSJEKwmUrFoAmveC">> = iolist_to_binary(re:replace("aaabcde","(?>a*)*","VS&JEKwm&UrFoAmv\\1eC",[global])),
- <<"UCWWaaaaaSi">> = iolist_to_binary(re:replace("aaaaa","((?>a*))*","UCW\\1W&Si",[])),
- <<"UCWWaaaaaSiUCWWSi">> = iolist_to_binary(re:replace("aaaaa","((?>a*))*","UCW\\1W&Si",[global])),
- <<"Ynbbaa">> = iolist_to_binary(re:replace("aabbaa","((?>a*))*","Yn",[])),
- <<"YnYnbYnbYnYn">> = iolist_to_binary(re:replace("aabbaa","((?>a*))*","Yn",[global])),
+ <<"j(xp(abcd)mKu(HHgUS(abcd)IE(abcd)">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) |) ","j\\1xp&mKu\\1HHgUS&IE&",[extended])),
+ <<"j(xp(abcd)mKu(HHgUS(abcd)IE(abcd)">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) |) ","j\\1xp&mKu\\1HHgUS&IE&",[extended,
+ global])),
+ <<"yiIibTMatthe quick Rkn(abcd) fox">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) |) ","yi\\1IibTMat&Rkn",[extended])),
+ <<"yiIibTMatthe quick Rknyi(IibTMat(abcd)RknyiIibTMat foxRkn">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) |) ","yi\\1IibTMat&Rkn",[extended,
+ global])),
+ <<"(ruXsFSabcdLabcdbadX">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) |) ","ruXsFS&L&b\\1adX",[extended])),
+ <<"(ruXsFSabcdLabcdbadX">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) |) ","ruXsFS&L&b\\1adX",[extended,
+ global])),
+ <<"kCb">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) ) ","kCb",[extended])),
+ <<"kCb">> = iolist_to_binary(re:replace("abcd","( \\( )? [^()]+ (?(1) \\) ) ","kCb",[extended,
+ global])),
+ <<"ufsBIAN(">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) ) ","ufsBIAN\\1",[extended])),
+ <<"ufsBIAN(">> = iolist_to_binary(re:replace("(abcd)","( \\( )? [^()]+ (?(1) \\) ) ","ufsBIAN\\1",[extended,
+ global])),
+ <<"VECNLXf(abcd) fox">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) ) ","V\\1\\1ECNL\\1Xf",[extended])),
+ <<"VECNLXfV((ECNL(XfVECNLXf">> = iolist_to_binary(re:replace("the quick (abcd) fox","( \\( )? [^()]+ (?(1) \\) ) ","V\\1\\1ECNL\\1Xf",[extended,
+ global])),
+ <<"(PBNukCrgiybP">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) ) ","PBNukCrgiybP",[extended])),
+ <<"(PBNukCrgiybP">> = iolist_to_binary(re:replace("(abcd","( \\( )? [^()]+ (?(1) \\) ) ","PBNukCrgiybP",[extended,
+ global])),
+ <<"eFGTe1q12hFWn12">> = iolist_to_binary(re:replace("12","^(?(2)a|(1)(2))+$","eFGTe\\1q&hFWn&",[])),
+ <<"eFGTe1q12hFWn12">> = iolist_to_binary(re:replace("12","^(?(2)a|(1)(2))+$","eFGTe\\1q&hFWn&",[global])),
+ <<"GQ">> = iolist_to_binary(re:replace("12a","^(?(2)a|(1)(2))+$","GQ",[])),
+ <<"GQ">> = iolist_to_binary(re:replace("12a","^(?(2)a|(1)(2))+$","GQ",[global])),
+ <<"t12aa">> = iolist_to_binary(re:replace("12aa","^(?(2)a|(1)(2))+$","t&",[])),
+ <<"t12aa">> = iolist_to_binary(re:replace("12aa","^(?(2)a|(1)(2))+$","t&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(2)a|(1)(2))+$","PaHcMWBmFjXXO",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?(2)a|(1)(2))+$","PaHcMWBmFjXXO",[global])),
+ <<"1234">> = iolist_to_binary(re:replace("1234","^(?(2)a|(1)(2))+$","R\\1u",[])),
+ <<"1234">> = iolist_to_binary(re:replace("1234","^(?(2)a|(1)(2))+$","R\\1u",[global])),
+ <<"geopblahblah blah">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+\\1","geop\\1&",[])),
+ <<"geopblahblah blah">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+\\1","geop\\1&",[global])),
+ <<"JTHjDKqA">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+\\1","JTHjDKqA",[])),
+ <<"JTHjDKqA">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+\\1","JTHjDKqA",[global])),
+ <<"Blah BlahGvSBlahBlah BlahBlahtBhBlahBlah">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+\\1","&GvS\\1&\\1tBh\\1\\1",[])),
+ <<"Blah BlahGvSBlahBlah BlahBlahtBhBlahBlah">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+\\1","&GvS\\1&\\1tBh\\1\\1",[global])),
+ <<"iCveQdblaHWblaH blaH">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+\\1","iCveQd\\1W&",[])),
+ <<"iCveQdblaHWblaH blaH">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+\\1","iCveQd\\1W&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)blah)\\s+\\1","thGaLpke&&mlDI",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)blah)\\s+\\1","thGaLpke&&mlDI",[global])),
+ <<"blah BLAH">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+\\1","eIP\\1xN",[])),
+ <<"blah BLAH">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+\\1","eIP\\1xN",[global])),
+ <<"Blah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+\\1","KKqbLs",[])),
+ <<"Blah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+\\1","KKqbLs",[global])),
+ <<"blaH blah">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+\\1","&jYN&OlnrIjJAVLKO",[])),
+ <<"blaH blah">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+\\1","&jYN&OlnrIjJAVLKO",[global])),
+ <<"PYINshqOHfblah blahblah blahawstrlblahblah blah">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+(?i:\\1)","PYINshqOHf&&awstrl\\1&",[])),
+ <<"PYINshqOHfblah blahblah blahawstrlblahblah blah">> = iolist_to_binary(re:replace("blah blah","((?i)blah)\\s+(?i:\\1)","PYINshqOHf&&awstrl\\1&",[global])),
+ <<"HqueiI">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+(?i:\\1)","HqueiI",[])),
+ <<"HqueiI">> = iolist_to_binary(re:replace("BLAH BLAH","((?i)blah)\\s+(?i:\\1)","HqueiI",[global])),
+ <<"MRJcrKPNBlahhmh">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+(?i:\\1)","MRJcrKPN\\1hmh",[])),
+ <<"MRJcrKPNBlahhmh">> = iolist_to_binary(re:replace("Blah Blah","((?i)blah)\\s+(?i:\\1)","MRJcrKPN\\1hmh",[global])),
+ <<"blaH">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+(?i:\\1)","\\1",[])),
+ <<"blaH">> = iolist_to_binary(re:replace("blaH blaH","((?i)blah)\\s+(?i:\\1)","\\1",[global])),
+ <<"KVSblah BLAHlXp">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+(?i:\\1)","KVS&lXp",[])),
+ <<"KVSblah BLAHlXp">> = iolist_to_binary(re:replace("blah BLAH","((?i)blah)\\s+(?i:\\1)","KVS&lXp",[global])),
+ <<"grKSEVpBlah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+(?i:\\1)","grKSEVp&",[])),
+ <<"grKSEVpBlah blah">> = iolist_to_binary(re:replace("Blah blah","((?i)blah)\\s+(?i:\\1)","grKSEVp&",[global])),
+ <<"dblaHqblaHqQpRmENblaH blahKbSKWblaH blahx">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+(?i:\\1)","d\\1q\\1qQpRmEN&KbSKW&x",[])),
+ <<"dblaHqblaHqQpRmENblaH blahKbSKWblaH blahx">> = iolist_to_binary(re:replace("blaH blah","((?i)blah)\\s+(?i:\\1)","d\\1q\\1qQpRmEN&KbSKW&x",[global])),
+ <<"WCdJaih">> = iolist_to_binary(re:replace("a","(?>a*)*","WCdJ&ih",[])),
+ <<"WCdJaihWCdJih">> = iolist_to_binary(re:replace("a","(?>a*)*","WCdJ&ih",[global])),
+ <<"YjUDqaafbyqfUOv">> = iolist_to_binary(re:replace("aa","(?>a*)*","Yj\\1UDq&fbyqfUOv",[])),
+ <<"YjUDqaafbyqfUOvYjUDqfbyqfUOv">> = iolist_to_binary(re:replace("aa","(?>a*)*","Yj\\1UDq&fbyqfUOv",[global])),
+ <<"DuaOoTKn">> = iolist_to_binary(re:replace("aaaa","(?>a*)*","DuaOoTKn\\1",[])),
+ <<"DuaOoTKnDuaOoTKn">> = iolist_to_binary(re:replace("aaaa","(?>a*)*","DuaOoTKn\\1",[global])),
+ <<"lUAkQQE">> = iolist_to_binary(re:replace("abc","(abc|)+","lUAkQQE",[])),
+ <<"lUAkQQElUAkQQE">> = iolist_to_binary(re:replace("abc","(abc|)+","lUAkQQE",[global])),
+ <<"e">> = iolist_to_binary(re:replace("abcabc","(abc|)+","e",[])),
+ <<"ee">> = iolist_to_binary(re:replace("abcabc","(abc|)+","e",[global])),
+ <<"LOeabcabcabcRabcabcabcxkWabcabcabcFSngiabcabcabcdabcabcabcDm">> = iolist_to_binary(re:replace("abcabcabc","(abc|)+","LOe&R&xkW&FSngi&d&Dm",[])),
+ <<"LOeabcabcabcRabcabcabcxkWabcabcabcFSngiabcabcabcdabcabcabcDmLOeRxkWFSngidDm">> = iolist_to_binary(re:replace("abcabcabc","(abc|)+","LOe&R&xkW&FSngi&d&Dm",[global])),
+ <<"IFSvaLmRAwsxyz">> = iolist_to_binary(re:replace("xyz","(abc|)+","IFSvaLmRAws",[])),
+ <<"IFSvaLmRAwsxIFSvaLmRAwsyIFSvaLmRAwszIFSvaLmRAws">> = iolist_to_binary(re:replace("xyz","(abc|)+","IFSvaLmRAws",[global])),
+ <<"DQUraaUYwApYRiYSqa">> = iolist_to_binary(re:replace("a","([a]*)*","DQUr\\1&&\\1UYwApYRiYSq&",[])),
+ <<"DQUraaUYwApYRiYSqaDQUrUYwApYRiYSq">> = iolist_to_binary(re:replace("a","([a]*)*","DQUr\\1&&\\1UYwApYRiYSq&",[global])),
+ <<"pfGYlaaaaadNpJmOaQHl">> = iolist_to_binary(re:replace("aaaaa","([a]*)*","pfGYl&dNpJm\\1OaQHl",[])),
+ <<"pfGYlaaaaadNpJmOaQHlpfGYldNpJmOaQHl">> = iolist_to_binary(re:replace("aaaaa","([a]*)*","pfGYl&dNpJm\\1OaQHl",[global])),
+ <<"IHNVcUg">> = iolist_to_binary(re:replace("a","([ab]*)*","\\1IHNVcUg",[])),
+ <<"IHNVcUgIHNVcUg">> = iolist_to_binary(re:replace("a","([ab]*)*","\\1IHNVcUg",[global])),
+ <<"N">> = iolist_to_binary(re:replace("b","([ab]*)*","N",[])),
+ <<"NN">> = iolist_to_binary(re:replace("b","([ab]*)*","N",[global])),
+ <<"dxkmabababdmRGQJb">> = iolist_to_binary(re:replace("ababab","([ab]*)*","dxkm&dmRGQJb",[])),
+ <<"dxkmabababdmRGQJbdxkmdmRGQJb">> = iolist_to_binary(re:replace("ababab","([ab]*)*","dxkm&dmRGQJb",[global])),
+ <<"urCYmaaaabYvaaaabFcde">> = iolist_to_binary(re:replace("aaaabcde","([ab]*)*","urCY\\1m&Yv&F",[])),
+ <<"urCYmaaaabYvaaaabFurCYmYvFcurCYmYvFdurCYmYvFeurCYmYvF">> = iolist_to_binary(re:replace("aaaabcde","([ab]*)*","urCY\\1m&Yv&F",[global])),
+ <<"W">> = iolist_to_binary(re:replace("bbbb","([ab]*)*","W\\1",[])),
+ <<"WW">> = iolist_to_binary(re:replace("bbbb","([ab]*)*","W\\1",[global])),
+ <<"LocbFbvgb">> = iolist_to_binary(re:replace("b","([^a]*)*","Loc&F&vg&",[])),
+ <<"LocbFbvgbLocFvg">> = iolist_to_binary(re:replace("b","([^a]*)*","Loc&F&vg&",[global])),
+ <<"tWIlHMJfBx">> = iolist_to_binary(re:replace("bbbb","([^a]*)*","tWIlHMJ\\1\\1fBx\\1",[])),
+ <<"tWIlHMJfBxtWIlHMJfBx">> = iolist_to_binary(re:replace("bbbb","([^a]*)*","tWIlHMJ\\1\\1fBx\\1",[global])),
+ <<"IoytBGaaa">> = iolist_to_binary(re:replace("aaa","([^a]*)*","Io\\1ytBG&",[])),
+ <<"IoytBGaIoytBGaIoytBGaIoytBG">> = iolist_to_binary(re:replace("aaa","([^a]*)*","Io\\1ytBG&",[global])),
+ <<"EPDyK">> = iolist_to_binary(re:replace("cccc","([^ab]*)*","EPDyK",[])),
+ <<"EPDyKEPDyK">> = iolist_to_binary(re:replace("cccc","([^ab]*)*","EPDyK",[global])),
+ <<"ovFfXExcDncDabab">> = iolist_to_binary(re:replace("abab","([^ab]*)*","ovFfXE\\1&x\\1cDncD",[])),
+ <<"ovFfXExcDncDaovFfXExcDncDbovFfXExcDncDaovFfXExcDncDbovFfXExcDncD">> = iolist_to_binary(re:replace("abab","([^ab]*)*","ovFfXE\\1&x\\1cDncD",[global])),
+ <<"DJadEBdkEMaRtCWFGEa">> = iolist_to_binary(re:replace("a","([a]*?)*","DJadEBdkEMa&RtCWFGE",[])),
+ <<"DJadEBdkEMaRtCWFGEDJadEBdkEMaaRtCWFGEDJadEBdkEMaRtCWFGE">> = iolist_to_binary(re:replace("a","([a]*?)*","DJadEBdkEMa&RtCWFGE",[global])),
+ <<"Tdgoaaaa">> = iolist_to_binary(re:replace("aaaa","([a]*?)*","T\\1dgo",[])),
+ <<"TdgoTdgoTdgoTdgoTdgoTdgoTdgoTdgoTdgo">> = iolist_to_binary(re:replace("aaaa","([a]*?)*","T\\1dgo",[global])),
+ <<"rvda">> = iolist_to_binary(re:replace("a","([ab]*?)*","&&rvd",[])),
+ <<"rvdaarvdrvd">> = iolist_to_binary(re:replace("a","([ab]*?)*","&&rvd",[global])),
+ <<"JEKgTqgvKb">> = iolist_to_binary(re:replace("b","([ab]*?)*","JEKgT\\1q&gvK",[])),
+ <<"JEKgTqgvKJEKgTqbgvKJEKgTqgvK">> = iolist_to_binary(re:replace("b","([ab]*?)*","JEKgT\\1q&gvK",[global])),
+ <<"UPWVyabab">> = iolist_to_binary(re:replace("abab","([ab]*?)*","UP\\1WVy",[])),
+ <<"UPWVyUPWVyUPWVyUPWVyUPWVyUPWVyUPWVyUPWVyUPWVy">> = iolist_to_binary(re:replace("abab","([ab]*?)*","UP\\1WVy",[global])),
+ <<"AbOomfYRdLAuDFGbaba">> = iolist_to_binary(re:replace("baba","([ab]*?)*","\\1AbO&omfYRdL\\1Au&DFG\\1",[])),
+ <<"AbOomfYRdLAuDFGAbObomfYRdLAubDFGAbOomfYRdLAuDFGAbOaomfYRdLAuaDFGAbOomfYRdLAuDFGAbObomfYRdLAubDFGAbOomfYRdLAuDFGAbOaomfYRdLAuaDFGAbOomfYRdLAuDFG">> = iolist_to_binary(re:replace("baba","([ab]*?)*","\\1AbO&omfYRdL\\1Au&DFG\\1",[global])),
+ <<"vpmFxwVLtNDmRVb">> = iolist_to_binary(re:replace("b","([^a]*?)*","v\\1pmFxwVLtNDmRV",[])),
+ <<"vpmFxwVLtNDmRVvpmFxwVLtNDmRVvpmFxwVLtNDmRV">> = iolist_to_binary(re:replace("b","([^a]*?)*","v\\1pmFxwVLtNDmRV",[global])),
+ <<"yVlokOKtokQKSbbbb">> = iolist_to_binary(re:replace("bbbb","([^a]*?)*","yVlokOK\\1\\1tok\\1\\1Q&KS&",[])),
+ <<"yVlokOKtokQKSyVlokOKtokQbKSbyVlokOKtokQKSyVlokOKtokQbKSbyVlokOKtokQKSyVlokOKtokQbKSbyVlokOKtokQKSyVlokOKtokQbKSbyVlokOKtokQKS">> = iolist_to_binary(re:replace("bbbb","([^a]*?)*","yVlokOK\\1\\1tok\\1\\1Q&KS&",[global])),
+ <<"eMcDykUaaa">> = iolist_to_binary(re:replace("aaa","([^a]*?)*","e\\1&McDykU\\1&",[])),
+ <<"eMcDykUaeMcDykUaeMcDykUaeMcDykU">> = iolist_to_binary(re:replace("aaa","([^a]*?)*","e\\1&McDykU\\1&",[global])),
+ <<"QEARocc">> = iolist_to_binary(re:replace("c","([^ab]*?)*","QEARo&c",[])),
+ <<"QEARocQEARoccQEARoc">> = iolist_to_binary(re:replace("c","([^ab]*?)*","QEARo&c",[global])),
+ <<"KFGQOVcccc">> = iolist_to_binary(re:replace("cccc","([^ab]*?)*","KFG&QO\\1V",[])),
+ <<"KFGQOVKFGcQOVKFGQOVKFGcQOVKFGQOVKFGcQOVKFGQOVKFGcQOVKFGQOV">> = iolist_to_binary(re:replace("cccc","([^ab]*?)*","KFG&QO\\1V",[global])),
+ <<"bhTlpTdfebaba">> = iolist_to_binary(re:replace("baba","([^ab]*?)*","bhTlp\\1Tdfe\\1",[])),
+ <<"bhTlpTdfebbhTlpTdfeabhTlpTdfebbhTlpTdfeabhTlpTdfe">> = iolist_to_binary(re:replace("baba","([^ab]*?)*","bhTlp\\1Tdfe\\1",[global])),
+ <<"PJllegKeFhjiLa">> = iolist_to_binary(re:replace("a","(?>a*)*","PJllegKeFh\\1j\\1iL&",[])),
+ <<"PJllegKeFhjiLaPJllegKeFhjiL">> = iolist_to_binary(re:replace("a","(?>a*)*","PJllegKeFh\\1j\\1iL&",[global])),
+ <<"gUuqhRhIObcde">> = iolist_to_binary(re:replace("aaabcde","(?>a*)*","\\1g\\1U\\1\\1uqhRh\\1IO",[])),
+ <<"gUuqhRhIOgUuqhRhIObgUuqhRhIOcgUuqhRhIOdgUuqhRhIOegUuqhRhIO">> = iolist_to_binary(re:replace("aaabcde","(?>a*)*","\\1g\\1U\\1\\1uqhRh\\1IO",[global])),
ok.
run14() ->
- <<"MLgsOWdfTvaaaaa">> = iolist_to_binary(re:replace("aaaaa","((?>a*?))*","MLgs&OW\\1df&T&v",[])),
- <<"MLgsOWdfTvaMLgsOWdfTvaMLgsOWdfTvaMLgsOWdfTvaMLgsOWdfTvaMLgsOWdfTv">> = iolist_to_binary(re:replace("aaaaa","((?>a*?))*","MLgs&OW\\1df&T&v",[global])),
- <<"aabbaa">> = iolist_to_binary(re:replace("aabbaa","((?>a*?))*","&",[])),
- <<"aabbaa">> = iolist_to_binary(re:replace("aabbaa","((?>a*?))*","&",[global])),
- <<"gTBVcFPFf12-sep-98nd">> = iolist_to_binary(re:replace("12-sep-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","gTBVcFPFf&\\1nd",[extended])),
- <<"gTBVcFPFf12-sep-98nd">> = iolist_to_binary(re:replace("12-sep-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","gTBVcFPFf&\\1nd",[extended,
- global])),
- <<"12-09-98h12-09-98Vrh12-09-98">> = iolist_to_binary(re:replace("12-09-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","&h&\\1Vrh\\1&",[extended])),
- <<"12-09-98h12-09-98Vrh12-09-98">> = iolist_to_binary(re:replace("12-09-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","&h&\\1Vrh\\1&",[extended,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","W&ve&i&",[extended])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","W&ve&i&",[extended,
- global])),
- <<"sep-12-98">> = iolist_to_binary(re:replace("sep-12-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","UrC",[extended])),
- <<"sep-12-98">> = iolist_to_binary(re:replace("sep-12-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","UrC",[extended,
- global])),
- <<"foodfooCEjVBAfoo">> = iolist_to_binary(re:replace("foobarfoo","(?<=(foo))bar\\1","d\\1CEjVBA\\1",[])),
- <<"foodfooCEjVBAfoo">> = iolist_to_binary(re:replace("foobarfoo","(?<=(foo))bar\\1","d\\1CEjVBA\\1",[global])),
- <<"foovctling">> = iolist_to_binary(re:replace("foobarfootling","(?<=(foo))bar\\1","vc",[])),
- <<"foovctling">> = iolist_to_binary(re:replace("foobarfootling","(?<=(foo))bar\\1","vc",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo))bar\\1","UXvqXj\\1yXDrW\\1&UV&aD",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo))bar\\1","UXvqXj\\1yXDrW\\1&UV&aD",[global])),
- <<"foobar">> = iolist_to_binary(re:replace("foobar","(?<=(foo))bar\\1","VWpBPnVuwGDg",[])),
- <<"foobar">> = iolist_to_binary(re:replace("foobar","(?<=(foo))bar\\1","VWpBPnVuwGDg",[global])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<=(foo))bar\\1","&jX",[])),
- <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<=(foo))bar\\1","&jX",[global])),
- <<"sQWfkfUNJnPcyC">> = iolist_to_binary(re:replace("saturday","(?i:saturday|sunday)","sQ\\1Wf\\1kfUNJnPcyC",[])),
- <<"sQWfkfUNJnPcyC">> = iolist_to_binary(re:replace("saturday","(?i:saturday|sunday)","sQ\\1Wf\\1kfUNJnPcyC",[global])),
- <<"xWJnRsundayofsundayP">> = iolist_to_binary(re:replace("sunday","(?i:saturday|sunday)","xWJn\\1R&of\\1&P",[])),
- <<"xWJnRsundayofsundayP">> = iolist_to_binary(re:replace("sunday","(?i:saturday|sunday)","xWJn\\1R&of\\1&P",[global])),
- <<"SaturdayWo">> = iolist_to_binary(re:replace("Saturday","(?i:saturday|sunday)","&W\\1o",[])),
- <<"SaturdayWo">> = iolist_to_binary(re:replace("Saturday","(?i:saturday|sunday)","&W\\1o",[global])),
- <<"TdQtxuqoDxI">> = iolist_to_binary(re:replace("Sunday","(?i:saturday|sunday)","TdQtxuqoDxI",[])),
- <<"TdQtxuqoDxI">> = iolist_to_binary(re:replace("Sunday","(?i:saturday|sunday)","TdQtxuqoDxI",[global])),
- <<"tSATURDAYpA">> = iolist_to_binary(re:replace("SATURDAY","(?i:saturday|sunday)","t&\\1pA",[])),
- <<"tSATURDAYpA">> = iolist_to_binary(re:replace("SATURDAY","(?i:saturday|sunday)","t&\\1pA",[global])),
- <<"PSUNDAYVdHPKeqeCHsbPht">> = iolist_to_binary(re:replace("SUNDAY","(?i:saturday|sunday)","P&VdHPKeqeCH\\1sbPht",[])),
- <<"PSUNDAYVdHPKeqeCHsbPht">> = iolist_to_binary(re:replace("SUNDAY","(?i:saturday|sunday)","P&VdHPKeqeCH\\1sbPht",[global])),
- <<"ADh">> = iolist_to_binary(re:replace("SunDay","(?i:saturday|sunday)","A\\1D\\1h\\1",[])),
- <<"ADh">> = iolist_to_binary(re:replace("SunDay","(?i:saturday|sunday)","A\\1D\\1h\\1",[global])),
- <<"mGKtRabcxPabcxJ">> = iolist_to_binary(re:replace("abcx","(a(?i)bc|BB)x","mGKtR&P&J",[])),
- <<"mGKtRabcxPabcxJ">> = iolist_to_binary(re:replace("abcx","(a(?i)bc|BB)x","mGKtR&P&J",[global])),
- <<"oaBCxMk">> = iolist_to_binary(re:replace("aBCx","(a(?i)bc|BB)x","o&Mk",[])),
- <<"oaBCxMk">> = iolist_to_binary(re:replace("aBCx","(a(?i)bc|BB)x","o&Mk",[global])),
- <<"BbbxAbbbbw">> = iolist_to_binary(re:replace("bbx","(a(?i)bc|BB)x","B&A\\1\\1w",[])),
- <<"BbbxAbbbbw">> = iolist_to_binary(re:replace("bbx","(a(?i)bc|BB)x","B&A\\1\\1w",[global])),
- <<"mJcBBAxatfogiBBBBOBBxw">> = iolist_to_binary(re:replace("BBx","(a(?i)bc|BB)x","mJc\\1Axatfogi\\1\\1O&w",[])),
- <<"mJcBBAxatfogiBBBBOBBxw">> = iolist_to_binary(re:replace("BBx","(a(?i)bc|BB)x","mJc\\1Axatfogi\\1\\1O&w",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)bc|BB)x","snLiVTr\\1v&GcLOx",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)bc|BB)x","snLiVTr\\1v&GcLOx",[global])),
- <<"abcX">> = iolist_to_binary(re:replace("abcX","(a(?i)bc|BB)x","cUgeDoMeUddk\\1X&",[])),
- <<"abcX">> = iolist_to_binary(re:replace("abcX","(a(?i)bc|BB)x","cUgeDoMeUddk\\1X&",[global])),
- <<"aBCX">> = iolist_to_binary(re:replace("aBCX","(a(?i)bc|BB)x","x\\1a&yaxHWdGs&udxU",[])),
- <<"aBCX">> = iolist_to_binary(re:replace("aBCX","(a(?i)bc|BB)x","x\\1a&yaxHWdGs&udxU",[global])),
- <<"bbX">> = iolist_to_binary(re:replace("bbX","(a(?i)bc|BB)x","AmUQ&rURn&&",[])),
- <<"bbX">> = iolist_to_binary(re:replace("bbX","(a(?i)bc|BB)x","AmUQ&rURn&&",[global])),
- <<"BBX">> = iolist_to_binary(re:replace("BBX","(a(?i)bc|BB)x","&\\1bNvEcoUrediWbu&Pbp",[])),
- <<"BBX">> = iolist_to_binary(re:replace("BBX","(a(?i)bc|BB)x","&\\1bNvEcoUrediWbu&Pbp",[global])),
- <<"UvDhoExRiacBIgOkt">> = iolist_to_binary(re:replace("ac","^([ab](?i)[cd]|[ef])","UvDhoExRi&BIgOkt",[])),
- <<"UvDhoExRiacBIgOkt">> = iolist_to_binary(re:replace("ac","^([ab](?i)[cd]|[ef])","UvDhoExRi&BIgOkt",[global])),
- <<"xPaCaCRDAtETUaCMGcb">> = iolist_to_binary(re:replace("aC","^([ab](?i)[cd]|[ef])","xP&\\1RDAtETU\\1MGcb",[])),
- <<"xPaCaCRDAtETUaCMGcb">> = iolist_to_binary(re:replace("aC","^([ab](?i)[cd]|[ef])","xP&\\1RDAtETU\\1MGcb",[global])),
- <<"YrbDPg">> = iolist_to_binary(re:replace("bD","^([ab](?i)[cd]|[ef])","Yr&Pg",[])),
- <<"YrbDPg">> = iolist_to_binary(re:replace("bD","^([ab](?i)[cd]|[ef])","Yr&Pg",[global])),
- <<"vxPeqqmHlephant">> = iolist_to_binary(re:replace("elephant","^([ab](?i)[cd]|[ef])","vxP&qqmH",[])),
- <<"vxPeqqmHlephant">> = iolist_to_binary(re:replace("elephant","^([ab](?i)[cd]|[ef])","vxP&qqmH",[global])),
- <<"CXttEDburope">> = iolist_to_binary(re:replace("Europe","^([ab](?i)[cd]|[ef])","CXtt\\1Db",[])),
- <<"CXttEDburope">> = iolist_to_binary(re:replace("Europe","^([ab](?i)[cd]|[ef])","CXtt\\1Db",[global])),
- <<"ckdAsOrog">> = iolist_to_binary(re:replace("frog","^([ab](?i)[cd]|[ef])","ckdAsO",[])),
- <<"ckdAsOrog">> = iolist_to_binary(re:replace("frog","^([ab](?i)[cd]|[ef])","ckdAsO",[global])),
- <<"FLAarance">> = iolist_to_binary(re:replace("France","^([ab](?i)[cd]|[ef])","\\1LAa",[])),
- <<"FLAarance">> = iolist_to_binary(re:replace("France","^([ab](?i)[cd]|[ef])","\\1LAa",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([ab](?i)[cd]|[ef])","&dK",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([ab](?i)[cd]|[ef])","&dK",[global])),
- <<"Africa">> = iolist_to_binary(re:replace("Africa","^([ab](?i)[cd]|[ef])","he&mN&m",[])),
- <<"Africa">> = iolist_to_binary(re:replace("Africa","^([ab](?i)[cd]|[ef])","he&mN&m",[global])),
- <<"QwnababababWRxgc">> = iolist_to_binary(re:replace("ab","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","Qwn&\\1\\1&WRxgc",[])),
- <<"QwnababababWRxgc">> = iolist_to_binary(re:replace("ab","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","Qwn&\\1\\1&WRxgc",[global])),
- <<"alixQPHvMhCA">> = iolist_to_binary(re:replace("aBd","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","alixQPHvMhCA",[])),
- <<"alixQPHvMhCA">> = iolist_to_binary(re:replace("aBd","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","alixQPHvMhCA",[global])),
- <<"fRTxgJVEjxyBxyliXrOuh">> = iolist_to_binary(re:replace("xy","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","fRTxgJVEj\\1B\\1liXrOuh",[])),
- <<"fRTxgJVEjxyBxyliXrOuh">> = iolist_to_binary(re:replace("xy","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","fRTxgJVEj\\1B\\1liXrOuh",[global])),
- <<"xYRFpytKCFxYlEt">> = iolist_to_binary(re:replace("xY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","&RFpytKCF&lEt",[])),
- <<"xYRFpytKCFxYlEt">> = iolist_to_binary(re:replace("xY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","&RFpytKCF&lEt",[global])),
- <<"vgzjebra">> = iolist_to_binary(re:replace("zebra","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","vg&j",[])),
- <<"vgzjebra">> = iolist_to_binary(re:replace("zebra","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","vg&j",[global])),
- <<"eZFmjyambesi">> = iolist_to_binary(re:replace("Zambesi","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","e&Fmjy",[])),
- <<"eZFmjyambesi">> = iolist_to_binary(re:replace("Zambesi","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","e&Fmjy",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","a",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","a",[global])),
- <<"aCD">> = iolist_to_binary(re:replace("aCD","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","gEOo",[])),
- <<"aCD">> = iolist_to_binary(re:replace("aCD","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","gEOo",[global])),
- <<"XY">> = iolist_to_binary(re:replace("XY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","&OrTvY&r\\1a\\1tNgO\\1",[])),
- <<"XY">> = iolist_to_binary(re:replace("XY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","&OrTvY&r\\1a\\1tNgO\\1",[global])),
+ <<"QVEsbJSBcadjBEjT">> = iolist_to_binary(re:replace("aaaaa","((?>a*))*","QVEsbJSBcadjB\\1EjT\\1",[])),
+ <<"QVEsbJSBcadjBEjTQVEsbJSBcadjBEjT">> = iolist_to_binary(re:replace("aaaaa","((?>a*))*","QVEsbJSBcadjB\\1EjT\\1",[global])),
+ <<"aajWaaDjOsitnxUkGdbbaa">> = iolist_to_binary(re:replace("aabbaa","((?>a*))*","&j\\1W&DjOsitnxUkGd",[])),
+ <<"aajWaaDjOsitnxUkGdjWDjOsitnxUkGdbjWDjOsitnxUkGdbaajWaaDjOsitnxUkGdjWDjOsitnxUkGd">> = iolist_to_binary(re:replace("aabbaa","((?>a*))*","&j\\1W&DjOsitnxUkGd",[global])),
+ <<"mpYoteiaaaaa">> = iolist_to_binary(re:replace("aaaaa","((?>a*?))*","&mpYotei",[])),
+ <<"mpYoteiampYoteiampYoteiampYoteiampYoteiampYotei">> = iolist_to_binary(re:replace("aaaaa","((?>a*?))*","&mpYotei",[global])),
+ <<"xwNaabbaa">> = iolist_to_binary(re:replace("aabbaa","((?>a*?))*","xwN",[])),
+ <<"xwNaxwNaxwNbxwNbxwNaxwNaxwN">> = iolist_to_binary(re:replace("aabbaa","((?>a*?))*","xwN",[global])),
+ <<"MHqWb12-sep-98tn12-sep-98">> = iolist_to_binary(re:replace("12-sep-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","MHqWb\\1&\\1\\1tn&",[extended])),
+ <<"MHqWb12-sep-98tn12-sep-98">> = iolist_to_binary(re:replace("12-sep-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","MHqWb\\1&\\1\\1tn&",[extended,
+ global])),
+ <<"DgNMNfEyu">> = iolist_to_binary(re:replace("12-09-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","DgNM\\1NfEyu",[extended])),
+ <<"DgNMNfEyu">> = iolist_to_binary(re:replace("12-09-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","DgNM\\1NfEyu",[extended,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","dJbs&PvrBmxnM",[extended])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","dJbs&PvrBmxnM",[extended,
+ global])),
+ <<"sep-12-98">> = iolist_to_binary(re:replace("sep-12-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","WdMj&nqA\\1",[extended])),
+ <<"sep-12-98">> = iolist_to_binary(re:replace("sep-12-98","(?(?=[^a-z]+[a-z]) \\d{2}-[a-z]{3}-\\d{2} | \\d{2}-\\d{2}-\\d{2} ) ","WdMj&nqA\\1",[extended,
+ global])),
+ <<"fooKBbarfooDAfoofbarfooMfooDQfqvJdYVQ">> = iolist_to_binary(re:replace("foobarfoo","(?<=(foo))bar\\1","KB&DA\\1f&M\\1DQfqvJdYVQ",[])),
+ <<"fooKBbarfooDAfoofbarfooMfooDQfqvJdYVQ">> = iolist_to_binary(re:replace("foobarfoo","(?<=(foo))bar\\1","KB&DA\\1f&M\\1DQfqvJdYVQ",[global])),
+ <<"foofKNfoofooQlDdcmBPbarfooCfooUbarfoofootling">> = iolist_to_binary(re:replace("foobarfootling","(?<=(foo))bar\\1","fKN\\1\\1QlDdcmBP&C\\1U&\\1",[])),
+ <<"foofKNfoofooQlDdcmBPbarfooCfooUbarfoofootling">> = iolist_to_binary(re:replace("foobarfootling","(?<=(foo))bar\\1","fKN\\1\\1QlDdcmBP&C\\1U&\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo))bar\\1","aN&pf\\1\\1\\1mf\\1frWLf&d&m",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(foo))bar\\1","aN&pf\\1\\1\\1mf\\1frWLf&d&m",[global])),
+ <<"foobar">> = iolist_to_binary(re:replace("foobar","(?<=(foo))bar\\1","NQ&IvkhD&RYe\\1\\1\\1",[])),
+ <<"foobar">> = iolist_to_binary(re:replace("foobar","(?<=(foo))bar\\1","NQ&IvkhD&RYe\\1\\1\\1",[global])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<=(foo))bar\\1","RV\\1lCqK\\1k",[])),
+ <<"barfoo">> = iolist_to_binary(re:replace("barfoo","(?<=(foo))bar\\1","RV\\1lCqK\\1k",[global])),
+ <<"WXSaOsXBjgsaturdayx">> = iolist_to_binary(re:replace("saturday","(?i:saturday|sunday)","W\\1X\\1S\\1aOsXBj\\1g&x",[])),
+ <<"WXSaOsXBjgsaturdayx">> = iolist_to_binary(re:replace("saturday","(?i:saturday|sunday)","W\\1X\\1S\\1aOsXBj\\1g&x",[global])),
+ <<"LogM">> = iolist_to_binary(re:replace("sunday","(?i:saturday|sunday)","Lo\\1gM",[])),
+ <<"LogM">> = iolist_to_binary(re:replace("sunday","(?i:saturday|sunday)","Lo\\1gM",[global])),
+ <<"bAkcTSaturdayamcSaturdayx">> = iolist_to_binary(re:replace("Saturday","(?i:saturday|sunday)","bAk\\1cT&amc&x",[])),
+ <<"bAkcTSaturdayamcSaturdayx">> = iolist_to_binary(re:replace("Saturday","(?i:saturday|sunday)","bAk\\1cT&amc&x",[global])),
+ <<"WJeSunday">> = iolist_to_binary(re:replace("Sunday","(?i:saturday|sunday)","WJe&",[])),
+ <<"WJeSunday">> = iolist_to_binary(re:replace("Sunday","(?i:saturday|sunday)","WJe&",[global])),
+ <<"HPSATURDAYOIKerWiY">> = iolist_to_binary(re:replace("SATURDAY","(?i:saturday|sunday)","HP&OIKerWi\\1Y",[])),
+ <<"HPSATURDAYOIKerWiY">> = iolist_to_binary(re:replace("SATURDAY","(?i:saturday|sunday)","HP&OIKerWi\\1Y",[global])),
+ <<"OgUOq">> = iolist_to_binary(re:replace("SUNDAY","(?i:saturday|sunday)","\\1OgUOq",[])),
+ <<"OgUOq">> = iolist_to_binary(re:replace("SUNDAY","(?i:saturday|sunday)","\\1OgUOq",[global])),
+ <<"UKulSunDaykpSunDayv">> = iolist_to_binary(re:replace("SunDay","(?i:saturday|sunday)","UKul&kp&v",[])),
+ <<"UKulSunDaykpSunDayv">> = iolist_to_binary(re:replace("SunDay","(?i:saturday|sunday)","UKul&kp&v",[global])),
+ <<"uKOqaabcexabcxpabcsJydJMabchE">> = iolist_to_binary(re:replace("abcx","(a(?i)bc|BB)x","uKOqa\\1ex&p\\1sJydJM\\1hE",[])),
+ <<"uKOqaabcexabcxpabcsJydJMabchE">> = iolist_to_binary(re:replace("abcx","(a(?i)bc|BB)x","uKOqa\\1ex&p\\1sJydJM\\1hE",[global])),
+ <<"rRNaBC">> = iolist_to_binary(re:replace("aBCx","(a(?i)bc|BB)x","rRN\\1",[])),
+ <<"rRNaBC">> = iolist_to_binary(re:replace("aBCx","(a(?i)bc|BB)x","rRN\\1",[global])),
+ <<"oJ">> = iolist_to_binary(re:replace("bbx","(a(?i)bc|BB)x","oJ",[])),
+ <<"oJ">> = iolist_to_binary(re:replace("bbx","(a(?i)bc|BB)x","oJ",[global])),
+ <<"BBxR">> = iolist_to_binary(re:replace("BBx","(a(?i)bc|BB)x","&R",[])),
+ <<"BBxR">> = iolist_to_binary(re:replace("BBx","(a(?i)bc|BB)x","&R",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)bc|BB)x","T&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(a(?i)bc|BB)x","T&",[global])),
+ <<"abcX">> = iolist_to_binary(re:replace("abcX","(a(?i)bc|BB)x","whvhAvFn",[])),
+ <<"abcX">> = iolist_to_binary(re:replace("abcX","(a(?i)bc|BB)x","whvhAvFn",[global])),
+ <<"aBCX">> = iolist_to_binary(re:replace("aBCX","(a(?i)bc|BB)x","Nb&vemA",[])),
+ <<"aBCX">> = iolist_to_binary(re:replace("aBCX","(a(?i)bc|BB)x","Nb&vemA",[global])),
+ <<"bbX">> = iolist_to_binary(re:replace("bbX","(a(?i)bc|BB)x","s\\1GdP\\1\\1dEQ\\1YO",[])),
+ <<"bbX">> = iolist_to_binary(re:replace("bbX","(a(?i)bc|BB)x","s\\1GdP\\1\\1dEQ\\1YO",[global])),
+ <<"BBX">> = iolist_to_binary(re:replace("BBX","(a(?i)bc|BB)x","oFBOVOb",[])),
+ <<"BBX">> = iolist_to_binary(re:replace("BBX","(a(?i)bc|BB)x","oFBOVOb",[global])),
+ <<"tacacotHFLuTEAHCbR">> = iolist_to_binary(re:replace("ac","^([ab](?i)[cd]|[ef])","t&\\1otHFLuTEAHCbR",[])),
+ <<"tacacotHFLuTEAHCbR">> = iolist_to_binary(re:replace("ac","^([ab](?i)[cd]|[ef])","t&\\1otHFLuTEAHCbR",[global])),
+ <<"BaCaCJ">> = iolist_to_binary(re:replace("aC","^([ab](?i)[cd]|[ef])","B&\\1J",[])),
+ <<"BaCaCJ">> = iolist_to_binary(re:replace("aC","^([ab](?i)[cd]|[ef])","B&\\1J",[global])),
+ <<"vbDvbDMbDnOy">> = iolist_to_binary(re:replace("bD","^([ab](?i)[cd]|[ef])","v&v\\1M&nOy",[])),
+ <<"vbDvbDMbDnOy">> = iolist_to_binary(re:replace("bD","^([ab](?i)[cd]|[ef])","v&v\\1M&nOy",[global])),
+ <<"HSegelephant">> = iolist_to_binary(re:replace("elephant","^([ab](?i)[cd]|[ef])","HS&ge",[])),
+ <<"HSegelephant">> = iolist_to_binary(re:replace("elephant","^([ab](?i)[cd]|[ef])","HS&ge",[global])),
+ <<"KmuWEkIQYqurope">> = iolist_to_binary(re:replace("Europe","^([ab](?i)[cd]|[ef])","KmuW&kIQYq",[])),
+ <<"KmuWEkIQYqurope">> = iolist_to_binary(re:replace("Europe","^([ab](?i)[cd]|[ef])","KmuW&kIQYq",[global])),
+ <<"qwwffEncmLfJNGOfOrog">> = iolist_to_binary(re:replace("frog","^([ab](?i)[cd]|[ef])","qww\\1&EncmL\\1JNGO&O",[])),
+ <<"qwwffEncmLfJNGOfOrog">> = iolist_to_binary(re:replace("frog","^([ab](?i)[cd]|[ef])","qww\\1&EncmL\\1JNGO&O",[global])),
+ <<"uVBupFMFDFFBwfMmnlfFrance">> = iolist_to_binary(re:replace("France","^([ab](?i)[cd]|[ef])","uVBup\\1M&D\\1\\1BwfMmnlf&",[])),
+ <<"uVBupFMFDFFBwfMmnlfFrance">> = iolist_to_binary(re:replace("France","^([ab](?i)[cd]|[ef])","uVBup\\1M&D\\1\\1BwfMmnlf&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([ab](?i)[cd]|[ef])","\\1cOIQhxWWs\\1F\\1&nEAw",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^([ab](?i)[cd]|[ef])","\\1cOIQhxWWs\\1F\\1&nEAw",[global])),
+ <<"Africa">> = iolist_to_binary(re:replace("Africa","^([ab](?i)[cd]|[ef])","h",[])),
+ <<"Africa">> = iolist_to_binary(re:replace("Africa","^([ab](?i)[cd]|[ef])","h",[global])),
+ <<"rWababXF">> = iolist_to_binary(re:replace("ab","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","rW\\1&XF",[])),
+ <<"rWababXF">> = iolist_to_binary(re:replace("ab","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","rW\\1&XF",[global])),
+ <<"wlBBHaBdG">> = iolist_to_binary(re:replace("aBd","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","wlBBH&G",[])),
+ <<"wlBBHaBdG">> = iolist_to_binary(re:replace("aBd","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","wlBBH&G",[global])),
+ <<"vxyxyyCoOgxy">> = iolist_to_binary(re:replace("xy","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","v\\1\\1yCoOg&",[])),
+ <<"vxyxyyCoOgxy">> = iolist_to_binary(re:replace("xy","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","v\\1\\1yCoOg&",[global])),
+ <<"sEBLg">> = iolist_to_binary(re:replace("xY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","sEBLg",[])),
+ <<"sEBLg">> = iolist_to_binary(re:replace("xY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","sEBLg",[global])),
+ <<"CxGBTmzFzaoxSvnzIJzxebra">> = iolist_to_binary(re:replace("zebra","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","CxGBTm&F&aoxSvn&IJ&x",[])),
+ <<"CxGBTmzFzaoxSvnzIJzxebra">> = iolist_to_binary(re:replace("zebra","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","CxGBTm&F&aoxSvn&IJ&x",[global])),
+ <<"tcaZQambesi">> = iolist_to_binary(re:replace("Zambesi","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","tca\\1Q",[])),
+ <<"tcaZQambesi">> = iolist_to_binary(re:replace("Zambesi","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","tca\\1Q",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","tSnco&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","tSnco&",[global])),
+ <<"aCD">> = iolist_to_binary(re:replace("aCD","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","dfo",[])),
+ <<"aCD">> = iolist_to_binary(re:replace("aCD","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","dfo",[global])),
+ <<"XY">> = iolist_to_binary(re:replace("XY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","U",[])),
+ <<"XY">> = iolist_to_binary(re:replace("XY","^(ab|a(?i)[b-c](?m-i)d|x(?i)y|z)","U",[global])),
<<"foo
-sutSyiAVbardY">> = iolist_to_binary(re:replace("foo
-bar","(?<=foo\\n)^bar","sutSyiAV&dY",[multiline])),
+NRWmeVkGqvP">> = iolist_to_binary(re:replace("foo
+bar","(?<=foo\\n)^bar","NRWmeVkGqv\\1P",[multiline])),
<<"foo
-sutSyiAVbardY">> = iolist_to_binary(re:replace("foo
-bar","(?<=foo\\n)^bar","sutSyiAV&dY",[multiline,global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=foo\\n)^bar","SbD\\1F&CKeqGUc\\1&",[multiline])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=foo\\n)^bar","SbD\\1F&CKeqGUc\\1&",[multiline,
- global])),
- <<"bar">> = iolist_to_binary(re:replace("bar","(?<=foo\\n)^bar","yi&DP",[multiline])),
- <<"bar">> = iolist_to_binary(re:replace("bar","(?<=foo\\n)^bar","yi&DP",[multiline,
- global])),
+NRWmeVkGqvP">> = iolist_to_binary(re:replace("foo
+bar","(?<=foo\\n)^bar","NRWmeVkGqv\\1P",[multiline,global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=foo\\n)^bar","pcR&ta\\1wJMdM&KPN",[multiline])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=foo\\n)^bar","pcR&ta\\1wJMdM&KPN",[multiline,
+ global])),
+ <<"bar">> = iolist_to_binary(re:replace("bar","(?<=foo\\n)^bar","jByCJtDS\\1o&THKBAM&y",[multiline])),
+ <<"bar">> = iolist_to_binary(re:replace("bar","(?<=foo\\n)^bar","jByCJtDS\\1o&THKBAM&y",[multiline,
+ global])),
<<"baz
bar">> = iolist_to_binary(re:replace("baz
-bar","(?<=foo\\n)^bar","hGG",[multiline])),
+bar","(?<=foo\\n)^bar","qsa\\1EcHRVFjLsoO&fk",[multiline])),
<<"baz
bar">> = iolist_to_binary(re:replace("baz
-bar","(?<=foo\\n)^bar","hGG",[multiline,global])),
- <<"barTsM">> = iolist_to_binary(re:replace("barbaz","(?<=(?<!foo)bar)baz","TsM",[])),
- <<"barTsM">> = iolist_to_binary(re:replace("barbaz","(?<=(?<!foo)bar)baz","TsM",[global])),
- <<"barbarbazJYNeeiOkukbazbaze">> = iolist_to_binary(re:replace("barbarbaz","(?<=(?<!foo)bar)baz","&JYNeeiOkuk&&e",[])),
- <<"barbarbazJYNeeiOkukbazbaze">> = iolist_to_binary(re:replace("barbarbaz","(?<=(?<!foo)bar)baz","&JYNeeiOkuk&&e",[global])),
- <<"koobarbazJDRvnHPtlJvlqbazha">> = iolist_to_binary(re:replace("koobarbaz","(?<=(?<!foo)bar)baz","&JD\\1RvnHPtlJvlq&ha",[])),
- <<"koobarbazJDRvnHPtlJvlqbazha">> = iolist_to_binary(re:replace("koobarbaz","(?<=(?<!foo)bar)baz","&JD\\1RvnHPtlJvlq&ha",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?<!foo)bar)baz","se&q\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?<!foo)bar)baz","se&q\\1",[global])),
- <<"baz">> = iolist_to_binary(re:replace("baz","(?<=(?<!foo)bar)baz","\\1FnT\\1ncG\\1qiLitBVlR",[])),
- <<"baz">> = iolist_to_binary(re:replace("baz","(?<=(?<!foo)bar)baz","\\1FnT\\1ncG\\1qiLitBVlR",[global])),
- <<"foobarbaz">> = iolist_to_binary(re:replace("foobarbaz","(?<=(?<!foo)bar)baz","TGjyDWNaukC\\1D",[])),
- <<"foobarbaz">> = iolist_to_binary(re:replace("foobarbaz","(?<=(?<!foo)bar)baz","TGjyDWNaukC\\1D",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?){4}$","PqtMwjvc&wXddSH",[])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?){4}$","PqtMwjvc&wXddSH",[global])),
- <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?){4}$","GgSSdPHMYJhXx",[])),
- <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?){4}$","GgSSdPHMYJhXx",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?){4}$","ucLn&Fx&kXfW",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?){4}$","ucLn&Fx&kXfW",[global])),
- <<"naaaaaaQNEaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?){4}$","n&\\1QNE&&&",[])),
- <<"naaaaaaQNEaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?){4}$","n&\\1QNE&&&",[global])),
- <<"ielIaAaXNwripBgIaHTa">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?){4}$","ielI\\1A\\1XNwripBgI\\1HT\\1",[])),
- <<"ielIaAaXNwripBgIaHTa">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?){4}$","ielI\\1A\\1XNwripBgI\\1HT\\1",[global])),
- <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?){4}$","HRYVEqqIFqY&Dl",[])),
- <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?){4}$","HRYVEqqIFqY&Dl",[global])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","&&t\\1s",[])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","&&t\\1s",[global])),
- <<"NaaaadLeaaaaxAL">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","N\\1dLe\\1xAL",[])),
- <<"NaaaadLeaaaaxAL">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","N\\1dLe\\1xAL",[global])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","\\1jr",[])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","\\1jr",[global])),
- <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?){4}$","N\\1",[])),
- <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?){4}$","N\\1",[global])),
- <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?){4}$","sQ&xSjdecK&&rSQkA",[])),
- <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?){4}$","sQ&xSjdecK&&rSQkA",[global])),
- <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?){4}$","CsOa",[])),
- <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?){4}$","CsOa",[global])),
- <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?){4}$","&pAEvtoqYnBxGT&Uox",[])),
- <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?){4}$","&pAEvtoqYnBxGT&Uox",[global])),
- <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?){4}$","&icuBLN",[])),
- <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?){4}$","&icuBLN",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","wxtPJAs&D\\1V&xlkaXy&",[])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","wxtPJAs&D\\1V&xlkaXy&",[global])),
- <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","GO\\1&NlEm",[])),
- <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","GO\\1&NlEm",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","trMv\\1vGRRdT&L",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","trMv\\1vGRRdT&L",[global])),
- <<"dtEvrhKayRa">> = iolist_to_binary(re:replace("aaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dtEvrhK\\1yR\\1",[])),
- <<"dtEvrhKayRa">> = iolist_to_binary(re:replace("aaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dtEvrhK\\1yR\\1",[global])),
- <<"swnY">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","swnY",[])),
- <<"swnY">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","swnY",[global])),
- <<"aaaaaarinTIDxAHEMa">> = iolist_to_binary(re:replace("aaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&rinTIDxAHEM\\1",[])),
- <<"aaaaaarinTIDxAHEMa">> = iolist_to_binary(re:replace("aaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&rinTIDxAHEM\\1",[global])),
- <<"UBvaoaaaaaaaaDUiX">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","UBvao\\1&DUiX",[])),
- <<"UBvaoaaaaaaaaDUiX">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","UBvao\\1&DUiX",[global])),
- <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","H\\1aLBBEpEaB",[])),
- <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","H\\1aLBBEpEaB",[global])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dpC",[])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dpC",[global])),
- <<"taaaaaaaaaahaaaaaaaaaaf">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","t&h&f",[])),
- <<"taaaaaaaaaahaaaaaaaaaaf">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","t&h&f",[global])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","rgxaXLiOHjVaKNJyPJ",[])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","rgxaXLiOHjVaKNJyPJ",[global])),
- <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","a\\1UVnCvM\\1bOy",[])),
- <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","a\\1UVnCvM\\1bOy",[global])),
- <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","mnxwE",[])),
- <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","mnxwE",[global])),
- <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","R",[])),
- <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","R",[global])),
- <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","CKEn&",[])),
- <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","CKEn&",[global])),
- <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dr\\1B\\1G&W\\1\\1\\1",[])),
- <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","dr\\1B\\1G&W\\1\\1\\1",[global])),
- <<"mTTwWHMeBAnTMAy">> = iolist_to_binary(re:replace("abc","abc","mTTwWHMe\\1B\\1AnTMAy",[])),
- <<"mTTwWHMeBAnTMAy">> = iolist_to_binary(re:replace("abc","abc","mTTwWHMe\\1B\\1AnTMAy",[global])),
- <<"xFRFntrFXSabcyBabcRky">> = iolist_to_binary(re:replace("xabcy","abc","FRFntrFXS&yB&\\1Rk",[])),
- <<"xFRFntrFXSabcyBabcRky">> = iolist_to_binary(re:replace("xabcy","abc","FRFntrFXS&yB&\\1Rk",[global])),
- <<"abmabceyJl">> = iolist_to_binary(re:replace("ababc","abc","m&eyJl",[])),
- <<"abmabceyJl">> = iolist_to_binary(re:replace("ababc","abc","m&eyJl",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","\\1kN",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","\\1kN",[global])),
- <<"xbc">> = iolist_to_binary(re:replace("xbc","abc","Rd",[])),
- <<"xbc">> = iolist_to_binary(re:replace("xbc","abc","Rd",[global])),
- <<"axc">> = iolist_to_binary(re:replace("axc","abc","qQP\\1gBdX&cfJfv&f",[])),
- <<"axc">> = iolist_to_binary(re:replace("axc","abc","qQP\\1gBdX&cfJfv&f",[global])),
- <<"abx">> = iolist_to_binary(re:replace("abx","abc","VMtbG",[])),
- <<"abx">> = iolist_to_binary(re:replace("abx","abc","VMtbG",[global])),
- <<"jNyOabclmQAUUabcabcabcM">> = iolist_to_binary(re:replace("abc","ab*c","jNyO&lmQA\\1UU&&&M",[])),
- <<"jNyOabclmQAUUabcabcabcM">> = iolist_to_binary(re:replace("abc","ab*c","jNyO&lmQA\\1UU&&&M",[global])),
- <<"NuNKaVVP">> = iolist_to_binary(re:replace("abc","ab*bc","NuNKaVV\\1\\1P",[])),
- <<"NuNKaVVP">> = iolist_to_binary(re:replace("abc","ab*bc","NuNKaVV\\1\\1P",[global])),
- <<"v">> = iolist_to_binary(re:replace("abbc","ab*bc","v",[])),
- <<"v">> = iolist_to_binary(re:replace("abbc","ab*bc","v",[global])),
- <<"IabbbbcLNYRgEvYHyabbbbctwq">> = iolist_to_binary(re:replace("abbbbc","ab*bc","I&LNYRgEvYHy&tw\\1q",[])),
- <<"IabbbbcLNYRgEvYHyabbbbctwq">> = iolist_to_binary(re:replace("abbbbc","ab*bc","I&LNYRgEvYHy&tw\\1q",[global])),
- <<"dcWrPQwrWtCeinonDembbbbc">> = iolist_to_binary(re:replace("abbbbc",".{1}","dcWrPQwrWtCeinonDem",[])),
- <<"dcWrPQwrWtCeinonDemdcWrPQwrWtCeinonDemdcWrPQwrWtCeinonDemdcWrPQwrWtCeinonDemdcWrPQwrWtCeinonDemdcWrPQwrWtCeinonDem">> = iolist_to_binary(re:replace("abbbbc",".{1}","dcWrPQwrWtCeinonDem",[global])),
- <<"NwOwabbbabbbCOvabbbenaNbc">> = iolist_to_binary(re:replace("abbbbc",".{3,4}","NwOw&&COv&e\\1naN",[])),
- <<"NwOwabbbabbbCOvabbbenaNbc">> = iolist_to_binary(re:replace("abbbbc",".{3,4}","NwOw&&COv&e\\1naN",[global])),
- <<"abbbbcCeTetSKDvAvrabbbbcpa">> = iolist_to_binary(re:replace("abbbbc","ab{0,}bc","&CeTetSKDvAvr&pa",[])),
- <<"abbbbcCeTetSKDvAvrabbbbcpa">> = iolist_to_binary(re:replace("abbbbc","ab{0,}bc","&CeTetSKDvAvr&pa",[global])),
- <<"TbtqfbcUrEcTU">> = iolist_to_binary(re:replace("abbc","ab+bc","Tb\\1tqfb\\1cUrEcTU",[])),
- <<"TbtqfbcUrEcTU">> = iolist_to_binary(re:replace("abbc","ab+bc","Tb\\1tqfb\\1cUrEcTU",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","TeS\\1\\1F",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","TeS\\1\\1F",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","ab+bc","EHEtuOC&GTMRx",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","ab+bc","EHEtuOC&GTMRx",[global])),
- <<"abq">> = iolist_to_binary(re:replace("abq","ab+bc","\\1ywtK\\1hfkEVdoXy\\1eH",[])),
- <<"abq">> = iolist_to_binary(re:replace("abq","ab+bc","\\1ywtK\\1hfkEVdoXy\\1eH",[global])),
- <<"GlETcsroCIlRt">> = iolist_to_binary(re:replace("abbbbc","ab+bc","GlETcsro\\1CIlRt\\1",[])),
- <<"GlETcsroCIlRt">> = iolist_to_binary(re:replace("abbbbc","ab+bc","GlETcsro\\1CIlRt\\1",[global])),
+bar","(?<=foo\\n)^bar","qsa\\1EcHRVFjLsoO&fk",[multiline,global])),
+ <<"barrVqQArLvUbazrlnI">> = iolist_to_binary(re:replace("barbaz","(?<=(?<!foo)bar)baz","r\\1\\1VqQArLvU&r\\1lnI",[])),
+ <<"barrVqQArLvUbazrlnI">> = iolist_to_binary(re:replace("barbaz","(?<=(?<!foo)bar)baz","r\\1\\1VqQArLvU&r\\1lnI",[global])),
+ <<"barbargh">> = iolist_to_binary(re:replace("barbarbaz","(?<=(?<!foo)bar)baz","gh",[])),
+ <<"barbargh">> = iolist_to_binary(re:replace("barbarbaz","(?<=(?<!foo)bar)baz","gh",[global])),
+ <<"koobarvdKYQDIVnwbazbazQWKBgh">> = iolist_to_binary(re:replace("koobarbaz","(?<=(?<!foo)bar)baz","vdKYQDIVnw&&QWKBgh",[])),
+ <<"koobarvdKYQDIVnwbazbazQWKBgh">> = iolist_to_binary(re:replace("koobarbaz","(?<=(?<!foo)bar)baz","vdKYQDIVnw&&QWKBgh",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?<!foo)bar)baz","FjVsA\\1&B",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?<!foo)bar)baz","FjVsA\\1&B",[global])),
+ <<"baz">> = iolist_to_binary(re:replace("baz","(?<=(?<!foo)bar)baz","HgWqxfrr\\1qYwT",[])),
+ <<"baz">> = iolist_to_binary(re:replace("baz","(?<=(?<!foo)bar)baz","HgWqxfrr\\1qYwT",[global])),
+ <<"foobarbaz">> = iolist_to_binary(re:replace("foobarbaz","(?<=(?<!foo)bar)baz","yjWsT\\1DYmUlc",[])),
+ <<"foobarbaz">> = iolist_to_binary(re:replace("foobarbaz","(?<=(?<!foo)bar)baz","yjWsT\\1DYmUlc",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?){4}$","xfcMrdAu",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?){4}$","xfcMrdAu",[global])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?){4}$","\\1BliC&LQrU\\1r",[])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?){4}$","\\1BliC&LQrU\\1r",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?){4}$","TeTeD\\1X&&l\\1w",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?){4}$","TeTeD\\1X&&l\\1w",[global])),
+ <<"HV">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?){4}$","HV",[])),
+ <<"HV">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?){4}$","HV",[global])),
+ <<"GmaaaaaaaawlpUaaaaaaaOy">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?){4}$","Gm\\1&wlpU&Oy",[])),
+ <<"GmaaaaaaaawlpUaaaaaaaOy">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?){4}$","Gm\\1&wlpU&Oy",[global])),
+ <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?){4}$","snNvqcf\\1mxQ\\1DRPIP",[])),
+ <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?){4}$","snNvqcf\\1mxQ\\1DRPIP",[global])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","\\1RtbPoOkgRgQnokJdP",[])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","\\1RtbPoOkgRgQnokJdP",[global])),
+ <<"aaaaaaaaaaaaaagBhaaaaaaaaaaIaaaaaaaaaaKaaaaaaaaaaeSvaaaanYhNTc">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","&\\1gBh&I&K&eSv\\1nYhNTc",[])),
+ <<"aaaaaaaaaaaaaagBhaaaaaaaaaaIaaaaaaaaaaKaaaaaaaaaaeSvaaaanYhNTc">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","&\\1gBh&I&K&eSv\\1nYhNTc",[global])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","\\1O",[])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","\\1O",[global])),
+ <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?){4}$","\\1&&",[])),
+ <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?){4}$","\\1&&",[global])),
+ <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?){4}$","gbGDh\\1\\1\\1PlvFnq",[])),
+ <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?){4}$","gbGDh\\1\\1\\1PlvFnq",[global])),
+ <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?){4}$","o\\1\\1\\1nIbiYVy&",[])),
+ <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?){4}$","o\\1\\1\\1nIbiYVy&",[global])),
+ <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?){4}$","K\\1IGHABBJDNX",[])),
+ <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?){4}$","K\\1IGHABBJDNX",[global])),
+ <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?){4}$","\\1&\\1wvNlo",[])),
+ <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?){4}$","\\1&\\1wvNlo",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","MMsqXp\\1L\\1",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","MMsqXp\\1L\\1",[global])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&\\1\\1cblGbrY\\1\\1sIosd",[])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&\\1\\1cblGbrY\\1\\1sIosd",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","WyI\\1\\1fd&A\\1",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","WyI\\1\\1fd&A\\1",[global])),
+ <<"hJaaaaKOGfPaaaanTbA">> = iolist_to_binary(re:replace("aaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","hJ&KOGfP&nTbA",[])),
+ <<"hJaaaaKOGfPaaaanTbA">> = iolist_to_binary(re:replace("aaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","hJ&KOGfP&nTbA",[global])),
+ <<"akBaaaaaaJapLD">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","\\1kB&aJ\\1pLD",[])),
+ <<"akBaaaaaaJapLD">> = iolist_to_binary(re:replace("aaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","\\1kB&aJ\\1pLD",[global])),
+ <<"aaadYLlnNBfn">> = iolist_to_binary(re:replace("aaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","a\\1adYLlnNBfn",[])),
+ <<"aaadYLlnNBfn">> = iolist_to_binary(re:replace("aaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","a\\1adYLlnNBfn",[global])),
+ <<"haaaaaaaMn">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","h&Mn",[])),
+ <<"haaaaaaaMn">> = iolist_to_binary(re:replace("aaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","h&Mn",[global])),
+ <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","F&\\1&",[])),
+ <<"aaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","F&\\1&",[global])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","ig&\\1hVNoqXY\\1kTDTB\\1qO",[])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","ig&\\1hVNoqXY\\1kTDTB\\1qO",[global])),
+ <<"jRaaaaaaaaaamEaTlkygaaaaaaaaaadSaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","jR&mE\\1Tlkyg&dS&",[])),
+ <<"jRaaaaaaaaaamEaTlkygaaaaaaaaaadSaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","jR&mE\\1Tlkyg&dS&",[global])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","Tec&gBdh\\1x",[])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","Tec&gBdh\\1x",[global])),
+ <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","MMXY&yRoehQihV&b\\1txa",[])),
+ <<"aaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","MMXY&yRoehQihV&b\\1txa",[global])),
+ <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&",[])),
+ <<"aaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","&",[global])),
+ <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","SnhXn&km\\1BaVtSJUu",[])),
+ <<"aaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","SnhXn&km\\1BaVtSJUu",[global])),
+ <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","FToR",[])),
+ <<"aaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","FToR",[global])),
+ <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","\\1",[])),
+ <<"aaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaa","^(a\\1?)(a\\1?)(a\\2?)(a\\3?)$","\\1",[global])),
+ <<"abcJJvjL">> = iolist_to_binary(re:replace("abc","abc","&J\\1\\1JvjL",[])),
+ <<"abcJJvjL">> = iolist_to_binary(re:replace("abc","abc","&J\\1\\1JvjL",[global])),
+ <<"xtsyy">> = iolist_to_binary(re:replace("xabcy","abc","tsy",[])),
+ <<"xtsyy">> = iolist_to_binary(re:replace("xabcy","abc","tsy",[global])),
+ <<"abr">> = iolist_to_binary(re:replace("ababc","abc","r",[])),
+ <<"abr">> = iolist_to_binary(re:replace("ababc","abc","r",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","&CvW\\1J&hP\\1kp",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","&CvW\\1J&hP\\1kp",[global])),
+ <<"xbc">> = iolist_to_binary(re:replace("xbc","abc","xONy",[])),
+ <<"xbc">> = iolist_to_binary(re:replace("xbc","abc","xONy",[global])),
+ <<"axc">> = iolist_to_binary(re:replace("axc","abc","O&RYgOFW&\\1b",[])),
+ <<"axc">> = iolist_to_binary(re:replace("axc","abc","O&RYgOFW&\\1b",[global])),
+ <<"abx">> = iolist_to_binary(re:replace("abx","abc","\\1wEEGj\\1Pu\\1E",[])),
+ <<"abx">> = iolist_to_binary(re:replace("abx","abc","\\1wEEGj\\1Pu\\1E",[global])),
+ <<"HnabcabcrHTQ">> = iolist_to_binary(re:replace("abc","ab*c","Hn&&rHTQ",[])),
+ <<"HnabcabcrHTQ">> = iolist_to_binary(re:replace("abc","ab*c","Hn&&rHTQ",[global])),
+ <<"xTpXkabc">> = iolist_to_binary(re:replace("abc","ab*bc","xTpXk&",[])),
+ <<"xTpXkabc">> = iolist_to_binary(re:replace("abc","ab*bc","xTpXk&",[global])),
+ <<"xLoabbchcabbckehh">> = iolist_to_binary(re:replace("abbc","ab*bc","xLo&hc&k\\1ehh",[])),
+ <<"xLoabbchcabbckehh">> = iolist_to_binary(re:replace("abbc","ab*bc","xLo&hc&k\\1ehh",[global])),
+ <<"Tkaj">> = iolist_to_binary(re:replace("abbbbc","ab*bc","Tkaj",[])),
+ <<"Tkaj">> = iolist_to_binary(re:replace("abbbbc","ab*bc","Tkaj",[global])),
+ <<"KJCYEgbbbbc">> = iolist_to_binary(re:replace("abbbbc",".{1}","\\1KJCYEg",[])),
+ <<"KJCYEgKJCYEgKJCYEgKJCYEgKJCYEgKJCYEg">> = iolist_to_binary(re:replace("abbbbc",".{1}","\\1KJCYEg",[global])),
+ <<"XabbbOSpFbFfabbbbc">> = iolist_to_binary(re:replace("abbbbc",".{3,4}","X&O\\1SpFbFf&",[])),
+ <<"XabbbOSpFbFfabbbbc">> = iolist_to_binary(re:replace("abbbbc",".{3,4}","X&O\\1SpFbFf&",[global])),
+ <<"FMabbbbcELDoDirqkHb">> = iolist_to_binary(re:replace("abbbbc","ab{0,}bc","FM&ELDoDirqkHb",[])),
+ <<"FMabbbbcELDoDirqkHb">> = iolist_to_binary(re:replace("abbbbc","ab{0,}bc","FM&ELDoDirqkHb",[global])),
+ <<"nVWfSGeKlL">> = iolist_to_binary(re:replace("abbc","ab+bc","n\\1VWfSGe\\1KlL",[])),
+ <<"nVWfSGeKlL">> = iolist_to_binary(re:replace("abbc","ab+bc","n\\1VWfSGe\\1KlL",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","\\1jmWD&n\\1\\1mX&mJMl\\1X",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","\\1jmWD&n\\1\\1mX&mJMl\\1X",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","ab+bc","\\1&W&Kf&\\1dU&T",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","ab+bc","\\1&W&Kf&\\1dU&T",[global])),
+ <<"abq">> = iolist_to_binary(re:replace("abq","ab+bc","l\\1yn\\1E&P\\1JeWGV",[])),
+ <<"abq">> = iolist_to_binary(re:replace("abq","ab+bc","l\\1yn\\1E&P\\1JeWGV",[global])),
ok.
run15() ->
- <<"GjnPRabbbbcabbbbcANabbbbcH">> = iolist_to_binary(re:replace("abbbbc","ab{1,}bc","Gj\\1nPR&&A\\1N&H",[])),
- <<"GjnPRabbbbcabbbbcANabbbbcH">> = iolist_to_binary(re:replace("abbbbc","ab{1,}bc","Gj\\1nPR&&A\\1N&H",[global])),
- <<"iPhrUY">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","i\\1Phr\\1UY\\1",[])),
- <<"iPhrUY">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","i\\1Phr\\1UY\\1",[global])),
- <<"oBEnPKpabbbbcAUrXVFQn">> = iolist_to_binary(re:replace("abbbbc","ab{3,4}bc","oBEnPK\\1p&AUr\\1X\\1VFQn\\1",[])),
- <<"oBEnPKpabbbbcAUrXVFQn">> = iolist_to_binary(re:replace("abbbbc","ab{3,4}bc","oBEnPK\\1p&AUr\\1X\\1VFQn\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}bc","VJPhAjJ&qt&R",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}bc","VJPhAjJ&qt&R",[global])),
- <<"abq">> = iolist_to_binary(re:replace("abq","ab{4,5}bc","\\1issDnwN",[])),
- <<"abq">> = iolist_to_binary(re:replace("abq","ab{4,5}bc","\\1issDnwN",[global])),
- <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{4,5}bc","&ty&x",[])),
- <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{4,5}bc","&ty&x",[global])),
- <<"UWGc">> = iolist_to_binary(re:replace("abbc","ab?bc","UWGc",[])),
- <<"UWGc">> = iolist_to_binary(re:replace("abbc","ab?bc","UWGc",[global])),
- <<"QpFXHqWog">> = iolist_to_binary(re:replace("abc","ab?bc","QpFXHqWog",[])),
- <<"QpFXHqWog">> = iolist_to_binary(re:replace("abc","ab?bc","QpFXHqWog",[global])),
- <<"lFwRabc">> = iolist_to_binary(re:replace("abc","ab{0,1}bc","lFwR&\\1",[])),
- <<"lFwRabc">> = iolist_to_binary(re:replace("abc","ab{0,1}bc","lFwR&\\1",[global])),
- <<"abcmabcJvgabcabco">> = iolist_to_binary(re:replace("abc","ab?c","&m&Jvg&&\\1\\1o",[])),
- <<"abcmabcJvgabcabco">> = iolist_to_binary(re:replace("abc","ab?c","&m&Jvg&&\\1\\1o",[global])),
- <<"jJ">> = iolist_to_binary(re:replace("abc","ab{0,1}c","jJ",[])),
- <<"jJ">> = iolist_to_binary(re:replace("abc","ab{0,1}c","jJ",[global])),
- <<"uPAtKYsKtqCBkkp">> = iolist_to_binary(re:replace("abc","^abc$","uPAtKYsKtqCBkkp\\1",[])),
- <<"uPAtKYsKtqCBkkp">> = iolist_to_binary(re:replace("abc","^abc$","uPAtKYsKtqCBkkp\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","e\\1XAs",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","e\\1XAs",[global])),
- <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","^abc$","\\1o&fsbP\\1pwbiIRIGb\\1UD",[])),
- <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","^abc$","\\1o&fsbP\\1pwbiIRIGb\\1UD",[global])),
- <<"abcc">> = iolist_to_binary(re:replace("abcc","^abc$","WJthAfXWWmv\\1IWjIe",[])),
- <<"abcc">> = iolist_to_binary(re:replace("abcc","^abc$","WJthAfXWWmv\\1IWjIe",[global])),
- <<"UTlfrQeHrOQCMnfc">> = iolist_to_binary(re:replace("abcc","^abc","UTlfr\\1QeH\\1rOQCMnf",[])),
- <<"UTlfrQeHrOQCMnfc">> = iolist_to_binary(re:replace("abcc","^abc","UTlfr\\1QeH\\1rOQCMnf",[global])),
- <<"aARabcppSYabcEIbcGwjE">> = iolist_to_binary(re:replace("aabc","abc$","\\1AR&ppSY&EIbc\\1G\\1wjE",[])),
- <<"aARabcppSYabcEIbcGwjE">> = iolist_to_binary(re:replace("aabc","abc$","\\1AR&ppSY&EIbc\\1G\\1wjE",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","FnSwJ&tmv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","FnSwJ&tmv",[global])),
- <<"aAmIBNLxa">> = iolist_to_binary(re:replace("aabc","abc$","Am\\1IB\\1NLxa",[])),
- <<"aAmIBNLxa">> = iolist_to_binary(re:replace("aabc","abc$","Am\\1IB\\1NLxa",[global])),
- <<"aabcd">> = iolist_to_binary(re:replace("aabcd","abc$","&EuxC&eEGEWnwI",[])),
- <<"aabcd">> = iolist_to_binary(re:replace("aabcd","abc$","&EuxC&eEGEWnwI",[global])),
- <<"cOryAkFNmtoLruabc">> = iolist_to_binary(re:replace("abc","^","cO\\1r&yAkFNmto\\1Lru&",[])),
- <<"cOryAkFNmtoLruabc">> = iolist_to_binary(re:replace("abc","^","cO\\1r&yAkFNmto\\1Lru&",[global])),
- <<"abcKpXarNeriGOdu">> = iolist_to_binary(re:replace("abc","$","Kp\\1XarNeriGOdu&",[])),
- <<"abcKpXarNeriGOdu">> = iolist_to_binary(re:replace("abc","$","Kp\\1XarNeriGOdu&",[global])),
- <<"FIusabcabcceEbtWBabc">> = iolist_to_binary(re:replace("abc","a.c","FIus&&ceEb\\1tWB&",[])),
- <<"FIusabcabcceEbtWBabc">> = iolist_to_binary(re:replace("abc","a.c","FIus&&ceEb\\1tWB&",[global])),
- <<"KqevmaxcVysaxcPaxc">> = iolist_to_binary(re:replace("axc","a.c","Kqevm&Vys&\\1\\1P&",[])),
- <<"KqevmaxcVysaxcPaxc">> = iolist_to_binary(re:replace("axc","a.c","Kqevm&Vys&\\1\\1P&",[global])),
- <<"xUdGxhaJQaxyzc">> = iolist_to_binary(re:replace("axyzc","a.*c","x\\1UdGxhaJQ&",[])),
- <<"xUdGxhaJQaxyzc">> = iolist_to_binary(re:replace("axyzc","a.*c","x\\1UdGxhaJQ&",[global])),
- <<"abdHpbYpV">> = iolist_to_binary(re:replace("abd","a[bc]d","&Hp\\1bYpV",[])),
- <<"abdHpbYpV">> = iolist_to_binary(re:replace("abd","a[bc]d","&Hp\\1bYpV",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bc]d","J&dGU\\1rioQPR\\1&S&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bc]d","J&dGU\\1rioQPR\\1&S&",[global])),
- <<"axyzd">> = iolist_to_binary(re:replace("axyzd","a[bc]d","LF\\1QgQx\\1kUO&\\1",[])),
- <<"axyzd">> = iolist_to_binary(re:replace("axyzd","a[bc]d","LF\\1QgQx\\1kUO&\\1",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","a[bc]d","tiUJYyxfVfeAM",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","a[bc]d","tiUJYyxfVfeAM",[global])),
- <<"lSBTQLYWjuaceCjDace">> = iolist_to_binary(re:replace("ace","a[b-d]e","lSBTQLYWju&CjD&",[])),
- <<"lSBTQLYWjuaceCjDace">> = iolist_to_binary(re:replace("ace","a[b-d]e","lSBTQLYWju&CjD&",[global])),
- <<"aWEgjXuNyAacQTNVqSl">> = iolist_to_binary(re:replace("aac","a[b-d]","WEgjXuNyA&QTNVqSl",[])),
- <<"aWEgjXuNyAacQTNVqSl">> = iolist_to_binary(re:replace("aac","a[b-d]","WEgjXuNyA&QTNVqSl",[global])),
+ <<"oOAIabbbbcabbbbcabbbbcio">> = iolist_to_binary(re:replace("abbbbc","ab+bc","oOAI&&&io",[])),
+ <<"oOAIabbbbcabbbbcabbbbcio">> = iolist_to_binary(re:replace("abbbbc","ab+bc","oOAI&&&io",[global])),
+ <<"eKDbRMig">> = iolist_to_binary(re:replace("abbbbc","ab{1,}bc","\\1eKDb\\1R\\1Mig",[])),
+ <<"eKDbRMig">> = iolist_to_binary(re:replace("abbbbc","ab{1,}bc","\\1eKDb\\1R\\1Mig",[global])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","&\\1",[])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{1,3}bc","&\\1",[global])),
+ <<"lLsEYiU">> = iolist_to_binary(re:replace("abbbbc","ab{3,4}bc","lLsEYiU",[])),
+ <<"lLsEYiU">> = iolist_to_binary(re:replace("abbbbc","ab{3,4}bc","lLsEYiU",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}bc","K\\1Q\\1Sjr&\\1&e&V\\1TQy",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}bc","K\\1Q\\1Sjr&\\1&e&V\\1TQy",[global])),
+ <<"abq">> = iolist_to_binary(re:replace("abq","ab{4,5}bc","O&C",[])),
+ <<"abq">> = iolist_to_binary(re:replace("abq","ab{4,5}bc","O&C",[global])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{4,5}bc","iqc",[])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","ab{4,5}bc","iqc",[global])),
+ <<"epUFDnxBdDXmIWF">> = iolist_to_binary(re:replace("abbc","ab?bc","epUFDnxBdDXmIW\\1F\\1",[])),
+ <<"epUFDnxBdDXmIWF">> = iolist_to_binary(re:replace("abbc","ab?bc","epUFDnxBdDXmIW\\1F\\1",[global])),
+ <<"WhqERQJGEPXkYabcqW">> = iolist_to_binary(re:replace("abc","ab?bc","Whq\\1ERQJGEPXkY&qW",[])),
+ <<"WhqERQJGEPXkYabcqW">> = iolist_to_binary(re:replace("abc","ab?bc","Whq\\1ERQJGEPXkY&qW",[global])),
+ <<"aabcLmSkjuaNwdKc">> = iolist_to_binary(re:replace("abc","ab{0,1}bc","\\1a&\\1LmSkjuaNwd\\1Kc\\1",[])),
+ <<"aabcLmSkjuaNwdKc">> = iolist_to_binary(re:replace("abc","ab{0,1}bc","\\1a&\\1LmSkjuaNwd\\1Kc\\1",[global])),
+ <<"bpSabcEqqmi">> = iolist_to_binary(re:replace("abc","ab?c","bp\\1S&Eqqmi\\1",[])),
+ <<"bpSabcEqqmi">> = iolist_to_binary(re:replace("abc","ab?c","bp\\1S&Eqqmi\\1",[global])),
+ <<"Clxabc">> = iolist_to_binary(re:replace("abc","ab{0,1}c","Clx&",[])),
+ <<"Clxabc">> = iolist_to_binary(re:replace("abc","ab{0,1}c","Clx&",[global])),
+ <<"SlhQaJwtnpw">> = iolist_to_binary(re:replace("abc","^abc$","Sl\\1h\\1Q\\1aJwtnpw",[])),
+ <<"SlhQaJwtnpw">> = iolist_to_binary(re:replace("abc","^abc$","Sl\\1h\\1Q\\1aJwtnpw",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","eiP",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","eiP",[global])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","^abc$","g\\1Qnq\\1jC&jh\\1wFsOwY\\1",[])),
+ <<"abbbbc">> = iolist_to_binary(re:replace("abbbbc","^abc$","g\\1Qnq\\1jC&jh\\1wFsOwY\\1",[global])),
+ <<"abcc">> = iolist_to_binary(re:replace("abcc","^abc$","CjHXsgNepVYlWp",[])),
+ <<"abcc">> = iolist_to_binary(re:replace("abcc","^abc$","CjHXsgNepVYlWp",[global])),
+ <<"HETabcc">> = iolist_to_binary(re:replace("abcc","^abc","HE\\1T&",[])),
+ <<"HETabcc">> = iolist_to_binary(re:replace("abcc","^abc","HE\\1T&",[global])),
+ <<"aodabcujLupqR">> = iolist_to_binary(re:replace("aabc","abc$","od&ujLupqR",[])),
+ <<"aodabcujLupqR">> = iolist_to_binary(re:replace("aabc","abc$","od&ujLupqR",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","R",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc$","R",[global])),
+ <<"aFvyvrxXtabcs">> = iolist_to_binary(re:replace("aabc","abc$","Fvyvrx\\1Xt&s",[])),
+ <<"aFvyvrxXtabcs">> = iolist_to_binary(re:replace("aabc","abc$","Fvyvrx\\1Xt&s",[global])),
+ <<"aabcd">> = iolist_to_binary(re:replace("aabcd","abc$","Pj\\1wNa&XbegI&F",[])),
+ <<"aabcd">> = iolist_to_binary(re:replace("aabcd","abc$","Pj\\1wNa&XbegI&F",[global])),
+ <<"ABvCLJOpNeVHhabc">> = iolist_to_binary(re:replace("abc","^","ABvC&&LJOpNeVH\\1h",[])),
+ <<"ABvCLJOpNeVHhabc">> = iolist_to_binary(re:replace("abc","^","ABvC&&LJOpNeVH\\1h",[global])),
+ <<"abcJEFEIGYBydFwJM">> = iolist_to_binary(re:replace("abc","$","JEFEIG&&&Y\\1BydFwJM",[])),
+ <<"abcJEFEIGYBydFwJM">> = iolist_to_binary(re:replace("abc","$","JEFEIG&&&Y\\1BydFwJM",[global])),
+ <<"UEUMgabcabclGDFuMsIl">> = iolist_to_binary(re:replace("abc","a.c","UEUMg&&lGDFu\\1MsIl",[])),
+ <<"UEUMgabcabclGDFuMsIl">> = iolist_to_binary(re:replace("abc","a.c","UEUMg&&lGDFu\\1MsIl",[global])),
+ <<"LAYr">> = iolist_to_binary(re:replace("axc","a.c","LAYr",[])),
+ <<"LAYr">> = iolist_to_binary(re:replace("axc","a.c","LAYr",[global])),
+ <<"EoYP">> = iolist_to_binary(re:replace("axyzc","a.*c","EoY\\1P",[])),
+ <<"EoYP">> = iolist_to_binary(re:replace("axyzc","a.*c","EoY\\1P",[global])),
+ <<"qYbmPPabd">> = iolist_to_binary(re:replace("abd","a[bc]d","qYbmPP&",[])),
+ <<"qYbmPPabd">> = iolist_to_binary(re:replace("abd","a[bc]d","qYbmPP&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bc]d","\\1C\\1SFfkHmrCTJ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bc]d","\\1C\\1SFfkHmrCTJ",[global])),
+ <<"axyzd">> = iolist_to_binary(re:replace("axyzd","a[bc]d","J&\\1J&",[])),
+ <<"axyzd">> = iolist_to_binary(re:replace("axyzd","a[bc]d","J&\\1J&",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","a[bc]d","Q&HAQK&t",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","a[bc]d","Q&HAQK&t",[global])),
+ <<"WbKKCNjyC">> = iolist_to_binary(re:replace("ace","a[b-d]e","\\1WbKKCNjyC",[])),
+ <<"WbKKCNjyC">> = iolist_to_binary(re:replace("ace","a[b-d]e","\\1WbKKCNjyC",[global])),
ok.
run16() ->
- <<"qQmna-Ga-a-rA">> = iolist_to_binary(re:replace("a-","a[-b]","q\\1Qmn&G&&rA",[])),
- <<"qQmna-Ga-a-rA">> = iolist_to_binary(re:replace("a-","a[-b]","q\\1Qmn&G&&rA",[global])),
- <<"QJ">> = iolist_to_binary(re:replace("a-","a[b-]","QJ",[])),
- <<"QJ">> = iolist_to_binary(re:replace("a-","a[b-]","QJ",[global])),
- <<"yia]ao">> = iolist_to_binary(re:replace("a]","a]","\\1yi&ao",[])),
- <<"yia]ao">> = iolist_to_binary(re:replace("a]","a]","\\1yi&ao",[global])),
- <<"FfC">> = iolist_to_binary(re:replace("a]b","a[]]b","FfC",[])),
- <<"FfC">> = iolist_to_binary(re:replace("a]b","a[]]b","FfC",[global])),
- <<"oXfcTOWQKFAlvTaedi">> = iolist_to_binary(re:replace("aed","a[^bc]d","oXfcTOWQKFAlvT\\1\\1&i",[])),
- <<"oXfcTOWQKFAlvTaedi">> = iolist_to_binary(re:replace("aed","a[^bc]d","oXfcTOWQKFAlvT\\1\\1&i",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^bc]d","&bDyTqTc",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^bc]d","&bDyTqTc",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","FjC&R\\1",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","FjC&R\\1",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","aENw",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","aENw",[global])),
- <<"adcdOJ">> = iolist_to_binary(re:replace("adc","a[^-b]c","&dOJ",[])),
- <<"adcdOJ">> = iolist_to_binary(re:replace("adc","a[^-b]c","&dOJ",[global])),
- <<"ANuydyM">> = iolist_to_binary(re:replace("adc","a[^]b]c","ANuydyM",[])),
- <<"ANuydyM">> = iolist_to_binary(re:replace("adc","a[^]b]c","ANuydyM",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^]b]c","SweRAVF\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^]b]c","SweRAVF\\1",[global])),
- <<"UoNrja-cLOLdIhqaTGLt">> = iolist_to_binary(re:replace("a-c","a[^]b]c","UoNrj&LOLdIhqaTGLt",[])),
- <<"UoNrja-cLOLdIhqaTGLt">> = iolist_to_binary(re:replace("a-c","a[^]b]c","UoNrj&LOLdIhqaTGLt",[global])),
- <<"a]c">> = iolist_to_binary(re:replace("a]c","a[^]b]c","w&UlR&\\1\\1Oo&I&",[])),
- <<"a]c">> = iolist_to_binary(re:replace("a]c","a[^]b]c","w&UlR&\\1\\1Oo&I&",[global])),
- <<"keSyyVigJfGa-">> = iolist_to_binary(re:replace("a-","\\ba\\b","\\1keSyy\\1VigJfG&",[])),
- <<"keSyyVigJfGa-">> = iolist_to_binary(re:replace("a-","\\ba\\b","\\1keSyy\\1VigJfG&",[global])),
- <<"-QajTaYNwiaOblsalRbJ">> = iolist_to_binary(re:replace("-a","\\ba\\b","Q&jT&YNwiaOb\\1ls&lRbJ",[])),
- <<"-QajTaYNwiaOblsalRbJ">> = iolist_to_binary(re:replace("-a","\\ba\\b","Q&jT&YNwiaOb\\1ls&lRbJ",[global])),
- <<"-jrLliKmS-">> = iolist_to_binary(re:replace("-a-","\\ba\\b","jrLliKm\\1S",[])),
- <<"-jrLliKmS-">> = iolist_to_binary(re:replace("-a-","\\ba\\b","jrLliKm\\1S",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\by\\b","tFe\\1K\\1&P&w",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\by\\b","tFe\\1K\\1&P&w",[global])),
- <<"xy">> = iolist_to_binary(re:replace("xy","\\by\\b","&&cw&p\\1BkixXR",[])),
- <<"xy">> = iolist_to_binary(re:replace("xy","\\by\\b","&&cw&p\\1BkixXR",[global])),
- <<"yz">> = iolist_to_binary(re:replace("yz","\\by\\b","Mlv\\1O",[])),
- <<"yz">> = iolist_to_binary(re:replace("yz","\\by\\b","Mlv\\1O",[global])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","\\by\\b","o&V\\1\\1&vaBPhc&YhjA\\1Hl",[])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","\\by\\b","o&V\\1\\1&vaBPhc&YhjA\\1Hl",[global])),
- <<"*** FEnnRHgdUlleafatdRwilers">> = iolist_to_binary(re:replace("*** Failers","\\Ba\\B","EnnRHgdUlle&f&tdRw",[])),
- <<"*** FEnnRHgdUlleafatdRwilers">> = iolist_to_binary(re:replace("*** Failers","\\Ba\\B","EnnRHgdUlle&f&tdRw",[global])),
- <<"a-">> = iolist_to_binary(re:replace("a-","\\Ba\\B","wXKR&jlEbdM&QBJmvK",[])),
- <<"a-">> = iolist_to_binary(re:replace("a-","\\Ba\\B","wXKR&jlEbdM&QBJmvK",[global])),
- <<"-a">> = iolist_to_binary(re:replace("-a","\\Ba\\B","f\\1dQc",[])),
- <<"-a">> = iolist_to_binary(re:replace("-a","\\Ba\\B","f\\1dQc",[global])),
- <<"-a-">> = iolist_to_binary(re:replace("-a-","\\Ba\\B","WTMu\\1drSum",[])),
- <<"-a-">> = iolist_to_binary(re:replace("-a-","\\Ba\\B","WTMu\\1drSum",[global])),
- <<"xheOtJ">> = iolist_to_binary(re:replace("xy","\\By\\b","\\1heOtJ\\1",[])),
- <<"xheOtJ">> = iolist_to_binary(re:replace("xy","\\By\\b","\\1heOtJ\\1",[global])),
- <<"xYHVuz">> = iolist_to_binary(re:replace("yz","\\by\\B","xYH\\1\\1Vu",[])),
- <<"xYHVuz">> = iolist_to_binary(re:replace("yz","\\by\\B","xYH\\1\\1Vu",[global])),
- <<"xUyfxgltgVyjPz">> = iolist_to_binary(re:replace("xyz","\\By\\B","\\1Uyf\\1xglt\\1gV\\1\\1&jP",[])),
- <<"xUyfxgltgVyjPz">> = iolist_to_binary(re:replace("xyz","\\By\\B","\\1Uyf\\1xglt\\1gV\\1\\1&jP",[global])),
- <<"PqSMLiChcHwx">> = iolist_to_binary(re:replace("a","\\w","PqSMLiChcHwx",[])),
- <<"PqSMLiChcHwx">> = iolist_to_binary(re:replace("a","\\w","PqSMLiChcHwx",[global])),
- <<"Bl">> = iolist_to_binary(re:replace("-","\\W","Bl",[])),
- <<"Bl">> = iolist_to_binary(re:replace("-","\\W","Bl",[global])),
- <<"**rPBnOGDkc** Failers">> = iolist_to_binary(re:replace("*** Failers","\\W","&&\\1rPBnOGDkc",[])),
- <<"**rPBnOGDkc**rPBnOGDkc**rPBnOGDkc rPBnOGDkcFailers">> = iolist_to_binary(re:replace("*** Failers","\\W","&&\\1rPBnOGDkc",[global])),
- <<"rI">> = iolist_to_binary(re:replace("-","\\W","rI",[])),
- <<"rI">> = iolist_to_binary(re:replace("-","\\W","rI",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","\\W","N&\\1h&mf\\1eJ&T",[])),
- <<"a">> = iolist_to_binary(re:replace("a","\\W","N&\\1h&mf\\1eJ&T",[global])),
- <<"Ia bHMFKnjmeDa bNCX">> = iolist_to_binary(re:replace("a b","a\\sb","I&HMFKnjm\\1eD&NCX",[])),
- <<"Ia bHMFKnjmeDa bNCX">> = iolist_to_binary(re:replace("a b","a\\sb","I&HMFKnjm\\1eD&NCX",[global])),
- <<"a-ba-ba-bnaNLABX">> = iolist_to_binary(re:replace("a-b","a\\Sb","&&&naN\\1LABX\\1",[])),
- <<"a-ba-ba-bnaNLABX">> = iolist_to_binary(re:replace("a-b","a\\Sb","&&&naN\\1LABX\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Sb","\\1bI&cDB\\1Bpe",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Sb","\\1bI&cDB\\1Bpe",[global])),
- <<"ILRpJeKfXTxFTY">> = iolist_to_binary(re:replace("a-b","a\\Sb","I\\1L\\1RpJe\\1KfXTxFTY",[])),
- <<"ILRpJeKfXTxFTY">> = iolist_to_binary(re:replace("a-b","a\\Sb","I\\1L\\1RpJe\\1KfXTxFTY",[global])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a\\Sb","\\1ngH\\1OgaFGbI",[])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a\\Sb","\\1ngH\\1OgaFGbI",[global])),
- <<"oOycwxv1FKdF">> = iolist_to_binary(re:replace("1","\\d","oOycwxv&FK\\1dF\\1",[])),
- <<"oOycwxv1FKdF">> = iolist_to_binary(re:replace("1","\\d","oOycwxv&FK\\1dF\\1",[global])),
- <<"YdKRXgdlJSvnIO">> = iolist_to_binary(re:replace("-","\\D","YdKRXgdl\\1JSvnIO",[])),
- <<"YdKRXgdlJSvnIO">> = iolist_to_binary(re:replace("-","\\D","YdKRXgdl\\1JSvnIO",[global])),
- <<"lxE*lk*V** Failers">> = iolist_to_binary(re:replace("*** Failers","\\D","lx\\1E&lk&V",[])),
- <<"lxE*lk*VlxE*lk*VlxE*lk*VlxE lk VlxEFlkFVlxEalkaVlxEilkiVlxEllklVlxEelkeVlxErlkrVlxEslksV">> = iolist_to_binary(re:replace("*** Failers","\\D","lx\\1E&lk&V",[global])),
- <<"JRKLvPGXEGf-a">> = iolist_to_binary(re:replace("-","\\D","JRK\\1LvPG\\1XEGf&a",[])),
- <<"JRKLvPGXEGf-a">> = iolist_to_binary(re:replace("-","\\D","JRK\\1LvPG\\1XEGf&a",[global])),
- <<"1">> = iolist_to_binary(re:replace("1","\\D","aTH&MPmaOF\\1\\1r",[])),
- <<"1">> = iolist_to_binary(re:replace("1","\\D","aTH&MPmaOF\\1\\1r",[global])),
- <<"MGKXIbaJcyWbp">> = iolist_to_binary(re:replace("a","[\\w]","MGKXIb&Jc\\1yWbp",[])),
- <<"MGKXIbaJcyWbp">> = iolist_to_binary(re:replace("a","[\\w]","MGKXIb&Jc\\1yWbp",[global])),
+ <<"aTHHUYacigdJtNac">> = iolist_to_binary(re:replace("aac","a[b-d]","THHUY&igdJt\\1N&",[])),
+ <<"aTHHUYacigdJtNac">> = iolist_to_binary(re:replace("aac","a[b-d]","THHUY&igdJt\\1N&",[global])),
+ <<"JdNla-BpgoAJobghPXXK">> = iolist_to_binary(re:replace("a-","a[-b]","JdNl&BpgoAJobghPXXK",[])),
+ <<"JdNla-BpgoAJobghPXXK">> = iolist_to_binary(re:replace("a-","a[-b]","JdNl&BpgoAJobghPXXK",[global])),
+ <<"ka-a-">> = iolist_to_binary(re:replace("a-","a[b-]","k&&\\1",[])),
+ <<"ka-a-">> = iolist_to_binary(re:replace("a-","a[b-]","k&&\\1",[global])),
+ <<"hXKn">> = iolist_to_binary(re:replace("a]","a]","hXKn",[])),
+ <<"hXKn">> = iolist_to_binary(re:replace("a]","a]","hXKn",[global])),
+ <<"Mpa]bJQ">> = iolist_to_binary(re:replace("a]b","a[]]b","\\1Mp&JQ",[])),
+ <<"Mpa]bJQ">> = iolist_to_binary(re:replace("a]b","a[]]b","\\1Mp&JQ",[global])),
+ <<"BqnaedgwNu">> = iolist_to_binary(re:replace("aed","a[^bc]d","Bqn\\1&gw\\1Nu",[])),
+ <<"BqnaedgwNu">> = iolist_to_binary(re:replace("aed","a[^bc]d","Bqn\\1&gw\\1Nu",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^bc]d","\\1BbD&v",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^bc]d","\\1BbD&v",[global])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","wsTKas&SjtLxJf\\1\\1hMC",[])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","wsTKas&SjtLxJf\\1\\1hMC",[global])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","NeK&\\1F",[])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a[^bc]d","NeK&\\1F",[global])),
+ <<"hLeXkpLIvadcW">> = iolist_to_binary(re:replace("adc","a[^-b]c","hLeXkpLIv&W",[])),
+ <<"hLeXkpLIvadcW">> = iolist_to_binary(re:replace("adc","a[^-b]c","hLeXkpLIv&W",[global])),
+ <<"adcadc">> = iolist_to_binary(re:replace("adc","a[^]b]c","&&\\1",[])),
+ <<"adcadc">> = iolist_to_binary(re:replace("adc","a[^]b]c","&&\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^]b]c","aELhPe\\1sLAnpxtxB",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^]b]c","aELhPe\\1sLAnpxtxB",[global])),
+ <<"SKH">> = iolist_to_binary(re:replace("a-c","a[^]b]c","SKH",[])),
+ <<"SKH">> = iolist_to_binary(re:replace("a-c","a[^]b]c","SKH",[global])),
+ <<"a]c">> = iolist_to_binary(re:replace("a]c","a[^]b]c","IB",[])),
+ <<"a]c">> = iolist_to_binary(re:replace("a]c","a[^]b]c","IB",[global])),
+ <<"COboVXMd-">> = iolist_to_binary(re:replace("a-","\\ba\\b","COboVXMd",[])),
+ <<"COboVXMd-">> = iolist_to_binary(re:replace("a-","\\ba\\b","COboVXMd",[global])),
+ <<"-ydGtl">> = iolist_to_binary(re:replace("-a","\\ba\\b","\\1ydGtl",[])),
+ <<"-ydGtl">> = iolist_to_binary(re:replace("-a","\\ba\\b","\\1ydGtl",[global])),
+ <<"-awxvweaXGdlD-">> = iolist_to_binary(re:replace("-a-","\\ba\\b","&wx\\1vweaX\\1GdlD",[])),
+ <<"-awxvweaXGdlD-">> = iolist_to_binary(re:replace("-a-","\\ba\\b","&wx\\1vweaX\\1GdlD",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\by\\b","V&Yu",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\by\\b","V&Yu",[global])),
+ <<"xy">> = iolist_to_binary(re:replace("xy","\\by\\b","&uQiJpvCwJtLUQ&n&e",[])),
+ <<"xy">> = iolist_to_binary(re:replace("xy","\\by\\b","&uQiJpvCwJtLUQ&n&e",[global])),
+ <<"yz">> = iolist_to_binary(re:replace("yz","\\by\\b","JnTOLWX\\1&mW&F\\1",[])),
+ <<"yz">> = iolist_to_binary(re:replace("yz","\\by\\b","JnTOLWX\\1&mW&F\\1",[global])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","\\by\\b","y&h\\1&u",[])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","\\by\\b","y&h\\1&u",[global])),
+ <<"*** Fdailers">> = iolist_to_binary(re:replace("*** Failers","\\Ba\\B","d&\\1",[])),
+ <<"*** Fdailers">> = iolist_to_binary(re:replace("*** Failers","\\Ba\\B","d&\\1",[global])),
+ <<"a-">> = iolist_to_binary(re:replace("a-","\\Ba\\B","sfBOnWLWdrl",[])),
+ <<"a-">> = iolist_to_binary(re:replace("a-","\\Ba\\B","sfBOnWLWdrl",[global])),
+ <<"-a">> = iolist_to_binary(re:replace("-a","\\Ba\\B","kQ",[])),
+ <<"-a">> = iolist_to_binary(re:replace("-a","\\Ba\\B","kQ",[global])),
+ <<"-a-">> = iolist_to_binary(re:replace("-a-","\\Ba\\B","&jYf&iIQh\\1",[])),
+ <<"-a-">> = iolist_to_binary(re:replace("-a-","\\Ba\\B","&jYf&iIQh\\1",[global])),
+ <<"xyyEyso">> = iolist_to_binary(re:replace("xy","\\By\\b","y&E&so",[])),
+ <<"xyyEyso">> = iolist_to_binary(re:replace("xy","\\By\\b","y&E&so",[global])),
+ <<"yymuiNz">> = iolist_to_binary(re:replace("yz","\\by\\B","\\1&&\\1muiN",[])),
+ <<"yymuiNz">> = iolist_to_binary(re:replace("yz","\\by\\B","\\1&&\\1muiN",[global])),
+ <<"xUyz">> = iolist_to_binary(re:replace("xyz","\\By\\B","U&",[])),
+ <<"xUyz">> = iolist_to_binary(re:replace("xyz","\\By\\B","U&",[global])),
+ <<"yohceaHvakiaxgGAPsc">> = iolist_to_binary(re:replace("a","\\w","yohce&Hv&ki&xgGAPsc",[])),
+ <<"yohceaHvakiaxgGAPsc">> = iolist_to_binary(re:replace("a","\\w","yohce&Hv&ki&xgGAPsc",[global])),
+ <<"t--q">> = iolist_to_binary(re:replace("-","\\W","t&&q",[])),
+ <<"t--q">> = iolist_to_binary(re:replace("-","\\W","t&&q",[global])),
+ <<"wSEi*VKdBOyBw** Failers">> = iolist_to_binary(re:replace("*** Failers","\\W","w\\1SEi\\1&VKdBOyB\\1w",[])),
+ <<"wSEi*VKdBOyBwwSEi*VKdBOyBwwSEi*VKdBOyBwwSEi VKdBOyBwFailers">> = iolist_to_binary(re:replace("*** Failers","\\W","w\\1SEi\\1&VKdBOyB\\1w",[global])),
+ <<"nI-H">> = iolist_to_binary(re:replace("-","\\W","nI&H",[])),
+ <<"nI-H">> = iolist_to_binary(re:replace("-","\\W","nI&H",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","\\W","kxKDSoW",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","\\W","kxKDSoW",[global])),
+ <<"d">> = iolist_to_binary(re:replace("a b","a\\sb","d",[])),
+ <<"d">> = iolist_to_binary(re:replace("a b","a\\sb","d",[global])),
+ <<"IQboAe">> = iolist_to_binary(re:replace("a-b","a\\Sb","IQboAe",[])),
+ <<"IQboAe">> = iolist_to_binary(re:replace("a-b","a\\Sb","IQboAe",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Sb","Ii&smqXytI\\1w\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Sb","Ii&smqXytI\\1w\\1",[global])),
+ <<"fXa-bEijX">> = iolist_to_binary(re:replace("a-b","a\\Sb","fX&EijX",[])),
+ <<"fXa-bEijX">> = iolist_to_binary(re:replace("a-b","a\\Sb","fX&EijX",[global])),
+ <<"a b">> = iolist_to_binary(re:replace("a b","a\\Sb","u&WnxKsF\\1EaL\\1",[])),
+ <<"a b">> = iolist_to_binary(re:replace("a b","a\\Sb","u&WnxKsF\\1EaL\\1",[global])),
+ <<"VOo1">> = iolist_to_binary(re:replace("1","\\d","VOo&",[])),
+ <<"VOo1">> = iolist_to_binary(re:replace("1","\\d","VOo&",[global])),
+ <<"--GGkJ---qWNn">> = iolist_to_binary(re:replace("-","\\D","&&GG\\1k\\1J&&&qWNn",[])),
+ <<"--GGkJ---qWNn">> = iolist_to_binary(re:replace("-","\\D","&&GG\\1k\\1J&&&qWNn",[global])),
+ <<"QOREoyFBbWu** Failers">> = iolist_to_binary(re:replace("*** Failers","\\D","QOREo\\1y\\1FBbWu",[])),
+ <<"QOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWuQOREoyFBbWu">> = iolist_to_binary(re:replace("*** Failers","\\D","QOREo\\1y\\1FBbWu",[global])),
+ <<"Pcnt-nSAvUGvRwiwct">> = iolist_to_binary(re:replace("-","\\D","\\1Pcn\\1t&nSAvUGvRwiwct",[])),
+ <<"Pcnt-nSAvUGvRwiwct">> = iolist_to_binary(re:replace("-","\\D","\\1Pcn\\1t&nSAvUGvRwiwct",[global])),
+ <<"1">> = iolist_to_binary(re:replace("1","\\D","WOH\\1UuhFQnuf&u",[])),
+ <<"1">> = iolist_to_binary(re:replace("1","\\D","WOH\\1UuhFQnuf&u",[global])),
ok.
run17() ->
- <<"YqG">> = iolist_to_binary(re:replace("-","[\\W]","YqG",[])),
- <<"YqG">> = iolist_to_binary(re:replace("-","[\\W]","YqG",[global])),
- <<"*nxdd*geTTc** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\W]","&nx\\1dd&geTTc",[])),
- <<"*nxdd*geTTc*nxdd*geTTc*nxdd*geTTc nxdd geTTcFailers">> = iolist_to_binary(re:replace("*** Failers","[\\W]","&nx\\1dd&geTTc",[global])),
- <<"iqqe">> = iolist_to_binary(re:replace("-","[\\W]","iqqe",[])),
- <<"iqqe">> = iolist_to_binary(re:replace("-","[\\W]","iqqe",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","[\\W]","wwF\\1Q",[])),
- <<"a">> = iolist_to_binary(re:replace("a","[\\W]","wwF\\1Q",[global])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a[\\s]b","&",[])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a[\\s]b","&",[global])),
- <<"SPqkyVa-bP">> = iolist_to_binary(re:replace("a-b","a[\\S]b","SPqkyV&P",[])),
- <<"SPqkyVa-bP">> = iolist_to_binary(re:replace("a-b","a[\\S]b","SPqkyV&P",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[\\S]b","\\1FDeRsoK&IAJD&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[\\S]b","\\1FDeRsoK&IAJD&",[global])),
- <<"VDpMoFi">> = iolist_to_binary(re:replace("a-b","a[\\S]b","VDpMoFi",[])),
- <<"VDpMoFi">> = iolist_to_binary(re:replace("a-b","a[\\S]b","VDpMoFi",[global])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a[\\S]b","r&\\1C&XvsB&",[])),
- <<"a b">> = iolist_to_binary(re:replace("a b","a[\\S]b","r&\\1C&XvsB&",[global])),
- <<"oHYpsb1fsM1IhN1n">> = iolist_to_binary(re:replace("1","[\\d]","oHY\\1psb&fsM&IhN\\1&n",[])),
- <<"oHYpsb1fsM1IhN1n">> = iolist_to_binary(re:replace("1","[\\d]","oHY\\1psb&fsM&IhN\\1&n",[global])),
- <<"-KJX">> = iolist_to_binary(re:replace("-","[\\D]","&KJX",[])),
- <<"-KJX">> = iolist_to_binary(re:replace("-","[\\D]","&KJX",[global])),
- <<"S*I*KU** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\D]","S&\\1I&KU",[])),
- <<"S*I*KUS*I*KUS*I*KUS I KUSFIFKUSaIaKUSiIiKUSlIlKUSeIeKUSrIrKUSsIsKU">> = iolist_to_binary(re:replace("*** Failers","[\\D]","S&\\1I&KU",[global])),
- <<"WSKtUY">> = iolist_to_binary(re:replace("-","[\\D]","WSKtUY",[])),
- <<"WSKtUY">> = iolist_to_binary(re:replace("-","[\\D]","WSKtUY",[global])),
- <<"1">> = iolist_to_binary(re:replace("1","[\\D]","B\\1iB",[])),
- <<"1">> = iolist_to_binary(re:replace("1","[\\D]","B\\1iB",[global])),
- <<"bkabprVc">> = iolist_to_binary(re:replace("abc","ab|cd","bk&prV",[])),
- <<"bkabprVc">> = iolist_to_binary(re:replace("abc","ab|cd","bk&prV",[global])),
- <<"oxPHxnpgpabTabDdTmMcd">> = iolist_to_binary(re:replace("abcd","ab|cd","oxPHxnpgp&T&DdTmM",[])),
- <<"oxPHxnpgpabTabDdTmMoxPHxnpgpcdTcdDdTmM">> = iolist_to_binary(re:replace("abcd","ab|cd","oxPHxnpgp&T&DdTmM",[global])),
- <<"dpfHboradY">> = iolist_to_binary(re:replace("def","()ef","pfH\\1bor\\1adY",[])),
- <<"dpfHboradY">> = iolist_to_binary(re:replace("def","()ef","pfH\\1bor\\1adY",[global])),
- <<"Uma(b">> = iolist_to_binary(re:replace("a(b","a\\(b","Um&",[])),
- <<"Uma(b">> = iolist_to_binary(re:replace("a(b","a\\(b","Um&",[global])),
- <<"YyxabuKXMauxXBpkrd">> = iolist_to_binary(re:replace("ab","a\\(*b","Yyx&uKXMauxXBpkrd",[])),
- <<"YyxabuKXMauxXBpkrd">> = iolist_to_binary(re:replace("ab","a\\(*b","Yyx&uKXMauxXBpkrd",[global])),
- <<"pDTwGyKkiLEWnnefa((b">> = iolist_to_binary(re:replace("a((b","a\\(*b","pDTwGyKkiLEWnnef&",[])),
- <<"pDTwGyKkiLEWnnefa((b">> = iolist_to_binary(re:replace("a((b","a\\(*b","pDTwGyKkiLEWnnef&",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","a\\\\b","G\\1H\\1qrOi&\\1&aUty",[])),
- <<"a">> = iolist_to_binary(re:replace("a","a\\\\b","G\\1H\\1qrOi&\\1&aUty",[global])),
- <<"eaywaaaVSCBcjnuIfRXabc">> = iolist_to_binary(re:replace("abc","((a))","e&yw&\\1&VSCBcjnuIfRX\\1",[])),
- <<"eaywaaaVSCBcjnuIfRXabc">> = iolist_to_binary(re:replace("abc","((a))","e&yw&\\1&VSCBcjnuIfRX\\1",[global])),
- <<"IbabcEabc">> = iolist_to_binary(re:replace("abc","(a)b(c)","Ib&E&",[])),
- <<"IbabcEabc">> = iolist_to_binary(re:replace("abc","(a)b(c)","Ib&E&",[global])),
- <<"aabbgflabcrIsYKabcUvEj">> = iolist_to_binary(re:replace("aabbabc","a+b+c","gf\\1\\1l&rIsYK&UvEj",[])),
- <<"aabbgflabcrIsYKabcUvEj">> = iolist_to_binary(re:replace("aabbabc","a+b+c","gf\\1\\1l&rIsYK&UvEj",[global])),
- <<"aabbUMebt">> = iolist_to_binary(re:replace("aabbabc","a{1,}b{1,}c","UMeb\\1t",[])),
- <<"aabbUMebt">> = iolist_to_binary(re:replace("aabbabc","a{1,}b{1,}c","UMeb\\1t",[global])),
- <<"pPfLrjPUFRjvuHjcjabc">> = iolist_to_binary(re:replace("abcabc","a.+?c","pPf\\1LrjPUFRjvuH\\1jcj\\1",[])),
- <<"pPfLrjPUFRjvuHjcjpPfLrjPUFRjvuHjcj">> = iolist_to_binary(re:replace("abcabc","a.+?c","pPf\\1LrjPUFRjvuH\\1jcj\\1",[global])),
- <<"abocUabav">> = iolist_to_binary(re:replace("ab","(a+|b)*","&ocU&av",[])),
- <<"abocUabavocUav">> = iolist_to_binary(re:replace("ab","(a+|b)*","&ocU&av",[global])),
- <<"FWabLo">> = iolist_to_binary(re:replace("ab","(a+|b){0,}","FW&Lo",[])),
- <<"FWabLoFWLo">> = iolist_to_binary(re:replace("ab","(a+|b){0,}","FW&Lo",[global])),
- <<"EGbhiYYab">> = iolist_to_binary(re:replace("ab","(a+|b)+","EG\\1hiYY&",[])),
- <<"EGbhiYYab">> = iolist_to_binary(re:replace("ab","(a+|b)+","EG\\1hiYY&",[global])),
- <<"jbtiMbbNbCoAUbUC">> = iolist_to_binary(re:replace("ab","(a+|b){1,}","j\\1tiM\\1\\1N\\1CoAU\\1UC",[])),
- <<"jbtiMbbNbCoAUbUC">> = iolist_to_binary(re:replace("ab","(a+|b){1,}","j\\1tiM\\1\\1N\\1CoAU\\1UC",[global])),
+ <<"ayglGX">> = iolist_to_binary(re:replace("a","[\\w]","&yglGX",[])),
+ <<"ayglGX">> = iolist_to_binary(re:replace("a","[\\w]","&yglGX",[global])),
+ <<"xHBNG-KPNeTiy--ANU">> = iolist_to_binary(re:replace("-","[\\W]","\\1xHBNG&KPNeTiy&&ANU",[])),
+ <<"xHBNG-KPNeTiy--ANU">> = iolist_to_binary(re:replace("-","[\\W]","\\1xHBNG&KPNeTiy&&ANU",[global])),
+ <<"dLaJCwC** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\W]","dLaJCwC",[])),
+ <<"dLaJCwCdLaJCwCdLaJCwCdLaJCwCFailers">> = iolist_to_binary(re:replace("*** Failers","[\\W]","dLaJCwC",[global])),
+ <<"wRDLkv-">> = iolist_to_binary(re:replace("-","[\\W]","wRDLkv\\1&",[])),
+ <<"wRDLkv-">> = iolist_to_binary(re:replace("-","[\\W]","wRDLkv\\1&",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","[\\W]","y&sFW&WNGfXd\\1gihko&",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","[\\W]","y&sFW&WNGfXd\\1gihko&",[global])),
+ <<"PTJaa bD">> = iolist_to_binary(re:replace("a b","a[\\s]b","PT\\1Ja&D",[])),
+ <<"PTJaa bD">> = iolist_to_binary(re:replace("a b","a[\\s]b","PT\\1Ja&D",[global])),
+ <<"a-bDGOD">> = iolist_to_binary(re:replace("a-b","a[\\S]b","&DGOD",[])),
+ <<"a-bDGOD">> = iolist_to_binary(re:replace("a-b","a[\\S]b","&DGOD",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[\\S]b","KI\\1qEIlJv\\1cnqM&pJC\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[\\S]b","KI\\1qEIlJv\\1cnqM&pJC\\1",[global])),
+ <<"gSDxa-bBtYNus">> = iolist_to_binary(re:replace("a-b","a[\\S]b","gSDx&BtYNus",[])),
+ <<"gSDxa-bBtYNus">> = iolist_to_binary(re:replace("a-b","a[\\S]b","gSDx&BtYNus",[global])),
+ <<"a b">> = iolist_to_binary(re:replace("a b","a[\\S]b","&h",[])),
+ <<"a b">> = iolist_to_binary(re:replace("a b","a[\\S]b","&h",[global])),
+ <<"ykt1W1">> = iolist_to_binary(re:replace("1","[\\d]","ykt&W&",[])),
+ <<"ykt1W1">> = iolist_to_binary(re:replace("1","[\\d]","ykt&W&",[global])),
+ <<"-a">> = iolist_to_binary(re:replace("-","[\\D]","&a",[])),
+ <<"-a">> = iolist_to_binary(re:replace("-","[\\D]","&a",[global])),
+ <<"*WbIHLJ** Failers">> = iolist_to_binary(re:replace("*** Failers","[\\D]","&WbIHLJ",[])),
+ <<"*WbIHLJ*WbIHLJ*WbIHLJ WbIHLJFWbIHLJaWbIHLJiWbIHLJlWbIHLJeWbIHLJrWbIHLJsWbIHLJ">> = iolist_to_binary(re:replace("*** Failers","[\\D]","&WbIHLJ",[global])),
+ <<"-ktR-">> = iolist_to_binary(re:replace("-","[\\D]","&kt\\1\\1R&",[])),
+ <<"-ktR-">> = iolist_to_binary(re:replace("-","[\\D]","&kt\\1\\1R&",[global])),
+ <<"1">> = iolist_to_binary(re:replace("1","[\\D]","ux",[])),
+ <<"1">> = iolist_to_binary(re:replace("1","[\\D]","ux",[global])),
+ <<"qKHabdvc">> = iolist_to_binary(re:replace("abc","ab|cd","qKH&dv",[])),
+ <<"qKHabdvc">> = iolist_to_binary(re:replace("abc","ab|cd","qKH&dv",[global])),
+ <<"DUTiacd">> = iolist_to_binary(re:replace("abcd","ab|cd","DUTia",[])),
+ <<"DUTiaDUTia">> = iolist_to_binary(re:replace("abcd","ab|cd","DUTia",[global])),
+ <<"dydMawOaiUefuVTct">> = iolist_to_binary(re:replace("def","()ef","ydMawOai\\1U&\\1uVTct",[])),
+ <<"dydMawOaiUefuVTct">> = iolist_to_binary(re:replace("def","()ef","ydMawOai\\1U&\\1uVTct",[global])),
+ <<"sca(bMyXpsUtrgSD">> = iolist_to_binary(re:replace("a(b","a\\(b","sc&MyXpsUtrgSD",[])),
+ <<"sca(bMyXpsUtrgSD">> = iolist_to_binary(re:replace("a(b","a\\(b","sc&MyXpsUtrgSD",[global])),
+ <<"tkabU">> = iolist_to_binary(re:replace("ab","a\\(*b","tk&U\\1",[])),
+ <<"tkabU">> = iolist_to_binary(re:replace("ab","a\\(*b","tk&U\\1",[global])),
+ <<"dETFop">> = iolist_to_binary(re:replace("a((b","a\\(*b","dE\\1TFop\\1",[])),
+ <<"dETFop">> = iolist_to_binary(re:replace("a((b","a\\(*b","dE\\1TFop\\1",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","a\\\\b","&wTiaRcRV",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","a\\\\b","&wTiaRcRV",[global])),
+ <<"aDOaQaITtabc">> = iolist_to_binary(re:replace("abc","((a))","\\1DO\\1Q&ITt&",[])),
+ <<"aDOaQaITtabc">> = iolist_to_binary(re:replace("abc","((a))","\\1DO\\1Q&ITt&",[global])),
+ <<"SQSxbQRhSUBA">> = iolist_to_binary(re:replace("abc","(a)b(c)","SQSxbQRhSUBA",[])),
+ <<"SQSxbQRhSUBA">> = iolist_to_binary(re:replace("abc","(a)b(c)","SQSxbQRhSUBA",[global])),
+ <<"aabbKDx">> = iolist_to_binary(re:replace("aabbabc","a+b+c","KDx",[])),
+ <<"aabbKDx">> = iolist_to_binary(re:replace("aabbabc","a+b+c","KDx",[global])),
+ <<"aabbabcVFjoRUjDtvnALeSGQ">> = iolist_to_binary(re:replace("aabbabc","a{1,}b{1,}c","&VFjoRU\\1jDtvnALeSGQ",[])),
+ <<"aabbabcVFjoRUjDtvnALeSGQ">> = iolist_to_binary(re:replace("aabbabc","a{1,}b{1,}c","&VFjoRU\\1jDtvnALeSGQ",[global])),
+ <<"abcWvfQRkKyUAabc">> = iolist_to_binary(re:replace("abcabc","a.+?c","&WvfQRkK\\1y\\1UA",[])),
+ <<"abcWvfQRkKyUAabcWvfQRkKyUA">> = iolist_to_binary(re:replace("abcabc","a.+?c","&WvfQRkK\\1y\\1UA",[global])),
+ <<"jiaeNJbKxbe">> = iolist_to_binary(re:replace("ab","(a+|b)*","jiaeNJ\\1Kx\\1e",[])),
+ <<"jiaeNJbKxbejiaeNJKxe">> = iolist_to_binary(re:replace("ab","(a+|b)*","jiaeNJ\\1Kx\\1e",[global])),
+ <<"EVnwucab">> = iolist_to_binary(re:replace("ab","(a+|b){0,}","EVnwuc&",[])),
+ <<"EVnwucabEVnwuc">> = iolist_to_binary(re:replace("ab","(a+|b){0,}","EVnwuc&",[global])),
+ <<"aKTbabLK">> = iolist_to_binary(re:replace("ab","(a+|b)+","aKT\\1&LK",[])),
+ <<"aKTbabLK">> = iolist_to_binary(re:replace("ab","(a+|b)+","aKT\\1&LK",[global])),
ok.
run18() ->
- <<"aLWaSkPahb">> = iolist_to_binary(re:replace("ab","(a+|b)?","\\1LW\\1SkP&h",[])),
- <<"aLWaSkPahbLWbSkPbhLWSkPh">> = iolist_to_binary(re:replace("ab","(a+|b)?","\\1LW\\1SkP&h",[global])),
- <<"Aab">> = iolist_to_binary(re:replace("ab","(a+|b){0,1}","A\\1",[])),
- <<"AaAbA">> = iolist_to_binary(re:replace("ab","(a+|b){0,1}","A\\1",[global])),
- <<"QOcdemOcded">> = iolist_to_binary(re:replace("cde","[^ab]*","QO&mO&d",[])),
- <<"QOcdemOcdedQOmOd">> = iolist_to_binary(re:replace("cde","[^ab]*","QO&mO&d",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","iTWYAHkkEiJ&r",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","iTWYAHkkEiJ&r",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","abc","Q",[])),
- <<"b">> = iolist_to_binary(re:replace("b","abc","Q",[global])),
- <<"nboabbbcdffWetJfpMLDkabbbcdjOabbbcd">> = iolist_to_binary(re:replace("abbbcd","([abc])*d","nbo&ffWetJfpMLDk&jO&",[])),
- <<"nboabbbcdffWetJfpMLDkabbbcdjOabbbcd">> = iolist_to_binary(re:replace("abbbcd","([abc])*d","nbo&ffWetJfpMLDk&jO&",[global])),
- <<"JaabcduaabcdVPsa">> = iolist_to_binary(re:replace("abcd","([abc])*bcd","J\\1&ua&VPs\\1",[])),
- <<"JaabcduaabcdVPsa">> = iolist_to_binary(re:replace("abcd","([abc])*bcd","J\\1&ua&VPs\\1",[global])),
- <<"e">> = iolist_to_binary(re:replace("e","a|b|c|d|e","&",[])),
- <<"e">> = iolist_to_binary(re:replace("e","a|b|c|d|e","&",[global])),
- <<"kefefAeXq">> = iolist_to_binary(re:replace("ef","(a|b|c|d|e)f","k&&A\\1Xq",[])),
- <<"kefefAeXq">> = iolist_to_binary(re:replace("ef","(a|b|c|d|e)f","k&&A\\1Xq",[global])),
- <<"fsGDN">> = iolist_to_binary(re:replace("abcdefg","abcd*efg","fsG\\1D\\1\\1N\\1",[])),
- <<"fsGDN">> = iolist_to_binary(re:replace("abcdefg","abcd*efg","fsG\\1D\\1\\1N\\1",[global])),
- <<"xThMpLDjpnyabbbz">> = iolist_to_binary(re:replace("xabyabbbz","ab*","T\\1hMpLDjpn",[])),
- <<"xThMpLDjpnyThMpLDjpnz">> = iolist_to_binary(re:replace("xabyabbbz","ab*","T\\1hMpLDjpn",[global])),
- <<"xqjaJaVJVyabbbz">> = iolist_to_binary(re:replace("xayabbbz","ab*","qj&J&VJV",[])),
- <<"xqjaJaVJVyqjabbbJabbbVJVz">> = iolist_to_binary(re:replace("xayabbbz","ab*","qj&J&VJV",[global])),
- <<"abCcdeQnNecduqUkMSfcdGcdecdeh">> = iolist_to_binary(re:replace("abcde","(ab|cd)e","C&QnNe\\1uqUkMSf\\1G&&h",[])),
- <<"abCcdeQnNecduqUkMSfcdGcdecdeh">> = iolist_to_binary(re:replace("abcde","(ab|cd)e","C&QnNe\\1uqUkMSf\\1G&&h",[global])),
- <<"gJyOb">> = iolist_to_binary(re:replace("hij","[abhgefdc]ij","gJyOb",[])),
- <<"gJyOb">> = iolist_to_binary(re:replace("hij","[abhgefdc]ij","gJyOb",[global])),
- <<"abcdGbYcPqM">> = iolist_to_binary(re:replace("abcdef","(abc|)ef","GbY\\1cPqM",[])),
- <<"abcdGbYcPqM">> = iolist_to_binary(re:replace("abcdef","(abc|)ef","GbY\\1cPqM",[global])),
- <<"aUbcdUBbcdAUpIFAbVerWgt">> = iolist_to_binary(re:replace("abcd","(a|b)c*d","U&UB&AUpIFA\\1VerWgt",[])),
- <<"aUbcdUBbcdAUpIFAbVerWgt">> = iolist_to_binary(re:replace("abcd","(a|b)c*d","U&UB&AUpIFA\\1VerWgt",[global])),
- <<"abckK">> = iolist_to_binary(re:replace("abc","(ab|ab*)bc","&kK",[])),
- <<"abckK">> = iolist_to_binary(re:replace("abc","(ab|ab*)bc","&kK",[global])),
- <<"MFabcMbcbcabcXbcGWabcbc">> = iolist_to_binary(re:replace("abc","a([bc]*)c*","MF&M\\1\\1&X\\1GW&\\1",[])),
- <<"MFabcMbcbcabcXbcGWabcbc">> = iolist_to_binary(re:replace("abc","a([bc]*)c*","MF&M\\1\\1&X\\1GW&\\1",[global])),
- <<"bcEbcyv">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c*d)","\\1E\\1yv",[])),
- <<"bcEbcyv">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c*d)","\\1E\\1yv",[global])),
- <<"HJx">> = iolist_to_binary(re:replace("abcd","a([bc]+)(c*d)","HJx",[])),
- <<"HJx">> = iolist_to_binary(re:replace("abcd","a([bc]+)(c*d)","HJx",[global])),
+ <<"RgGBbwcmabTgNL">> = iolist_to_binary(re:replace("ab","(a+|b){1,}","RgGB\\1wcm&TgNL",[])),
+ <<"RgGBbwcmabTgNL">> = iolist_to_binary(re:replace("ab","(a+|b){1,}","RgGB\\1wcm&TgNL",[global])),
+ <<"TawgaFaOxEylUb">> = iolist_to_binary(re:replace("ab","(a+|b)?","T&wg&F\\1OxEylU",[])),
+ <<"TawgaFaOxEylUTbwgbFbOxEylUTwgFOxEylU">> = iolist_to_binary(re:replace("ab","(a+|b)?","T&wg&F\\1OxEylU",[global])),
+ <<"aaaLnab">> = iolist_to_binary(re:replace("ab","(a+|b){0,1}","\\1&&Ln&",[])),
+ <<"aaaLnabbbLnbLn">> = iolist_to_binary(re:replace("ab","(a+|b){0,1}","\\1&&Ln&",[global])),
+ <<"slxWNnoiUcdeJcdercde">> = iolist_to_binary(re:replace("cde","[^ab]*","s\\1lxW\\1NnoiU\\1&J\\1&r&",[])),
+ <<"slxWNnoiUcdeJcdercdeslxWNnoiUJr">> = iolist_to_binary(re:replace("cde","[^ab]*","s\\1lxW\\1NnoiU\\1&J\\1&r&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","vVEiRHOJeg&j\\1CJbVaYo",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","vVEiRHOJeg&j\\1CJbVaYo",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","abc","G\\1tppsRP\\1RDSBHMk&kQ",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","abc","G\\1tppsRP\\1RDSBHMk&kQ",[global])),
+ <<"clNPcDSOUbWFhRtX">> = iolist_to_binary(re:replace("abbbcd","([abc])*d","\\1lNP\\1DSOUbWFhRtX",[])),
+ <<"clNPcDSOUbWFhRtX">> = iolist_to_binary(re:replace("abbbcd","([abc])*d","\\1lNP\\1DSOUbWFhRtX",[global])),
+ <<"bIaKUaabcdabcdjUqa">> = iolist_to_binary(re:replace("abcd","([abc])*bcd","bI\\1KU\\1&&jUq\\1",[])),
+ <<"bIaKUaabcdabcdjUqa">> = iolist_to_binary(re:replace("abcd","([abc])*bcd","bI\\1KU\\1&&jUq\\1",[global])),
+ <<"vBRef">> = iolist_to_binary(re:replace("e","a|b|c|d|e","vBR&f",[])),
+ <<"vBRef">> = iolist_to_binary(re:replace("e","a|b|c|d|e","vBR&f",[global])),
+ <<"eesSfPHTpUXDPv">> = iolist_to_binary(re:replace("ef","(a|b|c|d|e)f","\\1\\1sSfPHTpUXDPv",[])),
+ <<"eesSfPHTpUXDPv">> = iolist_to_binary(re:replace("ef","(a|b|c|d|e)f","\\1\\1sSfPHTpUXDPv",[global])),
+ <<"srtWRpRn">> = iolist_to_binary(re:replace("abcdefg","abcd*efg","sr\\1tWRpRn",[])),
+ <<"srtWRpRn">> = iolist_to_binary(re:replace("abcdefg","abcd*efg","sr\\1tWRpRn",[global])),
+ <<"xpLuYECabyabbbz">> = iolist_to_binary(re:replace("xabyabbbz","ab*","pLuYEC&",[])),
+ <<"xpLuYECabypLuYECabbbz">> = iolist_to_binary(re:replace("xabyabbbz","ab*","pLuYEC&",[global])),
+ <<"xGaaxBDcnaOuAXyabbbz">> = iolist_to_binary(re:replace("xayabbbz","ab*","G&&xBDc\\1n&O\\1\\1uAX\\1\\1\\1\\1",[])),
+ <<"xGaaxBDcnaOuAXyGabbbabbbxBDcnabbbOuAXz">> = iolist_to_binary(re:replace("xayabbbz","ab*","G&&xBDc\\1n&O\\1\\1uAX\\1\\1\\1\\1",[global])),
+ <<"abJiuiBBGK">> = iolist_to_binary(re:replace("abcde","(ab|cd)e","JiuiBBGK",[])),
+ <<"abJiuiBBGK">> = iolist_to_binary(re:replace("abcde","(ab|cd)e","JiuiBBGK",[global])),
+ <<"QIhijHNIh">> = iolist_to_binary(re:replace("hij","[abhgefdc]ij","QI\\1&HNI\\1h",[])),
+ <<"QIhijHNIh">> = iolist_to_binary(re:replace("hij","[abhgefdc]ij","QI\\1&HNI\\1h",[global])),
+ <<"abcdNy">> = iolist_to_binary(re:replace("abcdef","(abc|)ef","Ny",[])),
+ <<"abcdNy">> = iolist_to_binary(re:replace("abcdef","(abc|)ef","Ny",[global])),
+ <<"ahYR">> = iolist_to_binary(re:replace("abcd","(a|b)c*d","hYR",[])),
+ <<"ahYR">> = iolist_to_binary(re:replace("abcd","(a|b)c*d","hYR",[global])),
+ <<"LaabcUlMoCaAoluf">> = iolist_to_binary(re:replace("abc","(ab|ab*)bc","L\\1&UlMoC\\1Aoluf",[])),
+ <<"LaabcUlMoCaAoluf">> = iolist_to_binary(re:replace("abc","(ab|ab*)bc","L\\1&UlMoC\\1Aoluf",[global])),
+ <<"babcqrDkwikibc">> = iolist_to_binary(re:replace("abc","a([bc]*)c*","b&qrDkwiki\\1",[])),
+ <<"babcqrDkwikibc">> = iolist_to_binary(re:replace("abc","a([bc]*)c*","b&qrDkwiki\\1",[global])),
+ <<"VrVOACabcdHnObcsbc">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c*d)","VrVOAC&HnO\\1s\\1",[])),
+ <<"VrVOACabcdHnObcsbc">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c*d)","VrVOAC&HnO\\1s\\1",[global])),
ok.
run19() ->
- <<"HdbW">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c+d)","Hd\\1W",[])),
- <<"HdbW">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c+d)","Hd\\1W",[global])),
- <<"FqCeJOadcdcdeIvQpadcdcdeadcdcdeadcdcdeH">> = iolist_to_binary(re:replace("adcdcde","a[bcd]*dcdcde","FqCeJO&IvQp\\1\\1&&&H",[])),
- <<"FqCeJOadcdcdeIvQpadcdcdeadcdcdeadcdcdeH">> = iolist_to_binary(re:replace("adcdcde","a[bcd]*dcdcde","FqCeJO&IvQp\\1\\1&&&H",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bcd]+dcdcde","\\1&TNEyDw",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bcd]+dcdcde","\\1&TNEyDw",[global])),
- <<"abcde">> = iolist_to_binary(re:replace("abcde","a[bcd]+dcdcde","PqeS\\1GQJ&vSq&YhS",[])),
- <<"abcde">> = iolist_to_binary(re:replace("abcde","a[bcd]+dcdcde","PqeS\\1GQJ&vSq&YhS",[global])),
- <<"adcdcde">> = iolist_to_binary(re:replace("adcdcde","a[bcd]+dcdcde","vdBav\\1Ild",[])),
- <<"adcdcde">> = iolist_to_binary(re:replace("adcdcde","a[bcd]+dcdcde","vdBav\\1Ild",[global])),
- <<"GIjXVoAJXroabclW">> = iolist_to_binary(re:replace("abc","(ab|a)b*c","GIjXVoAJXro&lW",[])),
- <<"GIjXVoAJXroabclW">> = iolist_to_binary(re:replace("abc","(ab|a)b*c","GIjXVoAJXro&lW",[global])),
- <<"pKabcabctabcdqabcdaAabcdpgPtdK">> = iolist_to_binary(re:replace("abcd","((a)(b)c)(d)","pK\\1\\1t&q&aA&pgPtdK",[])),
- <<"pKabcabctabcdqabcdaAabcdpgPtdK">> = iolist_to_binary(re:replace("abcd","((a)(b)c)(d)","pK\\1\\1t&q&aA&pgPtdK",[global])),
- <<"XrxalphaplnalphaMFGv">> = iolist_to_binary(re:replace("alpha","[a-zA-Z_][a-zA-Z0-9_]*","Xrx&pln&MFG\\1v",[])),
- <<"XrxalphaplnalphaMFGv">> = iolist_to_binary(re:replace("alpha","[a-zA-Z_][a-zA-Z0-9_]*","Xrx&pln&MFG\\1v",[global])),
- <<"ajbhHEObuuuMEIegbh">> = iolist_to_binary(re:replace("abh","^a(bc+|b[eh])g|.h$","j&HEObuu\\1uMEIeg&",[])),
- <<"ajbhHEObuuuMEIegbh">> = iolist_to_binary(re:replace("abh","^a(bc+|b[eh])g|.h$","j&HEObuu\\1uMEIeg&",[global])),
- <<"effgzFiGeffgzUwqI">> = iolist_to_binary(re:replace("effgz","(bc+d$|ef*g.|h?i(j|k))","&FiG\\1UwqI",[])),
- <<"effgzFiGeffgzUwqI">> = iolist_to_binary(re:replace("effgz","(bc+d$|ef*g.|h?i(j|k))","&FiG\\1UwqI",[global])),
- <<"ijJMstbxCWsijpVijVwQav">> = iolist_to_binary(re:replace("ij","(bc+d$|ef*g.|h?i(j|k))","&JMstbxCWs&pV\\1VwQav",[])),
- <<"ijJMstbxCWsijpVijVwQav">> = iolist_to_binary(re:replace("ij","(bc+d$|ef*g.|h?i(j|k))","&JMstbxCWs&pV\\1VwQav",[global])),
- <<"rqYdteffgzVIpOoenIHdd">> = iolist_to_binary(re:replace("reffgz","(bc+d$|ef*g.|h?i(j|k))","qYdt&VIpOoenIHdd",[])),
- <<"rqYdteffgzVIpOoenIHdd">> = iolist_to_binary(re:replace("reffgz","(bc+d$|ef*g.|h?i(j|k))","qYdt&VIpOoenIHdd",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","aq",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","aq",[global])),
- <<"effg">> = iolist_to_binary(re:replace("effg","(bc+d$|ef*g.|h?i(j|k))","yHtJLFej\\1yYR\\1sQo&np",[])),
- <<"effg">> = iolist_to_binary(re:replace("effg","(bc+d$|ef*g.|h?i(j|k))","yHtJLFej\\1yYR\\1sQo&np",[global])),
- <<"bcdd">> = iolist_to_binary(re:replace("bcdd","(bc+d$|ef*g.|h?i(j|k))","y\\1WeuT\\1",[])),
- <<"bcdd">> = iolist_to_binary(re:replace("bcdd","(bc+d$|ef*g.|h?i(j|k))","y\\1WeuT\\1",[global])),
- <<"wodvWYlegweBrV">> = iolist_to_binary(re:replace("a","((((((((((a))))))))))","wodvWYlegweBrV",[])),
- <<"wodvWYlegweBrV">> = iolist_to_binary(re:replace("a","((((((((((a))))))))))","wodvWYlegweBrV",[global])),
- <<"gqasCpaas">> = iolist_to_binary(re:replace("aa","((((((((((a))))))))))\\10","gq\\1sCp\\1\\1s",[])),
- <<"gqasCpaas">> = iolist_to_binary(re:replace("aa","((((((((((a))))))))))\\10","gq\\1sCp\\1\\1s",[global])),
- <<"GwagSDfa">> = iolist_to_binary(re:replace("a","(((((((((a)))))))))","Gw&gSDf&",[])),
- <<"GwagSDfa">> = iolist_to_binary(re:replace("a","(((((((((a)))))))))","Gw&gSDf&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","qj&H&TFbc&WmR",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","qj&H&TFbc&WmR",[global])),
- <<"aa">> = iolist_to_binary(re:replace("aa","multiple words of text","FwU",[])),
- <<"aa">> = iolist_to_binary(re:replace("aa","multiple words of text","FwU",[global])),
- <<"uh-uh">> = iolist_to_binary(re:replace("uh-uh","multiple words of text","Tf&&&bwM&KOaXHg\\1WRNk",[])),
- <<"uh-uh">> = iolist_to_binary(re:replace("uh-uh","multiple words of text","Tf&&&bwM&KOaXHg\\1WRNk",[global])),
- <<"RdXXlExbAbHAgDE, yeah">> = iolist_to_binary(re:replace("multiple words, yeah","multiple words","R\\1dXXl\\1ExbAbHAgDE",[])),
- <<"RdXXlExbAbHAgDE, yeah">> = iolist_to_binary(re:replace("multiple words, yeah","multiple words","R\\1dXXl\\1ExbAbHAgDE",[global])),
- <<"ababcCxabsCTYB">> = iolist_to_binary(re:replace("abcde","(.*)c(.*)","\\1\\1cCx\\1sCTYB",[])),
- <<"ababcCxabsCTYB">> = iolist_to_binary(re:replace("abcde","(.*)c(.*)","\\1\\1cCx\\1sCTYB",[global])),
- <<"rW">> = iolist_to_binary(re:replace("(a, b)","\\((.*), (.*)\\)","rW",[])),
- <<"rW">> = iolist_to_binary(re:replace("(a, b)","\\((.*), (.*)\\)","rW",[global])),
- <<"dabcd">> = iolist_to_binary(re:replace("abcd","abcd","d&",[])),
- <<"dabcd">> = iolist_to_binary(re:replace("abcd","abcd","d&",[global])),
- <<"bclAbcTn">> = iolist_to_binary(re:replace("abcd","a(bc)d","\\1lA\\1Tn",[])),
- <<"bclAbcTn">> = iolist_to_binary(re:replace("abcd","a(bc)d","\\1lA\\1Tn",[global])),
- <<"waf">> = iolist_to_binary(re:replace("ac","a[-]?c","waf",[])),
- <<"waf">> = iolist_to_binary(re:replace("ac","a[-]?c","waf",[global])),
- <<"HpOuFXbFnUEO">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","HpOuFXbFnUEO",[])),
- <<"HpOuFXbFnUEO">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","HpOuFXbFnUEO",[global])),
+ <<"KBrNXAjqQYabcdRvj">> = iolist_to_binary(re:replace("abcd","a([bc]+)(c*d)","KBrNXAjqQY&Rvj",[])),
+ <<"KBrNXAjqQYabcdRvj">> = iolist_to_binary(re:replace("abcd","a([bc]+)(c*d)","KBrNXAjqQY&Rvj",[global])),
+ <<"o">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c+d)","o",[])),
+ <<"o">> = iolist_to_binary(re:replace("abcd","a([bc]*)(c+d)","o",[global])),
+ <<"mXgwSISPpB">> = iolist_to_binary(re:replace("adcdcde","a[bcd]*dcdcde","mXgw\\1S\\1ISPpB",[])),
+ <<"mXgwSISPpB">> = iolist_to_binary(re:replace("adcdcde","a[bcd]*dcdcde","mXgw\\1S\\1ISPpB",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bcd]+dcdcde","uJpSxOBN",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[bcd]+dcdcde","uJpSxOBN",[global])),
+ <<"abcde">> = iolist_to_binary(re:replace("abcde","a[bcd]+dcdcde","aDD\\1OV",[])),
+ <<"abcde">> = iolist_to_binary(re:replace("abcde","a[bcd]+dcdcde","aDD\\1OV",[global])),
+ <<"adcdcde">> = iolist_to_binary(re:replace("adcdcde","a[bcd]+dcdcde","sSDdKN\\1SAhXJR\\1Xwp",[])),
+ <<"adcdcde">> = iolist_to_binary(re:replace("adcdcde","a[bcd]+dcdcde","sSDdKN\\1SAhXJR\\1Xwp",[global])),
+ <<"HHwQpababUNd">> = iolist_to_binary(re:replace("abc","(ab|a)b*c","HHwQp\\1\\1UNd",[])),
+ <<"HHwQpababUNd">> = iolist_to_binary(re:replace("abc","(ab|a)b*c","HHwQp\\1\\1UNd",[global])),
+ <<"kvabcDX">> = iolist_to_binary(re:replace("abcd","((a)(b)c)(d)","kv\\1DX",[])),
+ <<"kvabcDX">> = iolist_to_binary(re:replace("abcd","((a)(b)c)(d)","kv\\1DX",[global])),
+ <<"odmopDrikjpbalphaalphaV">> = iolist_to_binary(re:replace("alpha","[a-zA-Z_][a-zA-Z0-9_]*","odmop\\1Drikjpb\\1&&V",[])),
+ <<"odmopDrikjpbalphaalphaV">> = iolist_to_binary(re:replace("alpha","[a-zA-Z_][a-zA-Z0-9_]*","odmop\\1Drikjpb\\1&&V",[global])),
+ <<"aJBuUN">> = iolist_to_binary(re:replace("abh","^a(bc+|b[eh])g|.h$","JBuU\\1N",[])),
+ <<"aJBuUN">> = iolist_to_binary(re:replace("abh","^a(bc+|b[eh])g|.h$","JBuU\\1N",[global])),
+ <<"GeffgzTeffgzeffgzVpRCp">> = iolist_to_binary(re:replace("effgz","(bc+d$|ef*g.|h?i(j|k))","G\\1T\\1\\1VpRCp",[])),
+ <<"GeffgzTeffgzeffgzVpRCp">> = iolist_to_binary(re:replace("effgz","(bc+d$|ef*g.|h?i(j|k))","G\\1T\\1\\1VpRCp",[global])),
+ <<"aqNijfRFijIAijWeij">> = iolist_to_binary(re:replace("ij","(bc+d$|ef*g.|h?i(j|k))","aqN&fRF\\1IA\\1We&",[])),
+ <<"aqNijfRFijIAijWeij">> = iolist_to_binary(re:replace("ij","(bc+d$|ef*g.|h?i(j|k))","aqN&fRF\\1IA\\1We&",[global])),
+ <<"roTeffgzdfhkqWsMVteffgzL">> = iolist_to_binary(re:replace("reffgz","(bc+d$|ef*g.|h?i(j|k))","oT\\1dfhkqWsMVt&L",[])),
+ <<"roTeffgzdfhkqWsMVteffgzL">> = iolist_to_binary(re:replace("reffgz","(bc+d$|ef*g.|h?i(j|k))","oT\\1dfhkqWsMVt&L",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","Dq&f&xNUnXDDAU",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","Dq&f&xNUnXDDAU",[global])),
+ <<"effg">> = iolist_to_binary(re:replace("effg","(bc+d$|ef*g.|h?i(j|k))","qtqCY\\1k",[])),
+ <<"effg">> = iolist_to_binary(re:replace("effg","(bc+d$|ef*g.|h?i(j|k))","qtqCY\\1k",[global])),
+ <<"bcdd">> = iolist_to_binary(re:replace("bcdd","(bc+d$|ef*g.|h?i(j|k))","JuBrHsMekXgTKSL&",[])),
+ <<"bcdd">> = iolist_to_binary(re:replace("bcdd","(bc+d$|ef*g.|h?i(j|k))","JuBrHsMekXgTKSL&",[global])),
+ <<"aDaQVaKxbaaHaatahXTm">> = iolist_to_binary(re:replace("a","((((((((((a))))))))))","\\1DaQV&Kxb\\1\\1H\\1&t\\1hXTm",[])),
+ <<"aDaQVaKxbaaHaatahXTm">> = iolist_to_binary(re:replace("a","((((((((((a))))))))))","\\1DaQV&Kxb\\1\\1H\\1&t\\1hXTm",[global])),
+ <<"m">> = iolist_to_binary(re:replace("aa","((((((((((a))))))))))\\10","m",[])),
+ <<"m">> = iolist_to_binary(re:replace("aa","((((((((((a))))))))))\\10","m",[global])),
+ <<"jaakGadYaFafTMa">> = iolist_to_binary(re:replace("a","(((((((((a)))))))))","j\\1&kGadY&F\\1fTM\\1",[])),
+ <<"jaakGadYaFafTMa">> = iolist_to_binary(re:replace("a","(((((((((a)))))))))","j\\1&kGadY&F\\1fTM\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","WEPrQ&rD&usui\\1D\\1VY",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","WEPrQ&rD&usui\\1D\\1VY",[global])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","multiple words of text","&wQ\\1",[])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","multiple words of text","&wQ\\1",[global])),
+ <<"uh-uh">> = iolist_to_binary(re:replace("uh-uh","multiple words of text","SLs\\1",[])),
+ <<"uh-uh">> = iolist_to_binary(re:replace("uh-uh","multiple words of text","SLs\\1",[global])),
+ <<"CRemultiple wordsKmultiple wordsQICTcCoH, yeah">> = iolist_to_binary(re:replace("multiple words, yeah","multiple words","CRe&K&QICT\\1cCoH",[])),
+ <<"CRemultiple wordsKmultiple wordsQICTcCoH, yeah">> = iolist_to_binary(re:replace("multiple words, yeah","multiple words","CRe&K&QICT\\1cCoH",[global])),
+ <<"hsyabSabFJkfGRG">> = iolist_to_binary(re:replace("abcde","(.*)c(.*)","hsy\\1S\\1FJkfGRG",[])),
+ <<"hsyabSabFJkfGRG">> = iolist_to_binary(re:replace("abcde","(.*)c(.*)","hsy\\1S\\1FJkfGRG",[global])),
+ <<"aOu">> = iolist_to_binary(re:replace("(a, b)","\\((.*), (.*)\\)","\\1Ou",[])),
+ <<"aOu">> = iolist_to_binary(re:replace("(a, b)","\\((.*), (.*)\\)","\\1Ou",[global])),
+ <<"WCvfBkLabcd">> = iolist_to_binary(re:replace("abcd","abcd","WCvfBkL&",[])),
+ <<"WCvfBkLabcd">> = iolist_to_binary(re:replace("abcd","abcd","WCvfBkL&",[global])),
+ <<"bcNBWgjxabcdFGdbcabcdw">> = iolist_to_binary(re:replace("abcd","a(bc)d","\\1NBWgjx&FGd\\1&w",[])),
+ <<"bcNBWgjxabcdFGdbcabcdw">> = iolist_to_binary(re:replace("abcd","a(bc)d","\\1NBWgjx&FGd\\1&w",[global])),
+ <<"acx">> = iolist_to_binary(re:replace("ac","a[-]?c","&x\\1",[])),
+ <<"acx">> = iolist_to_binary(re:replace("ac","a[-]?c","&x\\1",[global])),
ok.
run20() ->
- <<"XvCLIKabcabcohl">> = iolist_to_binary(re:replace("abcabc","([a-c]*)\\1","XvCLIK&ohl",[])),
- <<"XvCLIKabcabcohlXvCLIKohl">> = iolist_to_binary(re:replace("abcabc","([a-c]*)\\1","XvCLIK&ohl",[global])),
- <<"THmLVdxHpEOamaQ">> = iolist_to_binary(re:replace("a","(a)|\\1","THmLVdxHpEOam\\1Q",[])),
- <<"THmLVdxHpEOamaQ">> = iolist_to_binary(re:replace("a","(a)|\\1","THmLVdxHpEOam\\1Q",[global])),
- <<"*** FjGfKKSoilers">> = iolist_to_binary(re:replace("*** Failers","(a)|\\1","jGfKKSo",[])),
- <<"*** FjGfKKSoilers">> = iolist_to_binary(re:replace("*** Failers","(a)|\\1","jGfKKSo",[global])),
- <<"pCab">> = iolist_to_binary(re:replace("ab","(a)|\\1","pC&",[])),
- <<"pCab">> = iolist_to_binary(re:replace("ab","(a)|\\1","pC&",[global])),
- <<"x">> = iolist_to_binary(re:replace("x","(a)|\\1","U",[])),
- <<"x">> = iolist_to_binary(re:replace("x","(a)|\\1","U",[global])),
- <<"nwvlinqmgabbLababbvbcbc">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2)*","nwvlinqmga\\1L&v",[])),
- <<"nwvlinqmgabbLababbvnwvlinqmgaLvbnwvlinqmgacbcLcbcvnwvlinqmgaLv">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2)*","nwvlinqmga\\1L&v",[global])),
- <<"XEababbbcbccbcnoei">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2){3}","XE&\\1noei",[])),
- <<"XEababbbcbccbcnoei">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2){3}","XE&\\1noei",[global])),
- <<"aaaxabaxbaaxbbaxQHJip">> = iolist_to_binary(re:replace("aaaxabaxbaaxbbax","((\\3|b)\\2(a)x)+","&QHJip",[])),
- <<"aaaxabaxbaaxbbaxQHJip">> = iolist_to_binary(re:replace("aaaxabaxbaaxbbax","((\\3|b)\\2(a)x)+","&QHJip",[global])),
- <<"bbaababbabaaaaaFjrtkQstbbaaaabbabbaaaabbaRobbaaaabbaQwbbaJbbaaaabbabbaaaabba">> = iolist_to_binary(re:replace("bbaababbabaaaaabbaaaabba","((\\3|b)\\2(a)){2,}","FjrtkQst&&Ro&Qw\\1J&&",[])),
- <<"bbaababbabaaaaaFjrtkQstbbaaaabbabbaaaabbaRobbaaaabbaQwbbaJbbaaaabbabbaaaabba">> = iolist_to_binary(re:replace("bbaababbabaaaaabbaaaabba","((\\3|b)\\2(a)){2,}","FjrtkQst&&Ro&Qw\\1J&&",[global])),
- <<"hryRShiLJ">> = iolist_to_binary(re:replace("ABC","abc","hryRShiL\\1J",[caseless])),
- <<"hryRShiLJ">> = iolist_to_binary(re:replace("ABC","abc","hryRShiL\\1J",[caseless,
- global])),
- <<"XHUenvABCCmAOuuCY">> = iolist_to_binary(re:replace("XABCY","abc","HUenv&C\\1mAOuuC",[caseless])),
- <<"XHUenvABCCmAOuuCY">> = iolist_to_binary(re:replace("XABCY","abc","HUenv&C\\1mAOuuC",[caseless,
- global])),
- <<"AB">> = iolist_to_binary(re:replace("ABABC","abc","\\1",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("ABABC","abc","\\1",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","qc&a\\1M&&\\1qqO&&YaV",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","qc&a\\1M&&\\1qqO&&YaV",[caseless,
- global])),
- <<"aaxabxbaxbbx">> = iolist_to_binary(re:replace("aaxabxbaxbbx","abc","YoMmmB&v\\1N\\1voc",[caseless])),
- <<"aaxabxbaxbbx">> = iolist_to_binary(re:replace("aaxabxbaxbbx","abc","YoMmmB&v\\1N\\1voc",[caseless,
+ <<"huMWbabcsRaEC">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","huMWb\\1sRaEC",[])),
+ <<"huMWbabcsRaEC">> = iolist_to_binary(re:replace("abcabc","(abc)\\1","huMWb\\1sRaEC",[global])),
+ <<"iexabcabcabcabcNCHabcabcvuWaLb">> = iolist_to_binary(re:replace("abcabc","([a-c]*)\\1","iex&&NCH&vuWaLb",[])),
+ <<"iexabcabcabcabcNCHabcabcvuWaLbiexNCHvuWaLb">> = iolist_to_binary(re:replace("abcabc","([a-c]*)\\1","iex&&NCH&vuWaLb",[global])),
+ <<"yJihtasaOaRaI">> = iolist_to_binary(re:replace("a","(a)|\\1","yJihtas&O&R&I",[])),
+ <<"yJihtasaOaRaI">> = iolist_to_binary(re:replace("a","(a)|\\1","yJihtas&O&R&I",[global])),
+ <<"*** FIaHjkilers">> = iolist_to_binary(re:replace("*** Failers","(a)|\\1","I\\1Hjk",[])),
+ <<"*** FIaHjkilers">> = iolist_to_binary(re:replace("*** Failers","(a)|\\1","I\\1Hjk",[global])),
+ <<"EamavFGoBaaBPRaFOhib">> = iolist_to_binary(re:replace("ab","(a)|\\1","E\\1m\\1vFGoB\\1&BPR\\1FOhi",[])),
+ <<"EamavFGoBaaBPRaFOhib">> = iolist_to_binary(re:replace("ab","(a)|\\1","E\\1m\\1vFGoB\\1&BPR\\1FOhi",[global])),
+ <<"x">> = iolist_to_binary(re:replace("x","(a)|\\1","NnSvRd&pb",[])),
+ <<"x">> = iolist_to_binary(re:replace("x","(a)|\\1","NnSvRd&pb",[global])),
+ <<"uBuYmababbcqWpqxebcbc">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2)*","uBuYm&cqWpqxe",[])),
+ <<"uBuYmababbcqWpqxeuBuYmcqWpqxebuBuYmcbccqWpqxeuBuYmcqWpqxe">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2)*","uBuYm&cqWpqxe",[global])),
+ <<"EcbcOTScbccbc">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2){3}","E\\1OTS\\1\\1",[])),
+ <<"EcbcOTScbccbc">> = iolist_to_binary(re:replace("ababbbcbc","(([a-c])b*?\\2){3}","E\\1OTS\\1\\1",[global])),
+ <<"aaaxabaxbaaxMcBMqqECobbaxAWhbbax">> = iolist_to_binary(re:replace("aaaxabaxbaaxbbax","((\\3|b)\\2(a)x)+","McBMqqECo\\1AWh\\1",[])),
+ <<"aaaxabaxbaaxMcBMqqECobbaxAWhbbax">> = iolist_to_binary(re:replace("aaaxabaxbaaxbbax","((\\3|b)\\2(a)x)+","McBMqqECo\\1AWh\\1",[global])),
+ <<"bbaababbabaaaaaqjbbaaaabbabbaVgmcpcbbajpNX">> = iolist_to_binary(re:replace("bbaababbabaaaaabbaaaabba","((\\3|b)\\2(a)){2,}","qj&\\1Vgmcpc\\1jpNX",[])),
+ <<"bbaababbabaaaaaqjbbaaaabbabbaVgmcpcbbajpNX">> = iolist_to_binary(re:replace("bbaababbabaaaaabbaaaabba","((\\3|b)\\2(a)){2,}","qj&\\1Vgmcpc\\1jpNX",[global])),
+ <<"ABCyABCdyvLRsRMABCihr">> = iolist_to_binary(re:replace("ABC","abc","&y&dy\\1vLRsRM&ihr",[caseless])),
+ <<"ABCyABCdyvLRsRMABCihr">> = iolist_to_binary(re:replace("ABC","abc","&y&dy\\1vLRsRM&ihr",[caseless,
+ global])),
+ <<"XfgcwoIpABCY">> = iolist_to_binary(re:replace("XABCY","abc","fgcwoIp&",[caseless])),
+ <<"XfgcwoIpABCY">> = iolist_to_binary(re:replace("XABCY","abc","fgcwoIp&",[caseless,
+ global])),
+ <<"ABWoWCFrcHpLABCpDF">> = iolist_to_binary(re:replace("ABABC","abc","WoW\\1CFrcHpL&p\\1DF",[caseless])),
+ <<"ABWoWCFrcHpLABCpDF">> = iolist_to_binary(re:replace("ABABC","abc","WoW\\1CFrcHpL&p\\1DF",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","\\1dHtGrvxuN&bjVI\\1LF&",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","abc","\\1dHtGrvxuN&bjVI\\1LF&",[caseless,
+ global])),
+ <<"aaxabxbaxbbx">> = iolist_to_binary(re:replace("aaxabxbaxbbx","abc","FMCY&jfPDp&ePPmkBaNK",[caseless])),
+ <<"aaxabxbaxbbx">> = iolist_to_binary(re:replace("aaxabxbaxbbx","abc","FMCY&jfPDp&ePPmkBaNK",[caseless,
+ global])),
+ <<"XBC">> = iolist_to_binary(re:replace("XBC","abc","yK",[caseless])),
+ <<"XBC">> = iolist_to_binary(re:replace("XBC","abc","yK",[caseless,
+ global])),
+ <<"AXC">> = iolist_to_binary(re:replace("AXC","abc","y\\1Bxx\\1c",[caseless])),
+ <<"AXC">> = iolist_to_binary(re:replace("AXC","abc","y\\1Bxx\\1c",[caseless,
+ global])),
+ <<"ABX">> = iolist_to_binary(re:replace("ABX","abc","&e\\1",[caseless])),
+ <<"ABX">> = iolist_to_binary(re:replace("ABX","abc","&e\\1",[caseless,
+ global])),
+ <<"wIDivFpmRD">> = iolist_to_binary(re:replace("ABC","ab*c","w\\1IDivFpmRD",[caseless])),
+ <<"wIDivFpmRD">> = iolist_to_binary(re:replace("ABC","ab*c","w\\1IDivFpmRD",[caseless,
+ global])),
+ <<"mjJOdABCVwUnuEHfFUblABCE">> = iolist_to_binary(re:replace("ABC","ab*bc","mjJOd&VwUnuEHfFUbl&E",[caseless])),
+ <<"mjJOdABCVwUnuEHfFUblABCE">> = iolist_to_binary(re:replace("ABC","ab*bc","mjJOd&VwUnuEHfFUbl&E",[caseless,
+ global])),
+ <<"aqlXiaaCABBCtGMyJr">> = iolist_to_binary(re:replace("ABBC","ab*bc","aqlXia\\1aC\\1&tGMyJr",[caseless])),
+ <<"aqlXiaaCABBCtGMyJr">> = iolist_to_binary(re:replace("ABBC","ab*bc","aqlXia\\1aC\\1&tGMyJr",[caseless,
+ global])),
+ <<"QsHTFT">> = iolist_to_binary(re:replace("ABBBBC","ab*?bc","Q\\1sHTFT",[caseless])),
+ <<"QsHTFT">> = iolist_to_binary(re:replace("ABBBBC","ab*?bc","Q\\1sHTFT",[caseless,
+ global])),
+ <<"UdwHeAkxpFABBBBCTJI">> = iolist_to_binary(re:replace("ABBBBC","ab{0,}?bc","\\1UdwHeAk\\1xpF&\\1T\\1JI",[caseless])),
+ <<"UdwHeAkxpFABBBBCTJI">> = iolist_to_binary(re:replace("ABBBBC","ab{0,}?bc","\\1UdwHeAk\\1xpF&\\1T\\1JI",[caseless,
+ global])),
+ <<"paupnNUOYjABBCXABBC">> = iolist_to_binary(re:replace("ABBC","ab+?bc","pa\\1upnNUO\\1Yj&\\1X&",[caseless])),
+ <<"paupnNUOYjABBCXABBC">> = iolist_to_binary(re:replace("ABBC","ab+?bc","pa\\1upnNUO\\1Yj&\\1X&",[caseless,
global])),
- <<"XBC">> = iolist_to_binary(re:replace("XBC","abc","\\1gwN\\1pcAL\\1le&B",[caseless])),
- <<"XBC">> = iolist_to_binary(re:replace("XBC","abc","\\1gwN\\1pcAL\\1le&B",[caseless,
- global])),
- <<"AXC">> = iolist_to_binary(re:replace("AXC","abc","vQ&&a\\1Kw",[caseless])),
- <<"AXC">> = iolist_to_binary(re:replace("AXC","abc","vQ&&a\\1Kw",[caseless,
- global])),
- <<"ABX">> = iolist_to_binary(re:replace("ABX","abc","pSJJqa&TbyEb",[caseless])),
- <<"ABX">> = iolist_to_binary(re:replace("ABX","abc","pSJJqa&TbyEb",[caseless,
- global])),
- <<"ABCYSKriNcABCxqw">> = iolist_to_binary(re:replace("ABC","ab*c","&YSKriNc&xqw",[caseless])),
- <<"ABCYSKriNcABCxqw">> = iolist_to_binary(re:replace("ABC","ab*c","&YSKriNc&xqw",[caseless,
- global])),
- <<"">> = iolist_to_binary(re:replace("ABC","ab*bc","\\1",[caseless])),
- <<"">> = iolist_to_binary(re:replace("ABC","ab*bc","\\1",[caseless,
- global])),
- <<"xd">> = iolist_to_binary(re:replace("ABBC","ab*bc","xd",[caseless])),
- <<"xd">> = iolist_to_binary(re:replace("ABBC","ab*bc","xd",[caseless,
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","uD\\1trygh\\1FV&xf&I",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","uD\\1trygh\\1FV&xf&I",[caseless,
+ global])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","ab+bc","&yTFr&\\1OfkVpLjJ",[caseless])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","ab+bc","&yTFr&\\1OfkVpLjJ",[caseless,
+ global])),
+ <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab+bc","D\\1MfU\\1&",[caseless])),
+ <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab+bc","D\\1MfU\\1&",[caseless,
+ global])),
+ <<"jLBDBABBBBCVABBBBCCLPUeBABBBBCE">> = iolist_to_binary(re:replace("ABBBBC","ab+bc","jLBDB&V&CLPU\\1eB&E",[caseless])),
+ <<"jLBDBABBBBCVABBBBCCLPUeBABBBBCE">> = iolist_to_binary(re:replace("ABBBBC","ab+bc","jLBDB&V&CLPU\\1eB&E",[caseless,
+ global])),
+ <<"vXw">> = iolist_to_binary(re:replace("ABBBBC","ab{1,}?bc","vXw",[caseless])),
+ <<"vXw">> = iolist_to_binary(re:replace("ABBBBC","ab{1,}?bc","vXw",[caseless,
+ global])),
+ <<"DE">> = iolist_to_binary(re:replace("ABBBBC","ab{1,3}?bc","DE",[caseless])),
+ <<"DE">> = iolist_to_binary(re:replace("ABBBBC","ab{1,3}?bc","DE",[caseless,
+ global])),
+ <<"oIRAABBBBCABBBBCoXH">> = iolist_to_binary(re:replace("ABBBBC","ab{3,4}?bc","oIRA&&oXH",[caseless])),
+ <<"oIRAABBBBCABBBBCoXH">> = iolist_to_binary(re:replace("ABBBBC","ab{3,4}?bc","oIRA&&oXH",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}?bc","&&JUwgUCSBcHYmFv&OQ",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}?bc","&&JUwgUCSBcHYmFv&OQ",[caseless,
+ global])),
+ <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab{4,5}?bc","\\1&yu&\\1ps&A",[caseless])),
+ <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab{4,5}?bc","\\1&yu&\\1ps&A",[caseless,
+ global])),
+ <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab{4,5}?bc","TgOJWMyTNuK&rOFr\\1n",[caseless])),
+ <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab{4,5}?bc","TgOJWMyTNuK&rOFr\\1n",[caseless,
+ global])),
+ ok.
+run21() ->
+ <<"DxABBCYABBCEhABBCISWH">> = iolist_to_binary(re:replace("ABBC","ab??bc","Dx\\1&Y&E\\1h\\1&ISWH",[caseless])),
+ <<"DxABBCYABBCEhABBCISWH">> = iolist_to_binary(re:replace("ABBC","ab??bc","Dx\\1&Y&E\\1h\\1&ISWH",[caseless,
+ global])),
+ <<"Qw">> = iolist_to_binary(re:replace("ABC","ab??bc","Qw",[caseless])),
+ <<"Qw">> = iolist_to_binary(re:replace("ABC","ab??bc","Qw",[caseless,
global])),
- <<"fSNABBBBCXyDgO">> = iolist_to_binary(re:replace("ABBBBC","ab*?bc","fSN&\\1\\1XyDgO\\1",[caseless])),
- <<"fSNABBBBCXyDgO">> = iolist_to_binary(re:replace("ABBBBC","ab*?bc","fSN&\\1\\1XyDgO\\1",[caseless,
+ <<"O">> = iolist_to_binary(re:replace("ABC","ab{0,1}?bc","O",[caseless])),
+ <<"O">> = iolist_to_binary(re:replace("ABC","ab{0,1}?bc","O",[caseless,
+ global])),
+ <<"vABCwErLBABCFLQaOAoABCJPx">> = iolist_to_binary(re:replace("ABC","ab??c","v&wErLB\\1&FLQaOAo&JPx",[caseless])),
+ <<"vABCwErLBABCFLQaOAoABCJPx">> = iolist_to_binary(re:replace("ABC","ab??c","v&wErLB\\1&FLQaOAo&JPx",[caseless,
global])),
- <<"kp">> = iolist_to_binary(re:replace("ABBBBC","ab{0,}?bc","kp",[caseless])),
- <<"kp">> = iolist_to_binary(re:replace("ABBBBC","ab{0,}?bc","kp",[caseless,
- global])),
- <<"TjPcYlpdNDABBCAJoFsABBC">> = iolist_to_binary(re:replace("ABBC","ab+?bc","TjPcYlpdND\\1\\1&AJoFs&",[caseless])),
- <<"TjPcYlpdNDABBCAJoFsABBC">> = iolist_to_binary(re:replace("ABBC","ab+?bc","TjPcYlpdND\\1\\1&AJoFs&",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","WWQXKaM\\1xLF&",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab+bc","WWQXKaM\\1xLF&",[caseless,
- global])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","ab+bc","w",[caseless])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","ab+bc","w",[caseless,
- global])),
- <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab+bc","SYdD",[caseless])),
- <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab+bc","SYdD",[caseless,
- global])),
- <<"TABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab+bc","T&",[caseless])),
- <<"TABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab+bc","T&",[caseless,
- global])),
- <<"grMABBBBCABBBBCnRD">> = iolist_to_binary(re:replace("ABBBBC","ab{1,}?bc","grM&&nRD",[caseless])),
- <<"grMABBBBCABBBBCnRD">> = iolist_to_binary(re:replace("ABBBBC","ab{1,}?bc","grM&&nRD",[caseless,
+ <<"lphGtTIqlw">> = iolist_to_binary(re:replace("ABC","ab{0,1}?c","lph\\1GtTIqlw",[caseless])),
+ <<"lphGtTIqlw">> = iolist_to_binary(re:replace("ABC","ab{0,1}?c","lph\\1GtTIqlw",[caseless,
+ global])),
+ <<"Ubn">> = iolist_to_binary(re:replace("ABC","^abc$","Ubn",[caseless])),
+ <<"Ubn">> = iolist_to_binary(re:replace("ABC","^abc$","Ubn",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&DcgWCx",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&DcgWCx",[caseless,
global])),
- <<"JJtIBfABBBBCaKtYmqwv">> = iolist_to_binary(re:replace("ABBBBC","ab{1,3}?bc","\\1JJtIBf&\\1aKtYmqwv",[caseless])),
- <<"JJtIBfABBBBCaKtYmqwv">> = iolist_to_binary(re:replace("ABBBBC","ab{1,3}?bc","\\1JJtIBf&\\1aKtYmqwv",[caseless,
- global])),
- <<"gwAlxwDfABBBBCNQKABBBBClABBBBCLxf">> = iolist_to_binary(re:replace("ABBBBC","ab{3,4}?bc","gw\\1AlxwDf&NQK&l\\1&Lxf",[caseless])),
- <<"gwAlxwDfABBBBCNQKABBBBClABBBBCLxf">> = iolist_to_binary(re:replace("ABBBBC","ab{3,4}?bc","gw\\1AlxwDf&NQK&l\\1&Lxf",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}?bc","qiwoP\\1bmIlc\\1&",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","ab{4,5}?bc","qiwoP\\1bmIlc\\1&",[caseless,
- global])),
- <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab{4,5}?bc","aBG\\1YIvTYXxiuDt&",[caseless])),
- <<"ABQ">> = iolist_to_binary(re:replace("ABQ","ab{4,5}?bc","aBG\\1YIvTYXxiuDt&",[caseless,
+ <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","^abc$","H",[caseless])),
+ <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","^abc$","H",[caseless,
+ global])),
+ <<"ABCC">> = iolist_to_binary(re:replace("ABCC","^abc$","NmNp",[caseless])),
+ <<"ABCC">> = iolist_to_binary(re:replace("ABCC","^abc$","NmNp",[caseless,
+ global])),
+ <<"ABCABCSTBJNuWABCfUXC">> = iolist_to_binary(re:replace("ABCC","^abc","&&STBJNu\\1W\\1&fUX",[caseless])),
+ <<"ABCABCSTBJNuWABCfUXC">> = iolist_to_binary(re:replace("ABCC","^abc","&&STBJNu\\1W\\1&fUX",[caseless,
+ global])),
+ <<"Aotm">> = iolist_to_binary(re:replace("AABC","abc$","otm\\1",[caseless])),
+ <<"Aotm">> = iolist_to_binary(re:replace("AABC","abc$","otm\\1",[caseless,
+ global])),
+ <<"wnRBtWpABC">> = iolist_to_binary(re:replace("ABC","^","\\1wnR\\1Bt\\1Wp",[caseless])),
+ <<"wnRBtWpABC">> = iolist_to_binary(re:replace("ABC","^","\\1wnR\\1Bt\\1Wp",[caseless,
+ global])),
+ <<"ABCcfCNQPaSTn">> = iolist_to_binary(re:replace("ABC","$","\\1\\1\\1cfCNQPaST\\1n",[caseless])),
+ <<"ABCcfCNQPaSTn">> = iolist_to_binary(re:replace("ABC","$","\\1\\1\\1cfCNQPaST\\1n",[caseless,
+ global])),
+ <<"KqbIu">> = iolist_to_binary(re:replace("ABC","a.c","KqbIu\\1",[caseless])),
+ <<"KqbIu">> = iolist_to_binary(re:replace("ABC","a.c","KqbIu\\1",[caseless,
+ global])),
+ <<"mSBBDWnWtWlJVLdWWAXC">> = iolist_to_binary(re:replace("AXC","a.c","mSBBDWnWtWlJVLdWW\\1&\\1",[caseless])),
+ <<"mSBBDWnWtWlJVLdWWAXC">> = iolist_to_binary(re:replace("AXC","a.c","mSBBDWnWtWlJVLdWW\\1&\\1",[caseless,
+ global])),
+ <<"gIkgDqEBaPTmSAXYZC">> = iolist_to_binary(re:replace("AXYZC","a.*?c","gIkgDq\\1EBa\\1PTmS&",[caseless])),
+ <<"gIkgDqEBaPTmSAXYZC">> = iolist_to_binary(re:replace("AXYZC","a.*?c","gIkgDq\\1EBa\\1PTmS&",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.*c","Sg&&rIwBxW&MAd",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.*c","Sg&&rIwBxW&MAd",[caseless,
+ global])),
+ <<"IkVJFLsCAABCqbiO">> = iolist_to_binary(re:replace("AABC","a.*c","\\1\\1IkVJFLsC\\1&qbiO",[caseless])),
+ <<"IkVJFLsCAABCqbiO">> = iolist_to_binary(re:replace("AABC","a.*c","\\1\\1IkVJFLsC\\1&qbiO",[caseless,
global])),
- <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab{4,5}?bc","T\\1d&vifs\\1n\\1Jvt",[caseless])),
- <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","ab{4,5}?bc","T\\1d&vifs\\1n\\1Jvt",[caseless,
- global])),
- <<"MvyHLhAABBCiABBCN">> = iolist_to_binary(re:replace("ABBC","ab??bc","M\\1vyHLhA\\1&\\1i&N",[caseless])),
- <<"MvyHLhAABBCiABBCN">> = iolist_to_binary(re:replace("ABBC","ab??bc","M\\1vyHLhA\\1&\\1i&N",[caseless,
- global])),
- <<"mlLABCgtDiemoB">> = iolist_to_binary(re:replace("ABC","ab??bc","mlL&gtDiemoB",[caseless])),
- <<"mlLABCgtDiemoB">> = iolist_to_binary(re:replace("ABC","ab??bc","mlL&gtDiemoB",[caseless,
+ <<"AXYZD">> = iolist_to_binary(re:replace("AXYZD","a.*c","&r",[caseless])),
+ <<"AXYZD">> = iolist_to_binary(re:replace("AXYZD","a.*c","&r",[caseless,
+ global])),
+ <<"mABDJFh">> = iolist_to_binary(re:replace("ABD","a[bc]d","m&J\\1\\1Fh",[caseless])),
+ <<"mABDJFh">> = iolist_to_binary(re:replace("ABD","a[bc]d","m&J\\1\\1Fh",[caseless,
+ global])),
+ <<"ysVqaiqxHWEb">> = iolist_to_binary(re:replace("ACE","a[b-d]e","ys\\1\\1Vqai\\1qx\\1HWEb",[caseless])),
+ <<"ysVqaiqxHWEb">> = iolist_to_binary(re:replace("ACE","a[b-d]e","ys\\1\\1Vqai\\1qx\\1HWEb",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[b-d]e","\\1eIyFD\\1",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[b-d]e","\\1eIyFD\\1",[caseless,
+ global])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","a[b-d]e","UU&&GPw&AHE",[caseless])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","a[b-d]e","UU&&GPw&AHE",[caseless,
+ global])),
+ <<"ABD">> = iolist_to_binary(re:replace("ABD","a[b-d]e","SKAyypUXUE\\1IHTdcqv&r",[caseless])),
+ <<"ABD">> = iolist_to_binary(re:replace("ABD","a[b-d]e","SKAyypUXUE\\1IHTdcqv&r",[caseless,
+ global])),
+ <<"AqACkKluACPPACf">> = iolist_to_binary(re:replace("AAC","a[b-d]","q&kKlu&PP&f",[caseless])),
+ <<"AqACkKluACPPACf">> = iolist_to_binary(re:replace("AAC","a[b-d]","q&kKlu&PP&f",[caseless,
global])),
+ <<"A-Wnm">> = iolist_to_binary(re:replace("A-","a[-b]","&Wnm",[caseless])),
+ <<"A-Wnm">> = iolist_to_binary(re:replace("A-","a[-b]","&Wnm",[caseless,
+ global])),
+ <<"paPAAKruyA-Wwd">> = iolist_to_binary(re:replace("A-","a[b-]","paPAAKruy&Wwd",[caseless])),
+ <<"paPAAKruyA-Wwd">> = iolist_to_binary(re:replace("A-","a[b-]","paPAAKruy&Wwd",[caseless,
+ global])),
+ <<"ImJu">> = iolist_to_binary(re:replace("A]","a]","I\\1m\\1Ju",[caseless])),
+ <<"ImJu">> = iolist_to_binary(re:replace("A]","a]","I\\1m\\1Ju",[caseless,
+ global])),
ok.
-run21() ->
- <<"aMKJBABCqBQrABCWvqqJABCVi">> = iolist_to_binary(re:replace("ABC","ab{0,1}?bc","aMKJB&qBQr&WvqqJ&Vi",[caseless])),
- <<"aMKJBABCqBQrABCWvqqJABCVi">> = iolist_to_binary(re:replace("ABC","ab{0,1}?bc","aMKJB&qBQr&WvqqJ&Vi",[caseless,
- global])),
- <<"KABCqKjWXyABC">> = iolist_to_binary(re:replace("ABC","ab??c","K\\1&qKjWXy\\1&",[caseless])),
- <<"KABCqKjWXyABC">> = iolist_to_binary(re:replace("ABC","ab??c","K\\1&qKjWXy\\1&",[caseless,
- global])),
- <<"t">> = iolist_to_binary(re:replace("ABC","ab{0,1}?c","t",[caseless])),
- <<"t">> = iolist_to_binary(re:replace("ABC","ab{0,1}?c","t",[caseless,
- global])),
- <<"djnySdABCABCxQAR">> = iolist_to_binary(re:replace("ABC","^abc$","djnyS\\1d&&\\1\\1x\\1QAR",[caseless])),
- <<"djnySdABCABCxQAR">> = iolist_to_binary(re:replace("ABC","^abc$","djnyS\\1d&&\\1\\1x\\1QAR",[caseless,
+run22() ->
+ <<"kdsETioUcshOFDldx">> = iolist_to_binary(re:replace("A]B","a[]]b","k\\1dsET\\1ioU\\1cshOFDldx",[caseless])),
+ <<"kdsETioUcshOFDldx">> = iolist_to_binary(re:replace("A]B","a[]]b","k\\1dsET\\1ioU\\1cshOFDldx",[caseless,
global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&cOwCIe",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^abc$","&cOwCIe",[caseless,
- global])),
- <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","^abc$","DTRA&tGT\\1WCjF\\1\\1",[caseless])),
- <<"ABBBBC">> = iolist_to_binary(re:replace("ABBBBC","^abc$","DTRA&tGT\\1WCjF\\1\\1",[caseless,
- global])),
- <<"ABCC">> = iolist_to_binary(re:replace("ABCC","^abc$","YC\\1",[caseless])),
- <<"ABCC">> = iolist_to_binary(re:replace("ABCC","^abc$","YC\\1",[caseless,
- global])),
- <<"oCxwvYlagrHYCUNjC">> = iolist_to_binary(re:replace("ABCC","^abc","oC\\1xwvYlagrHYCUN\\1j",[caseless])),
- <<"oCxwvYlagrHYCUNjC">> = iolist_to_binary(re:replace("ABCC","^abc","oC\\1xwvYlagrHYCUN\\1j",[caseless,
- global])),
- <<"AABCYOABCqABCABCXABCKHJVXnu">> = iolist_to_binary(re:replace("AABC","abc$","&YO&q&&X&\\1KHJVXnu",[caseless])),
- <<"AABCYOABCqABCABCXABCKHJVXnu">> = iolist_to_binary(re:replace("AABC","abc$","&YO&q&&X&\\1KHJVXnu",[caseless,
+ <<"uv">> = iolist_to_binary(re:replace("AED","a[^bc]d","uv\\1",[caseless])),
+ <<"uv">> = iolist_to_binary(re:replace("AED","a[^bc]d","uv\\1",[caseless,
+ global])),
+ <<"l">> = iolist_to_binary(re:replace("ADC","a[^-b]c","l",[caseless])),
+ <<"l">> = iolist_to_binary(re:replace("ADC","a[^-b]c","l",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^-b]c","vyfP\\1yX\\1onrR&f\\1\\1J&",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^-b]c","vyfP\\1yX\\1onrR&f\\1\\1J&",[caseless,
+ global])),
+ <<"ABD">> = iolist_to_binary(re:replace("ABD","a[^-b]c","gE&RxnGk&&\\1\\1mK",[caseless])),
+ <<"ABD">> = iolist_to_binary(re:replace("ABD","a[^-b]c","gE&RxnGk&&\\1\\1mK",[caseless,
global])),
- <<"YKSscFvdcxhKQAABC">> = iolist_to_binary(re:replace("ABC","^","YKSscFvdcx\\1hKQA\\1",[caseless])),
- <<"YKSscFvdcxhKQAABC">> = iolist_to_binary(re:replace("ABC","^","YKSscFvdcx\\1hKQA\\1",[caseless,
+ <<"A-C">> = iolist_to_binary(re:replace("A-C","a[^-b]c","xJw&DKvLJC",[caseless])),
+ <<"A-C">> = iolist_to_binary(re:replace("A-C","a[^-b]c","xJw&DKvLJC",[caseless,
+ global])),
+ <<"gm">> = iolist_to_binary(re:replace("ADC","a[^]b]c","gm",[caseless])),
+ <<"gm">> = iolist_to_binary(re:replace("ADC","a[^]b]c","gm",[caseless,
+ global])),
+ <<"RrLABABABUVLUehwC">> = iolist_to_binary(re:replace("ABC","ab|cd","RrL\\1&&&UVLUehw",[caseless])),
+ <<"RrLABABABUVLUehwC">> = iolist_to_binary(re:replace("ABC","ab|cd","RrL\\1&&&UVLUehw",[caseless,
+ global])),
+ <<"giABOABABqXGgxFhABdprogCD">> = iolist_to_binary(re:replace("ABCD","ab|cd","gi&O&&qXGgxFh&dprog",[caseless])),
+ <<"giABOABABqXGgxFhABdproggiCDOCDCDqXGgxFhCDdprog">> = iolist_to_binary(re:replace("ABCD","ab|cd","gi&O&&qXGgxFh&dprog",[caseless,
+ global])),
+ <<"DqEFRtXCOkEFdCHWAxqmEF">> = iolist_to_binary(re:replace("DEF","()ef","q&Rt\\1XCOk&dCHWAxqm&",[caseless])),
+ <<"DqEFRtXCOkEFdCHWAxqmEF">> = iolist_to_binary(re:replace("DEF","()ef","q&Rt\\1XCOk&dCHWAxqm&",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","$b","e&y",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","$b","e&y",[caseless,
+ global])),
+ <<"A]C">> = iolist_to_binary(re:replace("A]C","$b","Mu&NYopF&e\\1u",[caseless])),
+ <<"A]C">> = iolist_to_binary(re:replace("A]C","$b","Mu&NYopF&e\\1u",[caseless,
+ global])),
+ <<"B">> = iolist_to_binary(re:replace("B","$b","PgdiGyTFyntpg\\1",[caseless])),
+ <<"B">> = iolist_to_binary(re:replace("B","$b","PgdiGyTFyntpg\\1",[caseless,
+ global])),
+ <<"h">> = iolist_to_binary(re:replace("A(B","a\\(b","h",[caseless])),
+ <<"h">> = iolist_to_binary(re:replace("A(B","a\\(b","h",[caseless,
+ global])),
+ <<"UwxbpwNvAsyQI">> = iolist_to_binary(re:replace("AB","a\\(*b","\\1UwxbpwNvAsyQI",[caseless])),
+ <<"UwxbpwNvAsyQI">> = iolist_to_binary(re:replace("AB","a\\(*b","\\1UwxbpwNvAsyQI",[caseless,
global])),
- <<"ABCJPmJKxRqaJn">> = iolist_to_binary(re:replace("ABC","$","JPmJ&K\\1\\1x\\1RqaJ\\1n",[caseless])),
- <<"ABCJPmJKxRqaJn">> = iolist_to_binary(re:replace("ABC","$","JPmJ&K\\1\\1x\\1RqaJ\\1n",[caseless,
+ <<"M">> = iolist_to_binary(re:replace("A((B","a\\(*b","M",[caseless])),
+ <<"M">> = iolist_to_binary(re:replace("A((B","a\\(*b","M",[caseless,
+ global])),
+ <<"A">> = iolist_to_binary(re:replace("A","a\\\\b","h&t",[caseless,
+ notbol])),
+ <<"A">> = iolist_to_binary(re:replace("A","a\\\\b","h&t",[caseless,
+ notbol,
+ global])),
+ <<"vMPmAAlHguqIoSmcuudIBC">> = iolist_to_binary(re:replace("ABC","((a))","vMPm\\1&lHguqIoSmcuudI",[caseless])),
+ <<"vMPmAAlHguqIoSmcuudIBC">> = iolist_to_binary(re:replace("ABC","((a))","vMPm\\1&lHguqIoSmcuudI",[caseless,
global])),
- <<"KovmYABCBPABCY">> = iolist_to_binary(re:replace("ABC","a.c","KovmY&BP&Y",[caseless])),
- <<"KovmYABCBPABCY">> = iolist_to_binary(re:replace("ABC","a.c","KovmY&BP&Y",[caseless,
- global])),
- <<"tnMtqk">> = iolist_to_binary(re:replace("AXC","a.c","t\\1\\1n\\1Mtqk",[caseless])),
- <<"tnMtqk">> = iolist_to_binary(re:replace("AXC","a.c","t\\1\\1n\\1Mtqk",[caseless,
- global])),
- <<"PTEd">> = iolist_to_binary(re:replace("AXYZC","a.*?c","PTEd",[caseless])),
- <<"PTEd">> = iolist_to_binary(re:replace("AXYZC","a.*?c","PTEd",[caseless,
+ <<"RhLw">> = iolist_to_binary(re:replace("ABC","(a)b(c)","RhLw",[caseless])),
+ <<"RhLw">> = iolist_to_binary(re:replace("ABC","(a)b(c)","RhLw",[caseless,
global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.*c","\\1XFiq\\1uvPbLR",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a.*c","\\1XFiq\\1uvPbLR",[caseless,
- global])),
- <<"cqlTAABCy">> = iolist_to_binary(re:replace("AABC","a.*c","cqlT&\\1y",[caseless])),
- <<"cqlTAABCy">> = iolist_to_binary(re:replace("AABC","a.*c","cqlT&\\1y",[caseless,
- global])),
- <<"AXYZD">> = iolist_to_binary(re:replace("AXYZD","a.*c","nHl&b\\1Xh",[caseless])),
- <<"AXYZD">> = iolist_to_binary(re:replace("AXYZD","a.*c","nHl&b\\1Xh",[caseless,
- global])),
- <<"ABDABDdC">> = iolist_to_binary(re:replace("ABD","a[bc]d","&&dC",[caseless])),
- <<"ABDABDdC">> = iolist_to_binary(re:replace("ABD","a[bc]d","&&dC",[caseless,
- global])),
- <<"UqQFWlGkACEBdlidOCI">> = iolist_to_binary(re:replace("ACE","a[b-d]e","UqQF\\1WlGk&BdlidOCI\\1",[caseless])),
- <<"UqQFWlGkACEBdlidOCI">> = iolist_to_binary(re:replace("ACE","a[b-d]e","UqQF\\1WlGk&BdlidOCI\\1",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[b-d]e","UKuM",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[b-d]e","UKuM",[caseless,
- global])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","a[b-d]e","W",[caseless])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","a[b-d]e","W",[caseless,
- global])),
- <<"ABD">> = iolist_to_binary(re:replace("ABD","a[b-d]e","HF",[caseless])),
- <<"ABD">> = iolist_to_binary(re:replace("ABD","a[b-d]e","HF",[caseless,
- global])),
- <<"AFX">> = iolist_to_binary(re:replace("AAC","a[b-d]","FX",[caseless])),
- <<"AFX">> = iolist_to_binary(re:replace("AAC","a[b-d]","FX",[caseless,
- global])),
- <<"aWjCeJjBuA-eA-wLdnI">> = iolist_to_binary(re:replace("A-","a[-b]","aWjCeJj\\1Bu&e&wLdnI",[caseless])),
- <<"aWjCeJjBuA-eA-wLdnI">> = iolist_to_binary(re:replace("A-","a[-b]","aWjCeJj\\1Bu&e&wLdnI",[caseless,
- global])),
- <<"vEBoA-A-hhUA-oyIbqdTA">> = iolist_to_binary(re:replace("A-","a[b-]","vEBo&&hhU&oyIbq\\1d\\1TA",[caseless])),
- <<"vEBoA-A-hhUA-oyIbqdTA">> = iolist_to_binary(re:replace("A-","a[b-]","vEBo&&hhU&oyIbq\\1d\\1TA",[caseless,
- global])),
- <<"lxsWAAwljA]">> = iolist_to_binary(re:replace("A]","a]","lxsW\\1AAwlj&",[caseless])),
- <<"lxsWAAwljA]">> = iolist_to_binary(re:replace("A]","a]","lxsW\\1AAwlj&",[caseless,
- global])),
- <<"A]BBA]BwueRHPvA]BFaS">> = iolist_to_binary(re:replace("A]B","a[]]b","&B&\\1wueRHPv&FaS",[caseless])),
- <<"A]BBA]BwueRHPvA]BFaS">> = iolist_to_binary(re:replace("A]B","a[]]b","&B&\\1wueRHPv&FaS",[caseless,
- global])),
- ok.
-run22() ->
- <<"UTPAEDUuRpFvTKUIXNAEDH">> = iolist_to_binary(re:replace("AED","a[^bc]d","U\\1TP&UuRpFvTKUIXN&H",[caseless])),
- <<"UTPAEDUuRpFvTKUIXNAEDH">> = iolist_to_binary(re:replace("AED","a[^bc]d","U\\1TP&UuRpFvTKUIXN&H",[caseless,
- global])),
- <<"EEkBKqX">> = iolist_to_binary(re:replace("ADC","a[^-b]c","EEk\\1BKqX",[caseless])),
- <<"EEkBKqX">> = iolist_to_binary(re:replace("ADC","a[^-b]c","EEk\\1BKqX",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^-b]c","W&hcyn\\1LTFcrP",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a[^-b]c","W&hcyn\\1LTFcrP",[caseless,
+ <<"AABBABCJqvleABCABCoABCmABCFUTm">> = iolist_to_binary(re:replace("AABBABC","a+b+c","&Jqvle\\1&&o&m&FUTm",[caseless])),
+ <<"AABBABCJqvleABCABCoABCmABCFUTm">> = iolist_to_binary(re:replace("AABBABC","a+b+c","&Jqvle\\1&&o&m&FUTm",[caseless,
global])),
- <<"ABD">> = iolist_to_binary(re:replace("ABD","a[^-b]c","l&hDcBVR&&P\\1HyoS&",[caseless])),
- <<"ABD">> = iolist_to_binary(re:replace("ABD","a[^-b]c","l&hDcBVR&&P\\1HyoS&",[caseless,
- global])),
- <<"A-C">> = iolist_to_binary(re:replace("A-C","a[^-b]c","r&\\1",[caseless])),
- <<"A-C">> = iolist_to_binary(re:replace("A-C","a[^-b]c","r&\\1",[caseless,
- global])),
- <<"wsKsChmsBbyoCwJGFq">> = iolist_to_binary(re:replace("ADC","a[^]b]c","wsKsChm\\1sB\\1byoCwJGFq",[caseless])),
- <<"wsKsChmsBbyoCwJGFq">> = iolist_to_binary(re:replace("ADC","a[^]b]c","wsKsChm\\1sB\\1byoCwJGFq",[caseless,
- global])),
- <<"AdCuC">> = iolist_to_binary(re:replace("ABC","ab|cd","AdCu",[caseless])),
- <<"AdCuC">> = iolist_to_binary(re:replace("ABC","ab|cd","AdCu",[caseless,
+ <<"AABBac">> = iolist_to_binary(re:replace("AABBABC","a{1,}b{1,}c","ac",[caseless])),
+ <<"AABBac">> = iolist_to_binary(re:replace("AABBABC","a{1,}b{1,}c","ac",[caseless,
+ global])),
+ <<"OABC">> = iolist_to_binary(re:replace("ABCABC","a.+?c","O",[caseless])),
+ <<"OO">> = iolist_to_binary(re:replace("ABCABC","a.+?c","O",[caseless,
global])),
- <<"kPjHRmkRWABOFqNCD">> = iolist_to_binary(re:replace("ABCD","ab|cd","kPjHRm\\1k\\1RW&OFqN",[caseless])),
- <<"kPjHRmkRWABOFqNkPjHRmkRWCDOFqN">> = iolist_to_binary(re:replace("ABCD","ab|cd","kPjHRm\\1k\\1RW&OFqN",[caseless,
+ <<"scmlABC">> = iolist_to_binary(re:replace("ABCABC","a.*?c","scml",[caseless])),
+ <<"scmlscml">> = iolist_to_binary(re:replace("ABCABC","a.*?c","scml",[caseless,
+ global])),
+ <<"lPmBjogUPNEABC">> = iolist_to_binary(re:replace("ABCABC","a.{0,5}?c","lPmB\\1jogUPNE\\1",[caseless])),
+ <<"lPmBjogUPNElPmBjogUPNE">> = iolist_to_binary(re:replace("ABCABC","a.{0,5}?c","lPmB\\1jogUPNE\\1",[caseless,
+ global])),
+ <<"lytYeABWABABFmABccWBV">> = iolist_to_binary(re:replace("AB","(a+|b)*","lytYe&W&&Fm&ccW\\1V",[caseless])),
+ <<"lytYeABWABABFmABccWBVlytYeWFmccWV">> = iolist_to_binary(re:replace("AB","(a+|b)*","lytYe&W&&Fm&ccW\\1V",[caseless,
global])),
- <<"DipEFEFNEFXjXNBJMTG">> = iolist_to_binary(re:replace("DEF","()ef","ip&&N&XjXNBJMTG\\1",[caseless])),
- <<"DipEFEFNEFXjXNBJMTG">> = iolist_to_binary(re:replace("DEF","()ef","ip&&N&XjXNBJMTG\\1",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","$b","jl",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","$b","jl",[caseless,
- global])),
- <<"A]C">> = iolist_to_binary(re:replace("A]C","$b","Ghx\\1\\1nMcXP&D\\1hXTKGqJ",[caseless])),
- <<"A]C">> = iolist_to_binary(re:replace("A]C","$b","Ghx\\1\\1nMcXP&D\\1hXTKGqJ",[caseless,
- global])),
- <<"B">> = iolist_to_binary(re:replace("B","$b","&CU&s",[caseless])),
- <<"B">> = iolist_to_binary(re:replace("B","$b","&CU&s",[caseless,
- global])),
- <<"q">> = iolist_to_binary(re:replace("A(B","a\\(b","q",[caseless])),
- <<"q">> = iolist_to_binary(re:replace("A(B","a\\(b","q",[caseless,
- global])),
- <<"LbAKAddxuaGFABjds">> = iolist_to_binary(re:replace("AB","a\\(*b","LbAKAddx\\1\\1uaGF&jd\\1s",[caseless])),
- <<"LbAKAddxuaGFABjds">> = iolist_to_binary(re:replace("AB","a\\(*b","LbAKAddx\\1\\1uaGF&jd\\1s",[caseless,
- global])),
- <<"WcHNHA((BeLNHyhL">> = iolist_to_binary(re:replace("A((B","a\\(*b","WcH\\1\\1\\1NH&\\1\\1eLNHy\\1hL",[caseless])),
- <<"WcHNHA((BeLNHyhL">> = iolist_to_binary(re:replace("A((B","a\\(*b","WcH\\1\\1\\1NH&\\1\\1eLNHy\\1hL",[caseless,
- global])),
- <<"A">> = iolist_to_binary(re:replace("A","a\\\\b","FD\\1dW",[caseless,
- notbol])),
- <<"A">> = iolist_to_binary(re:replace("A","a\\\\b","FD\\1dW",[caseless,
- notbol,
- global])),
- <<"AojAgACCaWeAfuBC">> = iolist_to_binary(re:replace("ABC","((a))","\\1oj&g\\1CCaWe\\1fu",[caseless])),
- <<"AojAgACCaWeAfuBC">> = iolist_to_binary(re:replace("ABC","((a))","\\1oj&g\\1CCaWe\\1fu",[caseless,
- global])),
- <<"xSJDAQoInQAfBNwlABCJAO">> = iolist_to_binary(re:replace("ABC","(a)b(c)","xSJD\\1QoInQ\\1fBNwl&J\\1O",[caseless])),
- <<"xSJDAQoInQAfBNwlABCJAO">> = iolist_to_binary(re:replace("ABC","(a)b(c)","xSJD\\1QoInQ\\1fBNwl&J\\1O",[caseless,
- global])),
- <<"AABBABCWpU">> = iolist_to_binary(re:replace("AABBABC","a+b+c","&W\\1pU",[caseless])),
- <<"AABBABCWpU">> = iolist_to_binary(re:replace("AABBABC","a+b+c","&W\\1pU",[caseless,
+ <<"BBq">> = iolist_to_binary(re:replace("AB","(a+|b){0,}","\\1\\1q",[caseless])),
+ <<"BBqq">> = iolist_to_binary(re:replace("AB","(a+|b){0,}","\\1\\1q",[caseless,
global])),
- <<"AABBvuHyJYABClhsNABCABC">> = iolist_to_binary(re:replace("AABBABC","a{1,}b{1,}c","vuHyJY&lhsN&&",[caseless])),
- <<"AABBvuHyJYABClhsNABCABC">> = iolist_to_binary(re:replace("AABBABC","a{1,}b{1,}c","vuHyJY&lhsN&&",[caseless,
- global])),
- <<"PuUbOABC">> = iolist_to_binary(re:replace("ABCABC","a.+?c","Pu\\1UbO",[caseless])),
- <<"PuUbOPuUbO">> = iolist_to_binary(re:replace("ABCABC","a.+?c","Pu\\1UbO",[caseless,
- global])),
- <<"FGYfABCDdRACwIXABC">> = iolist_to_binary(re:replace("ABCABC","a.*?c","FGYf&DdRA\\1C\\1\\1wIX",[caseless])),
- <<"FGYfABCDdRACwIXFGYfABCDdRACwIX">> = iolist_to_binary(re:replace("ABCABC","a.*?c","FGYf&DdRA\\1C\\1\\1wIX",[caseless,
- global])),
- <<"hfyssBtPoqABC">> = iolist_to_binary(re:replace("ABCABC","a.{0,5}?c","\\1hfyssBt\\1Poq",[caseless])),
- <<"hfyssBtPoqhfyssBtPoq">> = iolist_to_binary(re:replace("ABCABC","a.{0,5}?c","\\1hfyssBt\\1Poq",[caseless,
- global])),
- <<"aoHgobCXYeRwABSXtABB">> = iolist_to_binary(re:replace("AB","(a+|b)*","aoHgobCXYeRw&SXt&\\1",[caseless])),
- <<"aoHgobCXYeRwABSXtABBaoHgobCXYeRwSXt">> = iolist_to_binary(re:replace("AB","(a+|b)*","aoHgobCXYeRw&SXt&\\1",[caseless,
- global])),
- <<"LYWAHKusKAgrXKh">> = iolist_to_binary(re:replace("AB","(a+|b){0,}","LYWAHKusKAgrXKh",[caseless])),
- <<"LYWAHKusKAgrXKhLYWAHKusKAgrXKh">> = iolist_to_binary(re:replace("AB","(a+|b){0,}","LYWAHKusKAgrXKh",[caseless,
- global])),
- <<"UVXSWR">> = iolist_to_binary(re:replace("AB","(a+|b)+","UVXSWR",[caseless])),
- <<"UVXSWR">> = iolist_to_binary(re:replace("AB","(a+|b)+","UVXSWR",[caseless,
- global])),
- <<"lXCwBqLtjKMQjABBokVR">> = iolist_to_binary(re:replace("AB","(a+|b){1,}","lXCw\\1qLtjKMQj&\\1okVR",[caseless])),
- <<"lXCwBqLtjKMQjABBokVR">> = iolist_to_binary(re:replace("AB","(a+|b){1,}","lXCw\\1qLtjKMQj&\\1okVR",[caseless,
+ <<"xBPvBwqaXlIBysBBNnQs">> = iolist_to_binary(re:replace("AB","(a+|b)+","x\\1Pv\\1wqaXlIBys\\1BNnQs",[caseless])),
+ <<"xBPvBwqaXlIBysBBNnQs">> = iolist_to_binary(re:replace("AB","(a+|b)+","x\\1Pv\\1wqaXlIBys\\1BNnQs",[caseless,
global])),
ok.
run23() ->
- <<"MAFkB">> = iolist_to_binary(re:replace("AB","(a+|b)?","M\\1Fk",[caseless])),
- <<"MAFkMBFkMFk">> = iolist_to_binary(re:replace("AB","(a+|b)?","M\\1Fk",[caseless,
+ <<"vJrBABXpcvqi">> = iolist_to_binary(re:replace("AB","(a+|b){1,}","vJr\\1&Xpcvqi",[caseless])),
+ <<"vJrBABXpcvqi">> = iolist_to_binary(re:replace("AB","(a+|b){1,}","vJr\\1&Xpcvqi",[caseless,
+ global])),
+ <<"hAKhhwB">> = iolist_to_binary(re:replace("AB","(a+|b)?","h&Khhw",[caseless])),
+ <<"hAKhhwhBKhhwhKhhw">> = iolist_to_binary(re:replace("AB","(a+|b)?","h&Khhw",[caseless,
global])),
- <<"STYCeRAuyArB">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}","STYCeR\\1uy\\1r",[caseless])),
- <<"STYCeRAuyArSTYCeRBuyBrSTYCeRuyr">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}","STYCeR\\1uy\\1r",[caseless,
- global])),
- <<"WBHxgnNQAB">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}?","W&BH\\1&\\1x&gnNQ",[caseless])),
- <<"WBHxgnNQWABHAAAxAgnNQWBHxgnNQWBBHBBBxBgnNQWBHxgnNQ">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}?","W&BH\\1&\\1x&gnNQ",[caseless,
- global])),
- <<"MbLbSWbCDEggiClWfEM">> = iolist_to_binary(re:replace("CDE","[^ab]*","MbLbSWb&ggiClWfEM",[caseless])),
- <<"MbLbSWbCDEggiClWfEMMbLbSWbggiClWfEM">> = iolist_to_binary(re:replace("CDE","[^ab]*","MbLbSWb&ggiClWfEM",[caseless,
- global])),
- <<"rjABBBCDfICJABBBCDABBBCDEjJ">> = iolist_to_binary(re:replace("ABBBCD","([abc])*d","rj&fICJ&&EjJ",[caseless])),
- <<"rjABBBCDfICJABBBCDABBBCDEjJ">> = iolist_to_binary(re:replace("ABBBCD","([abc])*d","rj&fICJ&&EjJ",[caseless,
- global])),
- <<"xQ">> = iolist_to_binary(re:replace("ABCD","([abc])*bcd","xQ",[caseless])),
- <<"xQ">> = iolist_to_binary(re:replace("ABCD","([abc])*bcd","xQ",[caseless,
- global])),
- <<"AllmaUiAaKG">> = iolist_to_binary(re:replace("E","a|b|c|d|e","AllmaUiAa\\1KG",[caseless])),
- <<"AllmaUiAaKG">> = iolist_to_binary(re:replace("E","a|b|c|d|e","AllmaUiAa\\1KG",[caseless,
- global])),
- <<"QdfE">> = iolist_to_binary(re:replace("EF","(a|b|c|d|e)f","Qdf\\1",[caseless])),
- <<"QdfE">> = iolist_to_binary(re:replace("EF","(a|b|c|d|e)f","Qdf\\1",[caseless,
- global])),
- <<"ABCDEFGTvQSeJABCDEFGWMXdIOTh">> = iolist_to_binary(re:replace("ABCDEFG","abcd*efg","\\1&TvQSeJ&\\1WMXdIO\\1Th",[caseless])),
- <<"ABCDEFGTvQSeJABCDEFGWMXdIOTh">> = iolist_to_binary(re:replace("ABCDEFG","abcd*efg","\\1&TvQSeJ&\\1WMXdIO\\1Th",[caseless,
- global])),
- <<"XlSgABJHbKHRjUuNjOrYABBBZ">> = iolist_to_binary(re:replace("XABYABBBZ","ab*","lSg&JHbKHRjUuNjOr",[caseless])),
- <<"XlSgABJHbKHRjUuNjOrYlSgABBBJHbKHRjUuNjOrZ">> = iolist_to_binary(re:replace("XABYABBBZ","ab*","lSg&JHbKHRjUuNjOr",[caseless,
- global])),
- <<"XNjAAesIAgAYABBBZ">> = iolist_to_binary(re:replace("XAYABBBZ","ab*","Nj&&esI&g&",[caseless])),
- <<"XNjAAesIAgAYNjABBBABBBesIABBBgABBBZ">> = iolist_to_binary(re:replace("XAYABBBZ","ab*","Nj&&esI&g&",[caseless,
+ <<"rfOTAksYhKEDAAKAoWuB">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}","rfOT\\1ksYhKED&&K\\1oWu",[caseless])),
+ <<"rfOTAksYhKEDAAKAoWurfOTBksYhKEDBBKBoWurfOTksYhKEDKoWu">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}","rfOT\\1ksYhKED&&K\\1oWu",[caseless,
+ global])),
+ <<"MGbpmvAB">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}?","\\1MGbpmv",[caseless])),
+ <<"MGbpmvAMGbpmvMGbpmvBMGbpmvMGbpmv">> = iolist_to_binary(re:replace("AB","(a+|b){0,1}?","\\1MGbpmv",[caseless,
+ global])),
+ <<"udAFEstNiUeKkd">> = iolist_to_binary(re:replace("CDE","[^ab]*","udAFEstNiUeKkd",[caseless])),
+ <<"udAFEstNiUeKkdudAFEstNiUeKkd">> = iolist_to_binary(re:replace("CDE","[^ab]*","udAFEstNiUeKkd",[caseless,
global])),
- <<"ABpvCDEayXCDEDCDSCDECDEwh">> = iolist_to_binary(re:replace("ABCDE","(ab|cd)e","pv&ayX&D\\1S&&wh",[caseless])),
- <<"ABpvCDEayXCDEDCDSCDECDEwh">> = iolist_to_binary(re:replace("ABCDE","(ab|cd)e","pv&ayX&D\\1S&&wh",[caseless,
- global])),
- <<"HIJAJ">> = iolist_to_binary(re:replace("HIJ","[abhgefdc]ij","&A\\1J\\1",[caseless])),
- <<"HIJAJ">> = iolist_to_binary(re:replace("HIJ","[abhgefdc]ij","&A\\1J\\1",[caseless,
+ <<"ABBBCDvDABBBCDABBBCDGllMCdwv">> = iolist_to_binary(re:replace("ABBBCD","([abc])*d","&vD&&GllMCdwv",[caseless])),
+ <<"ABBBCDvDABBBCDABBBCDGllMCdwv">> = iolist_to_binary(re:replace("ABBBCD","([abc])*d","&vD&&GllMCdwv",[caseless,
+ global])),
+ <<"SAABCDbA">> = iolist_to_binary(re:replace("ABCD","([abc])*bcd","S\\1&b\\1",[caseless])),
+ <<"SAABCDbA">> = iolist_to_binary(re:replace("ABCD","([abc])*bcd","S\\1&b\\1",[caseless,
global])),
- <<"ABCDE">> = iolist_to_binary(re:replace("ABCDE","^(ab|cd)e","y&gKEPudO&f\\1Vf",[caseless])),
- <<"ABCDE">> = iolist_to_binary(re:replace("ABCDE","^(ab|cd)e","y&gKEPudO&f\\1Vf",[caseless,
- global])),
- <<"ABCDsEFmkoWgwo">> = iolist_to_binary(re:replace("ABCDEF","(abc|)ef","s&mkoWgwo",[caseless])),
- <<"ABCDsEFmkoWgwo">> = iolist_to_binary(re:replace("ABCDEF","(abc|)ef","s&mkoWgwo",[caseless,
+ <<"COkGEqEpREwm">> = iolist_to_binary(re:replace("E","a|b|c|d|e","COkG&q&pR&wm\\1",[caseless])),
+ <<"COkGEqEpREwm">> = iolist_to_binary(re:replace("E","a|b|c|d|e","COkG&q&pR&wm\\1",[caseless,
+ global])),
+ <<"EFEYUF">> = iolist_to_binary(re:replace("EF","(a|b|c|d|e)f","&\\1YUF",[caseless])),
+ <<"EFEYUF">> = iolist_to_binary(re:replace("EF","(a|b|c|d|e)f","&\\1YUF",[caseless,
+ global])),
+ <<"keABCDEFGn">> = iolist_to_binary(re:replace("ABCDEFG","abcd*efg","\\1ke&n",[caseless])),
+ <<"keABCDEFGn">> = iolist_to_binary(re:replace("ABCDEFG","abcd*efg","\\1ke&n",[caseless,
+ global])),
+ <<"XTpYABBBZ">> = iolist_to_binary(re:replace("XABYABBBZ","ab*","Tp",[caseless])),
+ <<"XTpYTpZ">> = iolist_to_binary(re:replace("XABYABBBZ","ab*","Tp",[caseless,
+ global])),
+ <<"XcWRYABBBZ">> = iolist_to_binary(re:replace("XAYABBBZ","ab*","cWR\\1",[caseless])),
+ <<"XcWRYcWRZ">> = iolist_to_binary(re:replace("XAYABBBZ","ab*","cWR\\1",[caseless,
+ global])),
+ <<"ABICDg">> = iolist_to_binary(re:replace("ABCDE","(ab|cd)e","I\\1g",[caseless])),
+ <<"ABICDg">> = iolist_to_binary(re:replace("ABCDE","(ab|cd)e","I\\1g",[caseless,
+ global])),
+ <<"HIJe">> = iolist_to_binary(re:replace("HIJ","[abhgefdc]ij","&\\1e",[caseless])),
+ <<"HIJe">> = iolist_to_binary(re:replace("HIJ","[abhgefdc]ij","&\\1e",[caseless,
+ global])),
+ <<"ABCDE">> = iolist_to_binary(re:replace("ABCDE","^(ab|cd)e","YHPf",[caseless])),
+ <<"ABCDE">> = iolist_to_binary(re:replace("ABCDE","^(ab|cd)e","YHPf",[caseless,
+ global])),
+ <<"ABCDqDYnUXHWSlxXQRHVxU">> = iolist_to_binary(re:replace("ABCDEF","(abc|)ef","qDYnUXHWSlxXQRHVxU\\1",[caseless])),
+ <<"ABCDqDYnUXHWSlxXQRHVxU">> = iolist_to_binary(re:replace("ABCDEF","(abc|)ef","qDYnUXHWSlxXQRHVxU\\1",[caseless,
+ global])),
+ <<"ApMu">> = iolist_to_binary(re:replace("ABCD","(a|b)c*d","pMu",[caseless])),
+ <<"ApMu">> = iolist_to_binary(re:replace("ABCD","(a|b)c*d","pMu",[caseless,
+ global])),
+ <<"ntLDenfA">> = iolist_to_binary(re:replace("ABC","(ab|ab*)bc","ntLDenf\\1",[caseless])),
+ <<"ntLDenfA">> = iolist_to_binary(re:replace("ABC","(ab|ab*)bc","ntLDenf\\1",[caseless,
global])),
- <<"AEKBBQPBA">> = iolist_to_binary(re:replace("ABCD","(a|b)c*d","EK\\1\\1QP\\1A",[caseless])),
- <<"AEKBBQPBA">> = iolist_to_binary(re:replace("ABCD","(a|b)c*d","EK\\1\\1QP\\1A",[caseless,
- global])),
- <<"NnxIEABC">> = iolist_to_binary(re:replace("ABC","(ab|ab*)bc","NnxIE&",[caseless])),
- <<"NnxIEABC">> = iolist_to_binary(re:replace("ABC","(ab|ab*)bc","NnxIE&",[caseless,
- global])),
- <<"owDpyYBCHVgp">> = iolist_to_binary(re:replace("ABC","a([bc]*)c*","owDpyY\\1HVgp",[caseless])),
- <<"owDpyYBCHVgp">> = iolist_to_binary(re:replace("ABC","a([bc]*)c*","owDpyY\\1HVgp",[caseless,
- global])),
- <<"ABCDABCDaSWTqABCDBCABCDKOABCD">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c*d)","&&aSWTq&\\1&KO&",[caseless])),
- <<"ABCDABCDaSWTqABCDBCABCDKOABCD">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c*d)","&&aSWTq&\\1&KO&",[caseless,
- global])),
+ <<"kBC">> = iolist_to_binary(re:replace("ABC","a([bc]*)c*","k\\1",[caseless])),
+ <<"kBC">> = iolist_to_binary(re:replace("ABC","a([bc]*)c*","k\\1",[caseless,
+ global])),
ok.
run24() ->
- <<"llhYIK">> = iolist_to_binary(re:replace("ABCD","a([bc]+)(c*d)","llhYIK",[caseless])),
- <<"llhYIK">> = iolist_to_binary(re:replace("ABCD","a([bc]+)(c*d)","llhYIK",[caseless,
- global])),
- <<"qBhyABCDRsUdeBABCDcnABCDJOj">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c+d)","q\\1hy&RsUde\\1&cn&JOj",[caseless])),
- <<"qBhyABCDRsUdeBABCDcnABCDJOj">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c+d)","q\\1hy&RsUde\\1&cn&JOj",[caseless,
- global])),
- <<"sXpCRWnaew">> = iolist_to_binary(re:replace("ADCDCDE","a[bcd]*dcdcde","sXpCRWnae\\1w",[caseless])),
- <<"sXpCRWnaew">> = iolist_to_binary(re:replace("ADCDCDE","a[bcd]*dcdcde","sXpCRWnae\\1w",[caseless,
- global])),
- <<"PKABCMuYNABCABCXtIsm">> = iolist_to_binary(re:replace("ABC","(ab|a)b*c","PK&MuYN&&XtIsm",[caseless])),
- <<"PKABCMuYNABCABCXtIsm">> = iolist_to_binary(re:replace("ABC","(ab|a)b*c","PK&MuYN&&XtIsm",[caseless,
- global])),
- <<"pMOU">> = iolist_to_binary(re:replace("ABCD","((a)(b)c)(d)","pMOU",[caseless])),
- <<"pMOU">> = iolist_to_binary(re:replace("ABCD","((a)(b)c)(d)","pMOU",[caseless,
- global])),
- <<"bnFWpQALPHAjXlptg">> = iolist_to_binary(re:replace("ALPHA","[a-zA-Z_][a-zA-Z0-9_]*","bnFW\\1pQ&jXl\\1ptg\\1",[caseless])),
- <<"bnFWpQALPHAjXlptg">> = iolist_to_binary(re:replace("ALPHA","[a-zA-Z_][a-zA-Z0-9_]*","bnFW\\1pQ&jXl\\1ptg\\1",[caseless,
- global])),
- <<"ARTSHBHAfemfBHJIBHBHBH">> = iolist_to_binary(re:replace("ABH","^a(bc+|b[eh])g|.h$","RT\\1SH&Afemf&JI&&&",[caseless])),
- <<"ARTSHBHAfemfBHJIBHBHBH">> = iolist_to_binary(re:replace("ABH","^a(bc+|b[eh])g|.h$","RT\\1SH&Afemf&JI&&&",[caseless,
- global])),
- <<"lEFFGZichPjsHBEFFGZe">> = iolist_to_binary(re:replace("EFFGZ","(bc+d$|ef*g.|h?i(j|k))","l\\1ichPjsHB\\1e",[caseless])),
- <<"lEFFGZichPjsHBEFFGZe">> = iolist_to_binary(re:replace("EFFGZ","(bc+d$|ef*g.|h?i(j|k))","l\\1ichPjsHB\\1e",[caseless,
- global])),
- <<"IJnqeTnhpIJ">> = iolist_to_binary(re:replace("IJ","(bc+d$|ef*g.|h?i(j|k))","&nqeTnhp\\1",[caseless])),
- <<"IJnqeTnhpIJ">> = iolist_to_binary(re:replace("IJ","(bc+d$|ef*g.|h?i(j|k))","&nqeTnhp\\1",[caseless,
+ <<"dDECvKABCDBCABCDKBC">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c*d)","dDECvK&\\1&K\\1",[caseless])),
+ <<"dDECvKABCDBCABCDKBC">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c*d)","dDECvK&\\1&K\\1",[caseless,
+ global])),
+ <<"BCVkXABCDROnLhn">> = iolist_to_binary(re:replace("ABCD","a([bc]+)(c*d)","\\1VkX&ROnLhn",[caseless])),
+ <<"BCVkXABCDROnLhn">> = iolist_to_binary(re:replace("ABCD","a([bc]+)(c*d)","\\1VkX&ROnLhn",[caseless,
+ global])),
+ <<"sABCDfIigwcUBfcAtBAdBd">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c+d)","s&fIigwcU\\1fcAt\\1Ad\\1d",[caseless])),
+ <<"sABCDfIigwcUBfcAtBAdBd">> = iolist_to_binary(re:replace("ABCD","a([bc]*)(c+d)","s&fIigwcU\\1fcAt\\1Ad\\1d",[caseless,
+ global])),
+ <<"wkVJSCADCDCDEbeusn">> = iolist_to_binary(re:replace("ADCDCDE","a[bcd]*dcdcde","w\\1kVJSC&beus\\1\\1n",[caseless])),
+ <<"wkVJSCADCDCDEbeusn">> = iolist_to_binary(re:replace("ADCDCDE","a[bcd]*dcdcde","w\\1kVJSC&beus\\1\\1n",[caseless,
+ global])),
+ <<"fIEmgxyABXgAmoxnNTABCb">> = iolist_to_binary(re:replace("ABC","(ab|a)b*c","fIEmgxy\\1XgAmoxnNT&b",[caseless])),
+ <<"fIEmgxyABXgAmoxnNTABCb">> = iolist_to_binary(re:replace("ABC","(ab|a)b*c","fIEmgxy\\1XgAmoxnNT&b",[caseless,
+ global])),
+ <<"YSwweMKEtREGmRxABCEp">> = iolist_to_binary(re:replace("ABCD","((a)(b)c)(d)","YSwweMKEtREGmRx\\1Ep",[caseless])),
+ <<"YSwweMKEtREGmRxABCEp">> = iolist_to_binary(re:replace("ABCD","((a)(b)c)(d)","YSwweMKEtREGmRx\\1Ep",[caseless,
global])),
- <<"RTAEFFGZEFFGZtiL">> = iolist_to_binary(re:replace("REFFGZ","(bc+d$|ef*g.|h?i(j|k))","TA\\1&tiL",[caseless])),
- <<"RTAEFFGZEFFGZtiL">> = iolist_to_binary(re:replace("REFFGZ","(bc+d$|ef*g.|h?i(j|k))","TA\\1&tiL",[caseless,
+ <<"JMWvNALPHAHEALPHAgTLgLgw">> = iolist_to_binary(re:replace("ALPHA","[a-zA-Z_][a-zA-Z0-9_]*","JMWvN&HE&\\1gTLgLgw",[caseless])),
+ <<"JMWvNALPHAHEALPHAgTLgLgw">> = iolist_to_binary(re:replace("ALPHA","[a-zA-Z_][a-zA-Z0-9_]*","JMWvN&HE&\\1gTLgLgw",[caseless,
+ global])),
+ <<"ALoaDSHAABHcNcg">> = iolist_to_binary(re:replace("ABH","^a(bc+|b[eh])g|.h$","LoaDSHAA&c\\1Ncg",[caseless])),
+ <<"ALoaDSHAABHcNcg">> = iolist_to_binary(re:replace("ABH","^a(bc+|b[eh])g|.h$","LoaDSHAA&c\\1Ncg",[caseless,
global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","QSIQtF",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","QSIQtF",[caseless,
- global])),
- <<"ADCDCDE">> = iolist_to_binary(re:replace("ADCDCDE","(bc+d$|ef*g.|h?i(j|k))","hkkg&\\1M",[caseless])),
- <<"ADCDCDE">> = iolist_to_binary(re:replace("ADCDCDE","(bc+d$|ef*g.|h?i(j|k))","hkkg&\\1M",[caseless,
+ <<"AWnYrnkPEFFGZ">> = iolist_to_binary(re:replace("EFFGZ","(bc+d$|ef*g.|h?i(j|k))","AWnYrnkP&",[caseless])),
+ <<"AWnYrnkPEFFGZ">> = iolist_to_binary(re:replace("EFFGZ","(bc+d$|ef*g.|h?i(j|k))","AWnYrnkP&",[caseless,
+ global])),
+ <<"iIJYPJxCXsht">> = iolist_to_binary(re:replace("IJ","(bc+d$|ef*g.|h?i(j|k))","i&YPJxCXsht",[caseless])),
+ <<"iIJYPJxCXsht">> = iolist_to_binary(re:replace("IJ","(bc+d$|ef*g.|h?i(j|k))","i&YPJxCXsht",[caseless,
+ global])),
+ <<"ROdSmgEnEFFGZbUEFFGZxEFFGZEFFGZjiEFFGZD">> = iolist_to_binary(re:replace("REFFGZ","(bc+d$|ef*g.|h?i(j|k))","OdSmgEn&bU&x&&ji\\1D",[caseless])),
+ <<"ROdSmgEnEFFGZbUEFFGZxEFFGZEFFGZjiEFFGZD">> = iolist_to_binary(re:replace("REFFGZ","(bc+d$|ef*g.|h?i(j|k))","OdSmgEn&bU&x&&ji\\1D",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","ITOSQR&JRMPdo",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(bc+d$|ef*g.|h?i(j|k))","ITOSQR&JRMPdo",[caseless,
+ global])),
+ <<"ADCDCDE">> = iolist_to_binary(re:replace("ADCDCDE","(bc+d$|ef*g.|h?i(j|k))","Vy&&ec&TLeQ",[caseless])),
+ <<"ADCDCDE">> = iolist_to_binary(re:replace("ADCDCDE","(bc+d$|ef*g.|h?i(j|k))","Vy&&ec&TLeQ",[caseless,
+ global])),
+ <<"EFFG">> = iolist_to_binary(re:replace("EFFG","(bc+d$|ef*g.|h?i(j|k))","PCmRtstvtrOjn",[caseless])),
+ <<"EFFG">> = iolist_to_binary(re:replace("EFFG","(bc+d$|ef*g.|h?i(j|k))","PCmRtstvtrOjn",[caseless,
global])),
- <<"EFFG">> = iolist_to_binary(re:replace("EFFG","(bc+d$|ef*g.|h?i(j|k))","b",[caseless])),
- <<"EFFG">> = iolist_to_binary(re:replace("EFFG","(bc+d$|ef*g.|h?i(j|k))","b",[caseless,
- global])),
- <<"BCDD">> = iolist_to_binary(re:replace("BCDD","(bc+d$|ef*g.|h?i(j|k))","TW&UdGE\\1S&N\\1u&LM",[caseless])),
- <<"BCDD">> = iolist_to_binary(re:replace("BCDD","(bc+d$|ef*g.|h?i(j|k))","TW&UdGE\\1S&N\\1u&LM",[caseless,
- global])),
- <<"APvAegF">> = iolist_to_binary(re:replace("A","((((((((((a))))))))))","\\1Pv\\1egF",[caseless])),
- <<"APvAegF">> = iolist_to_binary(re:replace("A","((((((((((a))))))))))","\\1Pv\\1egF",[caseless,
- global])),
- <<"vCaAAVsbLoAAcsIToC">> = iolist_to_binary(re:replace("AA","((((((((((a))))))))))\\10","vCa&VsbLo&csIToC",[caseless])),
- <<"vCaAAVsbLoAAcsIToC">> = iolist_to_binary(re:replace("AA","((((((((((a))))))))))\\10","vCa&VsbLo&csIToC",[caseless,
- global])),
- <<"ADAqIbKy">> = iolist_to_binary(re:replace("A","(((((((((a)))))))))","\\1D\\1qIbKy",[caseless])),
- <<"ADAqIbKy">> = iolist_to_binary(re:replace("A","(((((((((a)))))))))","\\1D\\1qIbKy",[caseless,
- global])),
- <<"HdAAToxA">> = iolist_to_binary(re:replace("A","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))","Hd\\1\\1Tox&",[caseless])),
- <<"HdAAToxA">> = iolist_to_binary(re:replace("A","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))","Hd\\1\\1Tox&",[caseless,
- global])),
- <<"FoLn">> = iolist_to_binary(re:replace("C","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))","FoLn",[caseless])),
- <<"FoLn">> = iolist_to_binary(re:replace("C","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))","FoLn",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","eKwT&ytF",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","eKwT&ytF",[caseless,
- global])),
- <<"AA">> = iolist_to_binary(re:replace("AA","multiple words of text","&&naWXBUAJEX&uN\\1eWT&",[caseless])),
- <<"AA">> = iolist_to_binary(re:replace("AA","multiple words of text","&&naWXBUAJEX&uN\\1eWT&",[caseless,
- global])),
- <<"UH-UH">> = iolist_to_binary(re:replace("UH-UH","multiple words of text","AxWlS&OyQU",[caseless])),
- <<"UH-UH">> = iolist_to_binary(re:replace("UH-UH","multiple words of text","AxWlS&OyQU",[caseless,
- global])),
- <<"WkAfGvMULTIPLE WORDSvMULTIPLE WORDS, YEAH">> = iolist_to_binary(re:replace("MULTIPLE WORDS, YEAH","multiple words","WkAfGv&v&\\1",[caseless])),
- <<"WkAfGvMULTIPLE WORDSvMULTIPLE WORDS, YEAH">> = iolist_to_binary(re:replace("MULTIPLE WORDS, YEAH","multiple words","WkAfGv&v&\\1",[caseless,
- global])),
- <<"KN">> = iolist_to_binary(re:replace("ABCDE","(.*)c(.*)","KN",[caseless])),
- <<"KN">> = iolist_to_binary(re:replace("ABCDE","(.*)c(.*)","KN",[caseless,
- global])),
- <<"TMyXAYMUnYaLqLp">> = iolist_to_binary(re:replace("(A, B)","\\((.*), (.*)\\)","TMyX\\1YMUnYaLqLp",[caseless])),
- <<"TMyXAYMUnYaLqLp">> = iolist_to_binary(re:replace("(A, B)","\\((.*), (.*)\\)","TMyX\\1YMUnYaLqLp",[caseless,
- global])),
- <<"trKKABCDSCXABCDotxTyYR">> = iolist_to_binary(re:replace("ABCD","abcd","t\\1rKK&SCX&otxTyY\\1R",[caseless])),
- <<"trKKABCDSCXABCDotxTyYR">> = iolist_to_binary(re:replace("ABCD","abcd","t\\1rKK&SCX&otxTyY\\1R",[caseless,
+ <<"BCDD">> = iolist_to_binary(re:replace("BCDD","(bc+d$|ef*g.|h?i(j|k))","Sa\\1",[caseless])),
+ <<"BCDD">> = iolist_to_binary(re:replace("BCDD","(bc+d$|ef*g.|h?i(j|k))","Sa\\1",[caseless,
global])),
+ <<"ApAYGkIxvjAQAXrHAAD">> = iolist_to_binary(re:replace("A","((((((((((a))))))))))","\\1p&YGkIxvjAQ&XrH\\1\\1D",[caseless])),
+ <<"ApAYGkIxvjAQAXrHAAD">> = iolist_to_binary(re:replace("A","((((((((((a))))))))))","\\1p&YGkIxvjAQ&XrH\\1\\1D",[caseless,
+ global])),
+ <<"ggQ">> = iolist_to_binary(re:replace("AA","((((((((((a))))))))))\\10","ggQ",[caseless])),
+ <<"ggQ">> = iolist_to_binary(re:replace("AA","((((((((((a))))))))))\\10","ggQ",[caseless,
+ global])),
+ <<"hdkAdxeeAQGHCDfdU">> = iolist_to_binary(re:replace("A","(((((((((a)))))))))","hdk\\1dxee\\1QGHCDfdU",[caseless])),
+ <<"hdkAdxeeAQGHCDfdU">> = iolist_to_binary(re:replace("A","(((((((((a)))))))))","hdk\\1dxee\\1QGHCDfdU",[caseless,
+ global])),
+ <<"fnjTAfWdAoA">> = iolist_to_binary(re:replace("A","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))","fnjT\\1fWd\\1o&",[caseless])),
+ <<"fnjTAfWdAoA">> = iolist_to_binary(re:replace("A","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a))))))))))","fnjT\\1fWd\\1o&",[caseless,
+ global])),
+ <<"GqCEOfPIdb">> = iolist_to_binary(re:replace("C","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))","Gq\\1EOfPIdb",[caseless])),
+ <<"GqCEOfPIdb">> = iolist_to_binary(re:replace("C","(?:(?:(?:(?:(?:(?:(?:(?:(?:(a|b|c))))))))))","Gq\\1EOfPIdb",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","Q&",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","multiple words of text","Q&",[caseless,
+ global])),
+ <<"AA">> = iolist_to_binary(re:replace("AA","multiple words of text","gEn\\1",[caseless])),
+ <<"AA">> = iolist_to_binary(re:replace("AA","multiple words of text","gEn\\1",[caseless,
+ global])),
+ <<"UH-UH">> = iolist_to_binary(re:replace("UH-UH","multiple words of text","P\\1ls&muNytHsf",[caseless])),
+ <<"UH-UH">> = iolist_to_binary(re:replace("UH-UH","multiple words of text","P\\1ls&muNytHsf",[caseless,
+ global])),
+ <<"SJgPidMULTIPLE WORDS, YEAH">> = iolist_to_binary(re:replace("MULTIPLE WORDS, YEAH","multiple words","SJgPid&",[caseless])),
+ <<"SJgPidMULTIPLE WORDS, YEAH">> = iolist_to_binary(re:replace("MULTIPLE WORDS, YEAH","multiple words","SJgPid&",[caseless,
+ global])),
+ <<"NJFRwABCDEpl">> = iolist_to_binary(re:replace("ABCDE","(.*)c(.*)","NJFRw&pl",[caseless])),
+ <<"NJFRwABCDEpl">> = iolist_to_binary(re:replace("ABCDE","(.*)c(.*)","NJFRw&pl",[caseless,
+ global])),
+ <<"(A, B)E">> = iolist_to_binary(re:replace("(A, B)","\\((.*), (.*)\\)","&E",[caseless])),
+ <<"(A, B)E">> = iolist_to_binary(re:replace("(A, B)","\\((.*), (.*)\\)","&E",[caseless,
+ global])),
ok.
run25() ->
- <<"DMHBCoABCDlywnlEABCDj">> = iolist_to_binary(re:replace("ABCD","a(bc)d","DMH\\1o&lywnlE&j",[caseless])),
- <<"DMHBCoABCDlywnlEABCDj">> = iolist_to_binary(re:replace("ABCD","a(bc)d","DMH\\1o&lywnlE&j",[caseless,
- global])),
- <<"T">> = iolist_to_binary(re:replace("AC","a[-]?c","T",[caseless])),
- <<"T">> = iolist_to_binary(re:replace("AC","a[-]?c","T",[caseless,
- global])),
- <<"ABCsVoEdFABCABCABCABCpABCyABCABCWmPtsF">> = iolist_to_binary(re:replace("ABCABC","(abc)\\1","\\1sVoEdF&&p\\1y&WmPtsF",[caseless])),
- <<"ABCsVoEdFABCABCABCABCpABCyABCABCWmPtsF">> = iolist_to_binary(re:replace("ABCABC","(abc)\\1","\\1sVoEdF&&p\\1y&WmPtsF",[caseless,
- global])),
- <<"KfsABCABCeufABC">> = iolist_to_binary(re:replace("ABCABC","([a-c]*)\\1","Kfs&euf\\1",[caseless])),
- <<"KfsABCABCeufABCKfseuf">> = iolist_to_binary(re:replace("ABCABC","([a-c]*)\\1","Kfs&euf\\1",[caseless,
+ <<"owcnsqyFeABCDEQABCD">> = iolist_to_binary(re:replace("ABCD","abcd","owcnsqyFe&EQ&",[caseless])),
+ <<"owcnsqyFeABCDEQABCD">> = iolist_to_binary(re:replace("ABCD","abcd","owcnsqyFe&EQ&",[caseless,
+ global])),
+ <<"ruKABCDABCDABCDjGNABCDoQdaABCDO">> = iolist_to_binary(re:replace("ABCD","a(bc)d","ruK&&&jGN&oQda&O",[caseless])),
+ <<"ruKABCDABCDABCDjGNABCDoQdaABCDO">> = iolist_to_binary(re:replace("ABCD","a(bc)d","ruK&&&jGN&oQda&O",[caseless,
global])),
- <<"abfexgBadad">> = iolist_to_binary(re:replace("abad","a(?!b).","fexg\\1B&&",[])),
- <<"abfexgBadad">> = iolist_to_binary(re:replace("abad","a(?!b).","fexg\\1B&&",[global])),
- <<"abArfxtCIjx">> = iolist_to_binary(re:replace("abad","a(?=d).","ArfxtCIjx",[])),
- <<"abArfxtCIjx">> = iolist_to_binary(re:replace("abad","a(?=d).","ArfxtCIjx",[global])),
- <<"abQluadxad">> = iolist_to_binary(re:replace("abad","a(?=c|d).","Qlu&x&",[])),
- <<"abQluadxad">> = iolist_to_binary(re:replace("abad","a(?=c|d).","Qlu&x&",[global])),
- <<"YMKqcsWCacepOaceeY">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)(.)","YMKqcsWC&pO&\\1Y",[])),
- <<"YMKqcsWCacepOaceeY">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)(.)","YMKqcsWC&pO&\\1Y",[global])),
- <<"HHmlgyeRvN">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)*(.)","HHmlgyeRvN",[])),
- <<"HHmlgyeRvN">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)*(.)","HHmlgyeRvN",[global])),
- <<"xdTgRuweeyuwdlSacepeacee">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)+?(.)","xdTgRuw\\1\\1yuwdlS&p\\1&\\1",[])),
- <<"xdTgRuweeyuwdlSacepeacee">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)+?(.)","xdTgRuw\\1\\1yuwdlS&p\\1&\\1",[global])),
- <<"TYYAdCdfMbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+?(.)","TYYA\\1CdfM",[])),
- <<"TYYAdCdfMbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+?(.)","TYYA\\1CdfM",[global])),
- <<"rHwRaCuUc">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+(.)","rHwRaCuUc",[])),
- <<"rHwRaCuUc">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+(.)","rHwRaCuUc",[global])),
- <<"acdbWhFfMbSbtdcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){2}(.)","&WhFfM\\1S\\1td",[])),
- <<"acdbWhFfMbSbtdcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){2}(.)","&WhFfM\\1S\\1td",[global])),
- <<"bXacdbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}(.)","\\1X&",[])),
- <<"bXacdbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}(.)","\\1X&",[global])),
- <<"bCacdbcdobe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}?(.)","bC&o",[])),
- <<"bCacdbcdobe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}?(.)","bC&o",[global])),
- <<"barYfoobarsbxTHafoobarIbm">> = iolist_to_binary(re:replace("foobar","((foo)|(bar))*","\\1Y&sbxTHa&Ibm",[])),
- <<"barYfoobarsbxTHafoobarIbmYsbxTHaIbm">> = iolist_to_binary(re:replace("foobar","((foo)|(bar))*","\\1Y&sbxTHa&Ibm",[global])),
- <<"eeBieacdbcdbeeIHacdbcdbeNPRhLo">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}(.)","\\1\\1Bi\\1&\\1IH&NPRhLo",[])),
- <<"eeBieacdbcdbeeIHacdbcdbeNPRhLo">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}(.)","\\1\\1Bi\\1&\\1IH&NPRhLo",[global])),
- <<"acdbcdbeiacdbcdbevacdbcdbeorW">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}?(.)","&i&v&orW",[])),
- <<"acdbcdbeiacdbcdbevacdbcdbeorW">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}?(.)","&i&v&orW",[global])),
- <<"LeePacdbcdbeacdbcdbeCth">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}(.)","L\\1\\1P&&Cth",[])),
- <<"LeePacdbcdbeacdbcdbeCth">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}(.)","L\\1\\1P&&Cth",[global])),
- <<"uVacdbcdbWhMacdbcdbNbEue">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}?(.)","uV&WhM&N\\1Eu",[])),
- <<"uVacdbcdbWhMacdbcdbNbEue">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}?(.)","uV&WhM&N\\1Eu",[global])),
- <<"acdbcdbeuqWHNeI">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}(.)","&uqWHNeI",[])),
- <<"acdbcdbeuqWHNeI">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}(.)","&uqWHNeI",[global])),
+ <<"NACWHMsODnACQCvNsAC">> = iolist_to_binary(re:replace("AC","a[-]?c","N&WHM\\1sODn&QCvN\\1s&",[caseless])),
+ <<"NACWHMsODnACQCvNsAC">> = iolist_to_binary(re:replace("AC","a[-]?c","N&WHM\\1sODn&QCvN\\1s&",[caseless,
+ global])),
+ <<"sABCgQuaFABCh">> = iolist_to_binary(re:replace("ABCABC","(abc)\\1","s\\1gQuaF\\1h",[caseless])),
+ <<"sABCgQuaFABCh">> = iolist_to_binary(re:replace("ABCABC","(abc)\\1","s\\1gQuaF\\1h",[caseless,
+ global])),
+ <<"lABCmSQABCABCaXJqwxUYswqABCABC">> = iolist_to_binary(re:replace("ABCABC","([a-c]*)\\1","l\\1mSQ&aXJqwxUYswq&",[caseless])),
+ <<"lABCmSQABCABCaXJqwxUYswqABCABClmSQaXJqwxUYswq">> = iolist_to_binary(re:replace("ABCABC","([a-c]*)\\1","l\\1mSQ&aXJqwxUYswq&",[caseless,
+ global])),
+ <<"abdSPadcRcbUkgXmcHGW">> = iolist_to_binary(re:replace("abad","a(?!b).","dSP&\\1cRcbUkgXmcHGW\\1",[])),
+ <<"abdSPadcRcbUkgXmcHGW">> = iolist_to_binary(re:replace("abad","a(?!b).","dSP&\\1cRcbUkgXmcHGW\\1",[global])),
+ <<"abIRqW">> = iolist_to_binary(re:replace("abad","a(?=d).","IRqW",[])),
+ <<"abIRqW">> = iolist_to_binary(re:replace("abad","a(?=d).","IRqW",[global])),
+ <<"abykWXvthadUfKUlbLTp">> = iolist_to_binary(re:replace("abad","a(?=c|d).","y\\1kWXv\\1th&UfKUlbLTp",[])),
+ <<"abykWXvthadUfKUlbLTp">> = iolist_to_binary(re:replace("abad","a(?=c|d).","y\\1kWXv\\1th&UfKUlbLTp",[global])),
+ <<"pelUw">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)(.)","pelUw",[])),
+ <<"pelUw">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)(.)","pelUw",[global])),
+ <<"cfhcWSNABYeNMLh">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)*(.)","cfhcWSNABY\\1NMLh",[])),
+ <<"cfhcWSNABYeNMLh">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)*(.)","cfhcWSNABY\\1NMLh",[global])),
+ <<"etfeq">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)+?(.)","\\1tf\\1q",[])),
+ <<"etfeq">> = iolist_to_binary(re:replace("ace","a(?:b|c|d)+?(.)","\\1tf\\1q",[global])),
+ <<"acdOEfbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+?(.)","&OEf",[])),
+ <<"acdOEfbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+?(.)","&OEf",[global])),
+ <<"Vmfyu">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+(.)","Vmfyu",[])),
+ <<"Vmfyu">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d)+(.)","Vmfyu",[global])),
+ <<"FIbbMUVjTEcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){2}(.)","FI\\1\\1MUVjTE",[])),
+ <<"FIbbMUVjTEcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){2}(.)","FI\\1\\1MUVjTE",[global])),
+ <<"eicDcYacdbcdboLhMacdbcdbacdbcdbKRqe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}(.)","eicDcY&oLhM&&KRq",[])),
+ <<"eicDcYacdbcdboLhMacdbcdbacdbcdbKRqe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}(.)","eicDcY&oLhM&&KRq",[global])),
+ <<"acdbcdqsacdbcdrbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}?(.)","&qs&r",[])),
+ <<"acdbcdqsacdbcdrbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){4,5}?(.)","&qs&r",[global])),
+ <<"barbarOSJfoobar">> = iolist_to_binary(re:replace("foobar","((foo)|(bar))*","\\1\\1OSJ&",[])),
+ <<"barbarOSJfoobarOSJ">> = iolist_to_binary(re:replace("foobar","((foo)|(bar))*","\\1\\1OSJ&",[global])),
+ <<"HYIAacdbcdbeeRhacdbcdbeacdbcdbeacdbcdbeGQ">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}(.)","HYIA&\\1Rh&&&GQ",[])),
+ <<"HYIAacdbcdbeeRhacdbcdbeacdbcdbeacdbcdbeGQ">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}(.)","HYIA&\\1Rh&&&GQ",[global])),
+ <<"eacdbcdbeBcQacdbcdbewOmacdbcdbeacdbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}?(.)","\\1&BcQ&wOm&&",[])),
+ <<"eacdbcdbeBcQacdbcdbewOmacdbcdbeacdbcdbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){6,7}?(.)","\\1&BcQ&wOm&&",[global])),
+ <<"xacdbcdbeN">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}(.)","x&N",[])),
+ <<"xacdbcdbeN">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}(.)","x&N",[global])),
+ <<"bWxPOAbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}?(.)","\\1WxPOA\\1",[])),
+ <<"bWxPOAbe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,6}?(.)","\\1WxPOA\\1",[global])),
ok.
run26() ->
- <<"GacdbcdbbbPbGFTve">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}?(.)","G&\\1\\1P\\1GFTv",[])),
- <<"GacdbcdbbbPbGFTve">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}?(.)","G&\\1\\1P\\1GFTv",[global])),
- <<"taceacecgacefBmaHeYaceuace">> = iolist_to_binary(re:replace("ace","a(?:b|(c|e){1,2}?|d)+?(.)","t&&\\1g&fBmaHeY&u&",[])),
- <<"taceacecgacefBmaHeYaceuace">> = iolist_to_binary(re:replace("ace","a(?:b|(c|e){1,2}?|d)+?(.)","t&&\\1g&fBmaHeY&u&",[global])),
- <<"FcNioABABQKKAbfVA">> = iolist_to_binary(re:replace("AB","^(.+)?B","FcNio&&QKK\\1bfV\\1",[])),
- <<"FcNioABABQKKAbfVA">> = iolist_to_binary(re:replace("AB","^(.+)?B","FcNio&&QKK\\1bfV\\1",[global])),
- <<"QpJsSlDdk">> = iolist_to_binary(re:replace(".","^([^a-z])|(\\^)$","QpJsSlDdk",[])),
- <<"QpJsSlDdk">> = iolist_to_binary(re:replace(".","^([^a-z])|(\\^)$","QpJsSlDdk",[global])),
- <<"YtMLJWT<&GSA<&jOUT">> = iolist_to_binary(re:replace("<&OUT","^[<>]&","Y\\1tMLJWT&GSA&j",[])),
- <<"YtMLJWT<&GSA<&jOUT">> = iolist_to_binary(re:replace("<&OUT","^[<>]&","Y\\1tMLJWT&GSA&j",[global])),
- <<"RBbN">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","RBbN",[])),
- <<"RBbN">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","RBbN",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a\\1?){4}$","FHwc\\1\\1biSR",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a\\1?){4}$","FHwc\\1\\1biSR",[global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","^(a\\1?){4}$","rqMyo&\\1IoOAjaJ\\1vY",[])),
- <<"AB">> = iolist_to_binary(re:replace("AB","^(a\\1?){4}$","rqMyo&\\1IoOAjaJ\\1vY",[global])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","ebuyIYAaCuRmxbiVR",[])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","ebuyIYAaCuRmxbiVR",[global])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","U&\\1R&jmiM\\1\\1W",[])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","U&\\1R&jmiM\\1\\1W",[global])),
- <<"SyepNqAqGr">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a(?(1)\\1)){4}$","SyepNqAqGr",[])),
- <<"SyepNqAqGr">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a(?(1)\\1)){4}$","SyepNqAqGr",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a(?(1)\\1)){4}$","idrNArkV&XUmhWGrp\\1rN",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a(?(1)\\1)){4}$","idrNArkV&XUmhWGrp\\1rN",[global])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a(?(1)\\1)){4}$","dVYMTCeoR",[])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a(?(1)\\1)){4}$","dVYMTCeoR",[global])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a(?(1)\\1)){4}$","wtDhOT\\1Pu\\1xOt&P&&&",[])),
- <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a(?(1)\\1)){4}$","wtDhOT\\1Pu\\1xOt&P&&&",[global])),
- <<"oUbvLQMfrfVt">> = iolist_to_binary(re:replace("foobar","(?:(f)(o)(o)|(b)(a)(r))*","oUbvLQMfr\\1Vt",[])),
- <<"oUbvLQMfrfVtoUbvLQMfrVt">> = iolist_to_binary(re:replace("foobar","(?:(f)(o)(o)|(b)(a)(r))*","oUbvLQMfr\\1Vt",[global])),
- <<"aIbOkhquTbuWHx">> = iolist_to_binary(re:replace("ab","(?<=a)b","I&OkhquT&uWH\\1x",[])),
- <<"aIbOkhquTbuWHx">> = iolist_to_binary(re:replace("ab","(?<=a)b","I&OkhquT&uWH\\1x",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a)b","BQobLoQagH&I&Gf",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a)b","BQobLoQagH&I&Gf",[global])),
- <<"cb">> = iolist_to_binary(re:replace("cb","(?<=a)b","\\1qi\\1cF&xVKJl\\1&HHO&TH",[])),
- <<"cb">> = iolist_to_binary(re:replace("cb","(?<=a)b","\\1qi\\1cF&xVKJl\\1&HHO&TH",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","(?<=a)b","aRw&xSWDbr\\1wsnnJ&G",[])),
- <<"b">> = iolist_to_binary(re:replace("b","(?<=a)b","aRw&xSWDbr\\1wsnnJ&G",[global])),
- <<"albBEJPbhoUqwpHlyll">> = iolist_to_binary(re:replace("ab","(?<!c)b","l&BEJPbhoUqwpHlyll",[])),
- <<"albBEJPbhoUqwpHlyll">> = iolist_to_binary(re:replace("ab","(?<!c)b","l&BEJPbhoUqwpHlyll",[global])),
- <<"iNbLxxT">> = iolist_to_binary(re:replace("b","(?<!c)b","iN&LxxT",[])),
- <<"iNbLxxT">> = iolist_to_binary(re:replace("b","(?<!c)b","iN&LxxT",[global])),
- <<"byOfPd">> = iolist_to_binary(re:replace("b","(?<!c)b","&yOfPd",[])),
- <<"byOfPd">> = iolist_to_binary(re:replace("b","(?<!c)b","&yOfPd",[global])),
- <<"IblabamNFubVS">> = iolist_to_binary(re:replace("aba","(?:..)*a","Ibl&mNFubVS",[])),
- <<"IblabamNFubVS">> = iolist_to_binary(re:replace("aba","(?:..)*a","Ibl&mNFubVS",[global])),
- <<"wvNuoyarrAWFba">> = iolist_to_binary(re:replace("aba","(?:..)*?a","wvNuo\\1y&rrAWF",[])),
- <<"wvNuoyarrAWFbwvNuoyarrAWF">> = iolist_to_binary(re:replace("aba","(?:..)*?a","wvNuo\\1y&rrAWF",[global])),
- <<"abVmnPSDabPXSc">> = iolist_to_binary(re:replace("abc","^(?:b|a(?=(.)))*\\1","&VmnPSD&PXS",[])),
- <<"abVmnPSDabPXSc">> = iolist_to_binary(re:replace("abc","^(?:b|a(?=(.)))*\\1","&VmnPSD&PXS",[global])),
- <<"MNhLuKuRgFcjoiabc">> = iolist_to_binary(re:replace("abc","^(){3,5}","MNhL\\1uK&uRgFcj\\1o&i\\1\\1",[])),
- <<"MNhLuKuRgFcjoiabc">> = iolist_to_binary(re:replace("abc","^(){3,5}","MNhL\\1uK&uRgFcj\\1o&i\\1\\1",[global])),
- <<"aax">> = iolist_to_binary(re:replace("aax","^(a+)*ax","&",[])),
- <<"aax">> = iolist_to_binary(re:replace("aax","^(a+)*ax","&",[global])),
- <<"aax">> = iolist_to_binary(re:replace("aax","^((a|b)+)*ax","&",[])),
- <<"aax">> = iolist_to_binary(re:replace("aax","^((a|b)+)*ax","&",[global])),
- <<"UaaxEVMyUJoaafaaxbXAGlnX">> = iolist_to_binary(re:replace("aax","^((a|bc)+)*ax","U&EVMyUJoa\\1f&bXAGlnX",[])),
- <<"UaaxEVMyUJoaafaaxbXAGlnX">> = iolist_to_binary(re:replace("aax","^((a|bc)+)*ax","U&EVMyUJoa\\1f&bXAGlnX",[global])),
- <<"cHRavababj">> = iolist_to_binary(re:replace("cab","(a|x)*ab","HR\\1av&&j",[])),
- <<"cHRavababj">> = iolist_to_binary(re:replace("cab","(a|x)*ab","HR\\1av&&j",[global])),
- <<"ceqqArfabLqGjflabab">> = iolist_to_binary(re:replace("cab","(a)*ab","eqqA\\1rf&LqGjfl&&",[])),
- <<"ceqqArfabLqGjflabab">> = iolist_to_binary(re:replace("cab","(a)*ab","eqqA\\1rf&LqGjfl&&",[global])),
- <<"aMdQQ">> = iolist_to_binary(re:replace("ab","(?:(?i)a)b","aMdQQ",[])),
- <<"aMdQQ">> = iolist_to_binary(re:replace("ab","(?:(?i)a)b","aMdQQ",[global])),
+ <<"DJeLeA">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}(.)","DJ\\1LeA",[])),
+ <<"DJeLeA">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}(.)","DJ\\1LeA",[global])),
+ <<"qinMoe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}?(.)","qinMo",[])),
+ <<"qinMoe">> = iolist_to_binary(re:replace("acdbcdbe","a(?:b|c|d){5,7}?(.)","qinMo",[global])),
+ <<"acecXdaceaKTrIIqhpiWP">> = iolist_to_binary(re:replace("ace","a(?:b|(c|e){1,2}?|d)+?(.)","&\\1Xd&aKTrIIqhpiWP",[])),
+ <<"acecXdaceaKTrIIqhpiWP">> = iolist_to_binary(re:replace("ace","a(?:b|(c|e){1,2}?|d)+?(.)","&\\1Xd&aKTrIIqhpiWP",[global])),
+ <<"CiaeiABbFyjW">> = iolist_to_binary(re:replace("AB","^(.+)?B","Ciaei&bFyjW",[])),
+ <<"CiaeiABbFyjW">> = iolist_to_binary(re:replace("AB","^(.+)?B","Ciaei&bFyjW",[global])),
+ <<"..Ch.IWXxoeCE">> = iolist_to_binary(re:replace(".","^([^a-z])|(\\^)$","\\1&Ch&IWXxoeCE",[])),
+ <<"..Ch.IWXxoeCE">> = iolist_to_binary(re:replace(".","^([^a-z])|(\\^)$","\\1&Ch&IWXxoeCE",[global])),
+ <<"<&<&tOUT">> = iolist_to_binary(re:replace("<&OUT","^[<>]&","&&t",[])),
+ <<"<&<&tOUT">> = iolist_to_binary(re:replace("<&OUT","^[<>]&","&&t",[global])),
+ <<"Paaaaaaaaaaw">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","P&w",[])),
+ <<"Paaaaaaaaaaw">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a\\1?){4}$","P&w",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a\\1?){4}$","&jEcxWNe",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a\\1?){4}$","&jEcxWNe",[global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","^(a\\1?){4}$","&QByhvIPMdVCvMAk",[])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","^(a\\1?){4}$","&QByhvIPMdVCvMAk",[global])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","LKyhXCAKO&fKp&",[])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a\\1?){4}$","LKyhXCAKO&fKp&",[global])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","PktYBS",[])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a\\1?){4}$","PktYBS",[global])),
+ <<"aaaaaaaaaaLaaaaaaaaaaaaaaaaaaaaAB">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a(?(1)\\1)){4}$","&L&&AB",[])),
+ <<"aaaaaaaaaaLaaaaaaaaaaaaaaaaaaaaAB">> = iolist_to_binary(re:replace("aaaaaaaaaa","^(a(?(1)\\1)){4}$","&L&&AB",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a(?(1)\\1)){4}$","&NExLuXAoRv",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a(?(1)\\1)){4}$","&NExLuXAoRv",[global])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a(?(1)\\1)){4}$","TNhbF",[])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a(?(1)\\1)){4}$","TNhbF",[global])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a(?(1)\\1)){4}$","Nc\\1&GIjjbuiMOSVl",[])),
+ <<"aaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaa","^(a(?(1)\\1)){4}$","Nc\\1&GIjjbuiMOSVl",[global])),
+ <<"OO">> = iolist_to_binary(re:replace("foobar","(?:(f)(o)(o)|(b)(a)(r))*","OO",[])),
+ <<"OOOO">> = iolist_to_binary(re:replace("foobar","(?:(f)(o)(o)|(b)(a)(r))*","OO",[global])),
+ <<"aOVOqSRYFwv">> = iolist_to_binary(re:replace("ab","(?<=a)b","OVOqSRYFwv",[])),
+ <<"aOVOqSRYFwv">> = iolist_to_binary(re:replace("ab","(?<=a)b","OVOqSRYFwv",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a)b","fIH\\1c\\1A\\1&&sdSLy",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=a)b","fIH\\1c\\1A\\1&&sdSLy",[global])),
+ <<"cb">> = iolist_to_binary(re:replace("cb","(?<=a)b","ncyI",[])),
+ <<"cb">> = iolist_to_binary(re:replace("cb","(?<=a)b","ncyI",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","(?<=a)b","suOoPj&\\1M",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","(?<=a)b","suOoPj&\\1M",[global])),
+ <<"abriAFAbbvRIl">> = iolist_to_binary(re:replace("ab","(?<!c)b","&riAFA&&vR\\1Il",[])),
+ <<"abriAFAbbvRIl">> = iolist_to_binary(re:replace("ab","(?<!c)b","&riAFA&&vR\\1Il",[global])),
+ <<"oBIIxbHJbHrNT">> = iolist_to_binary(re:replace("b","(?<!c)b","oBIIx&HJ&H\\1rNT",[])),
+ <<"oBIIxbHJbHrNT">> = iolist_to_binary(re:replace("b","(?<!c)b","oBIIx&HJ&H\\1rNT",[global])),
+ <<"wWbIuHcu">> = iolist_to_binary(re:replace("b","(?<!c)b","wWbIuHcu",[])),
+ <<"wWbIuHcu">> = iolist_to_binary(re:replace("b","(?<!c)b","wWbIuHcu",[global])),
+ <<"abaNabaabaaba">> = iolist_to_binary(re:replace("aba","(?:..)*a","&N&&&",[])),
+ <<"abaNabaabaaba">> = iolist_to_binary(re:replace("aba","(?:..)*a","&N&&&",[global])),
+ <<"dmba">> = iolist_to_binary(re:replace("aba","(?:..)*?a","d\\1m",[])),
+ <<"dmbdm">> = iolist_to_binary(re:replace("aba","(?:..)*?a","d\\1m",[global])),
+ <<"Ywc">> = iolist_to_binary(re:replace("abc","^(?:b|a(?=(.)))*\\1","Yw",[])),
+ <<"Ywc">> = iolist_to_binary(re:replace("abc","^(?:b|a(?=(.)))*\\1","Yw",[global])),
+ <<"mwetmXoabc">> = iolist_to_binary(re:replace("abc","^(){3,5}","mwet\\1mXo",[])),
+ <<"mwetmXoabc">> = iolist_to_binary(re:replace("abc","^(){3,5}","mwet\\1mXo",[global])),
+ <<"agaYaDwEIxdcATaajdie">> = iolist_to_binary(re:replace("aax","^(a+)*ax","\\1g\\1Y\\1DwEIxdcAT\\1\\1jdie",[])),
+ <<"agaYaDwEIxdcATaajdie">> = iolist_to_binary(re:replace("aax","^(a+)*ax","\\1g\\1Y\\1DwEIxdcAT\\1\\1jdie",[global])),
+ <<"oOs">> = iolist_to_binary(re:replace("aax","^((a|b)+)*ax","oOs",[])),
+ <<"oOs">> = iolist_to_binary(re:replace("aax","^((a|b)+)*ax","oOs",[global])),
+ <<"XhaaxEdaassqaxiHJabBaK">> = iolist_to_binary(re:replace("aax","^((a|bc)+)*ax","Xh&Ed\\1\\1ssq\\1xiHJ\\1bB\\1K",[])),
+ <<"XhaaxEdaassqaxiHJabBaK">> = iolist_to_binary(re:replace("aax","^((a|bc)+)*ax","Xh&Ed\\1\\1ssq\\1xiHJ\\1bB\\1K",[global])),
+ <<"cXkxsSHRksqVJf">> = iolist_to_binary(re:replace("cab","(a|x)*ab","XkxsSHRk\\1sqVJf",[])),
+ <<"cXkxsSHRksqVJf">> = iolist_to_binary(re:replace("cab","(a|x)*ab","XkxsSHRk\\1sqVJf",[global])),
+ <<"cTOrWuaboDtjqjUj">> = iolist_to_binary(re:replace("cab","(a)*ab","TOrWu\\1&o\\1D\\1tjqjUj\\1\\1\\1",[])),
+ <<"cTOrWuaboDtjqjUj">> = iolist_to_binary(re:replace("cab","(a)*ab","TOrWu\\1&o\\1D\\1tjqjUj\\1\\1\\1",[global])),
ok.
run27() ->
- <<"qpLuqQJ">> = iolist_to_binary(re:replace("ab","((?i)a)b","qpLuqQJ",[])),
- <<"qpLuqQJ">> = iolist_to_binary(re:replace("ab","((?i)a)b","qpLuqQJ",[global])),
- <<"KU">> = iolist_to_binary(re:replace("Ab","(?:(?i)a)b","KU\\1",[])),
- <<"KU">> = iolist_to_binary(re:replace("Ab","(?:(?i)a)b","KU\\1",[global])),
- <<"HbAbcmtA">> = iolist_to_binary(re:replace("Ab","((?i)a)b","Hb&cmt\\1",[])),
- <<"HbAbcmtA">> = iolist_to_binary(re:replace("Ab","((?i)a)b","Hb&cmt\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?i)a)b","\\1&d\\1h",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?i)a)b","\\1&d\\1h",[global])),
- <<"cb">> = iolist_to_binary(re:replace("cb","(?:(?i)a)b","QGy\\1\\1s",[])),
- <<"cb">> = iolist_to_binary(re:replace("cb","(?:(?i)a)b","QGy\\1\\1s",[global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?:(?i)a)b","h&LcJB&\\1koG",[])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?:(?i)a)b","h&LcJB&\\1koG",[global])),
- <<"hQoabBcSA">> = iolist_to_binary(re:replace("ab","(?i:a)b","h\\1Qo&B\\1cSA",[])),
- <<"hQoabBcSA">> = iolist_to_binary(re:replace("ab","(?i:a)b","h\\1Qo&B\\1cSA",[global])),
- <<"C">> = iolist_to_binary(re:replace("ab","((?i:a))b","C",[])),
- <<"C">> = iolist_to_binary(re:replace("ab","((?i:a))b","C",[global])),
- <<"GAMAbeosONsSFAblyS">> = iolist_to_binary(re:replace("Ab","(?i:a)b","GAM&eos\\1O\\1Ns\\1SF&lyS",[])),
- <<"GAMAbeosONsSFAblyS">> = iolist_to_binary(re:replace("Ab","(?i:a)b","GAM&eos\\1O\\1Ns\\1SF&lyS",[global])),
- <<"AbASQYAbA">> = iolist_to_binary(re:replace("Ab","((?i:a))b","&\\1SQY&\\1",[])),
- <<"AbASQYAbA">> = iolist_to_binary(re:replace("Ab","((?i:a))b","&\\1SQY&\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i:a)b","EW&tEN\\1\\1&\\1\\1yd",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i:a)b","EW&tEN\\1\\1&\\1\\1yd",[global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","bK&xdvtcfqVCo",[])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","bK&xdvtcfqVCo",[global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","rU",[])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","rU",[global])),
- <<"fabvvabeKvWlUCaababk">> = iolist_to_binary(re:replace("ab","(?:(?-i)a)b","f&vv&eKvWlUC\\1\\1a&\\1&k",[caseless])),
- <<"fabvvabeKvWlUCaababk">> = iolist_to_binary(re:replace("ab","(?:(?-i)a)b","f&vv&eKvWlUC\\1\\1a&\\1&k",[caseless,
- global])),
- <<"a">> = iolist_to_binary(re:replace("ab","((?-i)a)b","a",[caseless])),
- <<"a">> = iolist_to_binary(re:replace("ab","((?-i)a)b","a",[caseless,
- global])),
- <<"YgwHaBaBEobvWdcKm">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","YgwH&&E\\1o\\1bvWdcKm",[caseless])),
- <<"YgwHaBaBEobvWdcKm">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","YgwH&&E\\1o\\1bvWdcKm",[caseless,
- global])),
- <<"gPQtaBiM">> = iolist_to_binary(re:replace("aB","((?-i)a)b","gPQt\\1BiM",[caseless])),
- <<"gPQtaBiM">> = iolist_to_binary(re:replace("aB","((?-i)a)b","gPQt\\1BiM",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","dAPB\\1lhgJnXJM\\1",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","dAPB\\1lhgJnXJM\\1",[caseless,
- global])),
- <<"cpmMjqeoMjqXPSCxgaB">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","cpmMjqeoMjqXPSC\\1xg&",[caseless])),
- <<"cpmMjqeoMjqXPSCxgaB">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","cpmMjqeoMjqXPSC\\1xg&",[caseless,
- global])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","ehCMjHfdoLOUT",[caseless])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","ehCMjHfdoLOUT",[caseless,
- global])),
- <<"aBaBXheDmRWIj">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","&&XheDmRW\\1Ij",[caseless])),
- <<"aBaBXheDmRWIj">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","&&XheDmRW\\1Ij",[caseless,
- global])),
- <<"HaBaBwaBaBarQLsPaLaBH">> = iolist_to_binary(re:replace("aB","((?-i)a)b","H&&w&&\\1rQLsP\\1L&H",[caseless])),
- <<"HaBaBwaBaBarQLsPaLaBH">> = iolist_to_binary(re:replace("aB","((?-i)a)b","H&&w&&\\1rQLsP\\1L&H",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","rA&&\\1Ox\\1x",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","rA&&\\1Ox\\1x",[caseless,
- global])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","qU\\1qgKirHcB",[caseless])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","qU\\1qgKirHcB",[caseless,
- global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?:(?-i)a)b","rtc&FUes&I&&V\\1Wi&o",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?:(?-i)a)b","rtc&FUes&I&&V\\1Wi&o",[caseless,
- global])),
+ <<"itod">> = iolist_to_binary(re:replace("ab","(?:(?i)a)b","itod",[])),
+ <<"itod">> = iolist_to_binary(re:replace("ab","(?:(?i)a)b","itod",[global])),
+ <<"WjabMNVeskabFabMkNj">> = iolist_to_binary(re:replace("ab","((?i)a)b","Wj&MNVesk&F&MkNj",[])),
+ <<"WjabMNVeskabFabMkNj">> = iolist_to_binary(re:replace("ab","((?i)a)b","Wj&MNVesk&F&MkNj",[global])),
+ <<"K">> = iolist_to_binary(re:replace("Ab","(?:(?i)a)b","K\\1",[])),
+ <<"K">> = iolist_to_binary(re:replace("Ab","(?:(?i)a)b","K\\1",[global])),
+ <<"KAbmpSqMJmrScTHEHA">> = iolist_to_binary(re:replace("Ab","((?i)a)b","K&mpSqMJmrScTHEH\\1",[])),
+ <<"KAbmpSqMJmrScTHEHA">> = iolist_to_binary(re:replace("Ab","((?i)a)b","K&mpSqMJmrScTHEH\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?i)a)b","jONwRrcyS&bFO",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?i)a)b","jONwRrcyS&bFO",[global])),
+ <<"cb">> = iolist_to_binary(re:replace("cb","(?:(?i)a)b","DIfuf&vF\\1&o&yYq",[])),
+ <<"cb">> = iolist_to_binary(re:replace("cb","(?:(?i)a)b","DIfuf&vF\\1&o&yYq",[global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?:(?i)a)b","\\1\\1ntgcmKqp",[])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?:(?i)a)b","\\1\\1ntgcmKqp",[global])),
+ <<"jI">> = iolist_to_binary(re:replace("ab","(?i:a)b","jI",[])),
+ <<"jI">> = iolist_to_binary(re:replace("ab","(?i:a)b","jI",[global])),
+ <<"bVgmsFMa">> = iolist_to_binary(re:replace("ab","((?i:a))b","bVgmsFMa",[])),
+ <<"bVgmsFMa">> = iolist_to_binary(re:replace("ab","((?i:a))b","bVgmsFMa",[global])),
+ <<"cEcAlebAbOIAbmOu">> = iolist_to_binary(re:replace("Ab","(?i:a)b","cEcAl\\1eb\\1&OI&\\1mOu",[])),
+ <<"cEcAlebAbOIAbmOu">> = iolist_to_binary(re:replace("Ab","(?i:a)b","cEcAl\\1eb\\1&OI&\\1mOu",[global])),
+ <<"hA">> = iolist_to_binary(re:replace("Ab","((?i:a))b","h\\1",[])),
+ <<"hA">> = iolist_to_binary(re:replace("Ab","((?i:a))b","h\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i:a)b","ip",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i:a)b","ip",[global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","\\1pL",[])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","\\1pL",[global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","qL&OvIX\\1G&&rRe&x\\1o\\1",[])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:a)b","qL&OvIX\\1G&&rRe&x\\1o\\1",[global])),
+ <<"RsYIqopkaabwdwdgKabT">> = iolist_to_binary(re:replace("ab","(?:(?-i)a)b","RsYIqopka&\\1wdwdgK&T",[caseless])),
+ <<"RsYIqopkaabwdwdgKabT">> = iolist_to_binary(re:replace("ab","(?:(?-i)a)b","RsYIqopka&\\1wdwdgK&T",[caseless,
+ global])),
+ <<"lLfababYHTqsmO">> = iolist_to_binary(re:replace("ab","((?-i)a)b","lLf&&YHTqsmO",[caseless])),
+ <<"lLfababYHTqsmO">> = iolist_to_binary(re:replace("ab","((?-i)a)b","lLf&&YHTqsmO",[caseless,
+ global])),
+ <<"JCuXbQvaBXV">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","JCuXbQv&XV",[caseless])),
+ <<"JCuXbQvaBXV">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","JCuXbQv&XV",[caseless,
+ global])),
+ <<"najlatTu">> = iolist_to_binary(re:replace("aB","((?-i)a)b","n\\1jl\\1tTu",[caseless])),
+ <<"najlatTu">> = iolist_to_binary(re:replace("aB","((?-i)a)b","n\\1jl\\1tTu",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","oRHrhfYgmYE",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","oRHrhfYgmYE",[caseless,
+ global])),
+ <<"C">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","C",[caseless])),
+ <<"C">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","C",[caseless,
+ global])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","MbmyjKDJY",[caseless])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","MbmyjKDJY",[caseless,
+ global])),
+ <<"KRBaBYDPTaBIetfKafk">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","K\\1RB&YDPT&Ietf\\1Kafk",[caseless])),
+ <<"KRBaBYDPTaBIetfKafk">> = iolist_to_binary(re:replace("aB","(?:(?-i)a)b","K\\1RB&YDPT&Ietf\\1Kafk",[caseless,
+ global])),
+ <<"FAeMLQgRgVVahad">> = iolist_to_binary(re:replace("aB","((?-i)a)b","FAeMLQgRgVV\\1h\\1d",[caseless])),
+ <<"FAeMLQgRgVVahad">> = iolist_to_binary(re:replace("aB","((?-i)a)b","FAeMLQgRgVV\\1h\\1d",[caseless,
+ global])),
ok.
run28() ->
- <<"gGfbP">> = iolist_to_binary(re:replace("ab","(?-i:a)b","\\1gGfbP",[caseless])),
- <<"gGfbP">> = iolist_to_binary(re:replace("ab","(?-i:a)b","\\1gGfbP",[caseless,
- global])),
- <<"oibsT">> = iolist_to_binary(re:replace("ab","((?-i:a))b","oibsT",[caseless])),
- <<"oibsT">> = iolist_to_binary(re:replace("ab","((?-i:a))b","oibsT",[caseless,
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","V",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?:(?-i)a)b","V",[caseless,
+ global])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","vOEiltgjc",[caseless])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?:(?-i)a)b","vOEiltgjc",[caseless,
+ global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?:(?-i)a)b","hCMP",[caseless])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?:(?-i)a)b","hCMP",[caseless,
global])),
- <<"erLkRe">> = iolist_to_binary(re:replace("aB","(?-i:a)b","erLkRe",[caseless])),
- <<"erLkRe">> = iolist_to_binary(re:replace("aB","(?-i:a)b","erLkRe",[caseless,
- global])),
- <<"NcuVaBaPaBqlgVJaaAMaBjt">> = iolist_to_binary(re:replace("aB","((?-i:a))b","NcuV&aP&qlgVJ\\1\\1AM&jt",[caseless])),
- <<"NcuVaBaPaBqlgVJaaAMaBjt">> = iolist_to_binary(re:replace("aB","((?-i:a))b","NcuV&aP&qlgVJ\\1\\1AM&jt",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","xW",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","xW",[caseless,
- global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","rBT\\1&D&jmNXx",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","rBT\\1&D&jmNXx",[caseless,
- global])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","oyAx&&hEq\\1",[caseless])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","oyAx&&hEq\\1",[caseless,
- global])),
- <<"shG">> = iolist_to_binary(re:replace("aB","(?-i:a)b","\\1shG",[caseless])),
- <<"shG">> = iolist_to_binary(re:replace("aB","(?-i:a)b","\\1shG",[caseless,
- global])),
- <<"OKLO">> = iolist_to_binary(re:replace("aB","((?-i:a))b","OKLO",[caseless])),
- <<"OKLO">> = iolist_to_binary(re:replace("aB","((?-i:a))b","OKLO",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","DV\\1NmsJ&bJn&F",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","DV\\1NmsJ&bJn&F",[caseless,
- global])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","I",[caseless])),
- <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","I",[caseless,
- global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","WVyTncmcNoIfn\\1B",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","WVyTncmcNoIfn\\1B",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?-i:a.))b","&UW\\1PRmJQx\\1inQ\\1o&&C",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?-i:a.))b","&UW\\1PRmJQx\\1inQ\\1o&&C",[caseless,
- global])),
- <<"AB">> = iolist_to_binary(re:replace("AB","((?-i:a.))b","xFK&bFAyoLB\\1F",[caseless])),
- <<"AB">> = iolist_to_binary(re:replace("AB","((?-i:a.))b","xFK&bFAyoLB\\1F",[caseless,
+ <<"WVjqJoaFabihXyIK">> = iolist_to_binary(re:replace("ab","(?-i:a)b","WVjqJoaF&\\1ihXy\\1IK",[caseless])),
+ <<"WVjqJoaFabihXyIK">> = iolist_to_binary(re:replace("ab","(?-i:a)b","WVjqJoaF&\\1ihXy\\1IK",[caseless,
+ global])),
+ <<"hEauHabaabI">> = iolist_to_binary(re:replace("ab","((?-i:a))b","hE\\1uH&\\1&I",[caseless])),
+ <<"hEauHabaabI">> = iolist_to_binary(re:replace("ab","((?-i:a))b","hE\\1uH&\\1&I",[caseless,
+ global])),
+ <<"PyNYkfxaBaFAYik">> = iolist_to_binary(re:replace("aB","(?-i:a)b","PyNYkfx&aFAYi\\1k",[caseless])),
+ <<"PyNYkfxaBaFAYik">> = iolist_to_binary(re:replace("aB","(?-i:a)b","PyNYkfx&aFAYi\\1k",[caseless,
+ global])),
+ <<"laBaBG">> = iolist_to_binary(re:replace("aB","((?-i:a))b","l&&G",[caseless])),
+ <<"laBaBG">> = iolist_to_binary(re:replace("aB","((?-i:a))b","l&&G",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","eS\\1dn",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","eS\\1dn",[caseless,
+ global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","MhsbM&x\\1ydTksl",[caseless])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","MhsbM&x\\1ydTksl",[caseless,
+ global])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","\\1srennTK\\1qOyk&LVOv",[caseless])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","\\1srennTK\\1qOyk&LVOv",[caseless,
+ global])),
+ <<"JJVTKIsthgwfb">> = iolist_to_binary(re:replace("aB","(?-i:a)b","JJVTKIst\\1hgwfb",[caseless])),
+ <<"JJVTKIsthgwfb">> = iolist_to_binary(re:replace("aB","(?-i:a)b","JJVTKIst\\1hgwfb",[caseless,
+ global])),
+ <<"CyLaBaaBaFaBUQLaBYD">> = iolist_to_binary(re:replace("aB","((?-i:a))b","CyL&a&aF&UQL&YD",[caseless])),
+ <<"CyLaBaaBaFaBUQLaBYD">> = iolist_to_binary(re:replace("aB","((?-i:a))b","CyL&a&aF&UQL&YD",[caseless,
global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","mWmXxiABWTMo&\\1bHX&m",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?-i:a)b","mWmXxiABWTMo&\\1bHX&m",[caseless,
+ global])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","KxfwWNxNB&uWywN",[caseless])),
+ <<"Ab">> = iolist_to_binary(re:replace("Ab","(?-i:a)b","KxfwWNxNB&uWywN",[caseless,
+ global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","FB&EbQh",[caseless])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","(?-i:a)b","FB&EbQh",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?-i:a.))b","GeHOW",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?-i:a.))b","GeHOW",[caseless,
+ global])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","((?-i:a.))b","t&\\1\\1wNwJd&umtr&\\1P&v",[caseless])),
+ <<"AB">> = iolist_to_binary(re:replace("AB","((?-i:a.))b","t&\\1\\1wNwJd&umtr&\\1P&v",[caseless,
+ global])),
<<"a
B">> = iolist_to_binary(re:replace("a
-B","((?-i:a.))b","\\1E\\1AL\\1QP",[caseless])),
+B","((?-i:a.))b","xLBhf&h",[caseless])),
<<"a
B">> = iolist_to_binary(re:replace("a
-B","((?-i:a.))b","\\1E\\1AL\\1QP",[caseless,global])),
- <<"bja
-Ba
-wRNOa
-LMvela
-w">> = iolist_to_binary(re:replace("a
-B","((?s-i:a.))b","bj&\\1wRNO\\1LMvel\\1w",[caseless])),
- <<"bja
-Ba
-wRNOa
-LMvela
-w">> = iolist_to_binary(re:replace("a
-B","((?s-i:a.))b","bj&\\1wRNO\\1LMvel\\1w",[caseless,global])),
- <<"oi">> = iolist_to_binary(re:replace("cabbbb","(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))","oi",[])),
- <<"oi">> = iolist_to_binary(re:replace("cabbbb","(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))","oi",[global])),
- <<"LPIaGAjcBB">> = iolist_to_binary(re:replace("caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))","LPIaGAjc\\1B\\1B",[])),
- <<"LPIaGAjcBB">> = iolist_to_binary(re:replace("caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))","LPIaGAjc\\1B\\1B",[global])),
- <<"Ab4abmaeqLAb4abK">> = iolist_to_binary(re:replace("Ab4ab","(ab)\\d\\1","&maeqL&K",[caseless])),
- <<"Ab4abmaeqLAb4abK">> = iolist_to_binary(re:replace("Ab4ab","(ab)\\d\\1","&maeqL&K",[caseless,
- global])),
- <<"AUMabjlQ">> = iolist_to_binary(re:replace("ab4Ab","(ab)\\d\\1","AUM\\1jlQ",[caseless])),
- <<"AUMabjlQ">> = iolist_to_binary(re:replace("ab4Ab","(ab)\\d\\1","AUM\\1jlQ",[caseless,
- global])),
- <<"XmYfoobar1234bazkhCJfoobar1234bazrE">> = iolist_to_binary(re:replace("foobar1234baz","foo\\w*\\d{4}baz","\\1\\1XmY&khCJ&rE",[])),
- <<"XmYfoobar1234bazkhCJfoobar1234bazrE">> = iolist_to_binary(re:replace("foobar1234baz","foo\\w*\\d{4}baz","\\1\\1XmY&khCJ&rE",[global])),
- <<"j">> = iolist_to_binary(re:replace("x~~","x(~~)*(?:(?:F)?)?","j",[])),
- <<"j">> = iolist_to_binary(re:replace("x~~","x(~~)*(?:(?:F)?)?","j",[global])),
- <<"dvmR">> = iolist_to_binary(re:replace("aaac","^a(?#xxx){3}c","dvmR",[])),
- <<"dvmR">> = iolist_to_binary(re:replace("aaac","^a(?#xxx){3}c","dvmR",[global])),
- <<"TcvCihggCC">> = iolist_to_binary(re:replace("aaac","^a (?#xxx) (?#yyy) {3}c","TcvCihggCC\\1",[extended])),
- <<"TcvCihggCC">> = iolist_to_binary(re:replace("aaac","^a (?#xxx) (?#yyy) {3}c","TcvCihggCC\\1",[extended,
- global])),
+B","((?-i:a.))b","xLBhf&h",[caseless,global])),
+ <<"a
+BeNa
+a
+ra
+B">> = iolist_to_binary(re:replace("a
+B","((?s-i:a.))b","&eN\\1\\1r&",[caseless])),
+ <<"a
+BeNa
+a
+ra
+B">> = iolist_to_binary(re:replace("a
+B","((?s-i:a.))b","&eN\\1\\1r&",[caseless,global])),
+ <<"xDgxGuTySBL">> = iolist_to_binary(re:replace("cabbbb","(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))","xDgxGuTySB\\1L",[])),
+ <<"xDgxGuTySBL">> = iolist_to_binary(re:replace("cabbbb","(?:c|d)(?:)(?:a(?:)(?:b)(?:b(?:))(?:b(?:)(?:b)))","xDgxGuTySB\\1L",[global])),
+ <<"S">> = iolist_to_binary(re:replace("caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))","S",[])),
+ <<"S">> = iolist_to_binary(re:replace("caaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb","(?:c|d)(?:)(?:aaaaaaaa(?:)(?:bbbbbbbb)(?:bbbbbbbb(?:))(?:bbbbbbbb(?:)(?:bbbbbbbb)))","S",[global])),
+ <<"oAb4abQPdAAb">> = iolist_to_binary(re:replace("Ab4ab","(ab)\\d\\1","o&QPdA\\1",[caseless])),
+ <<"oAb4abQPdAAb">> = iolist_to_binary(re:replace("Ab4ab","(ab)\\d\\1","o&QPdA\\1",[caseless,
+ global])),
+ <<"xDxHH">> = iolist_to_binary(re:replace("ab4Ab","(ab)\\d\\1","xDxHH",[caseless])),
+ <<"xDxHH">> = iolist_to_binary(re:replace("ab4Ab","(ab)\\d\\1","xDxHH",[caseless,
+ global])),
+ <<"iEooNfoobar1234bazWrIlfoobar1234baznlqjBfoobar1234bazb">> = iolist_to_binary(re:replace("foobar1234baz","foo\\w*\\d{4}baz","iEooN&WrIl&nlqjB&\\1b",[])),
+ <<"iEooNfoobar1234bazWrIlfoobar1234baznlqjBfoobar1234bazb">> = iolist_to_binary(re:replace("foobar1234baz","foo\\w*\\d{4}baz","iEooN&WrIl&nlqjB&\\1b",[global])),
+ <<"dph">> = iolist_to_binary(re:replace("x~~","x(~~)*(?:(?:F)?)?","dph",[])),
+ <<"dph">> = iolist_to_binary(re:replace("x~~","x(~~)*(?:(?:F)?)?","dph",[global])),
+ <<"aaacCaaaciHua">> = iolist_to_binary(re:replace("aaac","^a(?#xxx){3}c","&C&iHua",[])),
+ <<"aaacCaaaciHua">> = iolist_to_binary(re:replace("aaac","^a(?#xxx){3}c","&C&iHua",[global])),
ok.
run29() ->
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<![cd])b","aDLvRLT\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<![cd])b","aDLvRLT\\1",[global])),
+ <<"UkKlOLQggowaaaclFkU">> = iolist_to_binary(re:replace("aaac","^a (?#xxx) (?#yyy) {3}c","UkKlO\\1LQggow&lFkU",[extended])),
+ <<"UkKlOLQggowaaaclFkU">> = iolist_to_binary(re:replace("aaac","^a (?#xxx) (?#yyy) {3}c","UkKlO\\1LQggow&lFkU",[extended,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<![cd])b","qVEB\\1Buo",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<![cd])b","qVEB\\1Buo",[global])),
<<"B
B">> = iolist_to_binary(re:replace("B
-B","(?<![cd])b","&rX",[])),
+B","(?<![cd])b","&PINm\\1tQW&u",[])),
<<"B
B">> = iolist_to_binary(re:replace("B
-B","(?<![cd])b","&rX",[global])),
- <<"dbcb">> = iolist_to_binary(re:replace("dbcb","(?<![cd])b","RAdHe",[])),
- <<"dbcb">> = iolist_to_binary(re:replace("dbcb","(?<![cd])b","RAdHe",[global])),
- <<"dbLDvFpkRnyKFiqpapacb">> = iolist_to_binary(re:replace("dbaacb","(?<![cd])[ab]","LDvFpkRnyKFiqpap",[])),
- <<"dbLDvFpkRnyKFiqpapLDvFpkRnyKFiqpapcb">> = iolist_to_binary(re:replace("dbaacb","(?<![cd])[ab]","LDvFpkRnyKFiqpap",[global])),
- <<"dbpCgFRSanfBwdBHacb">> = iolist_to_binary(re:replace("dbaacb","(?<!(c|d))[ab]","pCgFRS&\\1nfBwdBH",[])),
- <<"dbpCgFRSanfBwdBHpCgFRSanfBwdBHcb">> = iolist_to_binary(re:replace("dbaacb","(?<!(c|d))[ab]","pCgFRS&\\1nfBwdBH",[global])),
- <<"cdaccJYb">> = iolist_to_binary(re:replace("cdaccb","(?<!cd)[ab]","J\\1Yb",[])),
- <<"cdaccJYb">> = iolist_to_binary(re:replace("cdaccb","(?<!cd)[ab]","J\\1Yb",[global])),
- <<"QQBKENcxCtDv">> = iolist_to_binary(re:replace("","^(?:a?b?)*$","\\1&QQ\\1BKENcxCtD&v",[])),
- <<"QQBKENcxCtDv">> = iolist_to_binary(re:replace("","^(?:a?b?)*$","\\1&QQ\\1BKENcxCtD&v",[global])),
- <<"EUVqGakpKtkaa">> = iolist_to_binary(re:replace("a","^(?:a?b?)*$","EUVqG&kp\\1\\1Ktk&&",[])),
- <<"EUVqGakpKtkaa">> = iolist_to_binary(re:replace("a","^(?:a?b?)*$","EUVqG&kp\\1\\1Ktk&&",[global])),
- <<"PJebYabVrwtUnyyi">> = iolist_to_binary(re:replace("ab","^(?:a?b?)*$","PJebY&Vrw\\1tUnyyi",[])),
- <<"PJebYabVrwtUnyyi">> = iolist_to_binary(re:replace("ab","^(?:a?b?)*$","PJebY&Vrw\\1tUnyyi",[global])),
- <<"TaaaaJgnBHpNaaaqW">> = iolist_to_binary(re:replace("aaa","^(?:a?b?)*$","Ta&JgnBHpN&qW",[])),
- <<"TaaaaJgnBHpNaaaqW">> = iolist_to_binary(re:replace("aaa","^(?:a?b?)*$","Ta&JgnBHpN&qW",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:a?b?)*$","s",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:a?b?)*$","s",[global])),
- <<"dbcb">> = iolist_to_binary(re:replace("dbcb","^(?:a?b?)*$","D",[])),
- <<"dbcb">> = iolist_to_binary(re:replace("dbcb","^(?:a?b?)*$","D",[global])),
- <<"a--">> = iolist_to_binary(re:replace("a--","^(?:a?b?)*$","xqeccmA\\1PK&\\1j\\1QcQv&",[])),
- <<"a--">> = iolist_to_binary(re:replace("a--","^(?:a?b?)*$","xqeccmA\\1PK&\\1j\\1QcQv&",[global])),
- <<"aa--">> = iolist_to_binary(re:replace("aa--","^(?:a?b?)*$","&y&JYUp&omM",[])),
- <<"aa--">> = iolist_to_binary(re:replace("aa--","^(?:a?b?)*$","&y&JYUp&omM",[global])),
- <<"suK
+B","(?<![cd])b","&PINm\\1tQW&u",[global])),
+ <<"dbcb">> = iolist_to_binary(re:replace("dbcb","(?<![cd])b","JN\\1nXQWo\\1gpGr",[])),
+ <<"dbcb">> = iolist_to_binary(re:replace("dbcb","(?<![cd])b","JN\\1nXQWo\\1gpGr",[global])),
+ <<"dbgLxFuiCCrajPsTmTacb">> = iolist_to_binary(re:replace("dbaacb","(?<![cd])[ab]","gLxFuiCCrajP\\1sTmT",[])),
+ <<"dbgLxFuiCCrajPsTmTgLxFuiCCrajPsTmTcb">> = iolist_to_binary(re:replace("dbaacb","(?<![cd])[ab]","gLxFuiCCrajP\\1sTmT",[global])),
+ <<"dbiyqEacb">> = iolist_to_binary(re:replace("dbaacb","(?<!(c|d))[ab]","iyqE",[])),
+ <<"dbiyqEiyqEcb">> = iolist_to_binary(re:replace("dbaacb","(?<!(c|d))[ab]","iyqE",[global])),
+ <<"cdaccfGWRbbyWukeN">> = iolist_to_binary(re:replace("cdaccb","(?<!cd)[ab]","\\1\\1fGWR\\1&\\1&yWukeN",[])),
+ <<"cdaccfGWRbbyWukeN">> = iolist_to_binary(re:replace("cdaccb","(?<!cd)[ab]","\\1\\1fGWR\\1&\\1&yWukeN",[global])),
+ <<"radhOoMmkTyvp">> = iolist_to_binary(re:replace("","^(?:a?b?)*$","radhO&oMmkTy&vp",[])),
+ <<"radhOoMmkTyvp">> = iolist_to_binary(re:replace("","^(?:a?b?)*$","radhO&oMmkTy&vp",[global])),
+ <<"iaraX">> = iolist_to_binary(re:replace("a","^(?:a?b?)*$","i&r&X",[])),
+ <<"iaraX">> = iolist_to_binary(re:replace("a","^(?:a?b?)*$","i&r&X",[global])),
+ <<"uvabababcGDFD">> = iolist_to_binary(re:replace("ab","^(?:a?b?)*$","uv&&&cGDFD",[])),
+ <<"uvabababcGDFD">> = iolist_to_binary(re:replace("ab","^(?:a?b?)*$","uv&&&cGDFD",[global])),
+ <<"aaawlwIRsqaaallaaaAnaaaBraaa">> = iolist_to_binary(re:replace("aaa","^(?:a?b?)*$","&wlwIRsq&ll\\1&An&B\\1r&",[])),
+ <<"aaawlwIRsqaaallaaaAnaaaBraaa">> = iolist_to_binary(re:replace("aaa","^(?:a?b?)*$","&wlwIRsq&ll\\1&An&B\\1r&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:a?b?)*$","HQDGKPOboFhEDT&FLu&D",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:a?b?)*$","HQDGKPOboFhEDT&FLu&D",[global])),
+ <<"dbcb">> = iolist_to_binary(re:replace("dbcb","^(?:a?b?)*$","dWU\\1&MLWjnDLY\\1\\1M",[])),
+ <<"dbcb">> = iolist_to_binary(re:replace("dbcb","^(?:a?b?)*$","dWU\\1&MLWjnDLY\\1\\1M",[global])),
+ <<"a--">> = iolist_to_binary(re:replace("a--","^(?:a?b?)*$","\\1&KaprjNw&yXkKe",[])),
+ <<"a--">> = iolist_to_binary(re:replace("a--","^(?:a?b?)*$","\\1&KaprjNw&yXkKe",[global])),
+ <<"aa--">> = iolist_to_binary(re:replace("aa--","^(?:a?b?)*$","Rr&FlU",[])),
+ <<"aa--">> = iolist_to_binary(re:replace("aa--","^(?:a?b?)*$","Rr&FlU",[global])),
+ <<"Ta
+ba
+Bkga
+bx
c">> = iolist_to_binary(re:replace("a
b
-c","((?s)^a(.))((?m)^b$)","suK",[])),
- <<"suK
+c","((?s)^a(.))((?m)^b$)","T&\\1Bkg&x",[])),
+ <<"Ta
+ba
+Bkga
+bx
c">> = iolist_to_binary(re:replace("a
b
-c","((?s)^a(.))((?m)^b$)","suK",[global])),
+c","((?s)^a(.))((?m)^b$)","T&\\1Bkg&x",[global])),
<<"a
-bsbrmbHobdxBbb
+fRyiaWcebhcY
c">> = iolist_to_binary(re:replace("a
b
-c","((?m)^b$)","\\1s&rm\\1Ho&dxB&\\1",[])),
+c","((?m)^b$)","fRyiaWce&hcY",[])),
<<"a
-bsbrmbHobdxBbb
+fRyiaWcebhcY
c">> = iolist_to_binary(re:replace("a
b
-c","((?m)^b$)","\\1s&rm\\1Ho&dxB&\\1",[global])),
+c","((?m)^b$)","fRyiaWce&hcY",[global])),
<<"a
-DbLxnGxIyQMiaCJKYa">> = iolist_to_binary(re:replace("a
-b","(?m)^b","D&LxnGxIyQMiaCJKYa\\1",[])),
+j">> = iolist_to_binary(re:replace("a
+b","(?m)^b","j\\1",[])),
<<"a
-DbLxnGxIyQMiaCJKYa">> = iolist_to_binary(re:replace("a
-b","(?m)^b","D&LxnGxIyQMiaCJKYa\\1",[global])),
+j">> = iolist_to_binary(re:replace("a
+b","(?m)^b","j\\1",[global])),
<<"a
-TbTgrAWgAV">> = iolist_to_binary(re:replace("a
-b","(?m)^(b)","T\\1TgrAWgAV",[])),
+tbDLKbpbbqBbWXNbjBU">> = iolist_to_binary(re:replace("a
+b","(?m)^(b)","t\\1DLK\\1p&\\1qB\\1WXNbjBU",[])),
<<"a
-TbTgrAWgAV">> = iolist_to_binary(re:replace("a
-b","(?m)^(b)","T\\1TgrAWgAV",[global])),
+tbDLKbpbbqBbWXNbjBU">> = iolist_to_binary(re:replace("a
+b","(?m)^(b)","t\\1DLK\\1p&\\1qB\\1WXNbjBU",[global])),
<<"a
-KvbbbEUIbCFmvpdpI">> = iolist_to_binary(re:replace("a
-b","((?m)^b)","Kv\\1&&EUI&CFmvpdpI",[])),
+hJUkbQmbMMdabmm">> = iolist_to_binary(re:replace("a
+b","((?m)^b)","hJUk&Qm\\1MMda&mm",[])),
<<"a
-KvbbbEUIbCFmvpdpI">> = iolist_to_binary(re:replace("a
-b","((?m)^b)","Kv\\1&&EUI&CFmvpdpI",[global])),
- <<"amFIqrSY
-bYBDTRTmIb">> = iolist_to_binary(re:replace("a
-b","\\n((?m)^b)","mFIqrSY&YBDTRTmI\\1",[])),
- <<"amFIqrSY
-bYBDTRTmIb">> = iolist_to_binary(re:replace("a
-b","\\n((?m)^b)","mFIqrSY&YBDTRTmI\\1",[global])),
+hJUkbQmbMMdabmm">> = iolist_to_binary(re:replace("a
+b","((?m)^b)","hJUk&Qm\\1MMda&mm",[global])),
+ <<"ad">> = iolist_to_binary(re:replace("a
+b","\\n((?m)^b)","d",[])),
+ <<"ad">> = iolist_to_binary(re:replace("a
+b","\\n((?m)^b)","d",[global])),
<<"a
-bGyvT
-WAEIfT
-">> = iolist_to_binary(re:replace("a
+bu">> = iolist_to_binary(re:replace("a
b
-c","((?s).)c(?!.)","GyvT\\1WAEIfT\\1",[])),
+c","((?s).)c(?!.)","u",[])),
<<"a
-bGyvT
-WAEIfT
-">> = iolist_to_binary(re:replace("a
+bu">> = iolist_to_binary(re:replace("a
b
-c","((?s).)c(?!.)","GyvT\\1WAEIfT\\1",[global])),
+c","((?s).)c(?!.)","u",[global])),
<<"a
-bu
-
-ciY
-ONSatC
-q
-cgqg">> = iolist_to_binary(re:replace("a
+bpB">> = iolist_to_binary(re:replace("a
b
-c","((?s).)c(?!.)","u\\1&iY\\1ONSatC\\1q&gqg",[])),
+c","((?s).)c(?!.)","pB",[])),
<<"a
-bu
-
-ciY
-ONSatC
-q
-cgqg">> = iolist_to_binary(re:replace("a
+bpB">> = iolist_to_binary(re:replace("a
b
-c","((?s).)c(?!.)","u\\1&iY\\1ONSatC\\1q&gqg",[global])),
+c","((?s).)c(?!.)","pB",[global])),
<<"a
-EaHhNb
-cc">> = iolist_to_binary(re:replace("a
b
-c","((?s)b.)c(?!.)","EaHhN&c",[])),
+cIe">> = iolist_to_binary(re:replace("a
+b
+c","((?s)b.)c(?!.)","&Ie",[])),
<<"a
-EaHhNb
-cc">> = iolist_to_binary(re:replace("a
b
-c","((?s)b.)c(?!.)","EaHhN&c",[global])),
+cIe">> = iolist_to_binary(re:replace("a
+b
+c","((?s)b.)c(?!.)","&Ie",[global])),
<<"a
-Qyf">> = iolist_to_binary(re:replace("a
+sqb
+">> = iolist_to_binary(re:replace("a
b
-c","((?s)b.)c(?!.)","Qyf",[])),
+c","((?s)b.)c(?!.)","sq\\1",[])),
<<"a
-Qyf">> = iolist_to_binary(re:replace("a
+sqb
+">> = iolist_to_binary(re:replace("a
b
-c","((?s)b.)c(?!.)","Qyf",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","()^b","uPupHDfyOM",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","()^b","uPupHDfyOM",[global])),
+c","((?s)b.)c(?!.)","sq\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","()^b","ov",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","()^b","ov",[global])),
<<"a
b
c">> = iolist_to_binary(re:replace("a
b
-c","()^b","ie",[])),
+c","()^b","uMvMIoSdSSJ",[])),
<<"a
b
c">> = iolist_to_binary(re:replace("a
b
-c","()^b","ie",[global])),
+c","()^b","uMvMIoSdSSJ",[global])),
<<"a
b
c">> = iolist_to_binary(re:replace("a
b
-c","()^b","XOjtYTE&",[])),
+c","()^b","CWpw",[])),
<<"a
b
c">> = iolist_to_binary(re:replace("a
b
-c","()^b","XOjtYTE&",[global])),
+c","()^b","CWpw",[global])),
<<"a
-up
+VJbfDbMGQCbssq
c">> = iolist_to_binary(re:replace("a
b
-c","((?m)^b)","up",[])),
+c","((?m)^b)","VJ&fD&MGQC&ssq",[])),
<<"a
-up
+VJbfDbMGQCbssq
c">> = iolist_to_binary(re:replace("a
b
-c","((?m)^b)","up",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(x)?(?(1)a|b)","Q&VpBvd&HCANVl",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(x)?(?(1)a|b)","Q&VpBvd&HCANVl",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","PJENMvR\\1&\\1nkq\\1j&P&",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","PJENMvR\\1&\\1nkq\\1j&P&",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","hStdV\\1o",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","hStdV\\1o",[global])),
- <<"bpiiYpjmbL">> = iolist_to_binary(re:replace("a","(x)?(?(1)b|a)","bpiiYpjmbL",[])),
- <<"bpiiYpjmbL">> = iolist_to_binary(re:replace("a","(x)?(?(1)b|a)","bpiiYpjmbL",[global])),
- <<"ldpcm">> = iolist_to_binary(re:replace("a","()?(?(1)b|a)","ldpc\\1m",[])),
- <<"ldpcm">> = iolist_to_binary(re:replace("a","()?(?(1)b|a)","ldpc\\1m",[global])),
+c","((?m)^b)","VJ&fD&MGQC&ssq",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(x)?(?(1)a|b)","LNqS&m",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(x)?(?(1)a|b)","LNqS&m",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","OkYauyNGxeWuW\\1\\1&MWr",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","OkYauyNGxeWuW\\1\\1&MWr",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","scDk\\1nM",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(x)?(?(1)a|b)","scDk\\1nM",[global])),
+ <<"YcA">> = iolist_to_binary(re:replace("a","(x)?(?(1)b|a)","\\1YcA",[])),
+ <<"YcA">> = iolist_to_binary(re:replace("a","(x)?(?(1)b|a)","\\1YcA",[global])),
ok.
run30() ->
- <<"XVaoQoPYY">> = iolist_to_binary(re:replace("a","()?(?(1)a|b)","\\1X\\1V&oQoPYY",[])),
- <<"XVaoQoPYY">> = iolist_to_binary(re:replace("a","()?(?(1)a|b)","\\1X\\1V&oQoPYY",[global])),
- <<"NIfcW(blah)G">> = iolist_to_binary(re:replace("(blah)","^(\\()?blah(?(1)(\\)))$","NIfcW&G",[])),
- <<"NIfcW(blah)G">> = iolist_to_binary(re:replace("(blah)","^(\\()?blah(?(1)(\\)))$","NIfcW&G",[global])),
- <<"pnblahSJOoELoLblah">> = iolist_to_binary(re:replace("blah","^(\\()?blah(?(1)(\\)))$","pn&SJOoELoL&",[])),
- <<"pnblahSJOoELoLblah">> = iolist_to_binary(re:replace("blah","^(\\()?blah(?(1)(\\)))$","pn&SJOoELoL&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\()?blah(?(1)(\\)))$","&qo&jitI",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\()?blah(?(1)(\\)))$","&qo&jitI",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","^(\\()?blah(?(1)(\\)))$","nvEsX\\1dtIq",[])),
- <<"a">> = iolist_to_binary(re:replace("a","^(\\()?blah(?(1)(\\)))$","nvEsX\\1dtIq",[global])),
- <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\()?blah(?(1)(\\)))$","QkLbrxtPSiEFXY",[])),
- <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\()?blah(?(1)(\\)))$","QkLbrxtPSiEFXY",[global])),
- <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\()?blah(?(1)(\\)))$","lAP",[])),
- <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\()?blah(?(1)(\\)))$","lAP",[global])),
- <<"(LsJwkbg(bfkt(NulbXR">> = iolist_to_binary(re:replace("(blah)","^(\\(+)?blah(?(1)(\\)))$","\\1LsJwkbg\\1bfkt\\1NulbXR",[])),
- <<"(LsJwkbg(bfkt(NulbXR">> = iolist_to_binary(re:replace("(blah)","^(\\(+)?blah(?(1)(\\)))$","\\1LsJwkbg\\1bfkt\\1NulbXR",[global])),
- <<"d">> = iolist_to_binary(re:replace("blah","^(\\(+)?blah(?(1)(\\)))$","\\1d",[])),
- <<"d">> = iolist_to_binary(re:replace("blah","^(\\(+)?blah(?(1)(\\)))$","\\1d",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\(+)?blah(?(1)(\\)))$","EMgTAXywJ\\1sx",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\(+)?blah(?(1)(\\)))$","EMgTAXywJ\\1sx",[global])),
- <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\(+)?blah(?(1)(\\)))$","LdpE",[])),
- <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\(+)?blah(?(1)(\\)))$","LdpE",[global])),
- <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\(+)?blah(?(1)(\\)))$","x",[])),
- <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\(+)?blah(?(1)(\\)))$","x",[global])),
- <<"DTG">> = iolist_to_binary(re:replace("a","(?(?!a)b|a)","DT\\1G\\1",[])),
- <<"DTG">> = iolist_to_binary(re:replace("a","(?(?!a)b|a)","DT\\1G\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=a)b|a)","d\\1lnf&YLYNM",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=a)b|a)","d\\1lnf&YLYNM",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","\\1SGC\\1&hP&OBDNrG",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","\\1SGC\\1&hP&OBDNrG",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","\\1O",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","\\1O",[global])),
- <<"ToKaPapJTYo">> = iolist_to_binary(re:replace("a","(?(?=a)a|b)","\\1ToKaP&pJTYo",[])),
- <<"ToKaPapJTYo">> = iolist_to_binary(re:replace("a","(?(?=a)a|b)","\\1ToKaP&pJTYo",[global])),
- <<"aaYfA">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","\\1YfA",[])),
- <<"aaYfA">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","\\1YfA",[global])),
- <<"Oone:LVumwJGPxKone:">> = iolist_to_binary(re:replace("one:","(\\w+:)+","O&LVumwJGPxK\\1",[])),
- <<"Oone:LVumwJGPxKone:">> = iolist_to_binary(re:replace("one:","(\\w+:)+","O&LVumwJGPxK\\1",[global])),
- <<"axOGBQtmfLikDGlXSft">> = iolist_to_binary(re:replace("a","$(?<=^(a))","xOGBQtmfLikDGlXSft",[])),
- <<"axOGBQtmfLikDGlXSft">> = iolist_to_binary(re:replace("a","$(?<=^(a))","xOGBQtmfLikDGlXSft",[global])),
- <<"auQKtSaabLmmqtekWvRQaWJ">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","uQKtS&LmmqtekWvRQ\\1WJ",[])),
- <<"auQKtSaabLmmqtekWvRQaWJ">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","uQKtS&LmmqtekWvRQ\\1WJ",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?=(a+?))\\1ab","&&USoct\\1R",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?=(a+?))\\1ab","&&USoct\\1R",[global])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","nNyoTw&TuS\\1oXos",[])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","nNyoTw&TuS\\1oXos",[global])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","MAutXFUx",[])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","MAutXFUx",[global])),
- <<"cXabcdPLyeVVq">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","c\\1X&\\1PLyeV\\1Vq",[])),
- <<"cXabcdPLyeVVq">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","c\\1X&\\1PLyeV\\1Vq",[global])),
- <<"jxy:z:::abcdYDxy:z:::Ixy:z:::abcdA">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","j&YD\\1I&A",[])),
- <<"jxy:z:::abcdYDxy:z:::Ixy:z:::abcdA">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","j&YD\\1I&A",[global])),
- <<"IbkqaaexycIVtbd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","Ibkqa&IVtb",[])),
- <<"IbkqaaexycIVtbd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","Ibkqa&IVtb",[global])),
- <<"cSLuXFBaavfbUaahyxuWowk">> = iolist_to_binary(re:replace("caab","(a*)b+","SLuXFB\\1vfbU\\1hyxuWowk",[])),
- <<"cSLuXFBaavfbUaahyxuWowk">> = iolist_to_binary(re:replace("caab","(a*)b+","SLuXFB\\1vfbU\\1hyxuWowk",[global])),
- <<"n">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","n",[])),
- <<"n">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","n",[global])),
- <<"xy:z:::abcdSfCyKxy:z:::abcdxy:z:::rOIxy:z:::qaXJV">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","&SfCyK&\\1rOI\\1qaXJV",[])),
- <<"xy:z:::abcdSfCyKxy:z:::abcdxy:z:::rOIxy:z:::qaXJV">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","&SfCyK&\\1rOI\\1qaXJV",[global])),
- <<"*** FDIubo">> = iolist_to_binary(re:replace("*** Failers","([\\w:]+::)?(\\w+)$","FDIubo",[])),
- <<"*** FDIubo">> = iolist_to_binary(re:replace("*** Failers","([\\w:]+::)?(\\w+)$","FDIubo",[global])),
- <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","\\1\\1FqKhObWFBLnW",[])),
- <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","\\1\\1FqKhObWFBLnW",[global])),
- <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","\\1\\1\\1JSX&vwHeWnyicJH",[])),
- <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","\\1\\1\\1JSX&vwHeWnyicJH",[global])),
- <<"bsuraexycHejcJAclcd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","bsur&HejcJA\\1l\\1",[])),
- <<"bsuraexycHejcJAclcd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","bsur&HejcJA\\1l\\1",[global])),
+ <<"xNapUFFvOIj">> = iolist_to_binary(re:replace("a","()?(?(1)b|a)","xN&pU\\1FFvOIj",[])),
+ <<"xNapUFFvOIj">> = iolist_to_binary(re:replace("a","()?(?(1)b|a)","xN&pU\\1FFvOIj",[global])),
+ <<"XuaPbWvaWaalBtsa">> = iolist_to_binary(re:replace("a","()?(?(1)a|b)","Xu&PbWv&W&&lBts&",[])),
+ <<"XuaPbWvaWaalBtsa">> = iolist_to_binary(re:replace("a","()?(?(1)a|b)","Xu&PbWv&W&&lBts&",[global])),
+ <<"(fyCFuvHU((puIwItIx(">> = iolist_to_binary(re:replace("(blah)","^(\\()?blah(?(1)(\\)))$","\\1fyCFuvHU\\1\\1puIwItIx\\1",[])),
+ <<"(fyCFuvHU((puIwItIx(">> = iolist_to_binary(re:replace("(blah)","^(\\()?blah(?(1)(\\)))$","\\1fyCFuvHU\\1\\1puIwItIx\\1",[global])),
+ <<"AyRblahEPvK">> = iolist_to_binary(re:replace("blah","^(\\()?blah(?(1)(\\)))$","AyR&EPvK",[])),
+ <<"AyRblahEPvK">> = iolist_to_binary(re:replace("blah","^(\\()?blah(?(1)(\\)))$","AyR&EPvK",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\()?blah(?(1)(\\)))$","SbDcblGvpFYoX&J&Gu",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\()?blah(?(1)(\\)))$","SbDcblGvpFYoX&J&Gu",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(\\()?blah(?(1)(\\)))$","&m",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(\\()?blah(?(1)(\\)))$","&m",[global])),
+ <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\()?blah(?(1)(\\)))$","k\\1",[])),
+ <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\()?blah(?(1)(\\)))$","k\\1",[global])),
+ <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\()?blah(?(1)(\\)))$","BufqWrp\\1\\1UijV",[])),
+ <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\()?blah(?(1)(\\)))$","BufqWrp\\1\\1UijV",[global])),
+ <<"pIOc(eAW(">> = iolist_to_binary(re:replace("(blah)","^(\\(+)?blah(?(1)(\\)))$","pIOc\\1eAW\\1",[])),
+ <<"pIOc(eAW(">> = iolist_to_binary(re:replace("(blah)","^(\\(+)?blah(?(1)(\\)))$","pIOc\\1eAW\\1",[global])),
+ <<"p">> = iolist_to_binary(re:replace("blah","^(\\(+)?blah(?(1)(\\)))$","p",[])),
+ <<"p">> = iolist_to_binary(re:replace("blah","^(\\(+)?blah(?(1)(\\)))$","p",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\(+)?blah(?(1)(\\)))$","y&&&AOp\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\(+)?blah(?(1)(\\)))$","y&&&AOp\\1",[global])),
+ <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\(+)?blah(?(1)(\\)))$","\\1VJMcD\\1vw&NweMFm",[])),
+ <<"blah)">> = iolist_to_binary(re:replace("blah)","^(\\(+)?blah(?(1)(\\)))$","\\1VJMcD\\1vw&NweMFm",[global])),
+ <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\(+)?blah(?(1)(\\)))$","nmpAKxmhP\\1VH\\1DE\\1",[])),
+ <<"(blah">> = iolist_to_binary(re:replace("(blah","^(\\(+)?blah(?(1)(\\)))$","nmpAKxmhP\\1VH\\1DE\\1",[global])),
+ <<"sVrnWeaaBWqoEe">> = iolist_to_binary(re:replace("a","(?(?!a)b|a)","sVrnWea&BWqoE\\1e\\1",[])),
+ <<"sVrnWeaaBWqoEe">> = iolist_to_binary(re:replace("a","(?(?!a)b|a)","sVrnWea&BWqoE\\1e\\1",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=a)b|a)","yKlwaKvFuDaY&",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?(?=a)b|a)","yKlwaKvFuDaY&",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","a&xlo",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","a&xlo",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","HA\\1fUFNxI",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(?(?=a)b|a)","HA\\1fUFNxI",[global])),
+ <<"UTGiYaXaqADaSaxgaG">> = iolist_to_binary(re:replace("a","(?(?=a)a|b)","UTGiY&\\1X&qAD\\1&S&xgaG",[])),
+ <<"UTGiYaXaqADaSaxgaG">> = iolist_to_binary(re:replace("a","(?(?=a)a|b)","UTGiY&\\1X&qAD\\1&S&xgaG",[global])),
+ <<"aTjaOYiTQLgjuOn">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","Tj\\1OYiTQLgjuOn",[])),
+ <<"aTjaOYiTQLgjuOn">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","Tj\\1OYiTQLgjuOn",[global])),
+ <<"one:Yone:hI">> = iolist_to_binary(re:replace("one:","(\\w+:)+","&Y&hI",[])),
+ <<"one:Yone:hI">> = iolist_to_binary(re:replace("one:","(\\w+:)+","&Y&hI",[global])),
+ <<"aJdMoadBqra">> = iolist_to_binary(re:replace("a","$(?<=^(a))","JdMo\\1&dBqr&\\1",[])),
+ <<"aJdMoadBqra">> = iolist_to_binary(re:replace("a","$(?<=^(a))","JdMo\\1&dBqr&\\1",[global])),
+ <<"aRayaTFQFN">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","R\\1yaTFQFN",[])),
+ <<"aRayaTFQFN">> = iolist_to_binary(re:replace("aaab","(?=(a+?))(\\1ab)","R\\1yaTFQFN",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?=(a+?))\\1ab","w",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?=(a+?))\\1ab","w",[global])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","TAs",[])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","TAs",[global])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","gObuYj\\1f\\1&Y\\1&\\1",[])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","^(?=(a+?))\\1ab","gObuYj\\1f\\1&Y\\1&\\1",[global])),
+ <<"WqUamivVmXabcdLd">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","W\\1qUamiv\\1V\\1mX&Ld",[])),
+ <<"WqUamivVmXabcdLd">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","W\\1qUamiv\\1V\\1mX&Ld",[global])),
+ <<"Ixy:z:::abcdxy:z:::abcdnxy:z:::xy:z:::abcdbsHvXRBC">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","I&&n\\1&bsHvXRBC",[])),
+ <<"Ixy:z:::abcdxy:z:::abcdnxy:z:::xy:z:::abcdbsHvXRBC">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","I&&n\\1&bsHvXRBC",[global])),
+ <<"Xd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","X",[])),
+ <<"Xd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","X",[global])),
+ <<"cxqAaaeaabaaLWaaaaQJTaaaaxG">> = iolist_to_binary(re:replace("caab","(a*)b+","xqA\\1e&\\1LW\\1\\1QJT\\1\\1xG",[])),
+ <<"cxqAaaeaabaaLWaaaaQJTaaaaxG">> = iolist_to_binary(re:replace("caab","(a*)b+","xqA\\1e&\\1LW\\1\\1QJT\\1\\1xG",[global])),
+ <<"PabcdoXTDiScdQabcdE">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","P&\\1o\\1XTDiScdQ&E",[])),
+ <<"PabcdoXTDiScdQabcdE">> = iolist_to_binary(re:replace("abcd","([\\w:]+::)?(\\w+)$","P&\\1o\\1XTDiScdQ&E",[global])),
+ <<"ltxy:z:::abcdOkVmTnmtexy:z:::MMY">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","lt&OkVmTnmte\\1MMY",[])),
+ <<"ltxy:z:::abcdOkVmTnmtexy:z:::MMY">> = iolist_to_binary(re:replace("xy:z:::abcd","([\\w:]+::)?(\\w+)$","lt&OkVmTnmte\\1MMY",[global])),
+ <<"*** hdDdHBCKXpUraMooFailersFailersW">> = iolist_to_binary(re:replace("*** Failers","([\\w:]+::)?(\\w+)$","hdDdHBCKXpUraMoo&\\1&W",[])),
+ <<"*** hdDdHBCKXpUraMooFailersFailersW">> = iolist_to_binary(re:replace("*** Failers","([\\w:]+::)?(\\w+)$","hdDdHBCKXpUraMoo&\\1&W",[global])),
+ <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","W&CE",[])),
+ <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","W&CE",[global])),
+ <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","HS&xAXhj\\1&h\\1oJanfg",[])),
+ <<"abcd:">> = iolist_to_binary(re:replace("abcd:","([\\w:]+::)?(\\w+)$","HS&xAXhj\\1&h\\1oJanfg",[global])),
+ <<"gncfaexycKcgd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","gn\\1f&K\\1g",[])),
+ <<"gncfaexycKcgd">> = iolist_to_binary(re:replace("aexycd","^[^bcd]*(c+)","gn\\1f&K\\1g",[global])),
ok.
run31() ->
- <<"C">> = iolist_to_binary(re:replace("aaab","(?>a+)b","\\1C",[])),
- <<"C">> = iolist_to_binary(re:replace("aaab","(?>a+)b","\\1C",[global])),
- <<"aNO:[pGn:[:[Hb]:">> = iolist_to_binary(re:replace("a:[b]:","([[:]+)","NO\\1pGn&\\1H",[])),
- <<"aNO:[pGn:[:[Hb]NO:pGn::H">> = iolist_to_binary(re:replace("a:[b]:","([[:]+)","NO\\1pGn&\\1H",[global])),
- <<"aUSAUCBri=[uNyXKFxsgAib]=">> = iolist_to_binary(re:replace("a=[b]=","([[=]+)","USAUCBri&uNyXKFxsgAi",[])),
- <<"aUSAUCBri=[uNyXKFxsgAib]USAUCBri=uNyXKFxsgAi">> = iolist_to_binary(re:replace("a=[b]=","([[=]+)","USAUCBri&uNyXKFxsgAi",[global])),
- <<"alNmxCu.[.[iUB.[.[b].">> = iolist_to_binary(re:replace("a.[b].","([[.]+)","lNmxCu&&iUB&\\1",[])),
- <<"alNmxCu.[.[iUB.[.[b]lNmxCu..iUB..">> = iolist_to_binary(re:replace("a.[b].","([[.]+)","lNmxCu&&iUB&\\1",[global])),
- <<"gGaaab">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","gG&",[])),
- <<"gGaaab">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","gG&",[global])),
- <<"XaaaSaaaFUaaabJnaaabMCaaabedCQAgh">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","X\\1S\\1FU&Jn&MC&edCQAgh",[])),
- <<"XaaaSaaaFUaaabJnaaabMCaaabedCQAgh">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","X\\1S\\1FU&Jn&MC&edCQAgh",[global])),
- <<"((nxgvJb">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","n\\1gvJb",[])),
- <<"((nxgvJb">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","n\\1gvJb",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Z","dnHcIc\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Z","dnHcIc\\1",[global])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","a\\Z","TMH",[])),
- <<"aaab">> = iolist_to_binary(re:replace("aaab","a\\Z","TMH",[global])),
+ <<"dIgTpbIaaabHEixaaaby">> = iolist_to_binary(re:replace("aaab","(?>a+)b","dI\\1gTpbI&HEix&y",[])),
+ <<"dIgTpbIaaabHEixaaaby">> = iolist_to_binary(re:replace("aaab","(?>a+)b","dI\\1gTpbI&HEix&y",[global])),
+ <<"a:[xKoXTWDN:[:[P:[b]:">> = iolist_to_binary(re:replace("a:[b]:","([[:]+)","&xKoXTWDN\\1\\1P\\1",[])),
+ <<"a:[xKoXTWDN:[:[P:[b]:xKoXTWDN::P:">> = iolist_to_binary(re:replace("a:[b]:","([[:]+)","&xKoXTWDN\\1\\1P\\1",[global])),
+ <<"a=[b]=">> = iolist_to_binary(re:replace("a=[b]=","([[=]+)","\\1",[])),
+ <<"a=[b]=">> = iolist_to_binary(re:replace("a=[b]=","([[=]+)","\\1",[global])),
+ <<"aAULOvS.[q.[cI.[O.[K.[WMIpb].">> = iolist_to_binary(re:replace("a.[b].","([[.]+)","AULOvS&q\\1cI\\1O&K&WMIp",[])),
+ <<"aAULOvS.[q.[cI.[O.[K.[WMIpb]AULOvS.q.cI.O.K.WMIp">> = iolist_to_binary(re:replace("a.[b].","([[.]+)","AULOvS&q\\1cI\\1O&K&WMIp",[global])),
+ <<"tkaYMfUUpaaabHTyQAreKh">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","tkaYMfUUp&HTyQAreKh",[])),
+ <<"tkaYMfUUpaaabHTyQAreKh">> = iolist_to_binary(re:replace("aaab","((?>a+)b)","tkaYMfUUp&HTyQAreKh",[global])),
+ <<"EHaaaGtlKGyaaaEAaaaaaahAK">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","EH\\1GtlKGy\\1EA\\1\\1hAK",[])),
+ <<"EHaaaGtlKGyaaaEAaaaaaahAK">> = iolist_to_binary(re:replace("aaab","(?>(a+))b","EH\\1GtlKGy\\1EA\\1\\1hAK",[global])),
+ <<"((GwfYxOabc(ade)ufh()()xW">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","GwfY\\1O&W",[])),
+ <<"((GwfYxOabc(ade)ufh()()xW">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","((?>[^()]+)|\\([^()]*\\))+","GwfY\\1O&W",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Z","mItu\\1oJX&CQC&UvIK",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a\\Z","mItu\\1oJX&CQC&UvIK",[global])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","a\\Z","IaLyKsEnQnMtfj\\1",[])),
+ <<"aaab">> = iolist_to_binary(re:replace("aaab","a\\Z","IaLyKsEnQnMtfj\\1",[global])),
<<"a
b">> = iolist_to_binary(re:replace("a
-b","a\\Z","Dt\\1LIek",[])),
+b","a\\Z","eslV\\1s",[])),
<<"a
b">> = iolist_to_binary(re:replace("a
-b","a\\Z","Dt\\1LIek",[global])),
+b","a\\Z","eslV\\1s",[global])),
<<"a
-ihO">> = iolist_to_binary(re:replace("a
-b","b\\Z","ihO",[])),
+MKbmAwNCnGbLYb">> = iolist_to_binary(re:replace("a
+b","b\\Z","M\\1K&mAwNCnG&LY\\1&",[])),
<<"a
-ihO">> = iolist_to_binary(re:replace("a
-b","b\\Z","ihO",[global])),
+MKbmAwNCnGbLYb">> = iolist_to_binary(re:replace("a
+b","b\\Z","M\\1K&mAwNCnG&LY\\1&",[global])),
<<"a
-xaybR">> = iolist_to_binary(re:replace("a
-b","b\\Z","xaybR",[])),
+YxEpUt">> = iolist_to_binary(re:replace("a
+b","b\\Z","YxEpUt",[])),
<<"a
-xaybR">> = iolist_to_binary(re:replace("a
-b","b\\Z","xaybR",[global])),
+YxEpUt">> = iolist_to_binary(re:replace("a
+b","b\\Z","YxEpUt",[global])),
<<"a
-b">> = iolist_to_binary(re:replace("a
-b","b\\z","&",[])),
+nocMyHoQWrYuE">> = iolist_to_binary(re:replace("a
+b","b\\z","nocMyHoQ\\1WrY\\1uE",[])),
<<"a
-b">> = iolist_to_binary(re:replace("a
-b","b\\z","&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","b\\z","L\\1\\1ffT&Q\\1\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","b\\z","L\\1\\1ffT&Q\\1\\1",[global])),
- <<"lKtonNambJv">> = iolist_to_binary(re:replace("a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","lKt\\1onN&mbJ\\1v",[])),
- <<"lKtonNambJv">> = iolist_to_binary(re:replace("a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","lKt\\1onN&mbJ\\1v",[global])),
- <<"pabcYFSdblfLabcy">> = iolist_to_binary(re:replace("abc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","p&\\1YFSdbl\\1fL&y",[])),
- <<"pabcYFSdblfLabcy">> = iolist_to_binary(re:replace("abc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","p&\\1YFSdbl\\1fL&y",[global])),
- <<"Ta-bKyCljTYNdT">> = iolist_to_binary(re:replace("a-b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","T&KyCljTYN\\1dT",[])),
- <<"Ta-bKyCljTYNdT">> = iolist_to_binary(re:replace("a-b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","T&KyCljTYN\\1dT",[global])),
- <<"RHSJc">> = iolist_to_binary(re:replace("0-9","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","RHSJc",[])),
- <<"RHSJc">> = iolist_to_binary(re:replace("0-9","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","RHSJc",[global])),
- <<"dMwhrVYNNa.ba.bGa.br">> = iolist_to_binary(re:replace("a.b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","\\1dMwhrVYNN&&G&r",[])),
- <<"dMwhrVYNNa.ba.bGa.br">> = iolist_to_binary(re:replace("a.b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","\\1dMwhrVYNN&&G&r",[global])),
- <<"kPaiiQUiPl">> = iolist_to_binary(re:replace("5.6.7","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","kPaiiQUiPl\\1",[])),
- <<"kPaiiQUiPl">> = iolist_to_binary(re:replace("5.6.7","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","kPaiiQUiPl\\1",[global])),
- <<"wvQrLEJUiDlAr">> = iolist_to_binary(re:replace("the.quick.brown.fox","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","wvQ\\1rLEJUi\\1DlAr",[])),
- <<"wvQrLEJUiDlAr">> = iolist_to_binary(re:replace("the.quick.brown.fox","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","wvQ\\1rLEJUi\\1DlAr",[global])),
- <<"iHa100.b200.300cGyVda100.b200.300cekCw">> = iolist_to_binary(re:replace("a100.b200.300c","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","iH&GyVd&\\1ekCw",[])),
- <<"iHa100.b200.300cGyVda100.b200.300cekCw">> = iolist_to_binary(re:replace("a100.b200.300c","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","iH&GyVd&\\1ekCw",[global])),
- <<"O">> = iolist_to_binary(re:replace("12-ab.1245","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","O",[])),
- <<"O">> = iolist_to_binary(re:replace("12-ab.1245","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","O",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","HUtU\\1hwSyIT&Oh\\1&&y",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","HUtU\\1hwSyIT&Oh\\1&&y",[global])),
- <<"">> = iolist_to_binary(re:replace("","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hNvuQF&Qs&",[])),
- <<"">> = iolist_to_binary(re:replace("","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hNvuQF&Qs&",[global])),
- <<".a">> = iolist_to_binary(re:replace(".a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","QqXr&DuJWM",[])),
- <<".a">> = iolist_to_binary(re:replace(".a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","QqXr&DuJWM",[global])),
- <<"-a">> = iolist_to_binary(re:replace("-a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","sk\\1IEt",[])),
- <<"-a">> = iolist_to_binary(re:replace("-a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","sk\\1IEt",[global])),
- <<"a-">> = iolist_to_binary(re:replace("a-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","q&NPicpE",[])),
- <<"a-">> = iolist_to_binary(re:replace("a-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","q&NPicpE",[global])),
- <<"a.">> = iolist_to_binary(re:replace("a.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","CQXy",[])),
- <<"a.">> = iolist_to_binary(re:replace("a.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","CQXy",[global])),
- <<"a_b">> = iolist_to_binary(re:replace("a_b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","LYXq",[])),
- <<"a_b">> = iolist_to_binary(re:replace("a_b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","LYXq",[global])),
- <<"a.-">> = iolist_to_binary(re:replace("a.-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","MD\\1",[])),
- <<"a.-">> = iolist_to_binary(re:replace("a.-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","MD\\1",[global])),
- <<"a..">> = iolist_to_binary(re:replace("a..","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","L",[])),
- <<"a..">> = iolist_to_binary(re:replace("a..","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","L",[global])),
- <<"ab..bc">> = iolist_to_binary(re:replace("ab..bc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","BCKwcl\\1kueBcjj",[])),
- <<"ab..bc">> = iolist_to_binary(re:replace("ab..bc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","BCKwcl\\1kueBcjj",[global])),
- <<"the.quick.brown.fox-">> = iolist_to_binary(re:replace("the.quick.brown.fox-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","JT&&v&ADCCjyxv",[])),
- <<"the.quick.brown.fox-">> = iolist_to_binary(re:replace("the.quick.brown.fox-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","JT&&v&ADCCjyxv",[global])),
- <<"the.quick.brown.fox.">> = iolist_to_binary(re:replace("the.quick.brown.fox.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","ss",[])),
- <<"the.quick.brown.fox.">> = iolist_to_binary(re:replace("the.quick.brown.fox.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","ss",[global])),
- <<"the.quick.brown.fox_">> = iolist_to_binary(re:replace("the.quick.brown.fox_","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","oN\\1QUG",[])),
- <<"the.quick.brown.fox_">> = iolist_to_binary(re:replace("the.quick.brown.fox_","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","oN\\1QUG",[global])),
- <<"the.quick.brown.fox+">> = iolist_to_binary(re:replace("the.quick.brown.fox+","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","dOn\\1&jl\\1b&",[])),
- <<"the.quick.brown.fox+">> = iolist_to_binary(re:replace("the.quick.brown.fox+","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","dOn\\1&jl\\1b&",[global])),
- <<"fkIx">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd|wxyz))","fkIx",[])),
- <<"fkIxfkIx">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd|wxyz))","fkIx",[global])),
- <<"endingwxyzendingwxyzuyEXDtendingwxyzFCFendingwxyzgoLpALi">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd|wxyz))","&&uyEXDt&FCF&goLpALi",[])),
- <<"endingwxyzendingwxyzuyEXDtendingwxyzFCFendingwxyzgoLpALiuyEXDtFCFgoLpALi">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd|wxyz))","&&uyEXDt&FCF&goLpALi",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>.*)(?<=(abcd|wxyz))","ElH",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>.*)(?<=(abcd|wxyz))","ElH",[global])),
- <<"a rather long string that doesn't end with one of them">> = iolist_to_binary(re:replace("a rather long string that doesn't end with one of them","(?>.*)(?<=(abcd|wxyz))","&GVy",[])),
- <<"a rather long string that doesn't end with one of them">> = iolist_to_binary(re:replace("a rather long string that doesn't end with one of them","(?>.*)(?<=(abcd|wxyz))","&GVy",[global])),
- <<"IpFbERword cat dog elephant mussel cow horse canary baboon snake shark otherwordvjword cat dog elephant mussel cow horse canary baboon snake shark otherwordaul">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","IpFbER&vj&aul",[])),
- <<"IpFbERword cat dog elephant mussel cow horse canary baboon snake shark otherwordvjword cat dog elephant mussel cow horse canary baboon snake shark otherwordaul">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","IpFbER&vj&aul",[global])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","JMrCXcb\\1Q&T\\1ypBy",[])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","JMrCXcb\\1Q&T\\1ypBy",[global])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?>[a-zA-Z0-9]+ ){0,30}otherword","TD&O",[])),
- <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?>[a-zA-Z0-9]+ ){0,30}otherword","TD&O",[global])),
- <<"999fooKfooJ">> = iolist_to_binary(re:replace("999foo","(?<=\\d{3}(?!999))foo","&K&J",[])),
- <<"999fooKfooJ">> = iolist_to_binary(re:replace("999foo","(?<=\\d{3}(?!999))foo","&K&J",[global])),
- <<"123999ncsryomxOKBBikcY">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999))foo","\\1ncsry\\1omxOKBBikcY",[])),
- <<"123999ncsryomxOKBBikcY">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999))foo","\\1ncsry\\1omxOKBBikcY",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999))foo","NMXv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999))foo","NMXv",[global])),
- <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999))foo","B\\1\\1",[])),
- <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999))foo","B\\1\\1",[global])),
- <<"999faWvYAfooyphbfooC">> = iolist_to_binary(re:replace("999foo","(?<=(?!...999)\\d{3})foo","f\\1aW\\1vYA\\1&yphb&C",[])),
- <<"999faWvYAfooyphbfooC">> = iolist_to_binary(re:replace("999foo","(?<=(?!...999)\\d{3})foo","f\\1aW\\1vYA\\1&yphb&C",[global])),
- <<"123999D">> = iolist_to_binary(re:replace("123999foo","(?<=(?!...999)\\d{3})foo","D",[])),
- <<"123999D">> = iolist_to_binary(re:replace("123999foo","(?<=(?!...999)\\d{3})foo","D",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?!...999)\\d{3})foo","xk\\1&NP",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?!...999)\\d{3})foo","xk\\1&NP",[global])),
- <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=(?!...999)\\d{3})foo","Cpoo",[])),
- <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=(?!...999)\\d{3})foo","Cpoo",[global])),
- <<"123abcKgjBJrwxNA">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999)...)foo","KgjBJrwxNA",[])),
- <<"123abcKgjBJrwxNA">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999)...)foo","KgjBJrwxNA",[global])),
- <<"123456foomfooUfooUg">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}(?!999)...)foo","&m&U&Ug\\1",[])),
- <<"123456foomfooUfooUg">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}(?!999)...)foo","&m&U&Ug\\1",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999)...)foo","Ccj\\1&vjH&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999)...)foo","Ccj\\1&vjH&",[global])),
- <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999)...)foo","&MeuE&",[])),
- <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999)...)foo","&MeuE&",[global])),
- <<"123abcMdRfooqtYhLSo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}...)(?<!999)foo","Md\\1R&qtYhLSo",[])),
- <<"123abcMdRfooqtYhLSo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}...)(?<!999)foo","Md\\1R&qtYhLSo",[global])),
- <<"123456IfooHfooFgGWfoobS">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}...)(?<!999)foo","I&H\\1\\1&\\1FgGW&bS",[])),
- <<"123456IfooHfooFgGWfoobS">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}...)(?<!999)foo","I&H\\1\\1&\\1FgGW&bS",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}...)(?<!999)foo","x&KVkVB\\1mIkDO\\1",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}...)(?<!999)foo","x&KVkVB\\1mIkDO\\1",[global])),
- <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}...)(?<!999)foo","imQyT&\\1",[])),
- <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}...)(?<!999)foo","imQyT&\\1",[global])),
+nocMyHoQWrYuE">> = iolist_to_binary(re:replace("a
+b","b\\z","nocMyHoQ\\1WrY\\1uE",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","b\\z","WYbAyvR",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","b\\z","WYbAyvR",[global])),
+ <<"hnvNIpoJVjsUM">> = iolist_to_binary(re:replace("a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hnvNIpoJVjsU\\1M",[])),
+ <<"hnvNIpoJVjsUM">> = iolist_to_binary(re:replace("a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hnvNIpoJVjsU\\1M",[global])),
+ <<"hxMJiijTWX">> = iolist_to_binary(re:replace("abc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hxMJiijTWX",[])),
+ <<"hxMJiijTWX">> = iolist_to_binary(re:replace("abc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","hxMJiijTWX",[global])),
+ <<"YbRuX">> = iolist_to_binary(re:replace("a-b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","YbRuX",[])),
+ <<"YbRuX">> = iolist_to_binary(re:replace("a-b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","YbRuX",[global])),
+ <<"SxvuEx0-9jSlY">> = iolist_to_binary(re:replace("0-9","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","SxvuEx\\1&j\\1\\1Sl\\1Y",[])),
+ <<"SxvuEx0-9jSlY">> = iolist_to_binary(re:replace("0-9","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","SxvuEx\\1&j\\1\\1Sl\\1Y",[global])),
+ <<"f">> = iolist_to_binary(re:replace("a.b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","f",[])),
+ <<"f">> = iolist_to_binary(re:replace("a.b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","f",[global])),
+ <<"ITsyB5.6.7Aaf">> = iolist_to_binary(re:replace("5.6.7","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","ITsyB&\\1Aaf",[])),
+ <<"ITsyB5.6.7Aaf">> = iolist_to_binary(re:replace("5.6.7","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","ITsyB&\\1Aaf",[global])),
+ <<"VwsTKcuXijrhthe.quick.brown.foxtk">> = iolist_to_binary(re:replace("the.quick.brown.fox","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","VwsTK\\1cu\\1Xijrh&tk",[])),
+ <<"VwsTKcuXijrhthe.quick.brown.foxtk">> = iolist_to_binary(re:replace("the.quick.brown.fox","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","VwsTK\\1cu\\1Xijrh&tk",[global])),
+ <<"nnlUga100.b200.300cnaspQDy">> = iolist_to_binary(re:replace("a100.b200.300c","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","nnlUg&\\1naspQDy",[])),
+ <<"nnlUga100.b200.300cnaspQDy">> = iolist_to_binary(re:replace("a100.b200.300c","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","nnlUg&\\1naspQDy",[global])),
+ <<"Dg12-ab.1245dwIGWfGU12-ab.1245G">> = iolist_to_binary(re:replace("12-ab.1245","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","Dg&\\1dwIGW\\1fGU&G",[])),
+ <<"Dg12-ab.1245dwIGWfGU12-ab.1245G">> = iolist_to_binary(re:replace("12-ab.1245","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","Dg&\\1dwIGW\\1fGU&G",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","pRExPwXG\\1OMYxM&DJu",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","pRExPwXG\\1OMYxM&DJu",[global])),
+ <<"">> = iolist_to_binary(re:replace("","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","onWS&OuXOY\\1URE",[])),
+ <<"">> = iolist_to_binary(re:replace("","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","onWS&OuXOY\\1URE",[global])),
+ <<".a">> = iolist_to_binary(re:replace(".a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","D\\1",[])),
+ <<".a">> = iolist_to_binary(re:replace(".a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","D\\1",[global])),
+ <<"-a">> = iolist_to_binary(re:replace("-a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","CU&qX&&",[])),
+ <<"-a">> = iolist_to_binary(re:replace("-a","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","CU&qX&&",[global])),
+ <<"a-">> = iolist_to_binary(re:replace("a-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","AWEksHnb",[])),
+ <<"a-">> = iolist_to_binary(re:replace("a-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","AWEksHnb",[global])),
+ <<"a.">> = iolist_to_binary(re:replace("a.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","pDdW\\1Ja",[])),
+ <<"a.">> = iolist_to_binary(re:replace("a.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","pDdW\\1Ja",[global])),
+ <<"a_b">> = iolist_to_binary(re:replace("a_b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","sX\\1GuXg\\1M",[])),
+ <<"a_b">> = iolist_to_binary(re:replace("a_b","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","sX\\1GuXg\\1M",[global])),
+ <<"a.-">> = iolist_to_binary(re:replace("a.-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","XerO",[])),
+ <<"a.-">> = iolist_to_binary(re:replace("a.-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","XerO",[global])),
+ <<"a..">> = iolist_to_binary(re:replace("a..","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","c&oypUmVFTuQ\\1",[])),
+ <<"a..">> = iolist_to_binary(re:replace("a..","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","c&oypUmVFTuQ\\1",[global])),
+ <<"ab..bc">> = iolist_to_binary(re:replace("ab..bc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","lfUtOX&i",[])),
+ <<"ab..bc">> = iolist_to_binary(re:replace("ab..bc","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","lfUtOX&i",[global])),
+ <<"the.quick.brown.fox-">> = iolist_to_binary(re:replace("the.quick.brown.fox-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","d&SWUEw\\1lw&EK",[])),
+ <<"the.quick.brown.fox-">> = iolist_to_binary(re:replace("the.quick.brown.fox-","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","d&SWUEw\\1lw&EK",[global])),
+ <<"the.quick.brown.fox.">> = iolist_to_binary(re:replace("the.quick.brown.fox.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","Sn\\1",[])),
+ <<"the.quick.brown.fox.">> = iolist_to_binary(re:replace("the.quick.brown.fox.","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","Sn\\1",[global])),
+ <<"the.quick.brown.fox_">> = iolist_to_binary(re:replace("the.quick.brown.fox_","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","&pfLJ",[])),
+ <<"the.quick.brown.fox_">> = iolist_to_binary(re:replace("the.quick.brown.fox_","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","&pfLJ",[global])),
+ <<"the.quick.brown.fox+">> = iolist_to_binary(re:replace("the.quick.brown.fox+","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","TgSSa",[])),
+ <<"the.quick.brown.fox+">> = iolist_to_binary(re:replace("the.quick.brown.fox+","^(?>(?(1)\\.|())[^\\W_](?>[a-z0-9-]*[^\\W_])?)+$","TgSSa",[global])),
+ <<"QalphabetabcdkrolcqqNP">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd|wxyz))","Q&krolcqqNP",[])),
+ <<"QalphabetabcdkrolcqqNPQkrolcqqNP">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd|wxyz))","Q&krolcqqNP",[global])),
+ <<"VIJWRwxyzSk">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd|wxyz))","VIJWR\\1Sk",[])),
+ <<"VIJWRwxyzSkVIJWRwxyzSk">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd|wxyz))","VIJWR\\1Sk",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>.*)(?<=(abcd|wxyz))","\\1&gWuF",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?>.*)(?<=(abcd|wxyz))","\\1&gWuF",[global])),
+ <<"a rather long string that doesn't end with one of them">> = iolist_to_binary(re:replace("a rather long string that doesn't end with one of them","(?>.*)(?<=(abcd|wxyz))","H&ltPpih\\1o",[])),
+ <<"a rather long string that doesn't end with one of them">> = iolist_to_binary(re:replace("a rather long string that doesn't end with one of them","(?>.*)(?<=(abcd|wxyz))","H&ltPpih\\1o",[global])),
+ <<"EJTgrword cat dog elephant mussel cow horse canary baboon snake shark otherwordMRkhYV">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","EJ\\1Tgr&MRk\\1h\\1YV",[])),
+ <<"EJTgrword cat dog elephant mussel cow horse canary baboon snake shark otherwordMRkhYV">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark otherword","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","EJ\\1Tgr&MRk\\1h\\1YV",[global])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","AJGCQ&uuuLVT",[])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark","word (?>(?:(?!otherword)[a-zA-Z0-9]+ ){0,30})otherword","AJGCQ&uuuLVT",[global])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?>[a-zA-Z0-9]+ ){0,30}otherword","ncMPhkKY&ume",[])),
+ <<"word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope">> = iolist_to_binary(re:replace("word cat dog elephant mussel cow horse canary baboon snake shark the quick brown fox and the lazy dog and several other words getting close to thirty by now I hope","word (?>[a-zA-Z0-9]+ ){0,30}otherword","ncMPhkKY&ume",[global])),
+ <<"999Kofooh">> = iolist_to_binary(re:replace("999foo","(?<=\\d{3}(?!999))foo","Ko&h",[])),
+ <<"999Kofooh">> = iolist_to_binary(re:replace("999foo","(?<=\\d{3}(?!999))foo","Ko&h",[global])),
+ <<"123999eqaOjvQcm">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999))foo","\\1eqaO\\1jvQc\\1m",[])),
+ <<"123999eqaOjvQcm">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999))foo","\\1eqaO\\1jvQc\\1m",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999))foo","Re\\1UYpTHfhCxdlxiq",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999))foo","Re\\1UYpTHfhCxdlxiq",[global])),
+ <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999))foo","ww",[])),
+ <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999))foo","ww",[global])),
+ <<"999yvTHkcfoofoo">> = iolist_to_binary(re:replace("999foo","(?<=(?!...999)\\d{3})foo","yvT\\1Hkc\\1&&",[])),
+ <<"999yvTHkcfoofoo">> = iolist_to_binary(re:replace("999foo","(?<=(?!...999)\\d{3})foo","yvT\\1Hkc\\1&&",[global])),
+ <<"123999yatIrmp">> = iolist_to_binary(re:replace("123999foo","(?<=(?!...999)\\d{3})foo","yatIrmp",[])),
+ <<"123999yatIrmp">> = iolist_to_binary(re:replace("123999foo","(?<=(?!...999)\\d{3})foo","yatIrmp",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?!...999)\\d{3})foo","QnIaJrp\\1SWvhckCE",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=(?!...999)\\d{3})foo","QnIaJrp\\1SWvhckCE",[global])),
+ <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=(?!...999)\\d{3})foo","racp\\1ypxW",[])),
+ <<"123abcfoo">> = iolist_to_binary(re:replace("123abcfoo","(?<=(?!...999)\\d{3})foo","racp\\1ypxW",[global])),
+ <<"123abcHMcfoofoofoofooSLctffooFhIYC">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999)...)foo","HMc&&&&SLctf&FhIYC",[])),
+ <<"123abcHMcfoofoofoofooSLctffooFhIYC">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}(?!999)...)foo","HMc&&&&SLctf&FhIYC",[global])),
+ <<"123456tDCqfoo">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}(?!999)...)foo","t\\1DCq&",[])),
+ <<"123456tDCqfoo">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}(?!999)...)foo","t\\1DCq&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999)...)foo","hME",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}(?!999)...)foo","hME",[global])),
+ <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999)...)foo","UyaU\\1e&PfYQtNU",[])),
+ <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}(?!999)...)foo","UyaU\\1e&PfYQtNU",[global])),
ok.
run32() ->
- <<"YXkVs xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ <<"123abccaCEM">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}...)(?<!999)foo","caCEM",[])),
+ <<"123abccaCEM">> = iolist_to_binary(re:replace("123abcfoo","(?<=\\d{3}...)(?<!999)foo","caCEM",[global])),
+ <<"123456fSpVHIfooj">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}...)(?<!999)foo","fSpVHI&j",[])),
+ <<"123456fSpVHIfooj">> = iolist_to_binary(re:replace("123456foo","(?<=\\d{3}...)(?<!999)foo","fSpVHI&j",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}...)(?<!999)foo","eLqPt",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?<=\\d{3}...)(?<!999)foo","eLqPt",[global])),
+ <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}...)(?<!999)foo","&ORV",[])),
+ <<"123999foo">> = iolist_to_binary(re:replace("123999foo","(?<=\\d{3}...)(?<!999)foo","&ORV",[global])),
+ <<"gIWbF<a href=abcdNFWj xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","YX\\1kVs",[caseless,
+ # quote, otherwise match up to next space","gIWbF&NFWj",[caseless,
dotall,
extended])),
- <<"YXkVs xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ <<"gIWbF<a href=abcdNFWj xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","YX\\1kVs",[caseless,
+ # quote, otherwise match up to next space","gIWbF&NFWj",[caseless,
dotall,
extended,
global])),
- <<"j\"rurrrUhbILCWDO<a href=\"abcd xyz pqr\" cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ <<"l\"Ac cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","j\\1rurrrUhbILCWDO&",[caseless,
- dotall,
- extended])),
- <<"j\"rurrrUhbILCWDO<a href=\"abcd xyz pqr\" cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ # quote, otherwise match up to next space","l\\1Ac",[caseless,
+ dotall,
+ extended])),
+ <<"l\"Ac cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","j\\1rurrrUhbILCWDO&",[caseless,
- dotall,
- extended,
- global])),
- <<"KHDcRniMHRJEBi cats">> = iolist_to_binary(re:replace("<a href='abcd xyz pqr' cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ # quote, otherwise match up to next space","l\\1Ac",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"wMK'N'IKKxMErnc cats">> = iolist_to_binary(re:replace("<a href='abcd xyz pqr' cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","KHDcRniMHRJEBi",[caseless,
- dotall,
- extended])),
- <<"KHDcRniMHRJEBi cats">> = iolist_to_binary(re:replace("<a href='abcd xyz pqr' cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
+ # quote, otherwise match up to next space","wMK\\1N\\1IKKxMErnc",[caseless,
+ dotall,
+ extended])),
+ <<"wMK'N'IKKxMErnc cats">> = iolist_to_binary(re:replace("<a href='abcd xyz pqr' cats","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","KHDcRniMHRJEBi",[caseless,
- dotall,
- extended,
- global])),
- <<"DRkc<a href=abcd xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href\\s*=\\s* # find <a href=
- ([\"'])? # find single or double quote
- (?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","DRkc&\\1",[caseless,
- dotall,
- extended])),
- <<"DRkc<a href=abcd xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href\\s*=\\s* # find <a href=
+ # quote, otherwise match up to next space","wMK\\1N\\1IKKxMErnc",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"OB<a href=abcdNftFV<a href=abcd xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href\\s*=\\s* # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","DRkc&\\1",[caseless,
- dotall,
- extended,
- global])),
- <<"M\"b\"cG cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href\\s*=\\s* # find <a href=
- ([\"'])? # find single or double quote
- (?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","M\\1b\\1cG",[caseless,
+ # quote, otherwise match up to next space","OB&NftFV&\\1",[caseless,
dotall,
extended])),
- <<"M\"b\"cG cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href\\s*=\\s* # find <a href=
+ <<"OB<a href=abcdNftFV<a href=abcd xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href\\s*=\\s* # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","M\\1b\\1cG",[caseless,
+ # quote, otherwise match up to next space","OB&NftFV&\\1",[caseless,
dotall,
extended,
global])),
- <<"<a href = 'abcd xyz pqr'K'RAApBAC'TjXhwL cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href\\s*=\\s* # find <a href=
+ <<"<a href=\"abcd xyz pqr\"LxBb<a href=\"abcd xyz pqr\"\"EuHPuB\"\"dqn\"U cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href\\s*=\\s* # find <a href=
+ ([\"'])? # find single or double quote
+ (?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
+ # quote, otherwise match up to next space","&LxBb&\\1EuHPuB\\1\\1dqn\\1U",[caseless,
+ dotall,
+ extended])),
+ <<"<a href=\"abcd xyz pqr\"LxBb<a href=\"abcd xyz pqr\"\"EuHPuB\"\"dqn\"U cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href\\s*=\\s* # find <a href=
+ ([\"'])? # find single or double quote
+ (?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
+ # quote, otherwise match up to next space","&LxBb&\\1EuHPuB\\1\\1dqn\\1U",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"KCm'''H'Sd'O cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href\\s*=\\s* # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","&K\\1RAApBAC\\1TjXhwL",[caseless,
- dotall,
- extended])),
- <<"<a href = 'abcd xyz pqr'K'RAApBAC'TjXhwL cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href\\s*=\\s* # find <a href=
+ # quote, otherwise match up to next space","KCm\\1\\1\\1H\\1Sd\\1O",[caseless,
+ dotall,
+ extended])),
+ <<"KCm'''H'Sd'O cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href\\s*=\\s* # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","&K\\1RAApBAC\\1TjXhwL",[caseless,
- dotall,
- extended,
- global])),
- <<"udPf<a href=abcd<a href=abcdVmHT xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","KCm\\1\\1\\1H\\1Sd\\1O",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"hnRxfhjlJxA xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","\\1udPf&&VmHT\\1",[caseless,
- dotall,
- extended])),
- <<"udPf<a href=abcd<a href=abcdVmHT xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","hnRxfhjlJxA",[caseless,
+ dotall,
+ extended])),
+ <<"hnRxfhjlJxA xyz">> = iolist_to_binary(re:replace("<a href=abcd xyz","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","\\1udPf&&VmHT\\1",[caseless,
- dotall,
- extended,
- global])),
- <<"lO<a href=\"abcd xyz pqr\"C<a href=\"abcd xyz pqr\"dAuVMQlg cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","hnRxfhjlJxA",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"Md cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","lO&C&dAuVMQlg",[caseless,
- dotall,
- extended])),
- <<"lO<a href=\"abcd xyz pqr\"C<a href=\"abcd xyz pqr\"dAuVMQlg cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","Md",[caseless,
+ dotall,
+ extended])),
+ <<"Md cats">> = iolist_to_binary(re:replace("<a href=\"abcd xyz pqr\" cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","lO&C&dAuVMQlg",[caseless,
- dotall,
- extended,
- global])),
- <<"kNUDBNNpwgKs'j cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","Md",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"TYyXigPSfkp<a href = 'abcd xyz pqr'vsJ'B cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","kNUDBNNpwgKs\\1j",[caseless,
- dotall,
- extended])),
- <<"kNUDBNNpwgKs'j cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
+ # quote, otherwise match up to next space","TYyXigPSfkp&vsJ\\1B",[caseless,
+ dotall,
+ extended])),
+ <<"TYyXigPSfkp<a href = 'abcd xyz pqr'vsJ'B cats">> = iolist_to_binary(re:replace("<a href = 'abcd xyz pqr' cats","<a\\s+href(?>\\s*)=(?>\\s*) # find <a href=
([\"'])? # find single or double quote
(?(1) (.*?)\\1 | (\\S+)) # if quote found, match up to next matching
- # quote, otherwise match up to next space","kNUDBNNpwgKs\\1j",[caseless,
- dotall,
- extended,
- global])),
- <<"SBBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((Z)+|A)*","SB",[])),
- <<"SBSBBSBCSBDSBESBFSBGSB">> = iolist_to_binary(re:replace("ZABCDEFG","((Z)+|A)*","SB",[global])),
- <<"TGWhfNtEZAQBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","(Z()|A)*","TGWhfNtE&Q",[])),
- <<"TGWhfNtEZAQTGWhfNtEQBTGWhfNtEQCTGWhfNtEQDTGWhfNtEQETGWhfNtEQFTGWhfNtEQGTGWhfNtEQ">> = iolist_to_binary(re:replace("ZABCDEFG","(Z()|A)*","TGWhfNtE&Q",[global])),
- <<"QATmcAAZABCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","(Z(())|A)*","Q\\1Tmc\\1\\1&",[])),
- <<"QATmcAAZAQTmcBQTmcCQTmcDQTmcEQTmcFQTmcGQTmc">> = iolist_to_binary(re:replace("ZABCDEFG","(Z(())|A)*","Q\\1Tmc\\1\\1&",[global])),
- <<"LUBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((?>Z)+|A)*","LU",[])),
- <<"LULUBLUCLUDLUELUFLUGLU">> = iolist_to_binary(re:replace("ZABCDEFG","((?>Z)+|A)*","LU",[global])),
- <<"YLMbVmHKJJdvuAVZABCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((?>)+|A)*","YL&MbVmHKJJdv\\1&uAV",[])),
- <<"YLMbVmHKJJdvuAVZYLMbVmHKJJdvuAVYLAMbVmHKJJdvAuAVYLMbVmHKJJdvuAVBYLMbVmHKJJdvuAVCYLMbVmHKJJdvuAVDYLMbVmHKJJdvuAVEYLMbVmHKJJdvuAVFYLMbVmHKJJdvuAVGYLMbVmHKJJdvuAV">> = iolist_to_binary(re:replace("ZABCDEFG","((?>)+|A)*","YL&MbVmHKJJdv\\1&uAV",[global])),
- <<"qewqabbab">> = iolist_to_binary(re:replace("abbab","a*","qewq&",[])),
- <<"qewqaqewqbqewqbqewqaqewqbqewq">> = iolist_to_binary(re:replace("abbab","a*","qewq&",[global])),
- <<"Nabcde">> = iolist_to_binary(re:replace("abcde","^[a-\\d]","N&",[])),
- <<"Nabcde">> = iolist_to_binary(re:replace("abcde","^[a-\\d]","N&",[global])),
- <<"sg-aOs-tithings">> = iolist_to_binary(re:replace("-things","^[a-\\d]","sg&a\\1Os&ti",[])),
- <<"sg-aOs-tithings">> = iolist_to_binary(re:replace("-things","^[a-\\d]","sg&a\\1Os&ti",[global])),
- <<"DtMdigit">> = iolist_to_binary(re:replace("0digit","^[a-\\d]","DtM",[])),
- <<"DtMdigit">> = iolist_to_binary(re:replace("0digit","^[a-\\d]","DtM",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-\\d]","dJiX",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[a-\\d]","dJiX",[global])),
- <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[a-\\d]","AGDlhSs&Gk&u\\1L",[])),
- <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[a-\\d]","AGDlhSs&Gk&u\\1L",[global])),
- <<"crLvRhrTbcde">> = iolist_to_binary(re:replace("abcde","^[\\d-a]","crLvRhrT",[])),
- <<"crLvRhrTbcde">> = iolist_to_binary(re:replace("abcde","^[\\d-a]","crLvRhrT",[global])),
- <<"XaUtelthings">> = iolist_to_binary(re:replace("-things","^[\\d-a]","XaUtel",[])),
- <<"XaUtelthings">> = iolist_to_binary(re:replace("-things","^[\\d-a]","XaUtel",[global])),
- <<"0digit">> = iolist_to_binary(re:replace("0digit","^[\\d-a]","&",[])),
- <<"0digit">> = iolist_to_binary(re:replace("0digit","^[\\d-a]","&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[\\d-a]","E&gL&oOMM&E",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[\\d-a]","E&gL&oOMM&E",[global])),
- <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[\\d-a]","\\1kIKJw&Id",[])),
- <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[\\d-a]","\\1kIKJw&Id",[global])),
- <<">Qi<">> = iolist_to_binary(re:replace(">
- <","[[:space:]]+","\\1Qi",[])),
- <<">Qi<">> = iolist_to_binary(re:replace(">
- <","[[:space:]]+","\\1Qi",[global])),
- <<">VYrL AlFvYN
+ # quote, otherwise match up to next space","TYyXigPSfkp&vsJ\\1B",[caseless,
+ dotall,
+ extended,
+ global])),
+ <<"wMBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((Z)+|A)*","wM",[])),
+ <<"wMwMBwMCwMDwMEwMFwMGwM">> = iolist_to_binary(re:replace("ZABCDEFG","((Z)+|A)*","wM",[global])),
+ <<"bbZAKgAEEXBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","(Z()|A)*","bb&Kg\\1EEX",[])),
+ <<"bbZAKgAEEXbbKgEEXBbbKgEEXCbbKgEEXDbbKgEEXEbbKgEEXFbbKgEEXGbbKgEEX">> = iolist_to_binary(re:replace("ZABCDEFG","(Z()|A)*","bb&Kg\\1EEX",[global])),
+ <<"dNoAtAFSCaAAZAXLDIZATBCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","(Z(())|A)*","dNo\\1t\\1FSCa\\1A&XLDI&T",[])),
+ <<"dNoAtAFSCaAAZAXLDIZATdNotFSCaAXLDITBdNotFSCaAXLDITCdNotFSCaAXLDITDdNotFSCaAXLDITEdNotFSCaAXLDITFdNotFSCaAXLDITGdNotFSCaAXLDIT">> = iolist_to_binary(re:replace("ZABCDEFG","(Z(())|A)*","dNo\\1t\\1FSCa\\1A&XLDI&T",[global])),
+ <<"ALpUZABCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((?>Z)+|A)*","\\1LpU&",[])),
+ <<"ALpUZALpUBLpUCLpUDLpUELpUFLpUGLpU">> = iolist_to_binary(re:replace("ZABCDEFG","((?>Z)+|A)*","\\1LpU&",[global])),
+ <<"cMqaXsBwaDZABCDEFG">> = iolist_to_binary(re:replace("ZABCDEFG","((?>)+|A)*","cMq\\1\\1aX&sBw\\1aD",[])),
+ <<"cMqaXsBwaDZcMqaXsBwaDcMqaXAsBwaDcMqaXsBwaDBcMqaXsBwaDCcMqaXsBwaDDcMqaXsBwaDEcMqaXsBwaDFcMqaXsBwaDGcMqaXsBwaD">> = iolist_to_binary(re:replace("ZABCDEFG","((?>)+|A)*","cMq\\1\\1aX&sBw\\1aD",[global])),
+ <<"akaDGHXFpdvXlyHabbab">> = iolist_to_binary(re:replace("abbab","a*","&k&DGHXFpdvXlyH&",[])),
+ <<"akaDGHXFpdvXlyHakDGHXFpdvXlyHbkDGHXFpdvXlyHbakaDGHXFpdvXlyHakDGHXFpdvXlyHbkDGHXFpdvXlyH">> = iolist_to_binary(re:replace("abbab","a*","&k&DGHXFpdvXlyH&",[global])),
+ <<"YudMQIhVhnAHEwYsbcde">> = iolist_to_binary(re:replace("abcde","^[\\d-a]","YudMQIhVhnA\\1HE\\1wYs",[])),
+ <<"YudMQIhVhnAHEwYsbcde">> = iolist_to_binary(re:replace("abcde","^[\\d-a]","YudMQIhVhnA\\1HE\\1wYs",[global])),
+ <<"ITGPfithings">> = iolist_to_binary(re:replace("-things","^[\\d-a]","ITGPfi",[])),
+ <<"ITGPfithings">> = iolist_to_binary(re:replace("-things","^[\\d-a]","ITGPfi",[global])),
+ <<"LnPbdQ0digit">> = iolist_to_binary(re:replace("0digit","^[\\d-a]","\\1L\\1nP\\1\\1bdQ&",[])),
+ <<"LnPbdQ0digit">> = iolist_to_binary(re:replace("0digit","^[\\d-a]","\\1L\\1nP\\1\\1bdQ&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[\\d-a]","iDE&bvLKwXgDAsFK\\1Bjx",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^[\\d-a]","iDE&bvLKwXgDAsFK\\1Bjx",[global])),
+ <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[\\d-a]","Hni&",[])),
+ <<"bcdef">> = iolist_to_binary(re:replace("bcdef","^[\\d-a]","Hni&",[global])),
+ <<">Aqg<">> = iolist_to_binary(re:replace(">
+ <","[[:space:]]+","Aqg",[])),
+ <<">Aqg<">> = iolist_to_binary(re:replace(">
+ <","[[:space:]]+","Aqg",[global])),
+ <<"> p EdRI wCXk jvFPn
<">> = iolist_to_binary(re:replace(">
- <","[[:blank:]]+","VYrL&AlFvYN",[])),
- <<">VYrL AlFvYN
+ <","[[:blank:]]+","&p&&\\1EdRI&wCXk&jvFPn",[])),
+ <<"> p EdRI wCXk jvFPn
<">> = iolist_to_binary(re:replace(">
- <","[[:blank:]]+","VYrL&AlFvYN",[global])),
- <<">HJRfpOlI <">> = iolist_to_binary(re:replace(">
- <","[\\s]+","HJRfpOlI",[])),
- <<">HJRfpOlI <">> = iolist_to_binary(re:replace(">
- <","[\\s]+","HJRfpOlI",[global])),
- <<">
- t
- FtuuC <">> = iolist_to_binary(re:replace(">
- <","\\s+","&\\1t&FtuuC",[])),
- <<">
- t
- FtuuC <">> = iolist_to_binary(re:replace(">
- <","\\s+","&\\1t&FtuuC",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","a b","&lH\\1E&J\\1&L&&Rx",[extended])),
- <<"ab">> = iolist_to_binary(re:replace("ab","a b","&lH\\1E&J\\1&L&&Rx",[extended,
- global])),
+ <","[[:blank:]]+","&p&&\\1EdRI&wCXk&jvFPn",[global])),
+ <<">uUfO
+ Y
+
+ kF
+ yXDhdgEU<">> = iolist_to_binary(re:replace(">
+ <","[\\s]+","uUfO&Y&&kF&yXDhdgEU",[])),
+ <<">uUfO
+ Y
+
+ kF
+ yXDhdgEU<">> = iolist_to_binary(re:replace(">
+ <","[\\s]+","uUfO&Y&&kF&yXDhdgEU",[global])),
+ <<">LJx
+ SrSQ
+ LLV
+ c<">> = iolist_to_binary(re:replace(">
+ <","\\s+","L\\1Jx&SrSQ&LLV&c",[])),
+ <<">LJx
+ SrSQ
+ LLV
+ c<">> = iolist_to_binary(re:replace(">
+ <","\\s+","L\\1Jx&SrSQ&LLV&c",[global])),
+ <<"hjBvDrJpGabab">> = iolist_to_binary(re:replace("ab","a b","hjBv\\1DrJpG&&",[extended])),
+ <<"hjBvDrJpGabab">> = iolist_to_binary(re:replace("ab","a b","hjBv\\1DrJpG&&",[extended,
+ global])),
<<"a
-xWxKmxNIb">> = iolist_to_binary(re:replace("a
-xb","(?!\\A)x","&W&Km&NI",[multiline])),
+MHFuJMpPfb">> = iolist_to_binary(re:replace("a
+xb","(?!\\A)x","MHFuJ\\1MpPf",[multiline])),
<<"a
-xWxKmxNIb">> = iolist_to_binary(re:replace("a
-xb","(?!\\A)x","&W&Km&NI",[multiline,global])),
+MHFuJMpPfb">> = iolist_to_binary(re:replace("a
+xb","(?!\\A)x","MHFuJ\\1MpPf",[multiline,global])),
<<"a
xb">> = iolist_to_binary(re:replace("a
-xb","(?!^)x","jRLFoYEov&K",[multiline])),
+xb","(?!^)x","\\1&MUUB\\1&cvVsiXTO",[multiline])),
<<"a
xb">> = iolist_to_binary(re:replace("a
-xb","(?!^)x","jRLFoYEov&K",[multiline,global])),
- <<"JVoGaFQQ">> = iolist_to_binary(re:replace("abcabcabc","abc\\Qabc\\Eabc","JVoGaFQQ",[])),
- <<"JVoGaFQQ">> = iolist_to_binary(re:replace("abcabcabc","abc\\Qabc\\Eabc","JVoGaFQQ",[global])),
- <<"DSeVu">> = iolist_to_binary(re:replace("abc(*+|abc","abc\\Q(*+|\\Eabc","DSeVu",[])),
- <<"DSeVu">> = iolist_to_binary(re:replace("abc(*+|abc","abc\\Q(*+|\\Eabc","DSeVu",[global])),
+xb","(?!^)x","\\1&MUUB\\1&cvVsiXTO",[multiline,global])),
+ <<"ACPKQHic">> = iolist_to_binary(re:replace("abcabcabc","abc\\Qabc\\Eabc","ACPKQHic",[])),
+ <<"ACPKQHic">> = iolist_to_binary(re:replace("abcabcabc","abc\\Qabc\\Eabc","ACPKQHic",[global])),
+ <<"egYBIabc(*+|abciLq">> = iolist_to_binary(re:replace("abc(*+|abc","abc\\Q(*+|\\Eabc","\\1\\1e\\1gYBI&iLq",[])),
+ <<"egYBIabc(*+|abciLq">> = iolist_to_binary(re:replace("abc(*+|abc","abc\\Q(*+|\\Eabc","\\1\\1e\\1gYBI&iLq",[global])),
ok.
run33() ->
- <<"Li">> = iolist_to_binary(re:replace("abc abcabc"," abc\\Q abc\\Eabc","Li",[extended])),
- <<"Li">> = iolist_to_binary(re:replace("abc abcabc"," abc\\Q abc\\Eabc","Li",[extended,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," abc\\Q abc\\Eabc","njPc\\1Go\\1Mf&&HbU\\1&",[extended])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," abc\\Q abc\\Eabc","njPc\\1Go\\1Mf&&HbU\\1&",[extended,
- global])),
- <<"abcabcabc">> = iolist_to_binary(re:replace("abcabcabc"," abc\\Q abc\\Eabc","&xP&fFtGb&mNes\\1GI\\1",[extended])),
- <<"abcabcabc">> = iolist_to_binary(re:replace("abcabcabc"," abc\\Q abc\\Eabc","&xP&fFtGb&mNes\\1GI\\1",[extended,
- global])),
- <<"gKHkeQRUc">> = iolist_to_binary(re:replace("abc#not comment
+ <<"AbfsJWLabc abcabcptMOXYup">> = iolist_to_binary(re:replace("abc abcabc"," abc\\Q abc\\Eabc","AbfsJWL\\1&ptMOXYup",[extended])),
+ <<"AbfsJWLabc abcabcptMOXYup">> = iolist_to_binary(re:replace("abc abcabc"," abc\\Q abc\\Eabc","AbfsJWL\\1&ptMOXYup",[extended,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," abc\\Q abc\\Eabc","GICvX&n",[extended])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers"," abc\\Q abc\\Eabc","GICvX&n",[extended,
+ global])),
+ <<"abcabcabc">> = iolist_to_binary(re:replace("abcabcabc"," abc\\Q abc\\Eabc","BJk\\1",[extended])),
+ <<"abcabcabc">> = iolist_to_binary(re:replace("abcabcabc"," abc\\Q abc\\Eabc","BJk\\1",[extended,
+ global])),
+ <<"mabc#not comment
+ literalBadWyqAUwNabc#not comment
+ literalabc#not comment
+ literalC">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal\\E","gKHkeQRUc",[extended])),
- <<"gKHkeQRUc">> = iolist_to_binary(re:replace("abc#not comment
+ literal\\E","m\\1&BadWyqAUwN&&C",[extended])),
+ <<"mabc#not comment
+ literalBadWyqAUwNabc#not comment
+ literalabc#not comment
+ literalC">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal\\E","gKHkeQRUc",[extended,global])),
- <<"gmgWrrxBneXj">> = iolist_to_binary(re:replace("abc#not comment
+ literal\\E","m\\1&BadWyqAUwN&&C",[extended,global])),
+ <<"Ywruhyabc#not comment
+ literal">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal","gmgWrrxBneXj",[extended])),
- <<"gmgWrrxBneXj">> = iolist_to_binary(re:replace("abc#not comment
+ literal","Ywr\\1uh\\1y&",[extended])),
+ <<"Ywruhyabc#not comment
+ literal">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal","gmgWrrxBneXj",[extended,global])),
- <<"JetiXL">> = iolist_to_binary(re:replace("abc#not comment
+ literal","Ywr\\1uh\\1y&",[extended,global])),
+ <<"FWoMpwmabc#not comment
+ literalabc#not comment
+ literalAabc#not comment
+ literalpnsNM">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
literal\\E #more comment
- ","J\\1etiX\\1L",[extended])),
- <<"JetiXL">> = iolist_to_binary(re:replace("abc#not comment
+ ","FW\\1oMpwm&&A&pnsNM",[extended])),
+ <<"FWoMpwmabc#not comment
+ literalabc#not comment
+ literalAabc#not comment
+ literalpnsNM">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
literal\\E #more comment
- ","J\\1etiX\\1L",[extended,global])),
- <<"nxvXs">> = iolist_to_binary(re:replace("abc#not comment
+ ","FW\\1oMpwm&&A&pnsNM",[extended,global])),
+ <<"j">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal\\E #more comment","\\1nxvXs",[extended])),
- <<"nxvXs">> = iolist_to_binary(re:replace("abc#not comment
+ literal\\E #more comment","j",[extended])),
+ <<"j">> = iolist_to_binary(re:replace("abc#not comment
literal","abc#comment
\\Q#not comment
- literal\\E #more comment","\\1nxvXs",[extended,global])),
- <<"NHOqEFFabc\\$xyzj">> = iolist_to_binary(re:replace("abc\\$xyz","\\Qabc\\$xyz\\E","NHOqEFF&j",[])),
- <<"NHOqEFFabc\\$xyzj">> = iolist_to_binary(re:replace("abc\\$xyz","\\Qabc\\$xyz\\E","NHOqEFF&j",[global])),
- <<"DjW">> = iolist_to_binary(re:replace("abc$xyz","\\Qabc\\E\\$\\Qxyz\\E","DjW",[])),
- <<"DjW">> = iolist_to_binary(re:replace("abc$xyz","\\Qabc\\E\\$\\Qxyz\\E","DjW",[global])),
- <<"WAnMpAVfX">> = iolist_to_binary(re:replace("abc","\\Gabc","W\\1AnMpAV\\1f\\1X",[])),
- <<"WAnMpAVfX">> = iolist_to_binary(re:replace("abc","\\Gabc","W\\1AnMpAV\\1f\\1X",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Gabc","rW&&AVMSknoPI&&w",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Gabc","rW&&AVMSknoPI&&w",[global])),
- <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","\\Gabc","DFp\\1NhU&",[])),
- <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","\\Gabc","DFp\\1NhU&",[global])),
- <<"abc1ifEabc1hgAabc2xyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","\\Gabc.","\\1&ifE&hgA",[])),
- <<"abc1ifEabc1hgAabc2ifEabc2hgAxyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","\\Gabc.","\\1&ifE&hgA",[global])),
- <<"QCUPbyyjrEabc2xyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","abc.","QC\\1\\1UPbyyj\\1rE",[])),
- <<"QCUPbyyjrEQCUPbyyjrExyzQCUPbyyjrE">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","abc.","QC\\1\\1UPbyyj\\1rE",[global])),
- <<"XJIJfY">> = iolist_to_binary(re:replace("XabcdY","a(?x: b c )d","JIJf",[])),
- <<"XJIJfY">> = iolist_to_binary(re:replace("XabcdY","a(?x: b c )d","JIJf",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?x: b c )d","i&J&NwHJGVUFHoXlLB",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?x: b c )d","i&J&NwHJGVUFHoXlLB",[global])),
- <<"Xa b c d Y">> = iolist_to_binary(re:replace("Xa b c d Y","a(?x: b c )d","y&kXPnw&sN&&BHba",[])),
- <<"Xa b c d Y">> = iolist_to_binary(re:replace("Xa b c d Y","a(?x: b c )d","y&kXPnw&sN&&BHba",[global])),
- <<"XUQRabcabcUrY">> = iolist_to_binary(re:replace("XabcY","((?x)x y z | a b c)","UQR&\\1Ur",[])),
- <<"XUQRabcabcUrY">> = iolist_to_binary(re:replace("XabcY","((?x)x y z | a b c)","UQR&\\1Ur",[global])),
- <<"AgqfObHxyztxyzMXSCB">> = iolist_to_binary(re:replace("AxyzB","((?x)x y z | a b c)","gqfObH\\1t&MXSC",[])),
- <<"AgqfObHxyztxyzMXSCB">> = iolist_to_binary(re:replace("AxyzB","((?x)x y z | a b c)","gqfObH\\1t&MXSC",[global])),
- <<"XAAvVabCAjGTsabCPBY">> = iolist_to_binary(re:replace("XabCY","(?i)AB(?-i)C","AAvV&AjGTs&\\1PB",[])),
- <<"XAAvVabCAjGTsabCPBY">> = iolist_to_binary(re:replace("XabCY","(?i)AB(?-i)C","AAvV&AjGTs&\\1PB",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i)AB(?-i)C","UmCr&Vrv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i)AB(?-i)C","UmCr&Vrv",[global])),
- <<"XabcY">> = iolist_to_binary(re:replace("XabcY","(?i)AB(?-i)C","qxteX",[])),
- <<"XabcY">> = iolist_to_binary(re:replace("XabcY","(?i)AB(?-i)C","qxteX",[global])),
- <<"ai">> = iolist_to_binary(re:replace("abCE","((?i)AB(?-i)C|D)E","ai",[])),
- <<"ai">> = iolist_to_binary(re:replace("abCE","((?i)AB(?-i)C|D)E","ai",[global])),
- <<"qRLDKtDtqTDE">> = iolist_to_binary(re:replace("DE","((?i)AB(?-i)C|D)E","qRL\\1Kt\\1tqT&",[])),
- <<"qRLDKtDtqTDE">> = iolist_to_binary(re:replace("DE","((?i)AB(?-i)C|D)E","qRL\\1Kt\\1tqT&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)AB(?-i)C|D)E","tJGWHuAQJuV\\1ohL",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)AB(?-i)C|D)E","tJGWHuAQJuV\\1ohL",[global])),
- <<"abcE">> = iolist_to_binary(re:replace("abcE","((?i)AB(?-i)C|D)E","SL",[])),
- <<"abcE">> = iolist_to_binary(re:replace("abcE","((?i)AB(?-i)C|D)E","SL",[global])),
- <<"abCe">> = iolist_to_binary(re:replace("abCe","((?i)AB(?-i)C|D)E","INyHgcjBTk",[])),
- <<"abCe">> = iolist_to_binary(re:replace("abCe","((?i)AB(?-i)C|D)E","INyHgcjBTk",[global])),
- <<"dE">> = iolist_to_binary(re:replace("dE","((?i)AB(?-i)C|D)E","x\\1",[])),
- <<"dE">> = iolist_to_binary(re:replace("dE","((?i)AB(?-i)C|D)E","x\\1",[global])),
- <<"De">> = iolist_to_binary(re:replace("De","((?i)AB(?-i)C|D)E","pgmpT&v&DORqu&",[])),
- <<"De">> = iolist_to_binary(re:replace("De","((?i)AB(?-i)C|D)E","pgmpT&v&DORqu&",[global])),
- <<"abcpy">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","\\1py",[])),
- <<"abcpy">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","\\1py",[global])),
- <<"aeCYXPUlXbcjXWbcK">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","eCYXPUlX\\1jXW\\1K",[])),
- <<"aeCYXPUlXbcjXWbcK">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","eCYXPUlX\\1jXW\\1K",[global])),
- <<"hxyLlgCxwsHwpLlIYe">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","hxyLlgCxwsHwpLlIYe",[dotall])),
- <<"hxyLlgCxwsHwpLlIYe">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","hxyLlgCxwsHwpLlIYe",[dotall,
- global])),
- <<"aubcbcBbcJobcFXYl">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","u\\1\\1B\\1Jo\\1FXYl",[dotall])),
- <<"aubcbcBbcJobcFXYl">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","u\\1\\1B\\1Jo\\1FXYl",[dotall,
- global])),
- <<"BSBMIqq">> = iolist_to_binary(re:replace("abc123abc","((.*))\\d+\\1","BSBMIqq",[])),
- <<"BSBMIqq">> = iolist_to_binary(re:replace("abc123abc","((.*))\\d+\\1","BSBMIqq",[global])),
- <<"aWbc123bcnWkNJItYcGAvsDNYbW">> = iolist_to_binary(re:replace("abc123bc","((.*))\\d+\\1","W&nWkNJItYcGAvsDNYbW",[])),
- <<"aWbc123bcnWkNJItYcGAvsDNYbW">> = iolist_to_binary(re:replace("abc123bc","((.*))\\d+\\1","W&nWkNJItYcGAvsDNYbW",[global])),
- <<"kDSa123::a123Tp">> = iolist_to_binary(re:replace("a123::a123","^(?!:) # colon disallowed at start
+ literal\\E #more comment","j",[extended,global])),
+ <<"ChAMNBQIJQHq">> = iolist_to_binary(re:replace("abc\\$xyz","\\Qabc\\$xyz\\E","ChAMNBQIJQHq",[])),
+ <<"ChAMNBQIJQHq">> = iolist_to_binary(re:replace("abc\\$xyz","\\Qabc\\$xyz\\E","ChAMNBQIJQHq",[global])),
+ <<"Qabc$xyzKpQ">> = iolist_to_binary(re:replace("abc$xyz","\\Qabc\\E\\$\\Qxyz\\E","Q&KpQ",[])),
+ <<"Qabc$xyzKpQ">> = iolist_to_binary(re:replace("abc$xyz","\\Qabc\\E\\$\\Qxyz\\E","Q&KpQ",[global])),
+ <<"iDjabcXpqUmXasnjCabc">> = iolist_to_binary(re:replace("abc","\\Gabc","\\1i\\1Dj&XpqUmXasnj\\1C\\1&",[])),
+ <<"iDjabcXpqUmXasnjCabc">> = iolist_to_binary(re:replace("abc","\\Gabc","\\1i\\1Dj&XpqUmXasnj\\1C\\1&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Gabc","i\\1joBu\\1ebM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\Gabc","i\\1joBu\\1ebM",[global])),
+ <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","\\Gabc","pJK&la&\\1NSiseJOytL",[])),
+ <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","\\Gabc","pJK&la&\\1NSiseJOytL",[global])),
+ <<"ohvLabc2xyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","\\Gabc.","ohvL",[])),
+ <<"ohvLohvLxyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","\\Gabc.","ohvL",[global])),
+ <<"HJiFabc1Chbjabc2xyzabc3">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","abc.","HJiF&Chbj",[])),
+ <<"HJiFabc1ChbjHJiFabc2ChbjxyzHJiFabc3Chbj">> = iolist_to_binary(re:replace("abc1abc2xyzabc3","abc.","HJiF&Chbj",[global])),
+ <<"XxabcdrWcHPabcdKQabcdY">> = iolist_to_binary(re:replace("XabcdY","a(?x: b c )d","\\1x&rWcH\\1P&KQ&",[])),
+ <<"XxabcdrWcHPabcdKQabcdY">> = iolist_to_binary(re:replace("XabcdY","a(?x: b c )d","\\1x&rWcH\\1P&KQ&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?x: b c )d","yTwKPU\\1&NhlmWO",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","a(?x: b c )d","yTwKPU\\1&NhlmWO",[global])),
+ <<"Xa b c d Y">> = iolist_to_binary(re:replace("Xa b c d Y","a(?x: b c )d","psI",[])),
+ <<"Xa b c d Y">> = iolist_to_binary(re:replace("Xa b c d Y","a(?x: b c )d","psI",[global])),
+ <<"XOabccFXabcgY">> = iolist_to_binary(re:replace("XabcY","((?x)x y z | a b c)","O&cFX\\1g",[])),
+ <<"XOabccFXabcgY">> = iolist_to_binary(re:replace("XabcY","((?x)x y z | a b c)","O&cFX\\1g",[global])),
+ <<"AxyzaoxyzB">> = iolist_to_binary(re:replace("AxyzB","((?x)x y z | a b c)","\\1ao&",[])),
+ <<"AxyzaoxyzB">> = iolist_to_binary(re:replace("AxyzB","((?x)x y z | a b c)","\\1ao&",[global])),
+ <<"XibY">> = iolist_to_binary(re:replace("XabCY","(?i)AB(?-i)C","ib",[])),
+ <<"XibY">> = iolist_to_binary(re:replace("XabCY","(?i)AB(?-i)C","ib",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i)AB(?-i)C","wYYUWrmo",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(?i)AB(?-i)C","wYYUWrmo",[global])),
+ <<"XabcY">> = iolist_to_binary(re:replace("XabcY","(?i)AB(?-i)C","o&CXr&jJvHyaNHQ",[])),
+ <<"XabcY">> = iolist_to_binary(re:replace("XabcY","(?i)AB(?-i)C","o&CXr&jJvHyaNHQ",[global])),
+ <<"ouJo">> = iolist_to_binary(re:replace("abCE","((?i)AB(?-i)C|D)E","ouJo",[])),
+ <<"ouJo">> = iolist_to_binary(re:replace("abCE","((?i)AB(?-i)C|D)E","ouJo",[global])),
+ <<"OcHODINyYSDEpUbBfxDEGM">> = iolist_to_binary(re:replace("DE","((?i)AB(?-i)C|D)E","OcHO\\1INyYS&pUbBfx&GM",[])),
+ <<"OcHODINyYSDEpUbBfxDEGM">> = iolist_to_binary(re:replace("DE","((?i)AB(?-i)C|D)E","OcHO\\1INyYS&pUbBfx&GM",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)AB(?-i)C|D)E","BYe",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((?i)AB(?-i)C|D)E","BYe",[global])),
+ <<"abcE">> = iolist_to_binary(re:replace("abcE","((?i)AB(?-i)C|D)E","&rB\\1CAA",[])),
+ <<"abcE">> = iolist_to_binary(re:replace("abcE","((?i)AB(?-i)C|D)E","&rB\\1CAA",[global])),
+ <<"abCe">> = iolist_to_binary(re:replace("abCe","((?i)AB(?-i)C|D)E","a&LpvMhr",[])),
+ <<"abCe">> = iolist_to_binary(re:replace("abCe","((?i)AB(?-i)C|D)E","a&LpvMhr",[global])),
+ <<"dE">> = iolist_to_binary(re:replace("dE","((?i)AB(?-i)C|D)E","dS",[])),
+ <<"dE">> = iolist_to_binary(re:replace("dE","((?i)AB(?-i)C|D)E","dS",[global])),
+ <<"De">> = iolist_to_binary(re:replace("De","((?i)AB(?-i)C|D)E","cCfly&",[])),
+ <<"De">> = iolist_to_binary(re:replace("De","((?i)AB(?-i)C|D)E","cCfly&",[global])),
+ <<"Qabc123abcabcLBDabcXabca">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","Q&\\1LBD\\1X\\1a",[])),
+ <<"Qabc123abcabcLBDabcXabca">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","Q&\\1LBD\\1X\\1a",[global])),
+ <<"anTeSdybc123bcHldppbc123bcDx">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","nTeSdy&Hldpp&Dx",[])),
+ <<"anTeSdybc123bcHldppbc123bcDx">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","nTeSdy&Hldpp&Dx",[global])),
+ <<"pGabcabcabcabc123abcabc123abcawKG">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","pG\\1\\1\\1&&awKG",[dotall])),
+ <<"pGabcabcabcabc123abcabc123abcawKG">> = iolist_to_binary(re:replace("abc123abc","(.*)\\d+\\1","pG\\1\\1\\1&&awKG",[dotall,
+ global])),
+ <<"aMMJMXbc123bcGqwwAbc123bcEnL">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","MMJMX&GqwwA&EnL",[dotall])),
+ <<"aMMJMXbc123bcGqwwAbc123bcEnL">> = iolist_to_binary(re:replace("abc123bc","(.*)\\d+\\1","MMJMX&GqwwA&EnL",[dotall,
+ global])),
+ <<"qrVVkabc123abcwTosM">> = iolist_to_binary(re:replace("abc123abc","((.*))\\d+\\1","qrVVk&wTosM",[])),
+ <<"qrVVkabc123abcwTosM">> = iolist_to_binary(re:replace("abc123abc","((.*))\\d+\\1","qrVVk&wTosM",[global])),
+ <<"ayYbc123bcbcPPbcCodRbc123bcKbcVM">> = iolist_to_binary(re:replace("abc123bc","((.*))\\d+\\1","yY&\\1PP\\1CodR&K\\1VM",[])),
+ <<"ayYbc123bcbcPPbcCodRbc123bcKbcVM">> = iolist_to_binary(re:replace("abc123bc","((.*))\\d+\\1","yY&\\1PP\\1CodR&K\\1VM",[global])),
+ <<"LwcvndSdaPKHex">> = iolist_to_binary(re:replace("a123::a123","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18142,8 +18137,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","kDS&T\\1p",[extended,caseless])),
- <<"kDSa123::a123Tp">> = iolist_to_binary(re:replace("a123::a123","^(?!:) # colon disallowed at start
+ ","LwcvndSdaPKHex",[extended,caseless])),
+ <<"LwcvndSdaPKHex">> = iolist_to_binary(re:replace("a123::a123","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18151,8 +18146,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","kDS&T\\1p",[extended,caseless,global])),
- <<"r">> = iolist_to_binary(re:replace("a123:b342::abcd","^(?!:) # colon disallowed at start
+ ","LwcvndSdaPKHex",[extended,caseless,global])),
+ <<"RfGpa123:b342::abcdjkWGiWxPCIAx">> = iolist_to_binary(re:replace("a123:b342::abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18160,8 +18155,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","r",[extended,caseless])),
- <<"r">> = iolist_to_binary(re:replace("a123:b342::abcd","^(?!:) # colon disallowed at start
+ ","R\\1fGp&\\1jkWGiWxPCIAx",[extended,caseless])),
+ <<"RfGpa123:b342::abcdjkWGiWxPCIAx">> = iolist_to_binary(re:replace("a123:b342::abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18169,8 +18164,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","r",[extended,caseless,global])),
- <<"ia123:b342::324e:abcd">> = iolist_to_binary(re:replace("a123:b342::324e:abcd","^(?!:) # colon disallowed at start
+ ","R\\1fGp&\\1jkWGiWxPCIAx",[extended,caseless,global])),
+ <<"FBOvYuiruXBa123:b342::324e:abcdaag">> = iolist_to_binary(re:replace("a123:b342::324e:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18178,8 +18173,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","i&",[extended,caseless])),
- <<"ia123:b342::324e:abcd">> = iolist_to_binary(re:replace("a123:b342::324e:abcd","^(?!:) # colon disallowed at start
+ ","FBOvYuir\\1uXB&aag",[extended,caseless])),
+ <<"FBOvYuiruXBa123:b342::324e:abcdaag">> = iolist_to_binary(re:replace("a123:b342::324e:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18187,8 +18182,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","i&",[extended,caseless,global])),
- <<"eYuTiBYPtHa123:ddde:b342::324e:abcdJHIw">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:abcd","^(?!:) # colon disallowed at start
+ ","FBOvYuir\\1uXB&aag",[extended,caseless,global])),
+ <<"krOa123:ddde:b342::324e:abcdnoa123:ddde:b342::324e:abcdAqWa123:ddde:b342::324e:abcdLa123:ddde:b342::324e:abcdkpysY">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18196,8 +18191,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","eYuTiBYPtH&J\\1HIw",[extended,caseless])),
- <<"eYuTiBYPtHa123:ddde:b342::324e:abcdJHIw">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:abcd","^(?!:) # colon disallowed at start
+ ","krO&no&\\1Aq\\1W&L&kpysY",[extended,caseless])),
+ <<"krOa123:ddde:b342::324e:abcdnoa123:ddde:b342::324e:abcdAqWa123:ddde:b342::324e:abcdLa123:ddde:b342::324e:abcdkpysY">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18205,8 +18200,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","eYuTiBYPtH&J\\1HIw",[extended,caseless,global])),
- <<"">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
+ ","krO&no&\\1Aq\\1W&L&kpysY",[extended,caseless,global])),
+ <<"DkvAQa123:ddde:b342::324e:dcba:abcdJw">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18214,8 +18209,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","\\1",[extended,caseless])),
- <<"">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
+ ","Dk\\1vAQ&J\\1w",[extended,caseless])),
+ <<"DkvAQa123:ddde:b342::324e:dcba:abcdJw">> = iolist_to_binary(re:replace("a123:ddde:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18223,8 +18218,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","\\1",[extended,caseless,global])),
- <<"a123:ddde:9999:b342::324e:dcba:abcdoLIelBa123:ddde:9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
+ ","Dk\\1vAQ&J\\1w",[extended,caseless,global])),
+ <<"peonyvOkMFYpa123:ddde:9999:b342::324e:dcba:abcdp">> = iolist_to_binary(re:replace("a123:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18232,8 +18227,8 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","&oLIelB&",[extended,caseless])),
- <<"a123:ddde:9999:b342::324e:dcba:abcdoLIelBa123:ddde:9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
+ ","peo\\1n\\1yvOkMFY\\1\\1p&p",[extended,caseless])),
+ <<"peonyvOkMFYpa123:ddde:9999:b342::324e:dcba:abcdp">> = iolist_to_binary(re:replace("a123:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
(?(1)0 | () ) ) # if null previously matched, fail; else null
@@ -18241,7 +18236,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","&oLIelB&",[extended,caseless,global])),
+ ","peo\\1n\\1yvOkMFY\\1\\1p&p",[extended,caseless,global])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18250,7 +18245,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","&f\\1I",[extended,caseless])),
+ ","qiY&iLNeXJ",[extended,caseless])),
<<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18259,7 +18254,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","&f\\1I",[extended,caseless,global])),
+ ","qiY&iLNeXJ",[extended,caseless,global])),
<<"1:2:3:4:5:6:7:8">> = iolist_to_binary(re:replace("1:2:3:4:5:6:7:8","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18268,7 +18263,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","yUIYbm&\\1qdJb",[extended,caseless])),
+ ","O\\1E\\1yvbw\\1G&eF",[extended,caseless])),
<<"1:2:3:4:5:6:7:8">> = iolist_to_binary(re:replace("1:2:3:4:5:6:7:8","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18277,7 +18272,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","yUIYbm&\\1qdJb",[extended,caseless,global])),
+ ","O\\1E\\1yvbw\\1G&eF",[extended,caseless,global])),
<<"a123:bce:ddde:9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123:bce:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18286,7 +18281,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","Xhy\\1&M",[extended,caseless])),
+ ","dLaiU",[extended,caseless])),
<<"a123:bce:ddde:9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123:bce:ddde:9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18295,7 +18290,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","Xhy\\1&M",[extended,caseless,global])),
+ ","dLaiU",[extended,caseless,global])),
<<"a123::9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123::9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18304,7 +18299,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","sw",[extended,caseless])),
+ ","wLFUSYFg&aIH\\1g&V",[extended,caseless])),
<<"a123::9999:b342::324e:dcba:abcd">> = iolist_to_binary(re:replace("a123::9999:b342::324e:dcba:abcd","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18313,7 +18308,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","sw",[extended,caseless,global])),
+ ","wLFUSYFg&aIH\\1g&V",[extended,caseless,global])),
<<"abcde:2:3:4:5:6:7:8">> = iolist_to_binary(re:replace("abcde:2:3:4:5:6:7:8","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18322,7 +18317,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","pCUAeIjhQXp\\1K",[extended,caseless])),
+ ","giXrPJTSn\\1MX\\1C",[extended,caseless])),
<<"abcde:2:3:4:5:6:7:8">> = iolist_to_binary(re:replace("abcde:2:3:4:5:6:7:8","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18331,7 +18326,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","pCUAeIjhQXp\\1K",[extended,caseless,global])),
+ ","giXrPJTSn\\1MX\\1C",[extended,caseless,global])),
<<"::1">> = iolist_to_binary(re:replace("::1","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18340,7 +18335,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","rN\\1Dti&",[extended,caseless])),
+ ","vQ&R&",[extended,caseless])),
<<"::1">> = iolist_to_binary(re:replace("::1","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18349,7 +18344,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","rN\\1Dti&",[extended,caseless,global])),
+ ","vQ&R&",[extended,caseless,global])),
<<"abcd:fee0:123::">> = iolist_to_binary(re:replace("abcd:fee0:123::","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18358,7 +18353,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","eRNkqHK\\1RXNGFgu",[extended,caseless])),
+ ","wNB\\1C\\1T&k&vkfjS",[extended,caseless])),
<<"abcd:fee0:123::">> = iolist_to_binary(re:replace("abcd:fee0:123::","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18367,7 +18362,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","eRNkqHK\\1RXNGFgu",[extended,caseless,global])),
+ ","wNB\\1C\\1T&k&vkfjS",[extended,caseless,global])),
<<":1">> = iolist_to_binary(re:replace(":1","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18376,7 +18371,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","mbx",[extended,caseless])),
+ ","akxV\\1iHF&SgDPd&",[extended,caseless])),
<<":1">> = iolist_to_binary(re:replace(":1","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18385,7 +18380,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","mbx",[extended,caseless,global])),
+ ","akxV\\1iHF&SgDPd&",[extended,caseless,global])),
<<"1:">> = iolist_to_binary(re:replace("1:","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18394,7 +18389,7 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","WJB",[extended,caseless])),
+ ","QtJG\\1",[extended,caseless])),
<<"1:">> = iolist_to_binary(re:replace("1:","^(?!:) # colon disallowed at start
(?: # start of item
(?: [0-9a-f]{1,4} | # 1-4 hex digits or
@@ -18403,1557 +18398,1620 @@ run33() ->
){1,7} # end item; 1-7 of them required
[0-9a-f]{1,4} $ # final hex number at end of string
(?(1)|.) # check that there was an empty component
- ","WJB",[extended,caseless,global])),
- <<"NdcuJzCbxTd">> = iolist_to_binary(re:replace("z","[z\\Qa-d]\\E]","NdcuJ\\1&CbxTd",[])),
- <<"NdcuJzCbxTd">> = iolist_to_binary(re:replace("z","[z\\Qa-d]\\E]","NdcuJ\\1&CbxTd",[global])),
- <<"VLxNqfjwruLh">> = iolist_to_binary(re:replace("a","[z\\Qa-d]\\E]","VL\\1xNqfj\\1wruLh",[])),
- <<"VLxNqfjwruLh">> = iolist_to_binary(re:replace("a","[z\\Qa-d]\\E]","VL\\1xNqfj\\1wruLh",[global])),
- <<"jX">> = iolist_to_binary(re:replace("-","[z\\Qa-d]\\E]","jX",[])),
- <<"jX">> = iolist_to_binary(re:replace("-","[z\\Qa-d]\\E]","jX",[global])),
- <<"XRHLEUuwPyRxGJEv">> = iolist_to_binary(re:replace("d","[z\\Qa-d]\\E]","X\\1RHLEUuwP\\1yRxGJEv",[])),
- <<"XRHLEUuwPyRxGJEv">> = iolist_to_binary(re:replace("d","[z\\Qa-d]\\E]","X\\1RHLEUuwP\\1yRxGJEv",[global])),
- <<"Gtcd">> = iolist_to_binary(re:replace("]","[z\\Qa-d]\\E]","Gt\\1cd",[])),
- <<"Gtcd">> = iolist_to_binary(re:replace("]","[z\\Qa-d]\\E]","Gt\\1cd",[global])),
- <<"*** FCaQDFtaYgknvailers">> = iolist_to_binary(re:replace("*** Failers","[z\\Qa-d]\\E]","C&Q\\1\\1\\1DF\\1t&Ygknv&\\1",[])),
- <<"*** FCaQDFtaYgknvailers">> = iolist_to_binary(re:replace("*** Failers","[z\\Qa-d]\\E]","C&Q\\1\\1\\1DF\\1t&Ygknv&\\1",[global])),
- <<"b">> = iolist_to_binary(re:replace("b","[z\\Qa-d]\\E]","rUhPPBvokQvYvRC",[])),
- <<"b">> = iolist_to_binary(re:replace("b","[z\\Qa-d]\\E]","rUhPPBvokQvYvRC",[global])),
+ ","QtJG\\1",[extended,caseless,global])),
+ <<"thCzKtzX">> = iolist_to_binary(re:replace("z","[z\\Qa-d]\\E]","thC&Kt&X",[])),
+ <<"thCzKtzX">> = iolist_to_binary(re:replace("z","[z\\Qa-d]\\E]","thC&Kt&X",[global])),
+ <<"OWpbwPvaaDXmmr">> = iolist_to_binary(re:replace("a","[z\\Qa-d]\\E]","OWpbwPv&&DXmmr",[])),
+ <<"OWpbwPvaaDXmmr">> = iolist_to_binary(re:replace("a","[z\\Qa-d]\\E]","OWpbwPv&&DXmmr",[global])),
+ <<"vRf--tS-JWPTPl">> = iolist_to_binary(re:replace("-","[z\\Qa-d]\\E]","vR\\1\\1\\1f&&tS&JWPTPl",[])),
+ <<"vRf--tS-JWPTPl">> = iolist_to_binary(re:replace("-","[z\\Qa-d]\\E]","vR\\1\\1\\1f&&tS&JWPTPl",[global])),
+ <<"jExdDgrsjrfGMEAj">> = iolist_to_binary(re:replace("d","[z\\Qa-d]\\E]","j\\1Ex&Dgrsjrf\\1GMEA\\1j",[])),
+ <<"jExdDgrsjrfGMEAj">> = iolist_to_binary(re:replace("d","[z\\Qa-d]\\E]","j\\1Ex&Dgrsjrf\\1GMEA\\1j",[global])),
+ <<"BvV]Aqf">> = iolist_to_binary(re:replace("]","[z\\Qa-d]\\E]","BvV&Aqf",[])),
+ <<"BvV]Aqf">> = iolist_to_binary(re:replace("]","[z\\Qa-d]\\E]","BvV&Aqf",[global])),
+ <<"*** FhQsGEilers">> = iolist_to_binary(re:replace("*** Failers","[z\\Qa-d]\\E]","hQsG\\1E",[])),
+ <<"*** FhQsGEilers">> = iolist_to_binary(re:replace("*** Failers","[z\\Qa-d]\\E]","hQsG\\1E",[global])),
+ <<"b">> = iolist_to_binary(re:replace("b","[z\\Qa-d]\\E]","W\\1Au",[])),
+ <<"b">> = iolist_to_binary(re:replace("b","[z\\Qa-d]\\E]","W\\1Au",[global])),
ok.
run34() ->
- <<"jOKAO">> = iolist_to_binary(re:replace("z","[\\z\\C]","jOKAO",[])),
- <<"jOKAO">> = iolist_to_binary(re:replace("z","[\\z\\C]","jOKAO",[global])),
- <<"UIfGQohtPCcNiR">> = iolist_to_binary(re:replace("C","[\\z\\C]","\\1UIfGQohtP&c\\1\\1NiR",[])),
- <<"UIfGQohtPCcNiR">> = iolist_to_binary(re:replace("C","[\\z\\C]","\\1UIfGQohtP&c\\1\\1NiR",[global])),
- <<"xjHNUJliwGsC">> = iolist_to_binary(re:replace("M","\\M","xjHNUJ\\1liwGsC",[])),
- <<"xjHNUJliwGsC">> = iolist_to_binary(re:replace("M","\\M","xjHNUJ\\1liwGsC",[global])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a+)*b","ss\\1vxH\\1fmwG",[])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a+)*b","ss\\1vxH\\1fmwG",[global])),
- <<"„XAZXS">> = iolist_to_binary(re:replace("„XAZXB","(?<=Z)X.","XS",[])),
- <<"„XAZXS">> = iolist_to_binary(re:replace("„XAZXB","(?<=Z)X.","XS",[global])),
- <<"fU">> = iolist_to_binary(re:replace("ab cd defg","ab cd (?x) de fg","fU",[])),
- <<"fU">> = iolist_to_binary(re:replace("ab cd defg","ab cd (?x) de fg","fU",[global])),
- <<"ditab cddefg">> = iolist_to_binary(re:replace("ab cddefg","ab cd(?x) de fg","\\1dit&",[])),
- <<"ditab cddefg">> = iolist_to_binary(re:replace("ab cddefg","ab cd(?x) de fg","\\1dit&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","ab cd(?x) de fg","&Kr&\\1EgsvGfRsKlm",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","ab cd(?x) de fg","&Kr&\\1EgsvGfRsKlm",[global])),
- <<"abcddefg">> = iolist_to_binary(re:replace("abcddefg","ab cd(?x) de fg","\\1",[])),
- <<"abcddefg">> = iolist_to_binary(re:replace("abcddefg","ab cd(?x) de fg","\\1",[global])),
- <<"fooXSbarrbNX">> = iolist_to_binary(re:replace("foobarX","(?<![^f]oo)(bar)","XS\\1rbN",[])),
- <<"fooXSbarrbNX">> = iolist_to_binary(re:replace("foobarX","(?<![^f]oo)(bar)","XS\\1rbN",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f]oo)(bar)","P\\1\\1\\1&C\\1N\\1DLnhU&T",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f]oo)(bar)","P\\1\\1\\1&C\\1N\\1DLnhU&T",[global])),
- <<"boobarX">> = iolist_to_binary(re:replace("boobarX","(?<![^f]oo)(bar)","S&HuDj&pl&\\1K",[])),
- <<"boobarX">> = iolist_to_binary(re:replace("boobarX","(?<![^f]oo)(bar)","S&HuDj&pl&\\1K",[global])),
- <<"offAWvYjHsJodXLI">> = iolist_to_binary(re:replace("offX","(?<![^f])X","AWvYjHs\\1J\\1od&LI",[])),
- <<"offAWvYjHsJodXLI">> = iolist_to_binary(re:replace("offX","(?<![^f])X","AWvYjHs\\1J\\1od&LI",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f])X","\\1on",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f])X","\\1on",[global])),
- <<"onyX">> = iolist_to_binary(re:replace("onyX","(?<![^f])X","&f&D",[])),
- <<"onyX">> = iolist_to_binary(re:replace("onyX","(?<![^f])X","&f&D",[global])),
- <<"onyE">> = iolist_to_binary(re:replace("onyX","(?<=[^f])X","E",[])),
- <<"onyE">> = iolist_to_binary(re:replace("onyX","(?<=[^f])X","E",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^f])X","lEuucWp\\1&m",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^f])X","lEuucWp\\1&m",[global])),
- <<"offX">> = iolist_to_binary(re:replace("offX","(?<=[^f])X","QNevBRs\\1&OKqB&\\1\\1H",[])),
- <<"offX">> = iolist_to_binary(re:replace("offX","(?<=[^f])X","QNevBRs\\1&OKqB&\\1\\1H",[global])),
- <<"lHqgba
+ <<"KdrNqNfSzzqidyBChn">> = iolist_to_binary(re:replace("z","[\\z\\C]","KdrNqNfS\\1&&qidyBChn",[])),
+ <<"KdrNqNfSzzqidyBChn">> = iolist_to_binary(re:replace("z","[\\z\\C]","KdrNqNfS\\1&&qidyBChn",[global])),
+ <<"FWM">> = iolist_to_binary(re:replace("C","[\\z\\C]","FW\\1M",[])),
+ <<"FWM">> = iolist_to_binary(re:replace("C","[\\z\\C]","FW\\1M",[global])),
+ <<"FxjIeXxjLM">> = iolist_to_binary(re:replace("M","\\M","FxjIeXxjL&",[])),
+ <<"FxjIeXxjLM">> = iolist_to_binary(re:replace("M","\\M","FxjIeXxjL&",[global])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a+)*b","\\1AGI&o&owvv&Ew",[])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a+)*b","\\1AGI&o&owvv&Ew",[global])),
+ <<"„XAZidYPfGETo">> = iolist_to_binary(re:replace("„XAZXB","(?<=Z)X.","\\1\\1\\1idYPfGETo",[])),
+ <<"„XAZidYPfGETo">> = iolist_to_binary(re:replace("„XAZXB","(?<=Z)X.","\\1\\1\\1idYPfGETo",[global])),
+ <<"bNQDHCQab cd defgab cd defgLqxKPLt">> = iolist_to_binary(re:replace("ab cd defg","ab cd (?x) de fg","bNQDHCQ&&LqxKPLt",[])),
+ <<"bNQDHCQab cd defgab cd defgLqxKPLt">> = iolist_to_binary(re:replace("ab cd defg","ab cd (?x) de fg","bNQDHCQ&&LqxKPLt",[global])),
+ <<"kPHqOwBhoab cddefgWcAxPfqs">> = iolist_to_binary(re:replace("ab cddefg","ab cd(?x) de fg","k\\1PHqOwBho&WcAxP\\1fqs",[])),
+ <<"kPHqOwBhoab cddefgWcAxPfqs">> = iolist_to_binary(re:replace("ab cddefg","ab cd(?x) de fg","k\\1PHqOwBho&WcAxP\\1fqs",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","ab cd(?x) de fg","puhITHF\\1GmjJlsK",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","ab cd(?x) de fg","puhITHF\\1GmjJlsK",[global])),
+ <<"abcddefg">> = iolist_to_binary(re:replace("abcddefg","ab cd(?x) de fg","\\1UHa&nN\\1cm",[])),
+ <<"abcddefg">> = iolist_to_binary(re:replace("abcddefg","ab cd(?x) de fg","\\1UHa&nN\\1cm",[global])),
+ <<"foobarX">> = iolist_to_binary(re:replace("foobarX","(?<![^f]oo)(bar)","&",[])),
+ <<"foobarX">> = iolist_to_binary(re:replace("foobarX","(?<![^f]oo)(bar)","&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f]oo)(bar)","\\1Mu\\1yADtGr",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f]oo)(bar)","\\1Mu\\1yADtGr",[global])),
+ <<"boobarX">> = iolist_to_binary(re:replace("boobarX","(?<![^f]oo)(bar)","xE&\\1\\1\\1oKH",[])),
+ <<"boobarX">> = iolist_to_binary(re:replace("boobarX","(?<![^f]oo)(bar)","xE&\\1\\1\\1oKH",[global])),
+ <<"offYXXLgEkUWX">> = iolist_to_binary(re:replace("offX","(?<![^f])X","Y&&L\\1gEkUW&",[])),
+ <<"offYXXLgEkUWX">> = iolist_to_binary(re:replace("offX","(?<![^f])X","Y&&L\\1gEkUW&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f])X","WPlO&&XQQJOC&\\1SLu&I\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<![^f])X","WPlO&&XQQJOC&\\1SLu&I\\1",[global])),
+ <<"onyX">> = iolist_to_binary(re:replace("onyX","(?<![^f])X","&&",[])),
+ <<"onyX">> = iolist_to_binary(re:replace("onyX","(?<![^f])X","&&",[global])),
+ <<"onyGaqXoXBMVBEXtSYRHR">> = iolist_to_binary(re:replace("onyX","(?<=[^f])X","Gaq&oXBMVBE&tSYRHR",[])),
+ <<"onyGaqXoXBMVBEXtSYRHR">> = iolist_to_binary(re:replace("onyX","(?<=[^f])X","Gaq&oXBMVBE&tSYRHR",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^f])X","Djt&",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^f])X","Djt&",[global])),
+ <<"offX">> = iolist_to_binary(re:replace("offX","(?<=[^f])X","GvvcQ\\1\\1&lBxPYfk&",[])),
+ <<"offX">> = iolist_to_binary(re:replace("offX","(?<=[^f])X","GvvcQ\\1\\1&lBxPYfk&",[global])),
+ <<"CrHVKxYsa
b
c">> = iolist_to_binary(re:replace("a
b
-c","^","lHqg&b&",[multiline])),
- <<"lHqgba
-lHqgbb
-lHqgbc">> = iolist_to_binary(re:replace("a
+c","^","\\1CrHVKxYs",[multiline])),
+ <<"CrHVKxYsa
+CrHVKxYsb
+CrHVKxYsc">> = iolist_to_binary(re:replace("a
b
-c","^","lHqg&b&",[multiline,global])),
- <<"VDMcObuOyb">> = iolist_to_binary(re:replace("","^","VDM&cObuOy\\1b",[multiline])),
- <<"VDMcObuOyb">> = iolist_to_binary(re:replace("","^","VDM&cObuOy\\1b",[multiline,
- global])),
+c","^","\\1CrHVKxYs",[multiline,global])),
+ <<"tQATKgVWcvM">> = iolist_to_binary(re:replace("","^","tQATKgVW&cvM",[multiline])),
+ <<"tQATKgVWcvM">> = iolist_to_binary(re:replace("","^","tQATKgVW&cvM",[multiline,
+ global])),
<<"A
C
-luYGJMVrKYIkybC">> = iolist_to_binary(re:replace("A
+mnoJCDrViHC">> = iolist_to_binary(re:replace("A
C
-C","(?<=C\\n)^","lu\\1Y&GJM\\1VrKY&Ikyb\\1",[multiline])),
+C","(?<=C\\n)^","&mnoJCD&rV&iH",[multiline])),
<<"A
C
-luYGJMVrKYIkybC">> = iolist_to_binary(re:replace("A
+mnoJCDrViHC">> = iolist_to_binary(re:replace("A
C
-C","(?<=C\\n)^","lu\\1Y&GJM\\1VrKY&Ikyb\\1",[multiline,global])),
- <<"siXpqbXaXURhpboidbXaXRg">> = iolist_to_binary(re:replace("bXaX","(?:(?(1)a|b)(X))+","si\\1pq&URhpboid&Rg",[])),
- <<"siXpqbXaXURhpboidbXaXRg">> = iolist_to_binary(re:replace("bXaX","(?:(?(1)a|b)(X))+","si\\1pq&URhpboid&Rg",[global])),
- <<"AmhmmmbXXaYYaYAOkoG">> = iolist_to_binary(re:replace("bXXaYYaY","(?:(?(1)\\1a|b)(X|Y))+","Amhmmm&AOkoG",[])),
- <<"AmhmmmbXXaYYaYAOkoG">> = iolist_to_binary(re:replace("bXXaYYaY","(?:(?(1)\\1a|b)(X|Y))+","Amhmmm&AOkoG",[global])),
- <<"PtXQXEwjfhYaXXaX">> = iolist_to_binary(re:replace("bXYaXXaX","(?:(?(1)\\1a|b)(X|Y))+","PtXQ\\1Ewjfh",[])),
- <<"PtXQXEwjfhYaXXaX">> = iolist_to_binary(re:replace("bXYaXXaX","(?:(?(1)\\1a|b)(X|Y))+","PtXQ\\1Ewjfh",[global])),
- <<"qpflyycYXuQXaYYaY">> = iolist_to_binary(re:replace("bXXaYYaY","()()()()()()()()()(?:(?(10)\\10a|b)(X|Y))+","q\\1pflyycY\\1XuQ",[])),
- <<"qpflyycYXuQXaYYaY">> = iolist_to_binary(re:replace("bXXaYYaY","()()()()()()()()()(?:(?(10)\\10a|b)(X|Y))+","q\\1pflyycY\\1XuQ",[global])),
- <<"abc]GgJESKfdixjabc]">> = iolist_to_binary(re:replace("abc]","[[,abc,]+]","&GgJESKf\\1di\\1xj&",[])),
- <<"abc]GgJESKfdixjabc]">> = iolist_to_binary(re:replace("abc]","[[,abc,]+]","&GgJESKf\\1di\\1xj&",[global])),
- <<"wa,b]a,b]hta,b]NQ">> = iolist_to_binary(re:replace("a,b]","[[,abc,]+]","w&&ht&N\\1Q",[])),
- <<"wa,b]a,b]hta,b]NQ">> = iolist_to_binary(re:replace("a,b]","[[,abc,]+]","w&&ht&N\\1Q",[global])),
- <<"aDIlRnUPE[a,b,c]VAaV[a,b,c]V">> = iolist_to_binary(re:replace("[a,b,c]","[[,abc,]+]","aDIlRnU\\1PE&VAaV&V",[])),
- <<"aDIlRnUPE[a,b,c]VAaV[a,b,c]V">> = iolist_to_binary(re:replace("[a,b,c]","[[,abc,]+]","aDIlRnU\\1PE&VAaV&V",[global])),
- <<"AVNFmY XbCfJ B">> = iolist_to_binary(re:replace("A B","(?-x: )","V\\1NFmY\\1&X\\1bC\\1fJ&",[extended])),
- <<"AVNFmY XbCfJ B">> = iolist_to_binary(re:replace("A B","(?-x: )","V\\1NFmY\\1&X\\1bC\\1fJ&",[extended,
- global])),
- <<"ABB">> = iolist_to_binary(re:replace("A # B","(?x)(?-x: \\s*#\\s*)","B",[])),
- <<"ABB">> = iolist_to_binary(re:replace("A # B","(?x)(?-x: \\s*#\\s*)","B",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x)(?-x: \\s*#\\s*)","&CgSC",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x)(?-x: \\s*#\\s*)","&CgSC",[global])),
- <<"#">> = iolist_to_binary(re:replace("#","(?x)(?-x: \\s*#\\s*)","&&VXAaYSEf",[])),
- <<"#">> = iolist_to_binary(re:replace("#","(?x)(?-x: \\s*#\\s*)","&&VXAaYSEf",[global])),
- <<"A #includeu">> = iolist_to_binary(re:replace("A #include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","&u",[])),
- <<"A #includeu">> = iolist_to_binary(re:replace("A #include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","&u",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x-is)(?:(?-ixs) \\s*#\\s*) include","KyMhf",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x-is)(?:(?-ixs) \\s*#\\s*) include","KyMhf",[global])),
- <<"A#include">> = iolist_to_binary(re:replace("A#include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","PFlBaBuo\\1\\1\\1&Uu",[])),
- <<"A#include">> = iolist_to_binary(re:replace("A#include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","PFlBaBuo\\1\\1\\1&Uu",[global])),
- <<"A #Include">> = iolist_to_binary(re:replace("A #Include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","D\\1SrsbvVOeg\\1OC&Wy",[])),
- <<"A #Include">> = iolist_to_binary(re:replace("A #Include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","D\\1SrsbvVOeg\\1OC&Wy",[global])),
+C","(?<=C\\n)^","&mnoJCD&rV&iH",[multiline,global])),
+ <<"sybXaXBDYtXeaMXPXnbXaXbXaXC">> = iolist_to_binary(re:replace("bXaX","(?:(?(1)a|b)(X))+","sy&BDYt\\1eaM\\1P\\1n&&C",[])),
+ <<"sybXaXBDYtXeaMXPXnbXaXbXaXC">> = iolist_to_binary(re:replace("bXaX","(?:(?(1)a|b)(X))+","sy&BDYt\\1eaM\\1P\\1n&&C",[global])),
+ <<"KbXXaYYaYufAhHxbYRbXXaYYaYEGpjWY">> = iolist_to_binary(re:replace("bXXaYYaY","(?:(?(1)\\1a|b)(X|Y))+","K&ufAhHxb\\1R&EGpjW\\1",[])),
+ <<"KbXXaYYaYufAhHxbYRbXXaYYaYEGpjWY">> = iolist_to_binary(re:replace("bXXaYYaY","(?:(?(1)\\1a|b)(X|Y))+","K&ufAhHxb\\1R&EGpjW\\1",[global])),
+ <<"bXsOgbTHbXCbXuonYaXXaX">> = iolist_to_binary(re:replace("bXYaXXaX","(?:(?(1)\\1a|b)(X|Y))+","&sOgbTH&C&uon",[])),
+ <<"bXsOgbTHbXCbXuonYaXXaX">> = iolist_to_binary(re:replace("bXYaXXaX","(?:(?(1)\\1a|b)(X|Y))+","&sOgbTH&C&uon",[global])),
+ <<"JneobXbXBXXaYYaY">> = iolist_to_binary(re:replace("bXXaYYaY","()()()()()()()()()(?:(?(10)\\10a|b)(X|Y))+","Jn\\1eo&&BX\\1\\1",[])),
+ <<"JneobXbXBXXaYYaY">> = iolist_to_binary(re:replace("bXXaYYaY","()()()()()()()()()(?:(?(10)\\10a|b)(X|Y))+","Jn\\1eo&&BX\\1\\1",[global])),
+ <<"MGXaAc">> = iolist_to_binary(re:replace("abc]","[[,abc,]+]","MGXaAc",[])),
+ <<"MGXaAc">> = iolist_to_binary(re:replace("abc]","[[,abc,]+]","MGXaAc",[global])),
+ <<"QLdwhNFO">> = iolist_to_binary(re:replace("a,b]","[[,abc,]+]","QLdw\\1hNFO",[])),
+ <<"QLdwhNFO">> = iolist_to_binary(re:replace("a,b]","[[,abc,]+]","QLdw\\1hNFO",[global])),
+ <<"mrAsBve[a,b,c]UksE[a,b,c]">> = iolist_to_binary(re:replace("[a,b,c]","[[,abc,]+]","mrAsBve&U\\1k\\1sE&",[])),
+ <<"mrAsBve[a,b,c]UksE[a,b,c]">> = iolist_to_binary(re:replace("[a,b,c]","[[,abc,]+]","mrAsBve&U\\1k\\1sE&",[global])),
+ <<"AiIoucpHiJtVB">> = iolist_to_binary(re:replace("A B","(?-x: )","iI\\1oucpHiJtV",[extended])),
+ <<"AiIoucpHiJtVB">> = iolist_to_binary(re:replace("A B","(?-x: )","iI\\1oucpHiJtV",[extended,
+ global])),
+ <<"AfRWj # PetBdVWqyB">> = iolist_to_binary(re:replace("A # B","(?x)(?-x: \\s*#\\s*)","fRWj\\1&Pe\\1\\1tBdVW\\1qy",[])),
+ <<"AfRWj # PetBdVWqyB">> = iolist_to_binary(re:replace("A # B","(?x)(?-x: \\s*#\\s*)","fRWj\\1&Pe\\1\\1tBdVW\\1qy",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x)(?-x: \\s*#\\s*)","thjvygK\\1p&pYs\\1uBr",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x)(?-x: \\s*#\\s*)","thjvygK\\1p&pYs\\1uBr",[global])),
+ <<"#">> = iolist_to_binary(re:replace("#","(?x)(?-x: \\s*#\\s*)","tbFvq\\1IQg\\1RTAxEph",[])),
+ <<"#">> = iolist_to_binary(re:replace("#","(?x)(?-x: \\s*#\\s*)","tbFvq\\1IQg\\1RTAxEph",[global])),
+ <<"AVTpQN #includeS">> = iolist_to_binary(re:replace("A #include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","V\\1TpQN&S",[])),
+ <<"AVTpQN #includeS">> = iolist_to_binary(re:replace("A #include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","V\\1TpQN&S",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x-is)(?:(?-ixs) \\s*#\\s*) include","wlsB\\1O",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?x-is)(?:(?-ixs) \\s*#\\s*) include","wlsB\\1O",[global])),
+ <<"A#include">> = iolist_to_binary(re:replace("A#include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","Yo\\1qtePMHamKUo&",[])),
+ <<"A#include">> = iolist_to_binary(re:replace("A#include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","Yo\\1qtePMHamKUo&",[global])),
+ <<"A #Include">> = iolist_to_binary(re:replace("A #Include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","\\1e&&X&vW",[])),
+ <<"A #Include">> = iolist_to_binary(re:replace("A #Include","(?x-is)(?:(?-ixs) \\s*#\\s*) include","\\1e&&X&vW",[global])),
ok.
run35() ->
- <<"AYafQSUNhFRibaaabbbbT">> = iolist_to_binary(re:replace("aaabbbb","a*b*\\w","AYafQSUNhFRib&T",[])),
- <<"AYafQSUNhFRibaaabbbbT">> = iolist_to_binary(re:replace("aaabbbb","a*b*\\w","AYafQSUNhFRib&T",[global])),
- <<"vKBXMQS">> = iolist_to_binary(re:replace("aaaa","a*b*\\w","vKBXMQS\\1",[])),
- <<"vKBXMQS">> = iolist_to_binary(re:replace("aaaa","a*b*\\w","vKBXMQS\\1",[global])),
- <<"atbBVaRw">> = iolist_to_binary(re:replace("a","a*b*\\w","&tbBV&Rw",[])),
- <<"atbBVaRw">> = iolist_to_binary(re:replace("a","a*b*\\w","&tbBV&Rw",[global])),
- <<"QDXPfbb">> = iolist_to_binary(re:replace("aaabbbb","a*b?\\w","QDXPf\\1",[])),
- <<"QDXPfQDXPf">> = iolist_to_binary(re:replace("aaabbbb","a*b?\\w","QDXPf\\1",[global])),
- <<"qIIJaaaafyqkXQdN">> = iolist_to_binary(re:replace("aaaa","a*b?\\w","qIIJ&fyqkXQ\\1dN",[])),
- <<"qIIJaaaafyqkXQdN">> = iolist_to_binary(re:replace("aaaa","a*b?\\w","qIIJ&fyqkXQ\\1dN",[global])),
- <<"aqAJFQ">> = iolist_to_binary(re:replace("a","a*b?\\w","&qAJFQ",[])),
- <<"aqAJFQ">> = iolist_to_binary(re:replace("a","a*b?\\w","&qAJFQ",[global])),
- <<"qVNjOTqaaabbbbQfis">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,4}\\w","qV\\1NjOTq\\1&Qf\\1is\\1",[])),
- <<"qVNjOTqaaabbbbQfis">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,4}\\w","qV\\1NjOTq\\1&Qf\\1is\\1",[global])),
- <<"caaaaIqaaaa">> = iolist_to_binary(re:replace("aaaa","a*b{0,4}\\w","c&I\\1q&",[])),
- <<"caaaaIqaaaa">> = iolist_to_binary(re:replace("aaaa","a*b{0,4}\\w","c&I\\1q&",[global])),
- <<"MJLlapba">> = iolist_to_binary(re:replace("a","a*b{0,4}\\w","MJLl&\\1pb&",[])),
- <<"MJLlapba">> = iolist_to_binary(re:replace("a","a*b{0,4}\\w","MJLl&\\1pb&",[global])),
- <<"Uxbbm">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,}\\w","Uxbbm\\1",[])),
- <<"Uxbbm">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,}\\w","Uxbbm\\1",[global])),
- <<"fHXfIxomDIMBKtdig">> = iolist_to_binary(re:replace("aaaa","a*b{0,}\\w","f\\1HXfIxomD\\1\\1IMBKtdig",[])),
- <<"fHXfIxomDIMBKtdig">> = iolist_to_binary(re:replace("aaaa","a*b{0,}\\w","f\\1HXfIxomD\\1\\1IMBKtdig",[global])),
- <<"hdaYrYD">> = iolist_to_binary(re:replace("a","a*b{0,}\\w","\\1hd&YrYD\\1",[])),
- <<"hdaYrYD">> = iolist_to_binary(re:replace("a","a*b{0,}\\w","\\1hd&YrYD\\1",[global])),
- <<"xIjjbHXKSKRKUhwCer">> = iolist_to_binary(re:replace("0a","a*\\d*\\w","xIjjbHXKSKRKUhwCer",[])),
- <<"xIjjbHXKSKRKUhwCer">> = iolist_to_binary(re:replace("0a","a*\\d*\\w","xIjjbHXKSKRKUhwCer",[global])),
- <<"aklRHKO">> = iolist_to_binary(re:replace("a","a*\\d*\\w","&klRHK\\1O",[])),
- <<"aklRHKO">> = iolist_to_binary(re:replace("a","a*\\d*\\w","&klRHK\\1O",[global])),
- <<"aaaTxVbkRpu">> = iolist_to_binary(re:replace("a","a*b *\\w","&&&TxVbk\\1Rpu",[extended])),
- <<"aaaTxVbkRpu">> = iolist_to_binary(re:replace("a","a*b *\\w","&&&TxVbk\\1Rpu",[extended,
- global])),
- <<"ekWkPj">> = iolist_to_binary(re:replace("a","a*b#comment
- *\\w","ekWkPj",[extended])),
- <<"ekWkPj">> = iolist_to_binary(re:replace("a","a*b#comment
- *\\w","ekWkPj",[extended,global])),
- <<"XxA">> = iolist_to_binary(re:replace("a","a* b *\\w","XxA",[extended])),
- <<"XxA">> = iolist_to_binary(re:replace("a","a* b *\\w","XxA",[extended,
- global])),
- <<"FL
+ <<"bKrRGsoSckoSG">> = iolist_to_binary(re:replace("aaabbbb","a*b*\\w","bKrRGsoSckoSG",[])),
+ <<"bKrRGsoSckoSG">> = iolist_to_binary(re:replace("aaabbbb","a*b*\\w","bKrRGsoSckoSG",[global])),
+ <<"xc">> = iolist_to_binary(re:replace("aaaa","a*b*\\w","\\1xc",[])),
+ <<"xc">> = iolist_to_binary(re:replace("aaaa","a*b*\\w","\\1xc",[global])),
+ <<"DiagFR">> = iolist_to_binary(re:replace("a","a*b*\\w","Di&\\1gFR",[])),
+ <<"DiagFR">> = iolist_to_binary(re:replace("a","a*b*\\w","Di&\\1gFR",[global])),
+ <<"xSaaabbESTgXbkTtoCbb">> = iolist_to_binary(re:replace("aaabbbb","a*b?\\w","\\1xS&E\\1STgXb\\1kTtoC",[])),
+ <<"xSaaabbESTgXbkTtoCxSbbESTgXbkTtoC">> = iolist_to_binary(re:replace("aaabbbb","a*b?\\w","\\1xS&E\\1STgXb\\1kTtoC",[global])),
+ <<"NFFaaaaAMaaaakpmD">> = iolist_to_binary(re:replace("aaaa","a*b?\\w","NFF&AM&kp\\1mD",[])),
+ <<"NFFaaaaAMaaaakpmD">> = iolist_to_binary(re:replace("aaaa","a*b?\\w","NFF&AM&kp\\1mD",[global])),
+ <<"KCaDnJouY">> = iolist_to_binary(re:replace("a","a*b?\\w","\\1KC&DnJouY",[])),
+ <<"KCaDnJouY">> = iolist_to_binary(re:replace("a","a*b?\\w","\\1KC&DnJouY",[global])),
+ <<"ItNl">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,4}\\w","ItNl",[])),
+ <<"ItNl">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,4}\\w","ItNl",[global])),
+ <<"SpCeqD">> = iolist_to_binary(re:replace("aaaa","a*b{0,4}\\w","SpCeqD",[])),
+ <<"SpCeqD">> = iolist_to_binary(re:replace("aaaa","a*b{0,4}\\w","SpCeqD",[global])),
+ <<"VwueYyNFc">> = iolist_to_binary(re:replace("a","a*b{0,4}\\w","Vwu\\1eYyN\\1Fc",[])),
+ <<"VwueYyNFc">> = iolist_to_binary(re:replace("a","a*b{0,4}\\w","Vwu\\1eYyN\\1Fc",[global])),
+ <<"KjgaaabbbbAaaabbbbJXahPyE">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,}\\w","Kjg&A&JXahP\\1yE",[])),
+ <<"KjgaaabbbbAaaabbbbJXahPyE">> = iolist_to_binary(re:replace("aaabbbb","a*b{0,}\\w","Kjg&A&JXahP\\1yE",[global])),
+ <<"ngvFLRPw">> = iolist_to_binary(re:replace("aaaa","a*b{0,}\\w","ngvFLRPw",[])),
+ <<"ngvFLRPw">> = iolist_to_binary(re:replace("aaaa","a*b{0,}\\w","ngvFLRPw",[global])),
+ <<"DnucmfFKuYp">> = iolist_to_binary(re:replace("a","a*b{0,}\\w","Dn\\1ucm\\1\\1fFKuYp",[])),
+ <<"DnucmfFKuYp">> = iolist_to_binary(re:replace("a","a*b{0,}\\w","Dn\\1ucm\\1\\1fFKuYp",[global])),
+ <<"0aY">> = iolist_to_binary(re:replace("0a","a*\\d*\\w","&Y",[])),
+ <<"0aY">> = iolist_to_binary(re:replace("0a","a*\\d*\\w","&Y",[global])),
+ <<"xanCBUCkGaPAtML">> = iolist_to_binary(re:replace("a","a*\\d*\\w","x&nCBUCkG&PAt\\1ML",[])),
+ <<"xanCBUCkGaPAtML">> = iolist_to_binary(re:replace("a","a*\\d*\\w","x&nCBUCkG&PAt\\1ML",[global])),
+ <<"ii">> = iolist_to_binary(re:replace("a","a*b *\\w","ii",[extended])),
+ <<"ii">> = iolist_to_binary(re:replace("a","a*b *\\w","ii",[extended,
+ global])),
+ <<"VaGxIwMeaq">> = iolist_to_binary(re:replace("a","a*b#comment
+ *\\w","V&GxIwMeaq",[extended])),
+ <<"VaGxIwMeaq">> = iolist_to_binary(re:replace("a","a*b#comment
+ *\\w","V&GxIwMeaq",[extended,global])),
+ <<"AaapTXaPHaekH">> = iolist_to_binary(re:replace("a","a* b *\\w","Aa&pTX&PHaekH",[extended])),
+ <<"AaapTXaPHaekH">> = iolist_to_binary(re:replace("a","a* b *\\w","Aa&pTX&PHaekH",[extended,
+ global])),
+ <<"abc=xyz\\vmPNciE
pqr">> = iolist_to_binary(re:replace("abc=xyz\\
-pqr","^\\w+=.*(\\\\\\n.*)*","FL",[])),
- <<"FL
+pqr","^\\w+=.*(\\\\\\n.*)*","&vmPNciE",[])),
+ <<"abc=xyz\\vmPNciE
pqr">> = iolist_to_binary(re:replace("abc=xyz\\
-pqr","^\\w+=.*(\\\\\\n.*)*","FL",[global])),
- <<"KDabcd:abcdSabcd:">> = iolist_to_binary(re:replace("abcd:","(?=(\\w+))\\1:","KD&\\1S&",[])),
- <<"KDabcd:abcdSabcd:">> = iolist_to_binary(re:replace("abcd:","(?=(\\w+))\\1:","KD&\\1S&",[global])),
- <<"CFNabcd:xwKNSfsabcd">> = iolist_to_binary(re:replace("abcd:","^(?=(\\w+))\\1:","CFN&xwKNSfs\\1",[])),
- <<"CFNabcd:xwKNSfsabcd">> = iolist_to_binary(re:replace("abcd:","^(?=(\\w+))\\1:","CFN&xwKNSfs\\1",[global])),
- <<"UabcWq">> = iolist_to_binary(re:replace("abc","^\\Eabc","U&Wq",[])),
- <<"UabcWq">> = iolist_to_binary(re:replace("abc","^\\Eabc","U&Wq",[global])),
- <<"yamyDjNjvdapUq">> = iolist_to_binary(re:replace("a","^[\\Eabc]","y&myDjNjvd&pUq\\1",[])),
- <<"yamyDjNjvdapUq">> = iolist_to_binary(re:replace("a","^[\\Eabc]","y&myDjNjvd&pUq\\1",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\Eabc]","YWGNdA&XaWp\\1",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\Eabc]","YWGNdA&XaWp\\1",[global])),
- <<"E">> = iolist_to_binary(re:replace("E","^[\\Eabc]","qtud&GONs\\1W\\1I",[])),
- <<"E">> = iolist_to_binary(re:replace("E","^[\\Eabc]","qtud&GONs\\1W\\1I",[global])),
- <<"kj">> = iolist_to_binary(re:replace("b","^[a-\\Ec]","kj",[])),
- <<"kj">> = iolist_to_binary(re:replace("b","^[a-\\Ec]","kj",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a-\\Ec]","U\\1",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a-\\Ec]","U\\1",[global])),
- <<"-">> = iolist_to_binary(re:replace("-","^[a-\\Ec]","dluKDBOTsxDtQKaGXQn",[])),
- <<"-">> = iolist_to_binary(re:replace("-","^[a-\\Ec]","dluKDBOTsxDtQKaGXQn",[global])),
- <<"E">> = iolist_to_binary(re:replace("E","^[a-\\Ec]","j\\1KKHVDRF&\\1hBX\\1nerh",[])),
- <<"E">> = iolist_to_binary(re:replace("E","^[a-\\Ec]","j\\1KKHVDRF&\\1hBX\\1nerh",[global])),
- <<"eU">> = iolist_to_binary(re:replace("b","^[a\\E\\E-\\Ec]","\\1eU",[])),
- <<"eU">> = iolist_to_binary(re:replace("b","^[a\\E\\E-\\Ec]","\\1eU",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a\\E\\E-\\Ec]","Gp\\1hoe\\1ft",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a\\E\\E-\\Ec]","Gp\\1hoe\\1ft",[global])),
- <<"-">> = iolist_to_binary(re:replace("-","^[a\\E\\E-\\Ec]","&\\1&\\1dsAR\\1R&kfYLY&Nx",[])),
- <<"-">> = iolist_to_binary(re:replace("-","^[a\\E\\E-\\Ec]","&\\1&\\1dsAR\\1R&kfYLY&Nx",[global])),
- <<"E">> = iolist_to_binary(re:replace("E","^[a\\E\\E-\\Ec]","OmwiowAjJ&dB",[])),
- <<"E">> = iolist_to_binary(re:replace("E","^[a\\E\\E-\\Ec]","OmwiowAjJ&dB",[global])),
- <<"bLBVEBlTbNy">> = iolist_to_binary(re:replace("b","^[\\E\\Qa\\E-\\Qz\\E]+","&LBVEBlT&Ny",[])),
- <<"bLBVEBlTbNy">> = iolist_to_binary(re:replace("b","^[\\E\\Qa\\E-\\Qz\\E]+","&LBVEBlT&Ny",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\E\\Qa\\E-\\Qz\\E]+","&DGXW&\\1G",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\E\\Qa\\E-\\Qz\\E]+","&DGXW&\\1G",[global])),
- <<"-">> = iolist_to_binary(re:replace("-","^[\\E\\Qa\\E-\\Qz\\E]+","uh&tV&",[])),
- <<"-">> = iolist_to_binary(re:replace("-","^[\\E\\Qa\\E-\\Qz\\E]+","uh&tV&",[global])),
- <<"IgYyaXYfkYHvCal">> = iolist_to_binary(re:replace("a","^[a\\Q]bc\\E]","IgYy&XYf\\1kYH\\1vC&\\1l",[])),
- <<"IgYyaXYfkYHvCal">> = iolist_to_binary(re:replace("a","^[a\\Q]bc\\E]","IgYy&XYf\\1kYH\\1vC&\\1l",[global])),
- <<"DGTyeUFsoeifQI">> = iolist_to_binary(re:replace("]","^[a\\Q]bc\\E]","DGTyeUFsoeifQI",[])),
- <<"DGTyeUFsoeifQI">> = iolist_to_binary(re:replace("]","^[a\\Q]bc\\E]","DGTyeUFsoeifQI",[global])),
- <<"cdPJxbdO">> = iolist_to_binary(re:replace("c","^[a\\Q]bc\\E]","&dPJxb\\1dO",[])),
- <<"cdPJxbdO">> = iolist_to_binary(re:replace("c","^[a\\Q]bc\\E]","&dPJxb\\1dO",[global])),
- <<"achHbHOkynhnR">> = iolist_to_binary(re:replace("a","^[a-\\Q\\E]","&chHbHOkynhnR",[])),
- <<"achHbHOkynhnR">> = iolist_to_binary(re:replace("a","^[a-\\Q\\E]","&chHbHOkynhnR",[global])),
- <<"uu-MgaUIMliYd--">> = iolist_to_binary(re:replace("-","^[a-\\Q\\E]","uu\\1&MgaU\\1IMliYd&&",[])),
- <<"uu-MgaUIMliYd--">> = iolist_to_binary(re:replace("-","^[a-\\Q\\E]","uu\\1&MgaU\\1IMliYd&&",[global])),
- <<"CP">> = iolist_to_binary(re:replace("aaaa","^(a()*)*","CP",[])),
- <<"CP">> = iolist_to_binary(re:replace("aaaa","^(a()*)*","CP",[global])),
- <<"wQTHtaaaakYek">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))*)*","w\\1QTH\\1\\1t&kYe\\1k",[])),
- <<"wQTHtaaaakYek">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))*)*","w\\1QTH\\1\\1t&kYe\\1k",[global])),
+pqr","^\\w+=.*(\\\\\\n.*)*","&vmPNciE",[global])),
+ <<"oabcd:pabcd:qOabcdGfIeV">> = iolist_to_binary(re:replace("abcd:","(?=(\\w+))\\1:","o&p&qO\\1GfIeV",[])),
+ <<"oabcd:pabcd:qOabcdGfIeV">> = iolist_to_binary(re:replace("abcd:","(?=(\\w+))\\1:","o&p&qO\\1GfIeV",[global])),
+ <<"LTrSmxIPabcdOKMqwVAA">> = iolist_to_binary(re:replace("abcd:","^(?=(\\w+))\\1:","LTrSmxIP\\1OKMqwVAA",[])),
+ <<"LTrSmxIPabcdOKMqwVAA">> = iolist_to_binary(re:replace("abcd:","^(?=(\\w+))\\1:","LTrSmxIP\\1OKMqwVAA",[global])),
+ <<"aKjwwmYIpW">> = iolist_to_binary(re:replace("abc","^\\Eabc","aKj\\1w\\1wmY\\1Ip\\1W",[])),
+ <<"aKjwwmYIpW">> = iolist_to_binary(re:replace("abc","^\\Eabc","aKj\\1w\\1wmY\\1Ip\\1W",[global])),
+ <<"l">> = iolist_to_binary(re:replace("a","^[\\Eabc]","l",[])),
+ <<"l">> = iolist_to_binary(re:replace("a","^[\\Eabc]","l",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\Eabc]","bQ&mb\\1I&",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\Eabc]","bQ&mb\\1I&",[global])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[\\Eabc]","&qof&K&",[])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[\\Eabc]","&qof&K&",[global])),
+ <<"LbOibbFEALmTbt">> = iolist_to_binary(re:replace("b","^[a-\\Ec]","Lb\\1Oi&\\1\\1&FEA\\1Lm\\1T&t",[])),
+ <<"LbOibbFEALmTbt">> = iolist_to_binary(re:replace("b","^[a-\\Ec]","Lb\\1Oi&\\1\\1&FEA\\1Lm\\1T&t",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a-\\Ec]","PtF&e\\1KFwR&E",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a-\\Ec]","PtF&e\\1KFwR&E",[global])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[a-\\Ec]","N&Vuwq\\1D&\\1PXO&qg&Y",[])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[a-\\Ec]","N&Vuwq\\1D&\\1PXO&qg&Y",[global])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[a-\\Ec]","gfw",[])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[a-\\Ec]","gfw",[global])),
+ <<"m">> = iolist_to_binary(re:replace("b","^[a\\E\\E-\\Ec]","m",[])),
+ <<"m">> = iolist_to_binary(re:replace("b","^[a\\E\\E-\\Ec]","m",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a\\E\\E-\\Ec]","pr\\1hSV&a\\1Tq\\1uk\\1lGQn",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[a\\E\\E-\\Ec]","pr\\1hSV&a\\1Tq\\1uk\\1lGQn",[global])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[a\\E\\E-\\Ec]","PLu\\1jRBxH&j",[])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[a\\E\\E-\\Ec]","PLu\\1jRBxH&j",[global])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[a\\E\\E-\\Ec]","\\1RonyFdbw&\\1UT",[])),
+ <<"E">> = iolist_to_binary(re:replace("E","^[a\\E\\E-\\Ec]","\\1RonyFdbw&\\1UT",[global])),
+ <<"LtmFeEubbhDoqNG">> = iolist_to_binary(re:replace("b","^[\\E\\Qa\\E-\\Qz\\E]+","L\\1tmF\\1eEu&&hDoqNG",[])),
+ <<"LtmFeEubbhDoqNG">> = iolist_to_binary(re:replace("b","^[\\E\\Qa\\E-\\Qz\\E]+","L\\1tmF\\1eEu&&hDoqNG",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\E\\Qa\\E-\\Qz\\E]+","ks\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\E\\Qa\\E-\\Qz\\E]+","ks\\1",[global])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[\\E\\Qa\\E-\\Qz\\E]+","DNi",[])),
+ <<"-">> = iolist_to_binary(re:replace("-","^[\\E\\Qa\\E-\\Qz\\E]+","DNi",[global])),
+ <<"UoqHQfFfbONSGdk">> = iolist_to_binary(re:replace("a","^[a\\Q]bc\\E]","\\1UoqHQfFf\\1bONSGd\\1k",[])),
+ <<"UoqHQfFfbONSGdk">> = iolist_to_binary(re:replace("a","^[a\\Q]bc\\E]","\\1UoqHQfFf\\1bONSGd\\1k",[global])),
+ <<"eMWv]QMxjJL]v">> = iolist_to_binary(re:replace("]","^[a\\Q]bc\\E]","eMWv&QMxjJL&v",[])),
+ <<"eMWv]QMxjJL]v">> = iolist_to_binary(re:replace("]","^[a\\Q]bc\\E]","eMWv&QMxjJL&v",[global])),
+ <<"sDtJKXcbIVQesK">> = iolist_to_binary(re:replace("c","^[a\\Q]bc\\E]","sD\\1tJKX&bI\\1V\\1QesK",[])),
+ <<"sDtJKXcbIVQesK">> = iolist_to_binary(re:replace("c","^[a\\Q]bc\\E]","sD\\1tJKX&bI\\1V\\1QesK",[global])),
+ <<"phuiWK">> = iolist_to_binary(re:replace("a","^[a-\\Q\\E]","phuiWK",[])),
+ <<"phuiWK">> = iolist_to_binary(re:replace("a","^[a-\\Q\\E]","phuiWK",[global])),
+ <<"e-EpaKAPD-M-">> = iolist_to_binary(re:replace("-","^[a-\\Q\\E]","e&Epa\\1KAPD\\1&M&",[])),
+ <<"e-EpaKAPD-M-">> = iolist_to_binary(re:replace("-","^[a-\\Q\\E]","e&Epa\\1KAPD\\1&M&",[global])),
+ <<"VKXawWoyOhQtKatma">> = iolist_to_binary(re:replace("aaaa","^(a()*)*","VKX\\1wWoyOhQtK\\1tm\\1",[])),
+ <<"VKXawWoyOhQtKatma">> = iolist_to_binary(re:replace("aaaa","^(a()*)*","VKX\\1wWoyOhQtK\\1tm\\1",[global])),
+ <<"tPRweiQ">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))*)*","tPRweiQ",[])),
+ <<"tPRweiQ">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))*)*","tPRweiQ",[global])),
ok.
run36() ->
- <<"RGaXfvItI">> = iolist_to_binary(re:replace("aaaa","^(a()+)+","RG\\1XfvItI",[])),
- <<"RGaXfvItI">> = iolist_to_binary(re:replace("aaaa","^(a()+)+","RG\\1XfvItI",[global])),
- <<"dMSiHuvxupxlcaaaax">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))+)+","dMSiHuvxupxl\\1c&x",[])),
- <<"dMSiHuvxupxlcaaaax">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))+)+","dMSiHuvxupxl\\1c&x",[global])),
- <<"iP">> = iolist_to_binary(re:replace("abbD","(a){0,3}(?(1)b|(c|))*D","iP",[])),
- <<"iP">> = iolist_to_binary(re:replace("abbD","(a){0,3}(?(1)b|(c|))*D","iP",[global])),
- <<"ccccDXbTvQpvdoaW">> = iolist_to_binary(re:replace("ccccD","(a){0,3}(?(1)b|(c|))*D","&XbTvQ\\1p\\1vd\\1o\\1\\1\\1aW",[])),
- <<"ccccDXbTvQpvdoaW">> = iolist_to_binary(re:replace("ccccD","(a){0,3}(?(1)b|(c|))*D","&XbTvQ\\1p\\1vd\\1o\\1\\1\\1aW",[global])),
- <<"RVoDDTkMDjhW">> = iolist_to_binary(re:replace("D","(a){0,3}(?(1)b|(c|))*D","RVo&&TkM&jhW",[])),
- <<"RVoDDTkMDjhW">> = iolist_to_binary(re:replace("D","(a){0,3}(?(1)b|(c|))*D","RVo&&TkM&jhW",[global])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a|)*\\d","&\\1DGFkfxXGJ\\1yJ",[])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a|)*\\d","&\\1DGFkfxXGJ\\1yJ",[global])),
- <<"Kaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4GiaQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4jWNATt">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(a|)*\\d","K&GiaQ&jWNATt",[])),
- <<"Kaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4GiaQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4jWNATt">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(a|)*\\d","K&GiaQ&jWNATt",[global])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?>a|)*\\d","qHVMyR\\1g\\1",[])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?>a|)*\\d","qHVMyR\\1g\\1",[global])),
- <<"kGFBeTsPIf">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?>a|)*\\d","kGFBeTsPI\\1f",[])),
- <<"kGFBeTsPIf">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?>a|)*\\d","kGFBeTsPI\\1f",[global])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?:a|)*\\d","Yx",[])),
- <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?:a|)*\\d","Yx",[global])),
- <<"wkl">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?:a|)*\\d","wkl",[])),
- <<"wkl">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?:a|)*\\d","wkl",[global])),
- <<"abcqXmkEhjC">> = iolist_to_binary(re:replace("abc","\\Z","qXmkEhjC",[])),
- <<"abcqXmkEhjC">> = iolist_to_binary(re:replace("abc","\\Z","qXmkEhjC",[global])),
- <<"RdSYAact">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","RdSYAact",[])),
- <<"RdSYAact">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","RdSYAact",[global])),
- <<"JvTabcqFTcnkmyFJ">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","\\1JvT&qFTcnk\\1my\\1FJ",[])),
- <<"JvTabcqFTcnkmyFJ">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","\\1JvT&qFTcnk\\1my\\1FJ",[global])),
- <<"cqXXOeFFGVUWkMabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","cqXXOeFF\\1GVUW\\1kM",[])),
- <<"cqXXOeFFGVUWkMabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","cqXXOeFF\\1GVUW\\1kM",[global])),
- <<"JbxrWfegLobSfGKabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","\\1Jbx&rWfe&gLobSfGK",[])),
- <<"JbxrWfegLobSfGKabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","\\1Jbx&rWfe&gLobSfGK",[global])),
- <<"abceDUDjJoFtrgMYDo">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","eDUDjJoFtrgMYD&o",[])),
- <<"abceDUDjJoFtrgMYDo">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","eDUDjJoFtrgMYD&o",[global])),
- <<"abcL">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","L",[])),
- <<"abcL">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","L",[global])),
- <<"abcdddXku">> = iolist_to_binary(re:replace("abcd","(.*(.)?)*","&dd\\1\\1Xku",[])),
- <<"abcdddXkuddXku">> = iolist_to_binary(re:replace("abcd","(.*(.)?)*","&dd\\1\\1Xku",[global])),
- <<"pkdLVDscUDDEBUBabcd">> = iolist_to_binary(re:replace("abcd","( (A | (?(1)0|) )* )","pkd&L&VD&scUDDEBUB",[extended])),
- <<"pkdLVDscUDDEBUBapkdLVDscUDDEBUBbpkdLVDscUDDEBUBcpkdLVDscUDDEBUBdpkdLVDscUDDEBUB">> = iolist_to_binary(re:replace("abcd","( (A | (?(1)0|) )* )","pkd&L&VD&scUDDEBUB",[extended,
- global])),
- <<"AuDgWsdmnqYhabcd">> = iolist_to_binary(re:replace("abcd","( ( (?(1)0|) )* )","AuDgW&s&dm&nqYh",[extended])),
- <<"AuDgWsdmnqYhaAuDgWsdmnqYhbAuDgWsdmnqYhcAuDgWsdmnqYhdAuDgWsdmnqYh">> = iolist_to_binary(re:replace("abcd","( ( (?(1)0|) )* )","AuDgW&s&dm&nqYh",[extended,
- global])),
- <<"efinTcnmBlVFabcd">> = iolist_to_binary(re:replace("abcd","( (?(1)0|)* )","efinTc&nmB&\\1lV\\1F",[extended])),
- <<"efinTcnmBlVFaefinTcnmBlVFbefinTcnmBlVFcefinTcnmBlVFdefinTcnmBlVF">> = iolist_to_binary(re:replace("abcd","( (?(1)0|)* )","efinTc&nmB&\\1lV\\1F",[extended,
- global])),
- <<"EDiUXiAlYBAmCeNc">> = iolist_to_binary(re:replace("a]","[[:abcd:xyz]]","EDiUXiAlYBA\\1mCeNc",[])),
- <<"EDiUXiAlYBAmCeNc">> = iolist_to_binary(re:replace("a]","[[:abcd:xyz]]","EDiUXiAlYBA\\1mCeNc",[global])),
- <<"k:]h">> = iolist_to_binary(re:replace(":]","[[:abcd:xyz]]","k&h",[])),
- <<"k:]h">> = iolist_to_binary(re:replace(":]","[[:abcd:xyz]]","k&h",[global])),
- <<"hwNfUgfOoCtFayhAXX">> = iolist_to_binary(re:replace("a","[abc[:x\\]pqr]","hwNfUgfOo\\1CtF&yhA\\1XX",[])),
- <<"hwNfUgfOoCtFayhAXX">> = iolist_to_binary(re:replace("a","[abc[:x\\]pqr]","hwNfUgfOo\\1CtF&yhA\\1XX",[global])),
- <<"">> = iolist_to_binary(re:replace("[","[abc[:x\\]pqr]","\\1\\1",[])),
- <<"">> = iolist_to_binary(re:replace("[","[abc[:x\\]pqr]","\\1\\1",[global])),
- <<"fWMiJLaBnsaYQ">> = iolist_to_binary(re:replace(":","[abc[:x\\]pqr]","fWMiJLaBns\\1aYQ",[])),
- <<"fWMiJLaBnsaYQ">> = iolist_to_binary(re:replace(":","[abc[:x\\]pqr]","fWMiJLaBns\\1aYQ",[global])),
- <<"IlPjDF">> = iolist_to_binary(re:replace("]","[abc[:x\\]pqr]","IlPjDF\\1",[])),
- <<"IlPjDF">> = iolist_to_binary(re:replace("]","[abc[:x\\]pqr]","IlPjDF\\1",[global])),
- <<"jXFpSOncoxfPi">> = iolist_to_binary(re:replace("p","[abc[:x\\]pqr]","\\1jX\\1F&SOncoxf\\1Pi",[])),
- <<"jXFpSOncoxfPi">> = iolist_to_binary(re:replace("p","[abc[:x\\]pqr]","\\1jX\\1F&SOncoxf\\1Pi",[global])),
- <<"fooabcfoo">> = iolist_to_binary(re:replace("fooabcfoo",".*[op][xyz]","rU&wHuSyHLW\\1WUJxg\\1",[])),
- <<"fooabcfoo">> = iolist_to_binary(re:replace("fooabcfoo",".*[op][xyz]","rU&wHuSyHLW\\1WUJxg\\1",[global])),
- <<"Yadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)","\\1\\1Y",[])),
- <<"Yadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)","\\1\\1Y",[global])),
- <<"asQWunbuTsJvhIUbTxKxbc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)","sQWun&uTsJvhIU&TxKx&",[])),
- <<"asQWunbuTsJvhIUbTxKxbc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)","sQWun&uTsJvhIU&TxKx&",[global])),
- <<"WsShpCMbadc">> = iolist_to_binary(re:replace("adc","(?(?=^.*b)b|^)","WsShp\\1\\1C\\1Mb",[])),
- <<"WsShpCMbadc">> = iolist_to_binary(re:replace("adc","(?(?=^.*b)b|^)","WsShp\\1\\1C\\1Mb",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?(?=^.*b)b|^)","PkFnM\\1TJjij\\1s",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(?(?=^.*b)b|^)","PkFnM\\1TJjij\\1s",[global])),
- <<"QgracuqfskDadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)*","Qg\\1r\\1\\1acuqfskD\\1&",[])),
- <<"QgracuqfskDaQgracuqfskDdQgracuqfskDcQgracuqfskD">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)*","Qg\\1r\\1\\1acuqfskD\\1&",[global])),
- <<"NOaxcgWJQdJabc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)*","NOaxc\\1\\1gWJQdJ&",[])),
- <<"NOaxcgWJQdJaNOaxcgWJQdJbNOaxcgWJQdJcNOaxcgWJQdJ">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)*","NOaxc\\1\\1gWJQdJ&",[global])),
+ <<"n">> = iolist_to_binary(re:replace("aaaa","^(a()+)+","n",[])),
+ <<"n">> = iolist_to_binary(re:replace("aaaa","^(a()+)+","n",[global])),
+ <<"bI">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))+)+","bI",[])),
+ <<"bI">> = iolist_to_binary(re:replace("aaaa","^(?:a(?:(?:))+)+","bI",[global])),
+ <<"GabbDDae">> = iolist_to_binary(re:replace("abbD","(a){0,3}(?(1)b|(c|))*D","G&D\\1e",[])),
+ <<"GabbDDae">> = iolist_to_binary(re:replace("abbD","(a){0,3}(?(1)b|(c|))*D","G&D\\1e",[global])),
+ <<"OV">> = iolist_to_binary(re:replace("ccccD","(a){0,3}(?(1)b|(c|))*D","OV",[])),
+ <<"OV">> = iolist_to_binary(re:replace("ccccD","(a){0,3}(?(1)b|(c|))*D","OV",[global])),
+ <<"XhjfKDReHaDNMSf">> = iolist_to_binary(re:replace("D","(a){0,3}(?(1)b|(c|))*D","Xhjf\\1K&ReHa&NM\\1Sf",[])),
+ <<"XhjfKDReHaDNMSf">> = iolist_to_binary(re:replace("D","(a){0,3}(?(1)b|(c|))*D","Xhjf\\1K&ReHa&NM\\1Sf",[global])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a|)*\\d","SbOGt&K",[])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(a|)*\\d","SbOGt&K",[global])),
+ <<"xJrtco">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(a|)*\\d","\\1x\\1Jrtco",[])),
+ <<"xJrtco">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(a|)*\\d","\\1x\\1Jrtco",[global])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?>a|)*\\d","Y\\1\\1Fq&&Lb&&T&\\1&\\1\\1T",[])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?>a|)*\\d","Y\\1\\1Fq&&Lb&&T&\\1&\\1\\1T",[global])),
+ <<"ucWrNuavax">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?>a|)*\\d","ucWrNuavax",[])),
+ <<"ucWrNuavax">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?>a|)*\\d","ucWrNuavax",[global])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?:a|)*\\d","i\\1cf\\1CEE&\\1itOwcw&BF",[])),
+ <<"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","(?:a|)*\\d","i\\1cf\\1CEE&\\1itOwcw&BF",[global])),
+ <<"WvhbrstiFWO">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?:a|)*\\d","Wv\\1hbrstiFWO",[])),
+ <<"WvhbrstiFWO">> = iolist_to_binary(re:replace("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa4","(?:a|)*\\d","Wv\\1hbrstiFWO",[global])),
+ <<"abcUhNS">> = iolist_to_binary(re:replace("abc","\\Z","UhNS&\\1\\1",[])),
+ <<"abcUhNS">> = iolist_to_binary(re:replace("abc","\\Z","UhNS&\\1\\1",[global])),
+ <<"FEgUNUkGWxyqopsabc">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","\\1FEgUNUkGWxyqops&\\1",[])),
+ <<"FEgUNUkGWxyqopsabc">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","\\1FEgUNUkGWxyqops&\\1",[global])),
+ <<"O">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","O\\1",[])),
+ <<"O">> = iolist_to_binary(re:replace("abc","^(?s)(?>.*)(?<!\\n)","O\\1",[global])),
+ <<"xSVoQWsKeMpGQabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","xSV&oQWsKe&MpG&Q",[])),
+ <<"xSVoQWsKeMpGQabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","xSV&oQWsKe&MpG&Q",[global])),
+ <<"hAqynOabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","hA&qy\\1nO",[])),
+ <<"hAqynOabc">> = iolist_to_binary(re:replace("abc","^(?![^\\n]*\\n\\z)","hA&qy\\1nO",[global])),
+ <<"abcbboJlolQwgwa">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","bbo\\1JlolQ\\1\\1wgwa",[])),
+ <<"abcbboJlolQwgwa">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","bbo\\1JlolQ\\1\\1wgwa",[global])),
+ <<"abcSrDg">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","SrDg&",[])),
+ <<"abcSrDg">> = iolist_to_binary(re:replace("abc","\\z(?<!\\n)","SrDg&",[global])),
+ <<"aabcdiFPR">> = iolist_to_binary(re:replace("abcd","(.*(.)?)*","\\1a&iFPR\\1",[])),
+ <<"aabcdiFPRaiFPR">> = iolist_to_binary(re:replace("abcd","(.*(.)?)*","\\1a&iFPR\\1",[global])),
+ <<"uQWHjmFmJgqpvabcd">> = iolist_to_binary(re:replace("abcd","( (A | (?(1)0|) )* )","u&QWHjmFmJgq\\1pv",[extended])),
+ <<"uQWHjmFmJgqpvauQWHjmFmJgqpvbuQWHjmFmJgqpvcuQWHjmFmJgqpvduQWHjmFmJgqpv">> = iolist_to_binary(re:replace("abcd","( (A | (?(1)0|) )* )","u&QWHjmFmJgq\\1pv",[extended,
+ global])),
+ <<"tgtbuAeydNDbQksBabcd">> = iolist_to_binary(re:replace("abcd","( ( (?(1)0|) )* )","tg\\1tbuAe\\1ydNDbQksB\\1",[extended])),
+ <<"tgtbuAeydNDbQksBatgtbuAeydNDbQksBbtgtbuAeydNDbQksBctgtbuAeydNDbQksBdtgtbuAeydNDbQksB">> = iolist_to_binary(re:replace("abcd","( ( (?(1)0|) )* )","tg\\1tbuAe\\1ydNDbQksB\\1",[extended,
+ global])),
+ <<"geoFaKtBOldabcd">> = iolist_to_binary(re:replace("abcd","( (?(1)0|)* )","geoFa\\1K\\1\\1tBOld",[extended])),
+ <<"geoFaKtBOldageoFaKtBOldbgeoFaKtBOldcgeoFaKtBOlddgeoFaKtBOld">> = iolist_to_binary(re:replace("abcd","( (?(1)0|)* )","geoFa\\1K\\1\\1tBOld",[extended,
+ global])),
+ <<"a]FIQJiJK">> = iolist_to_binary(re:replace("a]","[[:abcd:xyz]]","&F\\1IQJiJK",[])),
+ <<"a]FIQJiJK">> = iolist_to_binary(re:replace("a]","[[:abcd:xyz]]","&F\\1IQJiJK",[global])),
+ <<"WWYQ:]Cfo:]">> = iolist_to_binary(re:replace(":]","[[:abcd:xyz]]","WWYQ&Cfo&\\1",[])),
+ <<"WWYQ:]Cfo:]">> = iolist_to_binary(re:replace(":]","[[:abcd:xyz]]","WWYQ&Cfo&\\1",[global])),
+ <<"qDnjOTLaOgtwATf">> = iolist_to_binary(re:replace("a","[abc[:x\\]pqr]","q\\1DnjOTL\\1&Og\\1twATf",[])),
+ <<"qDnjOTLaOgtwATf">> = iolist_to_binary(re:replace("a","[abc[:x\\]pqr]","q\\1DnjOTL\\1&Og\\1twATf",[global])),
+ <<"[">> = iolist_to_binary(re:replace("[","[abc[:x\\]pqr]","&\\1",[])),
+ <<"[">> = iolist_to_binary(re:replace("[","[abc[:x\\]pqr]","&\\1",[global])),
+ <<"mcQylXKI">> = iolist_to_binary(re:replace(":","[abc[:x\\]pqr]","\\1mcQy\\1\\1\\1lXKI",[])),
+ <<"mcQylXKI">> = iolist_to_binary(re:replace(":","[abc[:x\\]pqr]","\\1mcQy\\1\\1\\1lXKI",[global])),
+ <<"yLoVOOvX]MsmpqoJL">> = iolist_to_binary(re:replace("]","[abc[:x\\]pqr]","yLoVOOvX&MsmpqoJ\\1L",[])),
+ <<"yLoVOOvX]MsmpqoJL">> = iolist_to_binary(re:replace("]","[abc[:x\\]pqr]","yLoVOOvX&MsmpqoJ\\1L",[global])),
+ <<"X">> = iolist_to_binary(re:replace("p","[abc[:x\\]pqr]","\\1\\1X",[])),
+ <<"X">> = iolist_to_binary(re:replace("p","[abc[:x\\]pqr]","\\1\\1X",[global])),
+ <<"fooabcfoo">> = iolist_to_binary(re:replace("fooabcfoo",".*[op][xyz]","U&xA\\1PsdeOWUae&&Yna",[])),
+ <<"fooabcfoo">> = iolist_to_binary(re:replace("fooabcfoo",".*[op][xyz]","U&xA\\1PsdeOWUae&&Yna",[global])),
+ <<"QIBuirGXrnadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)","QIBuirGXrn",[])),
+ <<"QIBuirGXrnadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)","QIBuirGXrn",[global])),
+ <<"awbDHBgVdwqBlbic">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)","\\1w&DHBgVdwqBl&i",[])),
+ <<"awbDHBgVdwqBlbic">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)","\\1w&DHBgVdwqBl&i",[global])),
+ <<"bMxcDhNdGOtJIJBuCaadc">> = iolist_to_binary(re:replace("adc","(?(?=^.*b)b|^)","bMx\\1cDhNdGOtJIJBuCa&",[])),
+ <<"bMxcDhNdGOtJIJBuCaadc">> = iolist_to_binary(re:replace("adc","(?(?=^.*b)b|^)","bMx\\1cDhNdGOtJIJBuCa&",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?(?=^.*b)b|^)","nnHoU&\\1CMWtr",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(?(?=^.*b)b|^)","nnHoU&\\1CMWtr",[global])),
+ <<"PXRohlVadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)*","PX\\1\\1RohlV",[])),
+ <<"PXRohlVaPXRohlVdPXRohlVcPXRohlV">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)*","PX\\1\\1RohlV",[global])),
+ <<"qnabc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)*","&&qn",[])),
+ <<"qnabbqnqncqn">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)*","&&qn",[global])),
ok.
run37() ->
- <<"egMccJuvVmsJadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)+","egMccJu&\\1vVmsJ",[])),
- <<"egMccJuvVmsJadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)+","egMccJu&\\1vVmsJ",[global])),
- <<"awbKLc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)+","wbKL",[])),
- <<"awbKLc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)+","wbKL",[global])),
- <<"aaOKbMsgbwbYMvqpaKc">> = iolist_to_binary(re:replace("abc","(?(?=b).*b|^d)","aOK\\1&Msg&w&YMvqpaK",[])),
- <<"aaOKbMsgbwbYMvqpaKc">> = iolist_to_binary(re:replace("abc","(?(?=b).*b|^d)","aOK\\1&Msg&w&YMvqpaK",[global])),
- <<"deMQjInIpkdMc">> = iolist_to_binary(re:replace("abc","(?(?=.*b).*b|^d)","deMQjInI\\1\\1pk\\1dM",[])),
- <<"deMQjInIpkdMc">> = iolist_to_binary(re:replace("abc","(?(?=.*b).*b|^d)","deMQjInI\\1\\1pk\\1dM",[global])),
- <<"xONBt%ab%fkt">> = iolist_to_binary(re:replace("%ab%","^%((?(?=[a])[^%])|b)*%$","xONBt\\1&fkt",[])),
- <<"xONBt%ab%fkt">> = iolist_to_binary(re:replace("%ab%","^%((?(?=[a])[^%])|b)*%$","xONBt\\1&fkt",[global])),
- <<"XtGNvTytylTOX">> = iolist_to_binary(re:replace("XabX","(?i)a(?-i)b|c","tGN\\1\\1vT\\1yty\\1lTO",[])),
- <<"XtGNvTytylTOX">> = iolist_to_binary(re:replace("XabX","(?i)a(?-i)b|c","tGN\\1\\1vT\\1yty\\1lTO",[global])),
- <<"XAbMBAbVAbatgNrMNMDX">> = iolist_to_binary(re:replace("XAbX","(?i)a(?-i)b|c","&MB\\1&V&\\1atgNrMNMD",[])),
- <<"XAbMBAbVAbatgNrMNMDX">> = iolist_to_binary(re:replace("XAbX","(?i)a(?-i)b|c","&MB\\1&V&\\1atgNrMNMD",[global])),
- <<"CIeFFRMtpcC">> = iolist_to_binary(re:replace("CcC","(?i)a(?-i)b|c","IeFFRMtp&",[])),
- <<"CIeFFRMtpcC">> = iolist_to_binary(re:replace("CcC","(?i)a(?-i)b|c","IeFFRMtp&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?i)a(?-i)b|c","sJoTR\\1agT&QVpj&oo",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?i)a(?-i)b|c","sJoTR\\1agT&QVpj&oo",[global])),
- <<"XABX">> = iolist_to_binary(re:replace("XABX","(?i)a(?-i)b|c","Bx\\1L&vYQ&o",[])),
- <<"XABX">> = iolist_to_binary(re:replace("XABX","(?i)a(?-i)b|c","Bx\\1L&vYQ&o",[global])),
- <<"bPwO">> = iolist_to_binary(re:replace("
- ","[\\x00-\\xff\\s]+","bPwO",[])),
- <<"bPwO">> = iolist_to_binary(re:replace("
- ","[\\x00-\\xff\\s]+","bPwO",[global])),
- <<"tNnUXVoKd">> = iolist_to_binary(re:replace("?","^\\c","tNnUXVoKd\\1",[])),
- <<"tNnUXVoKd">> = iolist_to_binary(re:replace("?","^\\c","tNnUXVoKd\\1",[global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","Xcx",[caseless])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","Xcx",[caseless,
- global])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","yV\\1&bIy&bf",[])),
- <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","yV\\1&bIy&bf",[global])),
- <<"12llNQ12abc">> = iolist_to_binary(re:replace("12abc","[^a]*","&llNQ\\1&\\1",[caseless])),
- <<"12llNQ12llNQabcllNQbcllNQ">> = iolist_to_binary(re:replace("12abc","[^a]*","&llNQ\\1&\\1",[caseless,
- global])),
- <<"gDpABC">> = iolist_to_binary(re:replace("12ABC","[^a]*","gDp",[caseless])),
- <<"gDpgDpAgDpgDp">> = iolist_to_binary(re:replace("12ABC","[^a]*","gDp",[caseless,
- global])),
- <<"DTxabc">> = iolist_to_binary(re:replace("12abc","[^a]*+","D\\1T\\1x",[caseless])),
- <<"DTxDTxaDTxDTx">> = iolist_to_binary(re:replace("12abc","[^a]*+","D\\1T\\1x",[caseless,
- global])),
- <<"KJ12jqgNXmTv12lyEP12SABC">> = iolist_to_binary(re:replace("12ABC","[^a]*+","KJ&jqgNXm\\1Tv&lyE\\1P&S",[caseless])),
- <<"KJ12jqgNXmTv12lyEP12SKJjqgNXmTvlyEPSAKJBCjqgNXmTvBClyEPBCSKJjqgNXmTvlyEPS">> = iolist_to_binary(re:replace("12ABC","[^a]*+","KJ&jqgNXm\\1Tv&lyE\\1P&S",[caseless,
+ <<"rFmutNbLVErIdadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)+","rFmutN\\1bLVE\\1r&Id",[])),
+ <<"rFmutNbLVErIdadc">> = iolist_to_binary(re:replace("adc","(?(?=.*b)b|^)+","rFmutN\\1bLVE\\1r&Id",[global])),
+ <<"auGFbmOYWc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)+","uGF&mOYW",[])),
+ <<"auGFbmOYWc">> = iolist_to_binary(re:replace("abc","(?(?=.*b)b|^)+","uGF&mOYW",[global])),
+ <<"aLwwyNOhXnbPc">> = iolist_to_binary(re:replace("abc","(?(?=b).*b|^d)","L\\1wwyNOhXn&P",[])),
+ <<"aLwwyNOhXnbPc">> = iolist_to_binary(re:replace("abc","(?(?=b).*b|^d)","L\\1wwyNOhXn&P",[global])),
+ <<"asLUhduQyBc">> = iolist_to_binary(re:replace("abc","(?(?=.*b).*b|^d)","asLUhdu\\1Q\\1yB",[])),
+ <<"asLUhduQyBc">> = iolist_to_binary(re:replace("abc","(?(?=.*b).*b|^d)","asLUhdu\\1Q\\1yB",[global])),
+ <<"fiC%ab%h%ab%TxFpRPHS">> = iolist_to_binary(re:replace("%ab%","^%((?(?=[a])[^%])|b)*%$","fiC\\1&h&\\1TxFpRPHS",[])),
+ <<"fiC%ab%h%ab%TxFpRPHS">> = iolist_to_binary(re:replace("%ab%","^%((?(?=[a])[^%])|b)*%$","fiC\\1&h&\\1TxFpRPHS",[global])),
+ <<"XRMNILOabxXkxRwpX">> = iolist_to_binary(re:replace("XabX","(?i)a(?-i)b|c","\\1RMNILO&xX\\1kxRwp\\1",[])),
+ <<"XRMNILOabxXkxRwpX">> = iolist_to_binary(re:replace("XabX","(?i)a(?-i)b|c","\\1RMNILO&xX\\1kxRwp\\1",[global])),
+ <<"XvAGipJAbWX">> = iolist_to_binary(re:replace("XAbX","(?i)a(?-i)b|c","vAGipJ&W",[])),
+ <<"XvAGipJAbWX">> = iolist_to_binary(re:replace("XAbX","(?i)a(?-i)b|c","vAGipJ&W",[global])),
+ <<"CecknrhbVOUlbPhcC">> = iolist_to_binary(re:replace("CcC","(?i)a(?-i)b|c","e&knr\\1hbV\\1O\\1\\1UlbPh&",[])),
+ <<"CecknrhbVOUlbPhcC">> = iolist_to_binary(re:replace("CcC","(?i)a(?-i)b|c","e&knr\\1hbV\\1O\\1\\1UlbPh&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?i)a(?-i)b|c","oY\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?i)a(?-i)b|c","oY\\1",[global])),
+ <<"XABX">> = iolist_to_binary(re:replace("XABX","(?i)a(?-i)b|c","nMN",[])),
+ <<"XABX">> = iolist_to_binary(re:replace("XABX","(?i)a(?-i)b|c","nMN",[global])),
+ <<"
+ uhYqCJYVNVkjTafan">> = iolist_to_binary(re:replace("
+ ","[\\x00-\\xff\\s]+","&uhY\\1qCJYVNVkj\\1Tafan",[])),
+ <<"
+ uhYqCJYVNVkjTafan">> = iolist_to_binary(re:replace("
+ ","[\\x00-\\xff\\s]+","&uhY\\1qCJYVNVkj\\1Tafan",[global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","kAbCkN\\1XOTPWkPh",[caseless])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","kAbCkN\\1XOTPWkPh",[caseless,
+ global])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","&LHRW\\1vSiG&pKPe",[])),
+ <<"abc">> = iolist_to_binary(re:replace("abc","(abc)\\1","&LHRW\\1vSiG&pKPe",[global])),
+ <<"FPw12SGgbdRnHYs12Gabc">> = iolist_to_binary(re:replace("12abc","[^a]*","FPw&\\1SGgbdRnHYs&\\1G\\1",[caseless])),
+ <<"FPw12SGgbdRnHYs12GFPwSGgbdRnHYsGaFPwbcSGgbdRnHYsbcGFPwSGgbdRnHYsG">> = iolist_to_binary(re:replace("12abc","[^a]*","FPw&\\1SGgbdRnHYs&\\1G\\1",[caseless,
global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]*?X","Px&vXsBEFCysfMhDqV\\1P",[caseless])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]*?X","Px&vXsBEFCysfMhDqV\\1P",[caseless,
- global])),
- <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]*?X","q\\1a\\1jtOoCrLWAYsie",[caseless])),
- <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]*?X","q\\1a\\1jtOoCrLWAYsie",[caseless,
- global])),
- <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*?X","LCDXsQB\\1&fP&vNDlCH\\1",[caseless])),
- <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*?X","LCDXsQB\\1&fP&vNDlCH\\1",[caseless,
- global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]+?X","g&\\1\\1wRCp",[caseless])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]+?X","g&\\1\\1wRCp",[caseless,
- global])),
- <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]+?X","PO&\\1NINrfwP&\\1AcHiEa",[caseless])),
- <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]+?X","PO&\\1NINrfwP&\\1AcHiEa",[caseless,
+ <<"ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*","\\1",[caseless])),
+ <<"A">> = iolist_to_binary(re:replace("12ABC","[^a]*","\\1",[caseless,
+ global])),
+ <<"rwrXcjPYabc">> = iolist_to_binary(re:replace("12abc","[^a]*+","rw\\1r\\1XcjPY",[caseless])),
+ <<"rwrXcjPYrwrXcjPYarwrXcjPYrwrXcjPY">> = iolist_to_binary(re:replace("12abc","[^a]*+","rw\\1r\\1XcjPY",[caseless,
+ global])),
+ <<"12Ebhb12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*+","&Ebhb\\1&",[caseless])),
+ <<"12Ebhb12EbhbABCEbhbBCEbhb">> = iolist_to_binary(re:replace("12ABC","[^a]*+","&Ebhb\\1&",[caseless,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]*?X","vUGseV",[caseless])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]*?X","vUGseV",[caseless,
+ global])),
+ <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]*?X","p\\1\\1IMIKml&O&E",[caseless])),
+ <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]*?X","p\\1\\1IMIKml&O&E",[caseless,
+ global])),
+ <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*?X","x\\1",[caseless])),
+ <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]*?X","x\\1",[caseless,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]+?X","Y\\1KYtfghC",[caseless])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","[^a]+?X","Y\\1KYtfghC",[caseless,
+ global])),
+ <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]+?X","CjJxtxeRkNqWb",[caseless])),
+ <<"12abc">> = iolist_to_binary(re:replace("12abc","[^a]+?X","CjJxtxeRkNqWb",[caseless,
+ global])),
+ <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]+?X","\\1T&I\\1\\1UFIhN&\\1a",[caseless])),
+ <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]+?X","\\1T&I\\1\\1UFIhN&\\1a",[caseless,
global])),
- <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]+?X","LesucI&TIspq&O\\1AkOp",[caseless])),
- <<"12ABC">> = iolist_to_binary(re:replace("12ABC","[^a]+?X","LesucI&TIspq&O\\1AkOp",[caseless,
+ <<"12aTtXNbcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]?X","Tt&N",[caseless])),
+ <<"12aTtXNbTtcXN">> = iolist_to_binary(re:replace("12aXbcX","[^a]?X","Tt&N",[caseless,
+ global])),
+ <<"12AXkPyHlRCnbcTxXoIkgXPBCX">> = iolist_to_binary(re:replace("12AXBCX","[^a]?X","&kPyHlRCnbcTx&oIkg&P",[caseless])),
+ <<"12AXkPyHlRCnbcTxXoIkgXPBCXkPyHlRCnbcTxCXoIkgCXP">> = iolist_to_binary(re:replace("12AXBCX","[^a]?X","&kPyHlRCnbcTx&oIkg&P",[caseless,
global])),
- <<"12arSestlSfXbcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]?X","\\1rSestlSf\\1&",[caseless])),
- <<"12arSestlSfXbrSestlSfcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]?X","\\1rSestlSf\\1&",[caseless,
- global])),
- <<"12AVBtPBCX">> = iolist_to_binary(re:replace("12AXBCX","[^a]?X","VBtP",[caseless])),
- <<"12AVBtPBVBtP">> = iolist_to_binary(re:replace("12AXBCX","[^a]?X","VBtP",[caseless,
+ <<"BCXABigfWDnwCXJ">> = iolist_to_binary(re:replace("BCX","[^a]?X","&ABigfWDnw&J",[caseless])),
+ <<"BCXABigfWDnwCXJ">> = iolist_to_binary(re:replace("BCX","[^a]?X","&ABigfWDnw&J",[caseless,
+ global])),
+ <<"12aYXWbgOvNcDMXVYThubcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]??X","YX\\1\\1WbgOvNcDM&VYTh\\1u",[caseless])),
+ <<"12aYXWbgOvNcDMXVYThubYXWbgOvNcDMcXVYThu">> = iolist_to_binary(re:replace("12aXbcX","[^a]??X","YX\\1\\1WbgOvNcDM&VYTh\\1u",[caseless,
+ global])),
+ <<"12AEpmXPCouNXdKStKXBCX">> = iolist_to_binary(re:replace("12AXBCX","[^a]??X","Epm&PCouN&dKStK&",[caseless])),
+ <<"12AEpmXPCouNXdKStKXBEpmCXPCouNCXdKStKCX">> = iolist_to_binary(re:replace("12AXBCX","[^a]??X","Epm&PCouN&dKStK&",[caseless,
+ global])),
+ <<"BaCXpoxfpseXfNhG">> = iolist_to_binary(re:replace("BCX","[^a]??X","a\\1&po\\1x\\1fps\\1eXfNhG",[caseless])),
+ <<"BaCXpoxfpseXfNhG">> = iolist_to_binary(re:replace("BCX","[^a]??X","a\\1&po\\1x\\1fps\\1eXfNhG",[caseless,
+ global])),
+ <<"12aXbgfcXfFQYBVbwm">> = iolist_to_binary(re:replace("12aXbcX","[^a]?+X","gf&fFQYBVbwm",[caseless])),
+ <<"12aXbgfcXfFQYBVbwm">> = iolist_to_binary(re:replace("12aXbcX","[^a]?+X","gf&fFQYBVbwm",[caseless,
+ global])),
+ <<"12AXBehBuhCXqmVsCXWtCXg">> = iolist_to_binary(re:replace("12AXBCX","[^a]?+X","ehBuh&q\\1\\1mV\\1s\\1&Wt&g",[caseless])),
+ <<"12AXBehBuhCXqmVsCXWtCXg">> = iolist_to_binary(re:replace("12AXBCX","[^a]?+X","ehBuh&q\\1\\1mV\\1s\\1&Wt&g",[caseless,
+ global])),
+ <<"BQ">> = iolist_to_binary(re:replace("BCX","[^a]?+X","Q",[caseless])),
+ <<"BQ">> = iolist_to_binary(re:replace("BCX","[^a]?+X","Q",[caseless,
+ global])),
+ <<"ayFHgvqLgSIvMef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}","\\1yFHgvq\\1LgSIvM",[caseless])),
+ <<"ayFHgvqLgSIvMyFHgvqLgSIvM">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}","\\1yFHgvq\\1LgSIvM",[caseless,
+ global])),
+ <<"ADLEECoGfLBCDtOKBYRuEPEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}","\\1DLEECoGfL&tOKBYRuEP",[caseless])),
+ <<"ADLEECoGfLBCDtOKBYRuEPDLEECoGfLEFtOKBYRuEP">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}","\\1DLEECoGfL&tOKBYRuEP",[caseless,
+ global])),
+ <<"aUeRruprbcLyGdbcOBlHdef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}?","UeRrup\\1r\\1&Ly\\1Gd&OBlH",[caseless])),
+ <<"aUeRruprbcLyGdbcOBlHUeRruprdeLyGddeOBlHf">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}?","UeRrup\\1r\\1&Ly\\1Gd&OBlH",[caseless,
+ global])),
+ <<"AmqfmUDEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}?","mqfmU",[caseless])),
+ <<"AmqfmUmqfmUF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}?","mqfmU",[caseless,
+ global])),
+ <<"ajef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}+","j",[caseless])),
+ <<"ajj">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}+","j",[caseless,
global])),
- <<"BCXcYCXS">> = iolist_to_binary(re:replace("BCX","[^a]?X","&cY&S\\1",[caseless])),
- <<"BCXcYCXS">> = iolist_to_binary(re:replace("BCX","[^a]?X","&cY&S\\1",[caseless,
- global])),
- <<"12aMPavbiGCbcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]??X","MPavbi\\1GC",[caseless])),
- <<"12aMPavbiGCbMPavbiGC">> = iolist_to_binary(re:replace("12aXbcX","[^a]??X","MPavbi\\1GC",[caseless,
- global])),
- <<"12AOTaIyfCCPBCX">> = iolist_to_binary(re:replace("12AXBCX","[^a]??X","OTaIy\\1fC\\1CP",[caseless])),
- <<"12AOTaIyfCCPBOTaIyfCCP">> = iolist_to_binary(re:replace("12AXBCX","[^a]??X","OTaIy\\1fC\\1CP",[caseless,
- global])),
- <<"BCXlQqcJ">> = iolist_to_binary(re:replace("BCX","[^a]??X","&\\1l\\1QqcJ",[caseless])),
- <<"BCXlQqcJ">> = iolist_to_binary(re:replace("BCX","[^a]??X","&\\1l\\1QqcJ",[caseless,
- global])),
- <<"12aXbEPWWBEweltvRcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]?+X","EPWWBEweltvR&",[caseless])),
- <<"12aXbEPWWBEweltvRcX">> = iolist_to_binary(re:replace("12aXbcX","[^a]?+X","EPWWBEweltvR&",[caseless,
- global])),
- <<"12AXBLDKxRfr">> = iolist_to_binary(re:replace("12AXBCX","[^a]?+X","LD\\1KxRfr",[caseless])),
- <<"12AXBLDKxRfr">> = iolist_to_binary(re:replace("12AXBCX","[^a]?+X","LD\\1KxRfr",[caseless,
- global])),
- <<"BaWkje">> = iolist_to_binary(re:replace("BCX","[^a]?+X","aWkje",[caseless])),
- <<"BaWkje">> = iolist_to_binary(re:replace("BCX","[^a]?+X","aWkje",[caseless,
- global])),
- <<"alsDrlAVvgef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}","lsDrlAVvg",[caseless])),
- <<"alsDrlAVvglsDrlAVvg">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}","lsDrlAVvg",[caseless,
+ <<"AmBCDGmEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}+","m\\1&Gm",[caseless])),
+ <<"AmBCDGmmEFGm">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}+","m\\1&Gm",[caseless,
global])),
- <<"AWnBBhxrEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}","WnBBhxr\\1",[caseless])),
- <<"AWnBBhxrWnBBhxr">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}","WnBBhxr\\1",[caseless,
- global])),
- <<"aQlBRWDWodef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}?","QlBRWDWo",[caseless])),
- <<"aQlBRWDWoQlBRWDWof">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}?","QlBRWDWo",[caseless,
- global])),
- <<"ADysgJSywfPBCKKUUWYDEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}?","DysgJSywfP\\1&KKUUWY",[caseless])),
- <<"ADysgJSywfPBCKKUUWYDysgJSywfPDEKKUUWYF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}?","DysgJSywfP\\1&KKUUWY",[caseless,
- global])),
- <<"aWjgnJGWef">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}+","WjgnJ\\1GW",[caseless])),
- <<"aWjgnJGWWjgnJGW">> = iolist_to_binary(re:replace("abcdef","[^a]{2,3}+","WjgnJ\\1GW",[caseless,
- global])),
- <<"ArlhBCDwHgMHHwjEiAEF">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}+","rlh&wHgMHHwjEiA",[caseless])),
- <<"ArlhBCDwHgMHHwjEiArlhEFwHgMHHwjEiA">> = iolist_to_binary(re:replace("ABCDEF","[^a]{2,3}+","rlh&wHgMHHwjEiA",[caseless,
- global])),
- <<"JdTSxtdMYhvAoaO">> = iolist_to_binary(re:replace("Z","((a|)+)+Z","JdTSxtdMYhv\\1AoaO",[])),
- <<"JdTSxtdMYhvAoaO">> = iolist_to_binary(re:replace("Z","((a|)+)+Z","JdTSxtdMYhv\\1AoaO",[global])),
+ <<"VQZqc">> = iolist_to_binary(re:replace("Z","((a|)+)+Z","VQ&qc",[])),
+ <<"VQZqc">> = iolist_to_binary(re:replace("Z","((a|)+)+Z","VQ&qc",[global])),
ok.
run38() ->
- <<"dAWFejmOJacpU">> = iolist_to_binary(re:replace("ac","(a)b|(a)c","dA\\1\\1WFejmOJ&pU",[])),
- <<"dAWFejmOJacpU">> = iolist_to_binary(re:replace("ac","(a)b|(a)c","dA\\1\\1WFejmOJ&pU",[global])),
- <<"XacWp">> = iolist_to_binary(re:replace("ac","(?>(a))b|(a)c","X&Wp",[])),
- <<"XacWp">> = iolist_to_binary(re:replace("ac","(?>(a))b|(a)c","X&Wp",[global])),
- <<"VypacbfdlXdCGJofacdRt">> = iolist_to_binary(re:replace("ac","(?=(a))ab|(a)c","Vyp&bfdlXdCGJo\\1f&dRt",[])),
- <<"VypacbfdlXdCGJofacdRt">> = iolist_to_binary(re:replace("ac","(?=(a))ab|(a)c","Vyp&bfdlXdCGJo\\1f&dRt",[global])),
- <<"soXacAL">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)","soX&AL",[])),
- <<"soXacAL">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)","soX&AL",[global])),
- <<"ackacTacsYVlYVjKacCEL">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)++","&k\\1T&sYVlYVjK&CEL",[])),
- <<"ackacTacsYVlYVjKacCEL">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)++","&k\\1T&sYVlYVjK&CEL",[global])),
- <<"qiUiactJ">> = iolist_to_binary(re:replace("ac","(?:(?>(a))b|(a)c)++","qiUi&tJ\\1",[])),
- <<"qiUiactJ">> = iolist_to_binary(re:replace("ac","(?:(?>(a))b|(a)c)++","qiUi&tJ\\1",[global])),
- <<"KkacqeX">> = iolist_to_binary(re:replace("ac","(?=(?>(a))b|(a)c)(..)","Kk&qeX",[])),
- <<"KkacqeX">> = iolist_to_binary(re:replace("ac","(?=(?>(a))b|(a)c)(..)","Kk&qeX",[global])),
- <<"dtNNac">> = iolist_to_binary(re:replace("ac","(?>(?>(a))b|(a)c)","dtNN&",[])),
- <<"dtNNac">> = iolist_to_binary(re:replace("ac","(?>(?>(a))b|(a)c)","dtNN&",[global])),
- <<"maaaabaaabaababGEUEgWaaaabaaabaababRaaaabaaabaababYtLSDKaaaabaaabaababA">> = iolist_to_binary(re:replace("aaaabaaabaabab","((?>(a+)b)+(aabab))","m&GEUEgW\\1R&YtLSDK\\1A",[])),
- <<"maaaabaaabaababGEUEgWaaaabaaabaababRaaaabaaabaababYtLSDKaaaabaaabaababA">> = iolist_to_binary(re:replace("aaaabaaabaabab","((?>(a+)b)+(aabab))","m&GEUEgW\\1R&YtLSDK\\1A",[global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+?c","hd\\1shPpIuFmAa\\1aJk&q",[])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+?c","hd\\1shPpIuFmAa\\1aJk&q",[global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+c","ekKjsw&",[])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+c","ekKjsw&",[global])),
- <<"KRQcpPbvHhi">> = iolist_to_binary(re:replace("aabc","(?:a+|ab)+c","KRQcpPbvHhi",[])),
- <<"KRQcpPbvHhi">> = iolist_to_binary(re:replace("aabc","(?:a+|ab)+c","KRQcpPbvHhi",[global])),
- <<"iamaarURhafOTI">> = iolist_to_binary(re:replace("a","(?(?=(a))a)","i&m&&rURh\\1fOTI",[])),
- <<"iamaarURhafOTIimrURhfOTI">> = iolist_to_binary(re:replace("a","(?(?=(a))a)","i&m&&rURh\\1fOTI",[global])),
- <<"aba">> = iolist_to_binary(re:replace("ab","(?(?=(a))a)(b)","&a",[])),
- <<"aba">> = iolist_to_binary(re:replace("ab","(?(?=(a))a)(b)","&a",[global])),
- <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)++c","Siik\\1BdqOkNdp\\1",[])),
- <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)++c","Siik\\1BdqOkNdp\\1",[global])),
- <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?>a|ab)++c","LpFM&EcaXt\\1b\\1",[])),
- <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?>a|ab)++c","LpFM&EcaXt\\1b\\1",[global])),
- <<"FNLSSaaaabcr">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)+c","FNLSS&r",[])),
- <<"FNLSSaaaabcr">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)+c","FNLSS&r",[global])),
- <<"TxGxyzQbpeqVTpoEkrYqxyz">> = iolist_to_binary(re:replace("xyz","(?=abc){0}xyz","TxG\\1&QbpeqVTpoEkrYq&",[])),
- <<"TxGxyzQbpeqVTpoEkrYqxyz">> = iolist_to_binary(re:replace("xyz","(?=abc){0}xyz","TxG\\1&QbpeqVTpoEkrYq&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?=abc){1}xyz","cR\\1y\\1Q\\1&okEra\\1h",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?=abc){1}xyz","cR\\1y\\1Q\\1&okEra\\1h",[global])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","(?=abc){1}xyz","reg\\1lU\\1RfQVPuOHJA\\1Cq",[])),
- <<"xyz">> = iolist_to_binary(re:replace("xyz","(?=abc){1}xyz","reg\\1lU\\1RfQVPuOHJA\\1Cq",[global])),
- <<"xcPaaLxpkaXVHb">> = iolist_to_binary(re:replace("ab","(?=(a))?.","xcP\\1aLxpkaXVH",[])),
- <<"xcPaaLxpkaXVHxcPaLxpkaXVH">> = iolist_to_binary(re:replace("ab","(?=(a))?.","xcP\\1aLxpkaXVH",[global])),
- <<"sOiVGLUSbixjsOGc">> = iolist_to_binary(re:replace("bc","(?=(a))?.","s\\1OiVGLUS&ixjsOG",[])),
- <<"sOiVGLUSbixjsOGsOiVGLUScixjsOG">> = iolist_to_binary(re:replace("bc","(?=(a))?.","s\\1OiVGLUS&ixjsOG",[global])),
+ <<"PuyLdacsxAquacIQeUSo">> = iolist_to_binary(re:replace("ac","(a)b|(a)c","PuyLd&sxAqu&IQ\\1\\1eUSo",[])),
+ <<"PuyLdacsxAquacIQeUSo">> = iolist_to_binary(re:replace("ac","(a)b|(a)c","PuyLd&sxAqu&IQ\\1\\1eUSo",[global])),
+ <<"PfacaR">> = iolist_to_binary(re:replace("ac","(?>(a))b|(a)c","Pf&aR",[])),
+ <<"PfacaR">> = iolist_to_binary(re:replace("ac","(?>(a))b|(a)c","Pf&aR",[global])),
+ <<"acFJaBfLkqacLOtea">> = iolist_to_binary(re:replace("ac","(?=(a))ab|(a)c","&FJaBfLkq&LOtea",[])),
+ <<"acFJaBfLkqacLOtea">> = iolist_to_binary(re:replace("ac","(?=(a))ab|(a)c","&FJaBfLkq&LOtea",[global])),
+ <<"acGacsLawsVtbac">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)","\\1G&sLawsVtb\\1",[])),
+ <<"acGacsLawsVtbac">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)","\\1G&sLawsVtb\\1",[global])),
+ <<"acacoiIuacXacacraccbxYvQLU">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)++","&&oiIu&X\\1&r\\1cbxYvQLU",[])),
+ <<"acacoiIuacXacacraccbxYvQLU">> = iolist_to_binary(re:replace("ac","((?>(a))b|(a)c)++","&&oiIu&X\\1&r\\1cbxYvQLU",[global])),
+ <<"Gg">> = iolist_to_binary(re:replace("ac","(?:(?>(a))b|(a)c)++","\\1Gg",[])),
+ <<"Gg">> = iolist_to_binary(re:replace("ac","(?:(?>(a))b|(a)c)++","\\1Gg",[global])),
+ <<"unjEacjaceFacYac">> = iolist_to_binary(re:replace("ac","(?=(?>(a))b|(a)c)(..)","\\1u\\1njE&\\1j\\1&e\\1F&Y&\\1",[])),
+ <<"unjEacjaceFacYac">> = iolist_to_binary(re:replace("ac","(?=(?>(a))b|(a)c)(..)","\\1u\\1njE&\\1j\\1&e\\1F&Y&\\1",[global])),
+ <<"vacJbYTacPQOPmacrKp">> = iolist_to_binary(re:replace("ac","(?>(?>(a))b|(a)c)","v&JbYT&PQOPm&rKp",[])),
+ <<"vacJbYTacPQOPmacrKp">> = iolist_to_binary(re:replace("ac","(?>(?>(a))b|(a)c)","v&JbYT&PQOPm&rKp",[global])),
+ <<"n">> = iolist_to_binary(re:replace("aaaabaaabaabab","((?>(a+)b)+(aabab))","n",[])),
+ <<"n">> = iolist_to_binary(re:replace("aaaabaaabaabab","((?>(a+)b)+(aabab))","n",[global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+?c","wTE",[])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+?c","wTE",[global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+c","IcRpe",[])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","(?>a+|ab)+c","IcRpe",[global])),
+ <<"DJtCudRWwbqgG">> = iolist_to_binary(re:replace("aabc","(?:a+|ab)+c","DJtCudRWwbqgG",[])),
+ <<"DJtCudRWwbqgG">> = iolist_to_binary(re:replace("aabc","(?:a+|ab)+c","DJtCudRWwbqgG",[global])),
+ <<"aaaSoBtHaacWirPkada">> = iolist_to_binary(re:replace("a","(?(?=(a))a)","\\1\\1&SoBtH&&cWirPk&da",[])),
+ <<"aaaSoBtHaacWirPkadaSoBtHcWirPkda">> = iolist_to_binary(re:replace("a","(?(?=(a))a)","\\1\\1&SoBtH&&cWirPk&da",[global])),
+ <<"xSIuiabsLIGaaPOY">> = iolist_to_binary(re:replace("ab","(?(?=(a))a)(b)","xSIui\\1bsLIG\\1\\1POY",[])),
+ <<"xSIuiabsLIGaaPOY">> = iolist_to_binary(re:replace("ab","(?(?=(a))a)(b)","xSIui\\1bsLIG\\1\\1POY",[global])),
+ <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)++c","G",[])),
+ <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)++c","G",[global])),
+ <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?>a|ab)++c","DPoYmBjVu",[])),
+ <<"aaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?>a|ab)++c","DPoYmBjVu",[global])),
+ <<"Khaaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)+c","Kh&\\1",[])),
+ <<"Khaaaabc">> = iolist_to_binary(re:replace("aaaabc","^(?:a|ab)+c","Kh&\\1",[global])),
+ <<"hxyzMPAlxyzbeeMvcxyzFnYVJ">> = iolist_to_binary(re:replace("xyz","(?=abc){0}xyz","h&MPAl&beeMvc&FnYVJ",[])),
+ <<"hxyzMPAlxyzbeeMvcxyzFnYVJ">> = iolist_to_binary(re:replace("xyz","(?=abc){0}xyz","h&MPAl&beeMvc&FnYVJ",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?=abc){1}xyz","pskDi\\1Vp\\1\\1KjCOoy&",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?=abc){1}xyz","pskDi\\1Vp\\1\\1KjCOoy&",[global])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","(?=abc){1}xyz","\\1P\\1h&aRQ",[])),
+ <<"xyz">> = iolist_to_binary(re:replace("xyz","(?=abc){1}xyz","\\1P\\1h&aRQ",[global])),
+ <<"aaPvGqLaOcNadob">> = iolist_to_binary(re:replace("ab","(?=(a))?.","a\\1PvGqL&OcN&do",[])),
+ <<"aaPvGqLaOcNadoaPvGqLbOcNbdo">> = iolist_to_binary(re:replace("ab","(?=(a))?.","a\\1PvGqL&OcN&do",[global])),
+ <<"nEGDfiQkQbbc">> = iolist_to_binary(re:replace("bc","(?=(a))?.","nEGDfiQkQ&&",[])),
+ <<"nEGDfiQkQbbnEGDfiQkQcc">> = iolist_to_binary(re:replace("bc","(?=(a))?.","nEGDfiQkQ&&",[global])),
ok.
run39() ->
- <<"VDuEPkfWcTxyeUaBWb">> = iolist_to_binary(re:replace("ab","(?=(a))??.","VDuEPkfWcTxyeU&BW",[])),
- <<"VDuEPkfWcTxyeUaBWVDuEPkfWcTxyeUbBW">> = iolist_to_binary(re:replace("ab","(?=(a))??.","VDuEPkfWcTxyeU&BW",[global])),
- <<"mbbCUVsGVbqKPXic">> = iolist_to_binary(re:replace("bc","(?=(a))??.","m&bCUVsGVbqKPXi",[])),
- <<"mbbCUVsGVbqKPXimcbCUVsGVbqKPXi">> = iolist_to_binary(re:replace("bc","(?=(a))??.","m&bCUVsGVbqKPXi",[global])),
- <<"vckgammon">> = iolist_to_binary(re:replace("backgammon","^(?=(a)){0}b(?1)","v",[])),
- <<"vckgammon">> = iolist_to_binary(re:replace("backgammon","^(?=(a)){0}b(?1)","v",[global])),
- <<"jwhBBBtpN">> = iolist_to_binary(re:replace("abd","^(?=(?1))?[az]([abc])d","jwhBBBtpN",[])),
- <<"jwhBBBtpN">> = iolist_to_binary(re:replace("abd","^(?=(?1))?[az]([abc])d","jwhBBBtpN",[global])),
- <<"zcdBcKYPcEyoXnxVFxx">> = iolist_to_binary(re:replace("zcdxx","^(?=(?1))?[az]([abc])d","&B\\1KYPcEyoXnxVF",[])),
- <<"zcdBcKYPcEyoXnxVFxx">> = iolist_to_binary(re:replace("zcdxx","^(?=(?1))?[az]([abc])d","&B\\1KYPcEyoXnxVF",[global])),
- <<"eaaaaacuRrwVlw">> = iolist_to_binary(re:replace("aaaaa","^(?!a){0}\\w+","e&cuR\\1rwVlw",[])),
- <<"eaaaaacuRrwVlw">> = iolist_to_binary(re:replace("aaaaa","^(?!a){0}\\w+","e&cuR\\1rwVlw",[global])),
- <<"abcrjCWbwUOujlotBJKabcTxyz">> = iolist_to_binary(re:replace("abcxyz","(?<=(abc))?xyz","rjCWbwUOujlotBJK\\1T&",[])),
- <<"abcrjCWbwUOujlotBJKabcTxyz">> = iolist_to_binary(re:replace("abcxyz","(?<=(abc))?xyz","rjCWbwUOujlotBJK\\1T&",[global])),
- <<"pqrMKeGrgiv">> = iolist_to_binary(re:replace("pqrxyz","(?<=(abc))?xyz","MKeGrgi\\1v",[])),
- <<"pqrMKeGrgiv">> = iolist_to_binary(re:replace("pqrxyz","(?<=(abc))?xyz","MKeGrgi\\1v",[global])),
- <<"RxQ">> = iolist_to_binary(re:replace("ggg<<<aaa>>>","^[\\g<a>]+","\\1RxQ",[])),
- <<"RxQ">> = iolist_to_binary(re:replace("ggg<<<aaa>>>","^[\\g<a>]+","\\1RxQ",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\g<a>]+","dH",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\g<a>]+","dH",[global])),
- <<"\\ga">> = iolist_to_binary(re:replace("\\ga","^[\\g<a>]+","Uga",[])),
- <<"\\ga">> = iolist_to_binary(re:replace("\\ga","^[\\g<a>]+","Uga",[global])),
- <<"kGIjWAmWxlixyz">> = iolist_to_binary(re:replace("gggagagaxyz","^[\\ga]+","kGIjWAmWxli",[])),
- <<"kGIjWAmWxlixyz">> = iolist_to_binary(re:replace("gggagagaxyz","^[\\ga]+","kGIjWAmWxli",[global])),
- <<"aaaa444:::osjAfaaaa444:::myeRjZ">> = iolist_to_binary(re:replace("aaaa444:::Z","^[:a[:digit:]]+","&\\1osjAf&my\\1e\\1Rj",[])),
- <<"aaaa444:::osjAfaaaa444:::myeRjZ">> = iolist_to_binary(re:replace("aaaa444:::Z","^[:a[:digit:]]+","&\\1osjAf&my\\1e\\1Rj",[global])),
- <<"qSUaaaa444:::bbbthaaaa444:::bbboRHpyZ">> = iolist_to_binary(re:replace("aaaa444:::bbbZ","^[:a[:digit:]:b]+","qSU&th&oR\\1Hpy",[])),
- <<"qSUaaaa444:::bbbthaaaa444:::bbboRHpyZ">> = iolist_to_binary(re:replace("aaaa444:::bbbZ","^[:a[:digit:]:b]+","qSU&th&oR\\1Hpy",[global])),
- <<"mxfweUe">> = iolist_to_binary(re:replace(":xxx:","[:a]xxx[b:]","mxf\\1weUe",[])),
- <<"mxfweUe">> = iolist_to_binary(re:replace(":xxx:","[:a]xxx[b:]","mxf\\1weUe",[global])),
- <<"xaaVrvSafReLAbLfQXc">> = iolist_to_binary(re:replace("xaabc","(?<=a{2})b","Vr\\1vSafReLA&\\1LfQX",[caseless])),
- <<"xaaVrvSafReLAbLfQXc">> = iolist_to_binary(re:replace("xaabc","(?<=a{2})b","Vr\\1vSafReLA&\\1LfQX",[caseless,
+ <<"pHaPSTCOlNb">> = iolist_to_binary(re:replace("ab","(?=(a))??.","pH&PSTC\\1OlN",[])),
+ <<"pHaPSTCOlNpHbPSTCOlN">> = iolist_to_binary(re:replace("ab","(?=(a))??.","pH&PSTC\\1OlN",[global])),
+ <<"jnEANc">> = iolist_to_binary(re:replace("bc","(?=(a))??.","j\\1nEA\\1N",[])),
+ <<"jnEANjnEAN">> = iolist_to_binary(re:replace("bc","(?=(a))??.","j\\1nEA\\1N",[global])),
+ <<"abdKPLVefHPcQ">> = iolist_to_binary(re:replace("abd","^(?=(?1))?[az]([abc])d","&KPLVefHPcQ",[])),
+ <<"abdKPLVefHPcQ">> = iolist_to_binary(re:replace("abd","^(?=(?1))?[az]([abc])d","&KPLVefHPcQ",[global])),
+ <<"kdvlzcdSEgEzcdiczcdrnUyHFzcdxx">> = iolist_to_binary(re:replace("zcdxx","^(?=(?1))?[az]([abc])d","kdvl&SEgE&i\\1&rnUyHF&",[])),
+ <<"kdvlzcdSEgEzcdiczcdrnUyHFzcdxx">> = iolist_to_binary(re:replace("zcdxx","^(?=(?1))?[az]([abc])d","kdvl&SEgE&i\\1&rnUyHF&",[global])),
+ <<"WusspaaaaaeVjGLaaaaanwQKJ">> = iolist_to_binary(re:replace("aaaaa","^(?!a){0}\\w+","Wussp\\1&eVjGL&nwQKJ",[])),
+ <<"WusspaaaaaeVjGLaaaaanwQKJ">> = iolist_to_binary(re:replace("aaaaa","^(?!a){0}\\w+","Wussp\\1&eVjGL&nwQKJ",[global])),
+ <<"abcKabcxyz">> = iolist_to_binary(re:replace("abcxyz","(?<=(abc))?xyz","K\\1&",[])),
+ <<"abcKabcxyz">> = iolist_to_binary(re:replace("abcxyz","(?<=(abc))?xyz","K\\1&",[global])),
+ <<"pqrFntxyzt">> = iolist_to_binary(re:replace("pqrxyz","(?<=(abc))?xyz","F\\1nt&t",[])),
+ <<"pqrFntxyzt">> = iolist_to_binary(re:replace("pqrxyz","(?<=(abc))?xyz","F\\1nt&t",[global])),
+ <<"ggg<<<aaa>>>OCbsBdbMyTuvtAF">> = iolist_to_binary(re:replace("ggg<<<aaa>>>","^[\\g<a>]+","\\1\\1&OCbsBdbM\\1yTuvtAF",[])),
+ <<"ggg<<<aaa>>>OCbsBdbMyTuvtAF">> = iolist_to_binary(re:replace("ggg<<<aaa>>>","^[\\g<a>]+","\\1\\1&OCbsBdbM\\1yTuvtAF",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\g<a>]+","emX&&&\\1S&&uUtF",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^[\\g<a>]+","emX&&&\\1S&&uUtF",[global])),
+ <<"\\ga">> = iolist_to_binary(re:replace("\\ga","^[\\g<a>]+","d&uwF&X",[])),
+ <<"\\ga">> = iolist_to_binary(re:replace("\\ga","^[\\g<a>]+","d&uwF&X",[global])),
+ <<"gggagagaaEPEjNmgggagagaxCdmimaxyz">> = iolist_to_binary(re:replace("gggagagaxyz","^[\\ga]+","&aEP\\1EjNm&xCdm\\1\\1ima",[])),
+ <<"gggagagaaEPEjNmgggagagaxCdmimaxyz">> = iolist_to_binary(re:replace("gggagagaxyz","^[\\ga]+","&aEP\\1EjNm&xCdm\\1\\1ima",[global])),
+ <<"LqguCZ">> = iolist_to_binary(re:replace("aaaa444:::Z","^[:a[:digit:]]+","LqguC",[])),
+ <<"LqguCZ">> = iolist_to_binary(re:replace("aaaa444:::Z","^[:a[:digit:]]+","LqguC",[global])),
+ <<"Yaaaa444:::bbbnaaaa444:::bbbOuZ">> = iolist_to_binary(re:replace("aaaa444:::bbbZ","^[:a[:digit:]:b]+","Y&n&Ou",[])),
+ <<"Yaaaa444:::bbbnaaaa444:::bbbOuZ">> = iolist_to_binary(re:replace("aaaa444:::bbbZ","^[:a[:digit:]:b]+","Y&n&Ou",[global])),
+ <<"n:xxx::xxx:H:xxx:u:xxx:EQfs">> = iolist_to_binary(re:replace(":xxx:","[:a]xxx[b:]","n&&H&\\1u&EQf\\1s",[])),
+ <<"n:xxx::xxx:H:xxx:u:xxx:EQfs">> = iolist_to_binary(re:replace(":xxx:","[:a]xxx[b:]","n&&H&\\1u&EQf\\1s",[global])),
+ <<"xaabErbtiYvhBJbTRc">> = iolist_to_binary(re:replace("xaabc","(?<=a{2})b","&Er&tiYv\\1hB\\1J&TR",[caseless])),
+ <<"xaabErbtiYvhBJbTRc">> = iolist_to_binary(re:replace("xaabc","(?<=a{2})b","&Er&tiYv\\1hB\\1J&TR",[caseless,
global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=a{2})b","fcR",[caseless])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=a{2})b","fcR",[caseless,
- global])),
- <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<=a{2})b","BoRyoqeTXWscX",[caseless])),
- <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<=a{2})b","BoRyoqeTXWscX",[caseless,
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=a{2})b","sIKbikA",[caseless])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=a{2})b","sIKbikA",[caseless,
global])),
- <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<!a{2})b","&",[caseless])),
- <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<!a{2})b","&",[caseless,
- global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<!a{2})b","\\1o\\1eK\\1cENK\\1&djd",[caseless])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<!a{2})b","\\1o\\1eK\\1cENK\\1&djd",[caseless,
- global])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<!a{2})b","&&o&KwHJm",[caseless])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<!a{2})b","&&o&KwHJm",[caseless,
+ <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<=a{2})b","v\\1WGLw&Aj\\1&P&yFV\\1oME",[caseless])),
+ <<"xabc">> = iolist_to_binary(re:replace("xabc","(?<=a{2})b","v\\1WGLw&Aj\\1&P&yFV\\1oME",[caseless,
+ global])),
+ <<"xaOLJBdVsbrNnobNc">> = iolist_to_binary(re:replace("xabc","(?<!a{2})b","OL\\1\\1JBdVs&rNno\\1bN",[caseless])),
+ <<"xaOLJBdVsbrNnobNc">> = iolist_to_binary(re:replace("xabc","(?<!a{2})b","OL\\1\\1JBdVs&rNno\\1bN",[caseless,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<!a{2})b","b\\1U",[caseless])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<!a{2})b","b\\1U",[caseless,
global])),
- <<"xa ccEEJTcFn">> = iolist_to_binary(re:replace("xa c","(?<=a\\h)c","&&EEJ\\1T&F\\1n",[])),
- <<"xa ccEEJTcFn">> = iolist_to_binary(re:replace("xa c","(?<=a\\h)c","&&EEJ\\1T&F\\1n",[global])),
- <<"axxYHmPRLyCdYeBCTMFc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","YHmPRLyCdYeBCTMF",[])),
- <<"axxYHmPRLyCdYeBCTMFc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","YHmPRLyCdYeBCTMF",[global])),
- <<"aAAIbac">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","I&a",[])),
- <<"aAAIbac">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","I&a",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","Qosgls",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","Qosgls",[global])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","Iry\\1",[])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","Iry\\1",[global])),
- <<"axxbbc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","&&",[caseless])),
- <<"axxbbc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","&&",[caseless,
- global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","oNddUdB\\1XA",[caseless])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","oNddUdB\\1XA",[caseless,
- global])),
- <<"aAAbc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","boNOPUMfK&\\1",[caseless])),
- <<"aAAbc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","boNOPUMfK&\\1",[caseless,
- global])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","W&iffNoQ\\1",[caseless])),
- <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","W&iffNoQ\\1",[caseless,
- global])),
- <<"abKnqCjyP">> = iolist_to_binary(re:replace("abc","(?<=a\\H)c","KnqCjyP",[])),
- <<"abKnqCjyP">> = iolist_to_binary(re:replace("abc","(?<=a\\H)c","KnqCjyP",[global])),
- <<"abTxeCfVaOhSYo">> = iolist_to_binary(re:replace("abc","(?<=a\\V)c","TxeCfV\\1aOhSYo",[])),
- <<"abTxeCfVaOhSYo">> = iolist_to_binary(re:replace("abc","(?<=a\\V)c","TxeCfV\\1aOhSYo",[global])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<!a{2})b","o",[caseless])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<!a{2})b","o",[caseless,
+ global])),
+ <<"xa is">> = iolist_to_binary(re:replace("xa c","(?<=a\\h)c","is",[])),
+ <<"xa is">> = iolist_to_binary(re:replace("xa c","(?<=a\\h)c","is",[global])),
+ <<"axxDuvhoTEpKLbLbc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","DuvhoTEpKLbL&",[])),
+ <<"axxDuvhoTEpKLbLbc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","DuvhoTEpKLbL&",[global])),
+ <<"aAAxbbbGc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","\\1\\1x&\\1&&G",[])),
+ <<"aAAxbbbGc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","\\1\\1x&\\1&&G",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","Nt&ll\\1w",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","Nt&ll\\1w",[global])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","R",[])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","R",[global])),
+ <<"axxCbPYhXc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","C&PYhX",[caseless])),
+ <<"axxCbPYhXc">> = iolist_to_binary(re:replace("axxbc","(?<=[^a]{2})b","C&PYhX",[caseless,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","d\\1jkBrqR&X&Fc\\1vd",[caseless])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=[^a]{2})b","d\\1jkBrqR&X&Fc\\1vd",[caseless,
+ global])),
+ <<"aAAbc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","KNABa\\1\\1wON\\1S",[caseless])),
+ <<"aAAbc">> = iolist_to_binary(re:replace("aAAbc","(?<=[^a]{2})b","KNABa\\1\\1wON\\1S",[caseless,
+ global])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","CQ&DXxjEdVkGvk\\1",[caseless])),
+ <<"xaabc">> = iolist_to_binary(re:replace("xaabc","(?<=[^a]{2})b","CQ&DXxjEdVkGvk\\1",[caseless,
+ global])),
+ <<"abcdTXqBlsLHncSPA">> = iolist_to_binary(re:replace("abc","(?<=a\\H)c","&dTXqBlsLH\\1n&SPA\\1",[])),
+ <<"abcdTXqBlsLHncSPA">> = iolist_to_binary(re:replace("abc","(?<=a\\H)c","&dTXqBlsLH\\1n&SPA\\1",[global])),
+ <<"abjV">> = iolist_to_binary(re:replace("abc","(?<=a\\V)c","jV",[])),
+ <<"abjV">> = iolist_to_binary(re:replace("abc","(?<=a\\V)c","jV",[global])),
<<"a
-gxsYrXgNx">> = iolist_to_binary(re:replace("a
-c","(?<=a\\v)c","g\\1\\1xs\\1Yr\\1XgN\\1x",[])),
+oscmdgX">> = iolist_to_binary(re:replace("a
+c","(?<=a\\v)c","os&mdgX",[])),
<<"a
-gxsYrXgNx">> = iolist_to_binary(re:replace("a
-c","(?<=a\\v)c","g\\1\\1xs\\1Yr\\1XgN\\1x",[global])),
- <<"XcccddYLX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)++Y","&L",[])),
- <<"XcccddYLX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)++Y","&L",[global])),
- <<"XjcccddYxcccddYymX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)*+Y","j&x\\1&\\1\\1ym",[])),
- <<"XjcccddYxcccddYymX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)*+Y","j&x\\1&\\1\\1ym",[global])),
+oscmdgX">> = iolist_to_binary(re:replace("a
+c","(?<=a\\v)c","os&mdgX",[global])),
+ <<"XYpwLicvrdWdBXRX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)++Y","YpwL\\1icvrdWdBXR",[])),
+ <<"XYpwLicvrdWdBXRX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)++Y","YpwL\\1icvrdWdBXR",[global])),
+ <<"XialhPX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)*+Y","ia\\1lhP\\1",[])),
+ <<"XialhPX">> = iolist_to_binary(re:replace("XcccddYX","(?(?=c)c|d)*+Y","ia\\1lhP\\1",[global])),
+ <<"aaaaaaaBYHaBaaaaaaaaaajJ">> = iolist_to_binary(re:replace("aaaaaaa","^(a{2,3}){2,}+a","&BYHaB\\1&jJ",[])),
+ <<"aaaaaaaBYHaBaaaaaaaaaajJ">> = iolist_to_binary(re:replace("aaaaaaa","^(a{2,3}){2,}+a","&BYHaB\\1&jJ",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3}){2,}+a","BVB",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3}){2,}+a","BVB",[global])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3}){2,}+a","&cSk&xmMuHJpt\\1&VoP",[])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3}){2,}+a","&cSk&xmMuHJpt\\1&VoP",[global])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a{2,3}){2,}+a","c",[])),
+ <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a{2,3}){2,}+a","c",[global])),
ok.
run40() ->
- <<"P">> = iolist_to_binary(re:replace("aaaaaaa","^(a{2,3}){2,}+a","P",[])),
- <<"P">> = iolist_to_binary(re:replace("aaaaaaa","^(a{2,3}){2,}+a","P",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3}){2,}+a","&AJ",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3}){2,}+a","&AJ",[global])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3}){2,}+a","bT&aphetNw&xcisR",[])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3}){2,}+a","bT&aphetNw&xcisR",[global])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a{2,3}){2,}+a","g",[])),
- <<"aaaaaaaaa">> = iolist_to_binary(re:replace("aaaaaaaaa","^(a{2,3}){2,}+a","g",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})++a","U",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})++a","U",[global])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})++a","CjQf&BIE\\1m&vHKyV",[])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})++a","CjQf&BIE\\1m&vHKyV",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})*+a","jEe&kL&\\1Wd",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})*+a","jEe&kL&\\1Wd",[global])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})*+a","&VFXL\\1JOa\\1dHl&Yw",[])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})*+a","&VFXL\\1JOa\\1dHl&Yw",[global])),
- <<"fByANGarQU">> = iolist_to_binary(re:replace("abXde","ab\\Cde","\\1fByANGarQ\\1U",[])),
- <<"fByANGarQU">> = iolist_to_binary(re:replace("abXde","ab\\Cde","\\1fByANGarQ\\1U",[global])),
- <<"abZdeXdDJIltBeDyobKXo">> = iolist_to_binary(re:replace("abZdeX","(?<=ab\\Cde)X","&dDJIltBeDyobK&o",[])),
- <<"abZdeXdDJIltBeDyobKXo">> = iolist_to_binary(re:replace("abZdeX","(?<=ab\\Cde)X","&dDJIltBeDyobK&o",[global])),
- <<"hv">> = iolist_to_binary(re:replace("aCb","a[\\CD]b","h\\1v",[])),
- <<"hv">> = iolist_to_binary(re:replace("aCb","a[\\CD]b","h\\1v",[global])),
- <<"waDbEkr">> = iolist_to_binary(re:replace("aDb","a[\\CD]b","w&Ekr",[])),
- <<"waDbEkr">> = iolist_to_binary(re:replace("aDb","a[\\CD]b","w&Ekr",[global])),
- <<"RCcE">> = iolist_to_binary(re:replace("aJb","a[\\C-X]b","R\\1CcE",[])),
- <<"RCcE">> = iolist_to_binary(re:replace("aJb","a[\\C-X]b","R\\1CcE",[global])),
- <<"X X">> = iolist_to_binary(re:replace("X X","\\H\\h\\V\\v","B&pquMp\\1NBcoPfQTdr\\1o",[])),
- <<"X X">> = iolist_to_binary(re:replace("X X","\\H\\h\\V\\v","B&pquMp\\1NBcoPfQTdr\\1o",[global])),
- <<"bjVX X X X OAvV">> = iolist_to_binary(re:replace("X X ","\\H\\h\\V\\v","bjV&&OAv\\1V",[])),
- <<"bjVX X X X OAvV">> = iolist_to_binary(re:replace("X X ","\\H\\h\\V\\v","bjV&&OAv\\1V",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H\\h\\V\\v","Y",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H\\h\\V\\v","Y",[global])),
- <<"  X">> = iolist_to_binary(re:replace("  X","\\H\\h\\V\\v","VrvLpiABSBWYG",[])),
- <<"  X">> = iolist_to_binary(re:replace("  X","\\H\\h\\V\\v","VrvLpiABSBWYG",[global])),
- <<"UibLPUMxnHgluPEcwP">> = iolist_to_binary(re:replace("  X
- ","\\H*\\h+\\V?\\v{3,4}","Ui\\1bLPUMxnHgluPEcwP",[])),
- <<"UibLPUMxnHgluPEcwP">> = iolist_to_binary(re:replace("  X
- ","\\H*\\h+\\V?\\v{3,4}","Ui\\1bLPUMxnHgluPEcwP",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})++a","GeKmc\\1WhXfk\\1TBYDb&Ca",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})++a","GeKmc\\1WhXfk\\1TBYDb&Ca",[global])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})++a","MMBt&lb\\1&jbxk",[])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})++a","MMBt&lb\\1&jbxk",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})*+a","pwt&tvQ&X\\1uUUqymOuO",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a{2,3})*+a","pwt&tvQ&X\\1uUUqymOuO",[global])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})*+a","\\1",[])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(a{2,3})*+a","\\1",[global])),
+ <<"ODb">> = iolist_to_binary(re:replace("abXde","ab\\Cde","ODb",[])),
+ <<"ODb">> = iolist_to_binary(re:replace("abXde","ab\\Cde","ODb",[global])),
+ <<"abZdeOUSVkwkXixHSXuXh">> = iolist_to_binary(re:replace("abZdeX","(?<=ab\\Cde)X","OUSVkw\\1k&ixHS\\1&u\\1&h",[])),
+ <<"abZdeOUSVkwkXixHSXuXh">> = iolist_to_binary(re:replace("abZdeX","(?<=ab\\Cde)X","OUSVkw\\1k&ixHS\\1&u\\1&h",[global])),
+ <<"wcl">> = iolist_to_binary(re:replace("aCb","a[\\CD]b","wcl",[])),
+ <<"wcl">> = iolist_to_binary(re:replace("aCb","a[\\CD]b","wcl",[global])),
+ <<"R">> = iolist_to_binary(re:replace("aDb","a[\\CD]b","R",[])),
+ <<"R">> = iolist_to_binary(re:replace("aDb","a[\\CD]b","R",[global])),
+ <<"aJbUeGhRaJb">> = iolist_to_binary(re:replace("aJb","a[\\C-X]b","&UeGhR&",[])),
+ <<"aJbUeGhRaJb">> = iolist_to_binary(re:replace("aJb","a[\\C-X]b","&UeGhR&",[global])),
+ <<"X X">> = iolist_to_binary(re:replace("X X","\\H\\h\\V\\v","&e&aKbUC&nHH\\1qy\\1",[])),
+ <<"X X">> = iolist_to_binary(re:replace("X X","\\H\\h\\V\\v","&e&aKbUC&nHH\\1qy\\1",[global])),
+ <<"JqKpfdXTX X MbyX X X X ">> = iolist_to_binary(re:replace("X X ","\\H\\h\\V\\v","JqKpfdXT&Mby&\\1&",[])),
+ <<"JqKpfdXTX X MbyX X X X ">> = iolist_to_binary(re:replace("X X ","\\H\\h\\V\\v","JqKpfdXT&Mby&\\1&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H\\h\\V\\v","FAmVe\\1O",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H\\h\\V\\v","FAmVe\\1O",[global])),
+ <<"  X">> = iolist_to_binary(re:replace("  X","\\H\\h\\V\\v","\\1mSDSJp",[])),
+ <<"  X">> = iolist_to_binary(re:replace("  X","\\H\\h\\V\\v","\\1mSDSJp",[global])),
+ <<"JagFUGCxoJ  X
+ SMGCK">> = iolist_to_binary(re:replace("  X
+ ","\\H*\\h+\\V?\\v{3,4}","JagFUGCxoJ&\\1SMGCK",[])),
+ <<"JagFUGCxoJ  X
+ SMGCK">> = iolist_to_binary(re:replace("  X
+ ","\\H*\\h+\\V?\\v{3,4}","JagFUGCxoJ&\\1SMGCK",[global])),
+ <<"  
+ an  
+ uIjsv">> = iolist_to_binary(re:replace("  
+ ","\\H*\\h+\\V?\\v{3,4}","&an&\\1uIjsv\\1",[])),
<<"  
-  
- YOgvhC">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","&&YOgvhC\\1\\1",[])),
+ an  
+ uIjsv">> = iolist_to_binary(re:replace("  
+ ","\\H*\\h+\\V?\\v{3,4}","&an&\\1uIjsv\\1",[global])),
<<"  
-  
- YOgvhC">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","&&YOgvhC\\1\\1",[global])),
- <<"o  
- aixbY  
- BtbY">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","o&aixbY&BtbY\\1",[])),
- <<"o  
- aixbY  
- BtbY">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","o&aixbY&BtbY\\1",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H*\\h+\\V?\\v{3,4}","orCME\\1H",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H*\\h+\\V?\\v{3,4}","orCME\\1H",[global])),
+ Cnyt  
+ sJWoCUIsrr">> = iolist_to_binary(re:replace("  
+ ","\\H*\\h+\\V?\\v{3,4}","&C\\1nyt\\1\\1&\\1sJWoCUIsrr",[])),
+ <<"  
+ Cnyt  
+ sJWoCUIsrr">> = iolist_to_binary(re:replace("  
+ ","\\H*\\h+\\V?\\v{3,4}","&C\\1nyt\\1\\1&\\1sJWoCUIsrr",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H*\\h+\\V?\\v{3,4}","heJfENVeR\\1TJ\\1&&Dvf",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\H*\\h+\\V?\\v{3,4}","heJfENVeR\\1TJ\\1&&Dvf",[global])),
<<"  
">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","h&L\\1\\1wk\\1",[])),
+ ","\\H*\\h+\\V?\\v{3,4}","g&",[])),
<<"  
">> = iolist_to_binary(re:replace("  
- ","\\H*\\h+\\V?\\v{3,4}","h&L\\1\\1wk\\1",[global])),
- <<"XY aeVjRE">> = iolist_to_binary(re:replace("XY ABCDE","\\H{3,4}","aeVjR",[])),
- <<"XY aeVjRE">> = iolist_to_binary(re:replace("XY ABCDE","\\H{3,4}","aeVjR",[global])),
- <<"XY inwBHwGPQRKvfoDb ST">> = iolist_to_binary(re:replace("XY PQR ST","\\H{3,4}","in\\1wBHw\\1G&KvfoDb\\1",[])),
- <<"XY inwBHwGPQRKvfoDb ST">> = iolist_to_binary(re:replace("XY PQR ST","\\H{3,4}","in\\1wBHw\\1G&KvfoDb\\1",[global])),
- <<"XY AcCVYFB PYkLB PHB PFIQRB PBeQRS">> = iolist_to_binary(re:replace("XY AB PQRS",".\\h{3,4}.","\\1cCVYF&YkL&H&FIQR&Be",[])),
- <<"XY AcCVYFB PYkLB PHB PFIQRB PBeQRS">> = iolist_to_binary(re:replace("XY AB PQRS",".\\h{3,4}.","\\1cCVYF&YkL&H&FIQR&Be",[global])),
- <<">XNNNYZEbXNNNYZXNNNYZQsKnuk">> = iolist_to_binary(re:replace(">XNNNYZ","\\h*X\\h?\\H+Y\\H?Z","&E\\1b&&QsKnuk",[])),
- <<">XNNNYZEbXNNNYZXNNNYZQsKnuk">> = iolist_to_binary(re:replace(">XNNNYZ","\\h*X\\h?\\H+Y\\H?Z","&E\\1b&&QsKnuk",[global])),
- <<">m">> = iolist_to_binary(re:replace("> X NYQZ","\\h*X\\h?\\H+Y\\H?Z","m",[])),
- <<">m">> = iolist_to_binary(re:replace("> X NYQZ","\\h*X\\h?\\H+Y\\H?Z","m",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\h*X\\h?\\H+Y\\H?Z","W\\1BBQbt&HF\\1KkXwm\\1Vdn",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\h*X\\h?\\H+Y\\H?Z","W\\1BBQbt&HF\\1KkXwm\\1Vdn",[global])),
- <<">XYZ">> = iolist_to_binary(re:replace(">XYZ","\\h*X\\h?\\H+Y\\H?Z","&GW",[])),
- <<">XYZ">> = iolist_to_binary(re:replace(">XYZ","\\h*X\\h?\\H+Y\\H?Z","&GW",[global])),
- <<"> X NY Z">> = iolist_to_binary(re:replace("> X NY Z","\\h*X\\h?\\H+Y\\H?Z","JIYAqmdtuCSO",[])),
- <<"> X NY Z">> = iolist_to_binary(re:replace("> X NY Z","\\h*X\\h?\\H+Y\\H?Z","JIYAqmdtuCSO",[global])),
- <<">vctAlOgcGXY
+ ","\\H*\\h+\\V?\\v{3,4}","g&",[global])),
+ <<"XY bvHE">> = iolist_to_binary(re:replace("XY ABCDE","\\H{3,4}","bvH",[])),
+ <<"XY bvHE">> = iolist_to_binary(re:replace("XY ABCDE","\\H{3,4}","bvH",[global])),
+ <<"XY PQRGrQwU ST">> = iolist_to_binary(re:replace("XY PQR ST","\\H{3,4}","&GrQw\\1U",[])),
+ <<"XY PQRGrQwU ST">> = iolist_to_binary(re:replace("XY PQR ST","\\H{3,4}","&GrQw\\1U",[global])),
+ <<"XY AxeQRS">> = iolist_to_binary(re:replace("XY AB PQRS",".\\h{3,4}.","xe",[])),
+ <<"XY AxeQRS">> = iolist_to_binary(re:replace("XY AB PQRS",".\\h{3,4}.","xe",[global])),
+ <<">PvFpXNNNYZpueukCvxXNNNYZUJ">> = iolist_to_binary(re:replace(">XNNNYZ","\\h*X\\h?\\H+Y\\H?Z","PvFp&pueukCv\\1\\1\\1x&UJ",[])),
+ <<">PvFpXNNNYZpueukCvxXNNNYZUJ">> = iolist_to_binary(re:replace(">XNNNYZ","\\h*X\\h?\\H+Y\\H?Z","PvFp&pueukCv\\1\\1\\1x&UJ",[global])),
+ <<">enigqoQeBUc X NYQZFyFLjg">> = iolist_to_binary(re:replace("> X NYQZ","\\h*X\\h?\\H+Y\\H?Z","\\1enigqo\\1QeBUc&FyFLjg",[])),
+ <<">enigqoQeBUc X NYQZFyFLjg">> = iolist_to_binary(re:replace("> X NYQZ","\\h*X\\h?\\H+Y\\H?Z","\\1enigqo\\1QeBUc&FyFLjg",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\h*X\\h?\\H+Y\\H?Z","X",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\h*X\\h?\\H+Y\\H?Z","X",[global])),
+ <<">XYZ">> = iolist_to_binary(re:replace(">XYZ","\\h*X\\h?\\H+Y\\H?Z","CSYvJMwNrX\\1",[])),
+ <<">XYZ">> = iolist_to_binary(re:replace(">XYZ","\\h*X\\h?\\H+Y\\H?Z","CSYvJMwNrX\\1",[global])),
+ <<"> X NY Z">> = iolist_to_binary(re:replace("> X NY Z","\\h*X\\h?\\H+Y\\H?Z","WVcuLyAOpQ&",[])),
+ <<"> X NY Z">> = iolist_to_binary(re:replace("> X NY Z","\\h*X\\h?\\H+Y\\H?Z","WVcuLyAOpQ&",[global])),
+ <<">EXY
Z
-A NN h">> = iolist_to_binary(re:replace(">XY
+A NN PIMXY
Z
-A NN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","vc\\1tAl\\1O\\1gcG&h\\1",[])),
- <<">vctAlOgcGXY
+A NN Evk">> = iolist_to_binary(re:replace(">XY
Z
-A NN h">> = iolist_to_binary(re:replace(">XY
+A NN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","E&PIM\\1&E\\1vk",[])),
+ <<">EXY
Z
-A NN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","vc\\1tAl\\1O\\1gcG&h\\1",[global])),
- <<">bm
- X
-Y
- ZZZ
-AAA NNN uAMN">> = iolist_to_binary(re:replace(">
- X
-Y
- ZZZ
-AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","bm&\\1uAMN",[])),
- <<">bm
+A NN PIMXY
+Z
+A NN Evk">> = iolist_to_binary(re:replace(">XY
+Z
+A NN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","E&PIM\\1&E\\1vk",[global])),
+ <<">ux">> = iolist_to_binary(re:replace(">
X
Y
ZZZ
-AAA NNN uAMN">> = iolist_to_binary(re:replace(">
+AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","\\1ux",[])),
+ <<">ux">> = iolist_to_binary(re:replace(">
X
Y
ZZZ
-AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","bm&\\1uAMN",[global])),
- <<"foojypfoojma">> = iolist_to_binary(re:replace("foobar","(foo)\\Kbar","jyp\\1jma",[])),
- <<"foojypfoojma">> = iolist_to_binary(re:replace("foobar","(foo)\\Kbar","jyp\\1jma",[global])),
- <<"fooUcOiqwyxvfoobar">> = iolist_to_binary(re:replace("foobar","(foo)(\\Kbar|baz)","UcOiqwyxv\\1&",[])),
- <<"fooUcOiqwyxvfoobar">> = iolist_to_binary(re:replace("foobar","(foo)(\\Kbar|baz)","UcOiqwyxv\\1&",[global])),
- <<"xXfoobazTfoobazneSQcxWfooBA">> = iolist_to_binary(re:replace("foobaz","(foo)(\\Kbar|baz)","xX&T&neSQcxW\\1BA",[])),
- <<"xXfoobazTfoobazneSQcxWfooBA">> = iolist_to_binary(re:replace("foobaz","(foo)(\\Kbar|baz)","xX&T&neSQcxW\\1BA",[global])),
- <<"foovYnKbarbazVqfoobarheyiy">> = iolist_to_binary(re:replace("foobarbaz","(foo\\Kbar)baz","vYnK&Vq\\1heyiy",[])),
- <<"foovYnKbarbazVqfoobarheyiy">> = iolist_to_binary(re:replace("foobarbaz","(foo\\Kbar)baz","vYnK&Vq\\1heyiy",[global])),
- <<"wYDabPababababbbabZygQUbMBoQiXXXX">> = iolist_to_binary(re:replace("ababababbbabZXXXX","^(a(b))\\1\\g1\\g{1}\\g-1\\g{-1}\\g{-02}Z","wYD\\1P&ygQUbMBoQi",[])),
- <<"wYDabPababababbbabZygQUbMBoQiXXXX">> = iolist_to_binary(re:replace("ababababbbabZXXXX","^(a(b))\\1\\g1\\g{1}\\g-1\\g{-1}\\g{-02}Z","wYD\\1P&ygQUbMBoQi",[global])),
- <<"QJyUVPxY">> = iolist_to_binary(re:replace("tom-tom","(?<A>tom|bon)-\\g{A}","QJyUVPxY",[])),
- <<"QJyUVPxY">> = iolist_to_binary(re:replace("tom-tom","(?<A>tom|bon)-\\g{A}","QJyUVPxY",[global])),
- <<"bonvRbon-bonECJDijVbonbon-bonnbonYtaYv">> = iolist_to_binary(re:replace("bon-bon","(?<A>tom|bon)-\\g{A}","\\1vR&ECJDijV\\1&n\\1YtaYv",[])),
- <<"bonvRbon-bonECJDijVbonbon-bonnbonYtaYv">> = iolist_to_binary(re:replace("bon-bon","(?<A>tom|bon)-\\g{A}","\\1vR&ECJDijV\\1&n\\1YtaYv",[global])),
- <<"bacxxx">> = iolist_to_binary(re:replace("bacxxx","(^(a|b\\g{-1}))","B",[])),
- <<"bacxxx">> = iolist_to_binary(re:replace("bacxxx","(^(a|b\\g{-1}))","B",[global])),
- <<"abcHN">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))\\1","\\1HN",[])),
- <<"abcHN">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))\\1","\\1HN",[global])),
- <<"i">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))\\1","i",[])),
- <<"i">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))\\1","i",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))\\1","&RDdXS\\1",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))\\1","&RDdXS\\1",[global])),
- <<"abcxyz">> = iolist_to_binary(re:replace("abcxyz","(?|(abc)|(xyz))\\1","xvrTYMBEX",[])),
- <<"abcxyz">> = iolist_to_binary(re:replace("abcxyz","(?|(abc)|(xyz))\\1","xvrTYMBEX",[global])),
- <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))\\1","gkljK\\1CR\\1BykWHcqqC&G",[])),
- <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))\\1","gkljK\\1CR\\1BykWHcqqC&G",[global])),
+AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c","\\1ux",[global])),
+ <<"fooIlI">> = iolist_to_binary(re:replace("foobar","(foo)\\Kbar","IlI",[])),
+ <<"fooIlI">> = iolist_to_binary(re:replace("foobar","(foo)\\Kbar","IlI",[global])),
+ <<"fooMAfoowltkWfEDP">> = iolist_to_binary(re:replace("foobar","(foo)(\\Kbar|baz)","MA\\1wltkWfEDP",[])),
+ <<"fooMAfoowltkWfEDP">> = iolist_to_binary(re:replace("foobar","(foo)(\\Kbar|baz)","MA\\1wltkWfEDP",[global])),
+ <<"foobazhoMQ">> = iolist_to_binary(re:replace("foobaz","(foo)(\\Kbar|baz)","&hoMQ",[])),
+ <<"foobazhoMQ">> = iolist_to_binary(re:replace("foobaz","(foo)(\\Kbar|baz)","&hoMQ",[global])),
+ <<"fooenlbarbazfoobarOskJvtabarbazfoobarePBU">> = iolist_to_binary(re:replace("foobarbaz","(foo\\Kbar)baz","enl&\\1OskJvta&\\1ePBU",[])),
+ <<"fooenlbarbazfoobarOskJvtabarbazfoobarePBU">> = iolist_to_binary(re:replace("foobarbaz","(foo\\Kbar)baz","enl&\\1OskJvta&\\1ePBU",[global])),
+ <<"BDWEtomstom-tomtom-tom">> = iolist_to_binary(re:replace("tom-tom","(?<A>tom|bon)-\\g{A}","BDWE\\1s&&",[])),
+ <<"BDWEtomstom-tomtom-tom">> = iolist_to_binary(re:replace("tom-tom","(?<A>tom|bon)-\\g{A}","BDWE\\1s&&",[global])),
+ <<"wjbonFbon-bon">> = iolist_to_binary(re:replace("bon-bon","(?<A>tom|bon)-\\g{A}","wj\\1F&",[])),
+ <<"wjbonFbon-bon">> = iolist_to_binary(re:replace("bon-bon","(?<A>tom|bon)-\\g{A}","wj\\1F&",[global])),
+ <<"bacxxx">> = iolist_to_binary(re:replace("bacxxx","(^(a|b\\g{-1}))","Sx",[])),
+ <<"bacxxx">> = iolist_to_binary(re:replace("bacxxx","(^(a|b\\g{-1}))","Sx",[global])),
+ <<"H">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))\\1","H",[])),
+ <<"H">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))\\1","H",[global])),
+ <<"yxyzWcxyzxyzduabfPinElhSxyzxyzxyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))\\1","y\\1Wc&duabfPinElhS&&",[])),
+ <<"yxyzWcxyzxyzduabfPinElhSxyzxyzxyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))\\1","y\\1Wc&duabfPinElhS&&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))\\1","b\\1&layoQ",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))\\1","b\\1&layoQ",[global])),
+ <<"abcxyz">> = iolist_to_binary(re:replace("abcxyz","(?|(abc)|(xyz))\\1","pF",[])),
+ <<"abcxyz">> = iolist_to_binary(re:replace("abcxyz","(?|(abc)|(xyz))\\1","pF",[global])),
+ <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))\\1","GblOAJxEl",[])),
+ <<"xyzabc">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))\\1","GblOAJxEl",[global])),
+ <<"wDMUaJIhLW">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))(?1)","wDMUaJIhLW",[])),
+ <<"wDMUaJIhLW">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))(?1)","wDMUaJIhLW",[global])),
+ <<"uhDuxyzJEuDDxyzabcJKaxyzabcvdX">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))(?1)","uhDu\\1JEuDD&JKa&vdX",[])),
+ <<"uhDuxyzJEuDDxyzabcJKaxyzabcvdX">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))(?1)","uhDu\\1JEuDD&JKa&vdX",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))(?1)","oUFI&utTyJ",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))(?1)","oUFI&utTyJ",[global])),
+ <<"xyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))(?1)","ib\\1&erlkw&wuHdHNtS",[])),
+ <<"xyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))(?1)","ib\\1&erlkw&wuHdHNtS",[global])),
ok.
run41() ->
- <<"EaIdWBoabck">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))(?1)","EaIdWBo\\1k",[])),
- <<"EaIdWBoabck">> = iolist_to_binary(re:replace("abcabc","(?|(abc)|(xyz))(?1)","EaIdWBo\\1k",[global])),
- <<"xyzabcxyzxyzMvxyzjgRaou">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))(?1)","&\\1\\1Mv\\1jgRaou",[])),
- <<"xyzabcxyzxyzMvxyzjgRaou">> = iolist_to_binary(re:replace("xyzabc","(?|(abc)|(xyz))(?1)","&\\1\\1Mv\\1jgRaou",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))(?1)","&vqt\\1Hv",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?|(abc)|(xyz))(?1)","&vqt\\1Hv",[global])),
- <<"xyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))(?1)","LyN",[])),
- <<"xyzxyz">> = iolist_to_binary(re:replace("xyzxyz","(?|(abc)|(xyz))(?1)","LyN",[global])),
- <<"XYabcdYvXYabcdYXYabcdYXYabcdYjw">> = iolist_to_binary(re:replace("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)","&v&&&jw",[])),
- <<"XYabcdYvXYabcdYXYabcdYXYabcdYjw">> = iolist_to_binary(re:replace("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)","&v&&&jw",[global])),
- <<"uqndDBXYabcdYGahfmNcwsERUk">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)","uqndDB&G\\1hfmNcwsERUk",[])),
- <<"uqndDBXYabcdYGahfmNcwsERUk">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)","uqndDB&G\\1hfmNcwsERUk",[global])),
- <<"XYabcdYtahaNIsaeGvkDDLOQ">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)","&tah\\1NIs\\1eGvkDDLOQ",[])),
- <<"XYabcdYtahaNIsaeGvkDDLOQ">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)","&tah\\1NIs\\1eGvkDDLOQ",[global])),
- <<"boxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\k<abc>{2}","bo",[])),
- <<"boxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\k<abc>{2}","bo",[global])),
- <<"sqNrwMWMcRUxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\k<abc>{2}","sqNrwMWMcRU",[])),
- <<"sqNrwMWMcRUxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\k<abc>{2}","sqNrwMWMcRU",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\k<abc>{2}","Ahbk",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\k<abc>{2}","Ahbk",[global])),
- <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\k<abc>{2}","yr&SM&HjpyRb",[])),
- <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\k<abc>{2}","yr&SM&HjpyRb",[global])),
- <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\k<abc>{2}","BQwV",[])),
- <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\k<abc>{2}","BQwV",[global])),
- <<"a:aaxnnUMItwyNa:aamCRBaixyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\g{abc}{2}","&xnnUMItwyN&mCRB\\1i",[])),
- <<"a:aaxnnUMItwyNa:aamCRBaixyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\g{abc}{2}","&xnnUMItwyN&mCRB\\1i",[global])),
- <<"Labjab:ababqxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\g{abc}{2}","L\\1j&q",[])),
- <<"Labjab:ababqxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\g{abc}{2}","L\\1j&q",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\g{abc}{2}","dLG\\1",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\g{abc}{2}","dLG\\1",[global])),
- <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\g{abc}{2}","MKB",[])),
- <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\g{abc}{2}","MKB",[global])),
- <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\g{abc}{2}","BwHek&EFhbw",[])),
- <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\g{abc}{2}","BwHek&EFhbw",[global])),
- <<"abdqUabdFaabdtmIkaf">> = iolist_to_binary(re:replace("abd","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","&qU&Fa&tmIk\\1f",[extended])),
- <<"abdqUabdFaabdtmIkaf">> = iolist_to_binary(re:replace("abd","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","&qU&Fa&tmIk\\1f",[extended,
- global])),
- <<"haacettwdUtIv">> = iolist_to_binary(re:replace("ce","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","haa&ttwdU\\1tIv",[extended])),
- <<"haacettwdUtIv">> = iolist_to_binary(re:replace("ce","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","haa&ttwdU\\1tIv",[extended,
- global])),
- <<"uaXaXZYWULYgJXaXaXaXZg">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g-1Z","u&YWULYgJX\\1&g",[])),
- <<"uaXaXZYWULYgJXaXaXaXZg">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g-1Z","u&YWULYgJX\\1&g",[global])),
- <<"TpaXaXZmaXaXZQhnJ">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g{-1}Z","Tp&m&QhnJ",[])),
- <<"TpaXaXZmaXaXZQhnJ">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g{-1}Z","Tp&m&QhnJ",[global])),
- <<"cNcd">> = iolist_to_binary(re:replace("abcd","^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) ","cN",[extended])),
- <<"cNcd">> = iolist_to_binary(re:replace("abcd","^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) ","cN",[extended,
- global])),
- <<"S">> = iolist_to_binary(re:replace("metcalfe 33","(?<NAME>(?&NAME_PAT))\\s+(?<ADDR>(?&ADDRESS_PAT))
+ <<"UAyUXYabcdYapHaoXYabcdYOaaHkXYabcdY">> = iolist_to_binary(re:replace("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)","UAyU&\\1pH\\1o&O\\1\\1Hk&",[])),
+ <<"UAyUXYabcdYapHaoXYabcdYOaaHkXYabcdY">> = iolist_to_binary(re:replace("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)","UAyU&\\1pH\\1o&O\\1\\1Hk&",[global])),
+ <<"UlXYabcdYmKaP">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)","Ul&mKaP",[])),
+ <<"UlXYabcdYmKaP">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(r)(s))|(q))(c)(d)(Y)","Ul&mKaP",[global])),
+ <<"mOVIXYabcdYkbaNflC">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)","mOVI&kb\\1NflC",[])),
+ <<"mOVIXYabcdYkbaNflC">> = iolist_to_binary(re:replace("XYabcdY","^X(?7)(a)(?|(b|(?|(r)|(t))(s))|(q))(c)(d)(Y)","mOVI&kb\\1NflC",[global])),
+ <<"a:aaaua:aaaa:aacaKjjSkMSaLxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\k<abc>{2}","&\\1u&a&caKjjSkMS\\1L",[])),
+ <<"a:aaaua:aaaa:aacaKjjSkMSaLxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\k<abc>{2}","&\\1u&a&caKjjSkMS\\1L",[global])),
+ <<"ab:ababDababxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\k<abc>{2}","&D\\1\\1",[])),
+ <<"ab:ababDababxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\k<abc>{2}","&D\\1\\1",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\k<abc>{2}","NhofxbK\\1smLiNJ\\1YyrV",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\k<abc>{2}","NhofxbK\\1smLiNJ\\1YyrV",[global])),
+ <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\k<abc>{2}","&R&&m&&",[])),
+ <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\k<abc>{2}","&R&&m&&",[global])),
+ <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\k<abc>{2}","cxccnpYwqQ",[])),
+ <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\k<abc>{2}","cxccnpYwqQ",[global])),
+ <<"waYQqa:aalJrcNa:aaQujaFa:aanxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\g{abc}{2}","w\\1YQq&lJrcN&Quj\\1F&n",[])),
+ <<"waYQqa:aalJrcNa:aaQujaFa:aanxyz">> = iolist_to_binary(re:replace("a:aaxyz","(?'abc'\\w+):\\g{abc}{2}","w\\1YQq&lJrcN&Quj\\1F&n",[global])),
+ <<"SSNdab:ababnWnnujabab:ababab:ababxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\g{abc}{2}","SSNd&nWnnuj\\1&&",[])),
+ <<"SSNdab:ababnWnnujabab:ababab:ababxyz">> = iolist_to_binary(re:replace("ab:ababxyz","(?'abc'\\w+):\\g{abc}{2}","SSNd&nWnnuj\\1&&",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\g{abc}{2}","sC\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?'abc'\\w+):\\g{abc}{2}","sC\\1",[global])),
+ <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\g{abc}{2}","\\1&KtbPW\\1jI",[])),
+ <<"a:axyz">> = iolist_to_binary(re:replace("a:axyz","(?'abc'\\w+):\\g{abc}{2}","\\1&KtbPW\\1jI",[global])),
+ <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\g{abc}{2}","&Dh",[])),
+ <<"ab:abxyz">> = iolist_to_binary(re:replace("ab:abxyz","(?'abc'\\w+):\\g{abc}{2}","&Dh",[global])),
+ <<"HX">> = iolist_to_binary(re:replace("abd","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","HX",[extended])),
+ <<"HX">> = iolist_to_binary(re:replace("abd","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","HX",[extended,
+ global])),
+ <<"BlTxckgd">> = iolist_to_binary(re:replace("ce","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","BlTx\\1ckgd",[extended])),
+ <<"BlTxckgd">> = iolist_to_binary(re:replace("ce","^(?<ab>a)? (?(<ab>)b|c) (?('ab')d|e)","BlTx\\1ckgd",[extended,
+ global])),
+ <<"WbqaXaXZ">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g-1Z","Wbq&",[])),
+ <<"WbqaXaXZ">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g-1Z","Wbq&",[global])),
+ <<"xLqaXYaXouuKkaXU">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g{-1}Z","xLq\\1Y\\1ouuKk\\1U",[])),
+ <<"xLqaXYaXouuKkaXU">> = iolist_to_binary(re:replace("aXaXZ","^(a.)\\g{-1}Z","xLq\\1Y\\1ouuKk\\1U",[global])),
+ <<"uADabXiwJcd">> = iolist_to_binary(re:replace("abcd","^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) ","uAD&XiwJ",[extended])),
+ <<"uADabXiwJcd">> = iolist_to_binary(re:replace("abcd","^(?(DEFINE) (?<A> a) (?<B> b) ) (?&A) (?&B) ","uAD&XiwJ",[extended,
+ global])),
+ <<"metcalfe 33yCmetcalfe 33jQmetcalfemetcalfe 33metcalfe 33E">> = iolist_to_binary(re:replace("metcalfe 33","(?<NAME>(?&NAME_PAT))\\s+(?<ADDR>(?&ADDRESS_PAT))
(?(DEFINE)
(?<NAME_PAT>[a-z]+)
(?<ADDRESS_PAT>\\d+)
- )","S",[extended])),
- <<"S">> = iolist_to_binary(re:replace("metcalfe 33","(?<NAME>(?&NAME_PAT))\\s+(?<ADDR>(?&ADDRESS_PAT))
+ )","&yC&jQ\\1&&E",[extended])),
+ <<"metcalfe 33yCmetcalfe 33jQmetcalfemetcalfe 33metcalfe 33E">> = iolist_to_binary(re:replace("metcalfe 33","(?<NAME>(?&NAME_PAT))\\s+(?<ADDR>(?&ADDRESS_PAT))
(?(DEFINE)
(?<NAME_PAT>[a-z]+)
(?<ADDRESS_PAT>\\d+)
- )","S",[extended,global])),
- <<"m1.2.3.4CNSbdi">> = iolist_to_binary(re:replace("1.2.3.4","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","m&CNSbd\\1i",[])),
- <<"m1.2.3.4CNSbdi">> = iolist_to_binary(re:replace("1.2.3.4","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","m&CNSbd\\1i",[global])),
- <<"131.111.10.206131.111.10.206DPiNTNK131.111.10.206grPeyEu">> = iolist_to_binary(re:replace("131.111.10.206","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","&&DPiNTN\\1\\1K&grPey\\1Eu",[])),
- <<"131.111.10.206131.111.10.206DPiNTNK131.111.10.206grPeyEu">> = iolist_to_binary(re:replace("131.111.10.206","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","&&DPiNTN\\1\\1K&grPey\\1Eu",[global])),
- <<"uBfPy10.0.0.010.0.0.0svWuRdbVVmys">> = iolist_to_binary(re:replace("10.0.0.0","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","u\\1BfPy&&svWuRdbVVmys",[])),
- <<"uBfPy10.0.0.010.0.0.0svWuRdbVVmys">> = iolist_to_binary(re:replace("10.0.0.0","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","u\\1BfPy&&svWuRdbVVmys",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","jVYSCLvb\\1Rm\\1Vn&",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","jVYSCLvb\\1Rm\\1Vn&",[global])),
- <<"10.6">> = iolist_to_binary(re:replace("10.6","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","dECob\\1\\1yakWA",[])),
- <<"10.6">> = iolist_to_binary(re:replace("10.6","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","dECob\\1\\1yakWA",[global])),
- <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","r",[])),
- <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","r",[global])),
- <<"VjWQp">> = iolist_to_binary(re:replace("1.2.3.4","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","VjWQp",[])),
- <<"VjWQp">> = iolist_to_binary(re:replace("1.2.3.4","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","VjWQp",[global])),
- <<"VQs131.111.10.206131.111.10.206r.206.206">> = iolist_to_binary(re:replace("131.111.10.206","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","VQs&&r\\1\\1",[])),
- <<"VQs131.111.10.206131.111.10.206r.206.206">> = iolist_to_binary(re:replace("131.111.10.206","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","VQs&&r\\1\\1",[global])),
- <<"mebNTtCd10.0.0.010.0.0.010.0.0.010.0.0.0S.0">> = iolist_to_binary(re:replace("10.0.0.0","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","mebNTtCd&&&&S\\1",[])),
- <<"mebNTtCd10.0.0.010.0.0.010.0.0.010.0.0.0S.0">> = iolist_to_binary(re:replace("10.0.0.0","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","mebNTtCd&&&&S\\1",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","uvmK&GcQ&\\1u\\1",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","uvmK&GcQ&\\1u\\1",[global])),
- <<"10.6">> = iolist_to_binary(re:replace("10.6","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","TH\\1bkRaOVXKAGH&Wq\\1",[])),
- <<"10.6">> = iolist_to_binary(re:replace("10.6","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","TH\\1bkRaOVXKAGH&Wq\\1",[global])),
- <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","flY&",[])),
- <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","flY&",[global])),
- <<"XIXOpartynow is the time for all good men to come to the aid of the partyenW">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^(\\w++|\\s++)*$","XIXO\\1&enW",[])),
- <<"XIXOpartynow is the time for all good men to come to the aid of the partyenW">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^(\\w++|\\s++)*$","XIXO\\1&enW",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\w++|\\s++)*$","bwiYg",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\w++|\\s++)*$","bwiYg",[global])),
- <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^(\\w++|\\s++)*$","d\\1",[])),
- <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^(\\w++|\\s++)*$","d\\1",[global])),
- <<"m12345sdTXRM1234512345a">> = iolist_to_binary(re:replace("12345a","(\\d++)(\\w)","m\\1sdTXRM\\1&",[])),
- <<"m12345sdTXRM1234512345a">> = iolist_to_binary(re:replace("12345a","(\\d++)(\\w)","m\\1sdTXRM\\1&",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\d++)(\\w)","eFU&\\1cQE\\1\\1grkNJ&Ad\\1f",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\d++)(\\w)","eFU&\\1cQE\\1\\1grkNJ&Ad\\1f",[global])),
- <<"12345+">> = iolist_to_binary(re:replace("12345+","(\\d++)(\\w)","i&hvp\\1XhCAs&VRh",[])),
- <<"12345+">> = iolist_to_binary(re:replace("12345+","(\\d++)(\\w)","i&hvp\\1XhCAs&VRh",[global])),
- <<"NaaabIg">> = iolist_to_binary(re:replace("aaab","a++b","\\1N&Ig",[])),
- <<"NaaabIg">> = iolist_to_binary(re:replace("aaab","a++b","\\1N&Ig",[global])),
- <<"maaabaaabgBJFEHXaaabaaabaaabkAaaab">> = iolist_to_binary(re:replace("aaab","(a++b)","m&\\1gBJFEHX&&\\1kA&",[])),
- <<"maaabaaabgBJFEHXaaabaaabaaabkAaaab">> = iolist_to_binary(re:replace("aaab","(a++b)","m&\\1gBJFEHX&&\\1kA&",[global])),
- <<"TaaabRaaaaaaeBTpaaaTi">> = iolist_to_binary(re:replace("aaab","(a++)b","T&R\\1\\1eBTp\\1Ti",[])),
- <<"TaaabRaaaaaaeBTpaaaTi">> = iolist_to_binary(re:replace("aaab","(a++)b","T&R\\1\\1eBTp\\1Ti",[global])),
- <<"((PwxkrBxNdabc(ade)ufh()()xYBkxEabc(ade)ufh()()xFkxx">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","([^()]++|\\([^()]*\\))+","Pw\\1krB\\1Nd&YBk\\1E&Fk\\1\\1",[])),
- <<"((PwxkrBxNdabc(ade)ufh()()xYBkxEabc(ade)ufh()()xFkxx">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","([^()]++|\\([^()]*\\))+","Pw\\1krB\\1Nd&YBk\\1E&Fk\\1\\1",[global])),
- <<"F(abc)sMN">> = iolist_to_binary(re:replace("(abc)","\\(([^()]++|\\([^()]+\\))+\\)","F&sMN",[])),
- <<"F(abc)sMN">> = iolist_to_binary(re:replace("(abc)","\\(([^()]++|\\([^()]+\\))+\\)","F&sMN",[global])),
- <<"SMUJyftxyzxyz(abc(def)xyz)RpnMnA">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(([^()]++|\\([^()]+\\))+\\)","SMUJyft\\1\\1&RpnMnA",[])),
- <<"SMUJyftxyzxyz(abc(def)xyz)RpnMnA">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(([^()]++|\\([^()]+\\))+\\)","SMUJyft\\1\\1&RpnMnA",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(([^()]++|\\([^()]+\\))+\\)","p",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(([^()]++|\\([^()]+\\))+\\)","p",[global])),
- <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)","gVbYV&vnkHNjeK",[])),
- <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)","gVbYV&vnkHNjeK",[global])),
+ )","&yC&jQ\\1&&E",[extended,global])),
+ <<"csUt">> = iolist_to_binary(re:replace("1.2.3.4","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","csUt",[])),
+ <<"csUt">> = iolist_to_binary(re:replace("1.2.3.4","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","csUt",[global])),
+ <<"131.111.10.206CEy131.111.10.206iDmGa131.111.10.206Dl">> = iolist_to_binary(re:replace("131.111.10.206","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","&CEy&iDmGa&\\1Dl",[])),
+ <<"131.111.10.206CEy131.111.10.206iDmGa131.111.10.206Dl">> = iolist_to_binary(re:replace("131.111.10.206","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","&CEy&iDmGa&\\1Dl",[global])),
+ <<"YQqPs10.0.0.0DQgo10.0.0.0Nnyi10.0.0.0Ny">> = iolist_to_binary(re:replace("10.0.0.0","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","YQqPs&DQgo\\1\\1&Nnyi&Ny",[])),
+ <<"YQqPs10.0.0.0DQgo10.0.0.0Nnyi10.0.0.0Ny">> = iolist_to_binary(re:replace("10.0.0.0","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","YQqPs&DQgo\\1\\1&Nnyi&Ny",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","o\\1\\1&&Ds&F&",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","o\\1\\1&&Ds&F&",[global])),
+ <<"10.6">> = iolist_to_binary(re:replace("10.6","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","s&\\1BXWRj\\1rQXiOeLx",[])),
+ <<"10.6">> = iolist_to_binary(re:replace("10.6","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","s&\\1BXWRj\\1rQXiOeLx",[global])),
+ <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","Y",[])),
+ <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))\\b(?&byte)(\\.(?&byte)){3}","Y",[global])),
+ <<"DaLYYtnY">> = iolist_to_binary(re:replace("1.2.3.4","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","DaLYYtnY",[])),
+ <<"DaLYYtnY">> = iolist_to_binary(re:replace("1.2.3.4","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","DaLYYtnY",[global])),
+ <<"MBU.206M">> = iolist_to_binary(re:replace("131.111.10.206","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","MBU\\1M",[])),
+ <<"MBU.206M">> = iolist_to_binary(re:replace("131.111.10.206","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","MBU\\1M",[global])),
+ <<"10.0.0.0Lp">> = iolist_to_binary(re:replace("10.0.0.0","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","&Lp",[])),
+ <<"10.0.0.0Lp">> = iolist_to_binary(re:replace("10.0.0.0","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","&Lp",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","hr&USJrD",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","hr&USJrD",[global])),
+ <<"10.6">> = iolist_to_binary(re:replace("10.6","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","BbfgCNDo&\\1C\\1",[])),
+ <<"10.6">> = iolist_to_binary(re:replace("10.6","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","BbfgCNDo&\\1C\\1",[global])),
+ <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","w&Yt",[])),
+ <<"455.3.4.5">> = iolist_to_binary(re:replace("455.3.4.5","\\b(?&byte)(\\.(?&byte)){3}(?(DEFINE)(?<byte>2[0-4]\\d|25[0-5]|1\\d\\d|[1-9]?\\d))","w&Yt",[global])),
+ <<"Agnow is the time for all good men to come to the aid of the partyV">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^(\\w++|\\s++)*$","Ag&V",[])),
+ <<"Agnow is the time for all good men to come to the aid of the partyV">> = iolist_to_binary(re:replace("now is the time for all good men to come to the aid of the party","^(\\w++|\\s++)*$","Ag&V",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\w++|\\s++)*$","VxnH\\1OwDhnQQemGf&IJ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\w++|\\s++)*$","VxnH\\1OwDhnQQemGf&IJ",[global])),
+ <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^(\\w++|\\s++)*$","OmS\\1W&&yOcff\\1pn",[])),
+ <<"this is not a line with only words and spaces!">> = iolist_to_binary(re:replace("this is not a line with only words and spaces!","^(\\w++|\\s++)*$","OmS\\1W&&yOcff\\1pn",[global])),
+ <<"X12345aM">> = iolist_to_binary(re:replace("12345a","(\\d++)(\\w)","X&M",[])),
+ <<"X12345aM">> = iolist_to_binary(re:replace("12345a","(\\d++)(\\w)","X&M",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\d++)(\\w)","G&QA&qhihaMMrQ",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","(\\d++)(\\w)","G&QA&qhihaMMrQ",[global])),
+ <<"12345+">> = iolist_to_binary(re:replace("12345+","(\\d++)(\\w)","kIxM\\1rD\\1B\\1a",[])),
+ <<"12345+">> = iolist_to_binary(re:replace("12345+","(\\d++)(\\w)","kIxM\\1rD\\1B\\1a",[global])),
+ <<"tkeKIY">> = iolist_to_binary(re:replace("aaab","a++b","tkeKIY",[])),
+ <<"tkeKIY">> = iolist_to_binary(re:replace("aaab","a++b","tkeKIY",[global])),
+ <<"aaabIaaab">> = iolist_to_binary(re:replace("aaab","(a++b)","\\1I\\1",[])),
+ <<"aaabIaaab">> = iolist_to_binary(re:replace("aaab","(a++b)","\\1I\\1",[global])),
+ <<"rOaaabYBnR">> = iolist_to_binary(re:replace("aaab","(a++)b","rO&YBnR",[])),
+ <<"rOaaabYBnR">> = iolist_to_binary(re:replace("aaab","(a++)b","rO&YBnR",[global])),
+ <<"((uwsqruwBU">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","([^()]++|\\([^()]*\\))+","uwsqruwBU",[])),
+ <<"((uwsqruwBU">> = iolist_to_binary(re:replace("((abc(ade)ufh()()x","([^()]++|\\([^()]*\\))+","uwsqruwBU",[global])),
+ <<"(abc)GFFGlEEaBgxgufwp">> = iolist_to_binary(re:replace("(abc)","\\(([^()]++|\\([^()]+\\))+\\)","&GFFGlEEaBgxgufwp",[])),
+ <<"(abc)GFFGlEEaBgxgufwp">> = iolist_to_binary(re:replace("(abc)","\\(([^()]++|\\([^()]+\\))+\\)","&GFFGlEEaBgxgufwp",[global])),
+ <<"x(abc(def)xyz)(abc(def)xyz)Jvx(abc(def)xyz)xyzd(abc(def)xyz)(abc(def)xyz)">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(([^()]++|\\([^()]+\\))+\\)","x&&Jvx&\\1d&&",[])),
+ <<"x(abc(def)xyz)(abc(def)xyz)Jvx(abc(def)xyz)xyzd(abc(def)xyz)(abc(def)xyz)">> = iolist_to_binary(re:replace("(abc(def)xyz)","\\(([^()]++|\\([^()]+\\))+\\)","x&&Jvx&\\1d&&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(([^()]++|\\([^()]+\\))+\\)","ieL\\1IsedxuM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","\\(([^()]++|\\([^()]+\\))+\\)","ieL\\1IsedxuM",[global])),
+ <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)","&\\1fqeu\\1",[])),
+ <<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(re:replace("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)","&\\1fqeu\\1",[global])),
+ <<"kqQTCl">> = iolist_to_binary(re:replace("abc","^([^()]|\\((?1)*\\))*$","kqQTCl",[])),
+ <<"kqQTCl">> = iolist_to_binary(re:replace("abc","^([^()]|\\((?1)*\\))*$","kqQTCl",[global])),
+ <<"cRla(b)cGc">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","\\1Rl&G\\1",[])),
+ <<"cRla(b)cGc">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","\\1Rl&G\\1",[global])),
+ <<"dKa(b(c))dfGndCr">> = iolist_to_binary(re:replace("a(b(c))d","^([^()]|\\((?1)*\\))*$","\\1K&fGn\\1Cr",[])),
+ <<"dKa(b(c))dfGndCr">> = iolist_to_binary(re:replace("a(b(c))d","^([^()]|\\((?1)*\\))*$","\\1K&fGn\\1Cr",[global])),
+ <<"*** Failers)">> = iolist_to_binary(re:replace("*** Failers)","^([^()]|\\((?1)*\\))*$","\\1n\\1&umpF&",[])),
+ <<"*** Failers)">> = iolist_to_binary(re:replace("*** Failers)","^([^()]|\\((?1)*\\))*$","\\1n\\1&umpF&",[global])),
+ <<"a(b(c)d">> = iolist_to_binary(re:replace("a(b(c)d","^([^()]|\\((?1)*\\))*$","\\1JTc",[])),
+ <<"a(b(c)d">> = iolist_to_binary(re:replace("a(b(c)d","^([^()]|\\((?1)*\\))*$","\\1JTc",[global])),
ok.
run42() ->
- <<"YHcxHwcJHhabcabcyqOabcio">> = iolist_to_binary(re:replace("abc","^([^()]|\\((?1)*\\))*$","YH\\1xHw\\1JHh&&yqO&io",[])),
- <<"YHcxHwcJHhabcabcyqOabcio">> = iolist_to_binary(re:replace("abc","^([^()]|\\((?1)*\\))*$","YH\\1xHw\\1JHh&&yqO&io",[global])),
- <<"Xua(b)ccOqkxg">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","Xu&\\1Oqkxg",[])),
- <<"Xua(b)ccOqkxg">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","Xu&\\1Oqkxg",[global])),
- <<"pHOdcaLUi">> = iolist_to_binary(re:replace("a(b(c))d","^([^()]|\\((?1)*\\))*$","pHO\\1caLUi",[])),
- <<"pHOdcaLUi">> = iolist_to_binary(re:replace("a(b(c))d","^([^()]|\\((?1)*\\))*$","pHO\\1caLUi",[global])),
- <<"*** Failers)">> = iolist_to_binary(re:replace("*** Failers)","^([^()]|\\((?1)*\\))*$","&YxG",[])),
- <<"*** Failers)">> = iolist_to_binary(re:replace("*** Failers)","^([^()]|\\((?1)*\\))*$","&YxG",[global])),
- <<"a(b(c)d">> = iolist_to_binary(re:replace("a(b(c)d","^([^()]|\\((?1)*\\))*$","s\\1BLqc",[])),
- <<"a(b(c)d">> = iolist_to_binary(re:replace("a(b(c)d","^([^()]|\\((?1)*\\))*$","s\\1BLqc",[global])),
- <<"puAth">> = iolist_to_binary(re:replace(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","puAth",[])),
- <<"puAth">> = iolist_to_binary(re:replace(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","puAth",[global])),
- <<"QVYB>abc>1(2)3<xyz<cFhyH">> = iolist_to_binary(re:replace(">abc>1(2)3<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","QVYB&cFhyH",[])),
- <<"QVYB>abc>1(2)3<xyz<cFhyH">> = iolist_to_binary(re:replace(">abc>1(2)3<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","QVYB&cFhyH",[global])),
- <<"(1(2)3)">> = iolist_to_binary(re:replace(">abc>(1(2)3)<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","\\1",[])),
- <<"(1(2)3)">> = iolist_to_binary(re:replace(">abc>(1(2)3)<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","\\1",[global])),
- <<"fb1221w122112211221Q1221yL1221d">> = iolist_to_binary(re:replace("1221","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","fb\\1w\\1&&Q&yL&d",[caseless])),
- <<"fb1221w122112211221Q1221yL1221d">> = iolist_to_binary(re:replace("1221","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","fb\\1w\\1&&Q&yL&d",[caseless,
- global])),
- <<"yadakp">> = iolist_to_binary(re:replace("Satanoscillatemymetallicsonatas","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","ya\\1dakp\\1",[caseless])),
- <<"yadakp">> = iolist_to_binary(re:replace("Satanoscillatemymetallicsonatas","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","ya\\1dakp\\1",[caseless,
- global])),
- <<"aAmanaplanacanalPanamalDAmanaplanacanalPanamaiqyAmanaplanacanalPanamaOSvaJYbQ">> = iolist_to_binary(re:replace("AmanaplanacanalPanama","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","a&lD&i\\1qy&OSv\\1aJYbQ",[caseless])),
- <<"aAmanaplanacanalPanamalDAmanaplanacanalPanamaiqyAmanaplanacanalPanamaOSvaJYbQ">> = iolist_to_binary(re:replace("AmanaplanacanalPanama","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","a&lD&i\\1qy&OSv\\1aJYbQ",[caseless,
- global])),
- <<"UcSlDNWgAva">> = iolist_to_binary(re:replace("AblewasIereIsawElba","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","UcSlD\\1NWgAva\\1",[caseless])),
- <<"UcSlDNWgAva">> = iolist_to_binary(re:replace("AblewasIereIsawElba","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","UcSlD\\1NWgAva\\1",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","n",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","n",[caseless,
- global])),
- <<"Thequickbrownfox">> = iolist_to_binary(re:replace("Thequickbrownfox","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","MuY&Y&DfSiG&KPnRRGOO",[caseless])),
- <<"Thequickbrownfox">> = iolist_to_binary(re:replace("Thequickbrownfox","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","MuY&Y&DfSiG&KPnRRGOO",[caseless,
- global])),
- <<"Dlcq12uvNpwj">> = iolist_to_binary(re:replace("12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","Dlcq\\1uvNpwj",[])),
- <<"Dlcq12uvNpwj">> = iolist_to_binary(re:replace("12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","Dlcq\\1uvNpwj",[global])),
- <<"(((2+2)*-3)-7)Hq(((2+2)*-3)-7)nwjc(((2+2)*-3)-7)OCxTARr">> = iolist_to_binary(re:replace("(((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","&Hq&nwjc\\1OCxTARr",[])),
- <<"(((2+2)*-3)-7)Hq(((2+2)*-3)-7)nwjc(((2+2)*-3)-7)OCxTARr">> = iolist_to_binary(re:replace("(((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","&Hq&nwjc\\1OCxTARr",[global])),
- <<"EjPI-12tsA-12ux-12-12-12MfkO">> = iolist_to_binary(re:replace("-12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","EjPI&tsA&ux&\\1\\1MfkO",[])),
- <<"EjPI-12tsA-12ux-12-12-12MfkO">> = iolist_to_binary(re:replace("-12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","EjPI&tsA&ux&\\1\\1MfkO",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","sxA&v\\1L\\1Q\\1FFDAm\\1hOOv",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","sxA&v\\1L\\1Q\\1FFDAm\\1hOOv",[global])),
- <<"((2+2)*-3)-7)">> = iolist_to_binary(re:replace("((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","el\\1La",[])),
- <<"((2+2)*-3)-7)">> = iolist_to_binary(re:replace("((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","el\\1La",[global])),
- <<"vRxyzxyzrJYxyzxyzjNtdExyzSxeWm">> = iolist_to_binary(re:replace("xyz","^(x(y|(?1){2})z)","vR\\1\\1rJY&\\1jNtdE&SxeWm",[])),
- <<"vRxyzxyzrJYxyzxyzjNtdExyzSxeWm">> = iolist_to_binary(re:replace("xyz","^(x(y|(?1){2})z)","vR\\1\\1rJY&\\1jNtdE&SxeWm",[global])),
- <<"CRxxyzxyzzkQsxxyzxyzzHmiGvxxyzxyzzy">> = iolist_to_binary(re:replace("xxyzxyzz","^(x(y|(?1){2})z)","CR\\1kQs\\1HmiGv\\1y",[])),
- <<"CRxxyzxyzzkQsxxyzxyzzHmiGvxxyzxyzzy">> = iolist_to_binary(re:replace("xxyzxyzz","^(x(y|(?1){2})z)","CR\\1kQs\\1HmiGv\\1y",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(x(y|(?1){2})z)","qTfvW\\1q\\1&UXxp\\1b",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(x(y|(?1){2})z)","qTfvW\\1q\\1&UXxp\\1b",[global])),
- <<"xxyzz">> = iolist_to_binary(re:replace("xxyzz","^(x(y|(?1){2})z)","WRW&Ky",[])),
- <<"xxyzz">> = iolist_to_binary(re:replace("xxyzz","^(x(y|(?1){2})z)","WRW&Ky",[global])),
- <<"xxyzxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzxyzz","^(x(y|(?1){2})z)","SgB&TOTaVTG\\1\\1Sy",[])),
- <<"xxyzxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzxyzz","^(x(y|(?1){2})z)","SgB&TOTaVTG\\1\\1Sy",[global])),
+ <<">abc>123<xyz<Po3Pcn3tBnXovXUUqId">> = iolist_to_binary(re:replace(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","&Po\\1Pcn\\1tBnXovXUUqId",[])),
+ <<">abc>123<xyz<Po3Pcn3tBnXovXUUqId">> = iolist_to_binary(re:replace(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","&Po\\1Pcn\\1tBnXovXUUqId",[global])),
+ <<"P3KXinsyIho">> = iolist_to_binary(re:replace(">abc>1(2)3<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","P\\1KXinsyIho",[])),
+ <<"P3KXinsyIho">> = iolist_to_binary(re:replace(">abc>1(2)3<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","P\\1KXinsyIho",[global])),
+ <<"dQI(1(2)3)Ox>abc>(1(2)3)<xyz<MgB(1(2)3)(1(2)3)m(1(2)3)i>abc>(1(2)3)<xyz<SNVV">> = iolist_to_binary(re:replace(">abc>(1(2)3)<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","dQI\\1Ox&MgB\\1\\1m\\1i&SNVV",[])),
+ <<"dQI(1(2)3)Ox>abc>(1(2)3)<xyz<MgB(1(2)3)(1(2)3)m(1(2)3)i>abc>(1(2)3)<xyz<SNVV">> = iolist_to_binary(re:replace(">abc>(1(2)3)<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$","dQI\\1Ox&MgB\\1\\1m\\1i&SNVV",[global])),
+ <<"fjn">> = iolist_to_binary(re:replace("1221","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","fjn",[caseless])),
+ <<"fjn">> = iolist_to_binary(re:replace("1221","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","fjn",[caseless,
+ global])),
+ <<"EWyIbgb">> = iolist_to_binary(re:replace("Satanoscillatemymetallicsonatas","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","EW\\1yIbgb",[caseless])),
+ <<"EWyIbgb">> = iolist_to_binary(re:replace("Satanoscillatemymetallicsonatas","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","EW\\1yIbgb",[caseless,
+ global])),
+ <<"aAmanaplanacanalPanamayDfAmanaplanacanalPanamaanKSCjCr">> = iolist_to_binary(re:replace("AmanaplanacanalPanama","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","a&yDf&anKS\\1CjCr",[caseless])),
+ <<"aAmanaplanacanalPanamayDfAmanaplanacanalPanamaanKSCjCr">> = iolist_to_binary(re:replace("AmanaplanacanalPanama","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","a&yDf&anKS\\1CjCr",[caseless,
+ global])),
+ <<"hTo">> = iolist_to_binary(re:replace("AblewasIereIsawElba","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","\\1h\\1To",[caseless])),
+ <<"hTo">> = iolist_to_binary(re:replace("AblewasIereIsawElba","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","\\1h\\1To",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","SQq",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","SQq",[caseless,
+ global])),
+ <<"Thequickbrownfox">> = iolist_to_binary(re:replace("Thequickbrownfox","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","m&\\1ypjt",[caseless])),
+ <<"Thequickbrownfox">> = iolist_to_binary(re:replace("Thequickbrownfox","^(?:((.)(?1)\\2|)|((.)(?3)\\4|.))$","m&\\1ypjt",[caseless,
+ global])),
+ <<"vmtlvgrhXoIVUjuxCJ">> = iolist_to_binary(re:replace("12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","vmtlvgrhXoIVUjuxCJ",[])),
+ <<"vmtlvgrhXoIVUjuxCJ">> = iolist_to_binary(re:replace("12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","vmtlvgrhXoIVUjuxCJ",[global])),
+ <<"S(((2+2)*-3)-7)hoEGuxAELDlwIpN">> = iolist_to_binary(re:replace("(((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","S\\1hoEGuxAELDlwIpN",[])),
+ <<"S(((2+2)*-3)-7)hoEGuxAELDlwIpN">> = iolist_to_binary(re:replace("(((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","S\\1hoEGuxAELDlwIpN",[global])),
+ <<"fn-12K">> = iolist_to_binary(re:replace("-12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","fn&K",[])),
+ <<"fn-12K">> = iolist_to_binary(re:replace("-12","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","fn&K",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","kbKqwY\\1dbLnM",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","kbKqwY\\1dbLnM",[global])),
+ <<"((2+2)*-3)-7)">> = iolist_to_binary(re:replace("((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","&aHqiP",[])),
+ <<"((2+2)*-3)-7)">> = iolist_to_binary(re:replace("((2+2)*-3)-7)","^(\\d+|\\((?1)([+*-])(?1)\\)|-(?1))$","&aHqiP",[global])),
+ <<"qxyzCk">> = iolist_to_binary(re:replace("xyz","^(x(y|(?1){2})z)","q&Ck",[])),
+ <<"qxyzCk">> = iolist_to_binary(re:replace("xyz","^(x(y|(?1){2})z)","q&Ck",[global])),
+ <<"LxxyzxyzzSIxxyzxyzzHmXxxyzxyzzmxxyzxyzzxxyzxyzzQaGiQRxxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzz","^(x(y|(?1){2})z)","L&SI\\1HmX\\1m&&QaGiQR&",[])),
+ <<"LxxyzxyzzSIxxyzxyzzHmXxxyzxyzzmxxyzxyzzxxyzxyzzQaGiQRxxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzz","^(x(y|(?1){2})z)","L&SI\\1HmX\\1m&&QaGiQR&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(x(y|(?1){2})z)","JDpAfO\\1cLFC",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(x(y|(?1){2})z)","JDpAfO\\1cLFC",[global])),
+ <<"xxyzz">> = iolist_to_binary(re:replace("xxyzz","^(x(y|(?1){2})z)","iy\\1e\\1b",[])),
+ <<"xxyzz">> = iolist_to_binary(re:replace("xxyzz","^(x(y|(?1){2})z)","iy\\1e\\1b",[global])),
+ <<"xxyzxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzxyzz","^(x(y|(?1){2})z)","xpghdaVtJ\\1PnXNv\\1ALV",[])),
+ <<"xxyzxyzxyzz">> = iolist_to_binary(re:replace("xxyzxyzxyzz","^(x(y|(?1){2})z)","xpghdaVtJ\\1PnXNv\\1ALV",[global])),
<<"p">> = iolist_to_binary(re:replace("<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","p",[extended])),
<<"p">> = iolist_to_binary(re:replace("<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","p",[extended,
global])),
- <<"<abcd>oQy<abcd><abcd>UhI<abcd>g">> = iolist_to_binary(re:replace("<abcd>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","\\1oQy\\1&UhI&g",[extended])),
- <<"<abcd>oQy<abcd><abcd>UhI<abcd>g">> = iolist_to_binary(re:replace("<abcd>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","\\1oQy\\1&UhI&g",[extended,
- global])),
- <<"NymkAa">> = iolist_to_binary(re:replace("<abc <123> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","NymkAa",[extended])),
- <<"NymkAa">> = iolist_to_binary(re:replace("<abc <123> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","NymkAa",[extended,
- global])),
- <<"<abc i<def>g<def>fMHHlJ<def><def> hij>">> = iolist_to_binary(re:replace("<abc <def> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","i&g\\1fMHHlJ\\1\\1",[extended])),
- <<"<abc i<def>g<def>fMHHlJ<def><def> hij>">> = iolist_to_binary(re:replace("<abc <def> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","i&g\\1fMHHlJ\\1\\1",[extended,
- global])),
- <<"yJJ<abc<>def>yo<abc<>def>X">> = iolist_to_binary(re:replace("<abc<>def>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","yJJ&yo\\1X",[extended])),
- <<"yJJ<abc<>def>yo<abc<>def>X">> = iolist_to_binary(re:replace("<abc<>def>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","yJJ&yo\\1X",[extended,
- global])),
- <<"<abcn<>LhiK<>ufT<>q<><>SodEfM">> = iolist_to_binary(re:replace("<abc<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","n\\1LhiK&ufT&q&&SodEfM",[extended])),
- <<"<abcn<>LhiK<>ufT<>q<><>SodEfM">> = iolist_to_binary(re:replace("<abc<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","n\\1LhiK&ufT&q&&SodEfM",[extended,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","R&",[extended])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","R&",[extended,
- global])),
- <<"<abc">> = iolist_to_binary(re:replace("<abc","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","l",[extended])),
- <<"<abc">> = iolist_to_binary(re:replace("<abc","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","l",[extended,
- global])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^a+(*FAIL)","oWDClek&Nwt&&aMO\\1",[])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^a+(*FAIL)","oWDClek&Nwt&&aMO\\1",[global])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?c+(*FAIL)","L\\1&&fllctiK\\1WqBCUQ",[])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?c+(*FAIL)","L\\1&&fllctiK\\1WqBCUQ",[global])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*PRUNE)c+(*FAIL)","Jpy\\1FAL",[])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*PRUNE)c+(*FAIL)","Jpy\\1FAL",[global])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*COMMIT)c+(*FAIL)","I",[])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*COMMIT)c+(*FAIL)","I",[global])),
- <<"aaabcccaaabccc">> = iolist_to_binary(re:replace("aaabcccaaabccc","a+b?(*SKIP)c+(*FAIL)","cRBQ\\1mL",[])),
- <<"aaabcccaaabccc">> = iolist_to_binary(re:replace("aaabcccaaabccc","a+b?(*SKIP)c+(*FAIL)","cRBQ\\1mL",[global])),
- <<"JRWgePSUsExfJfHo">> = iolist_to_binary(re:replace("aaaxxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1JRWgePSUsExfJf\\1Ho",[])),
- <<"JRWgePSUsExfJfHo">> = iolist_to_binary(re:replace("aaaxxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1JRWgePSUsExfJf\\1Ho",[global])),
- <<"AlHMdrRl++++++">> = iolist_to_binary(re:replace("aaa++++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","AlHMdrRl",[])),
- <<"AlHMdrRl++++++">> = iolist_to_binary(re:replace("aaa++++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","AlHMdrRl",[global])),
- <<"bKH">> = iolist_to_binary(re:replace("bbbxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","bKH",[])),
- <<"bKH">> = iolist_to_binary(re:replace("bbbxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","bKH",[global])),
- <<"AyqLHpWSaFmaN+++++">> = iolist_to_binary(re:replace("bbb+++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","AyqLHpWSaFma\\1N",[])),
- <<"AyqLHpWSaFmaN+++++">> = iolist_to_binary(re:replace("bbb+++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","AyqLHpWSaFma\\1N",[global])),
- <<"bvYRps">> = iolist_to_binary(re:replace("cccxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","bvYR\\1ps",[])),
- <<"bvYRps">> = iolist_to_binary(re:replace("cccxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","bvYR\\1ps",[global])),
- <<"KPYMvODtuotXNIo++++">> = iolist_to_binary(re:replace("ccc++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","KPYMv\\1\\1ODtuotXNIo",[])),
- <<"KPYMvODtuotXNIo++++">> = iolist_to_binary(re:replace("ccc++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","KPYMv\\1\\1ODtuotXNIo",[global])),
- <<"kddddd">> = iolist_to_binary(re:replace("dddddddd","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","k",[])),
- <<"kddddd">> = iolist_to_binary(re:replace("dddddddd","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","k",[global])),
- <<"kaaaxxxxxxrQaRFqL">> = iolist_to_binary(re:replace("aaaxxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","k\\1rQaRFqL",[])),
- <<"kaaaxxxxxxrQaRFqL">> = iolist_to_binary(re:replace("aaaxxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","k\\1rQaRFqL",[global])),
- <<"aaaw++++++">> = iolist_to_binary(re:replace("aaa++++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1w",[])),
- <<"aaaw++++++">> = iolist_to_binary(re:replace("aaa++++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1w",[global])),
- <<"JyQqJIbbbxxxxxBAVHEvuuRsYpC">> = iolist_to_binary(re:replace("bbbxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","JyQqJI&BAVHEvuuRsYpC",[])),
- <<"JyQqJIbbbxxxxxBAVHEvuuRsYpC">> = iolist_to_binary(re:replace("bbbxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","JyQqJI&BAVHEvuuRsYpC",[global])),
- <<"dBwHTombbbccbbbR+++++">> = iolist_to_binary(re:replace("bbb+++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","dBwHTom&cc&R",[])),
- <<"dBwHTombbbccbbbR+++++">> = iolist_to_binary(re:replace("bbb+++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","dBwHTom&cc&R",[global])),
- <<"OcccxxxxeA">> = iolist_to_binary(re:replace("cccxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","O&eA",[])),
- <<"OcccxxxxeA">> = iolist_to_binary(re:replace("cccxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","O&eA",[global])),
- <<"DyFCQsccclWCcccy++++">> = iolist_to_binary(re:replace("ccc++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","DyFCQs&lWC&y",[])),
- <<"DyFCQsccclWCcccy++++">> = iolist_to_binary(re:replace("ccc++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","DyFCQs&lWC&y",[global])),
- <<"cdddvddddd">> = iolist_to_binary(re:replace("dddddddd","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","c&v",[])),
- <<"cdddvddddd">> = iolist_to_binary(re:replace("dddddddd","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","c&v",[global])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*THEN)c+(*FAIL)","PV&\\1x\\1vsUDLpYB\\1\\1t",[])),
- <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*THEN)c+(*FAIL)","PV&\\1x\\1vsUDLpYB\\1\\1t",[global])),
- <<"FhiABxmOfR">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Fhi\\1xmOfR",[extended])),
- <<"FhiABxmOfR">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Fhi\\1xmOfR",[extended,
- global])),
- <<"BHulABQjABrLtABEnSX">> = iolist_to_binary(re:replace("ABX","(A (A|B(*ACCEPT)|C) D)(E)","BHul&Qj&rLt\\1EnS",[extended])),
- <<"BHulABQjABrLtABEnSX">> = iolist_to_binary(re:replace("ABX","(A (A|B(*ACCEPT)|C) D)(E)","BHul&Qj&rLt\\1EnS",[extended,
- global])),
- <<"fwi">> = iolist_to_binary(re:replace("AADE","(A (A|B(*ACCEPT)|C) D)(E)","fwi",[extended])),
- <<"fwi">> = iolist_to_binary(re:replace("AADE","(A (A|B(*ACCEPT)|C) D)(E)","fwi",[extended,
- global])),
- <<"vpACDe">> = iolist_to_binary(re:replace("ACDE","(A (A|B(*ACCEPT)|C) D)(E)","vp\\1e",[extended])),
- <<"vpACDe">> = iolist_to_binary(re:replace("ACDE","(A (A|B(*ACCEPT)|C) D)(E)","vp\\1e",[extended,
- global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(A (A|B(*ACCEPT)|C) D)(E)","YJgvKXOIgucMHsvWUdgN",[extended])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(A (A|B(*ACCEPT)|C) D)(E)","YJgvKXOIgucMHsvWUdgN",[extended,
- global])),
- <<"AD">> = iolist_to_binary(re:replace("AD","(A (A|B(*ACCEPT)|C) D)(E)","ssJb&\\1nwuF&t",[extended])),
- <<"AD">> = iolist_to_binary(re:replace("AD","(A (A|B(*ACCEPT)|C) D)(E)","ssJb&\\1nwuF&t",[extended,
- global])),
- <<"AjVOUn">> = iolist_to_binary(re:replace("1221","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","AjVOUn",[caseless])),
- <<"AjVOUn">> = iolist_to_binary(re:replace("1221","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","AjVOUn",[caseless,
- global])),
- <<"BDdMi">> = iolist_to_binary(re:replace("Satan, oscillate my metallic sonatas!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","B\\1DdMi",[caseless])),
- <<"BDdMi">> = iolist_to_binary(re:replace("Satan, oscillate my metallic sonatas!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","B\\1DdMi",[caseless,
- global])),
- <<"YfFtA man, a plan, a canal: Panama!pwRSbpA man, a plan, a canal: Panama!">> = iolist_to_binary(re:replace("A man, a plan, a canal: Panama!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","YfFt\\1&\\1pwRSb\\1p&",[caseless])),
- <<"YfFtA man, a plan, a canal: Panama!pwRSbpA man, a plan, a canal: Panama!">> = iolist_to_binary(re:replace("A man, a plan, a canal: Panama!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","YfFt\\1&\\1pwRSb\\1p&",[caseless,
- global])),
- <<"xvAble was I ere I saw Elba.HqjQAble was I ere I saw Elba.vR">> = iolist_to_binary(re:replace("Able was I ere I saw Elba.","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","x\\1v&HqjQ&vR",[caseless])),
- <<"xvAble was I ere I saw Elba.HqjQAble was I ere I saw Elba.vR">> = iolist_to_binary(re:replace("Able was I ere I saw Elba.","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","x\\1v&HqjQ&vR",[caseless,
- global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","\\1JH",[caseless])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","\\1JH",[caseless,
- global])),
- <<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","GCnEOe&\\1HfW&",[caseless])),
- <<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","GCnEOe&\\1HfW&",[caseless,
- global])),
- <<"EEBtpaXa">> = iolist_to_binary(re:replace("a","^((.)(?1)\\2|.)$","EEBtpaX\\1",[])),
- <<"EEBtpaXa">> = iolist_to_binary(re:replace("a","^((.)(?1)\\2|.)$","EEBtpaX\\1",[global])),
- <<"qXEWopOY">> = iolist_to_binary(re:replace("aba","^((.)(?1)\\2|.)$","qXEWopOY",[])),
- <<"qXEWopOY">> = iolist_to_binary(re:replace("aba","^((.)(?1)\\2|.)$","qXEWopOY",[global])),
- <<"fQRaabaaaabaaaabaavgdtLaabaaijxUaabaaV">> = iolist_to_binary(re:replace("aabaa","^((.)(?1)\\2|.)$","fQR\\1\\1&vgdtL\\1ijxU\\1V",[])),
- <<"fQRaabaaaabaaaabaavgdtLaabaaijxUaabaaV">> = iolist_to_binary(re:replace("aabaa","^((.)(?1)\\2|.)$","fQR\\1\\1&vgdtL\\1ijxU\\1V",[global])),
- <<"rfIabcdcbaQmGUaQxwnGtIhc">> = iolist_to_binary(re:replace("abcdcba","^((.)(?1)\\2|.)$","rfI&QmGUaQxwnGtIhc",[])),
- <<"rfIabcdcbaQmGUaQxwnGtIhc">> = iolist_to_binary(re:replace("abcdcba","^((.)(?1)\\2|.)$","rfI&QmGUaQxwnGtIhc",[global])),
- <<"QEpqaabaaqpcpqaabaaqpmxcBpqaabaaqpfErt">> = iolist_to_binary(re:replace("pqaabaaqp","^((.)(?1)\\2|.)$","QE\\1c\\1mxcB&fErt",[])),
- <<"QEpqaabaaqpcpqaabaaqpmxcBpqaabaaqpfErt">> = iolist_to_binary(re:replace("pqaabaaqp","^((.)(?1)\\2|.)$","QE\\1c\\1mxcB&fErt",[global])),
- <<"KLFablewasiereisawelbaablewasiereisawelbaIablewasiereisawelbarjablewasiereisawelbasD">> = iolist_to_binary(re:replace("ablewasiereisawelba","^((.)(?1)\\2|.)$","KLF\\1&I&rj&sD",[])),
- <<"KLFablewasiereisawelbaablewasiereisawelbaIablewasiereisawelbarjablewasiereisawelbasD">> = iolist_to_binary(re:replace("ablewasiereisawelba","^((.)(?1)\\2|.)$","KLF\\1&I&rj&sD",[global])),
- <<"rhubarb">> = iolist_to_binary(re:replace("rhubarb","^((.)(?1)\\2|.)$","g\\1WKOnON\\1\\1YO\\1\\1Uj\\1F",[])),
- <<"rhubarb">> = iolist_to_binary(re:replace("rhubarb","^((.)(?1)\\2|.)$","g\\1WKOnON\\1\\1YO\\1\\1Uj\\1F",[global])),
- <<"the quick brown fox">> = iolist_to_binary(re:replace("the quick brown fox","^((.)(?1)\\2|.)$","JgofHErdXPIu\\1&",[])),
- <<"the quick brown fox">> = iolist_to_binary(re:replace("the quick brown fox","^((.)(?1)\\2|.)$","JgofHErdXPIu\\1&",[global])),
- <<"bKFgOfuwLfpxaHaJaz">> = iolist_to_binary(re:replace("baz","(a)(?<=b(?1))","KFgOfuwLfpx&H\\1J\\1",[])),
- <<"bKFgOfuwLfpxaHaJaz">> = iolist_to_binary(re:replace("baz","(a)(?<=b(?1))","KFgOfuwLfpx&H\\1J\\1",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)(?<=b(?1))","i\\1&j&",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)(?<=b(?1))","i\\1&j&",[global])),
- <<"caz">> = iolist_to_binary(re:replace("caz","(a)(?<=b(?1))","l&U&&H&t&",[])),
- <<"caz">> = iolist_to_binary(re:replace("caz","(a)(?<=b(?1))","l&U&&H&t&",[global])),
- <<"zbaakOqTqMsiTyaSGadz">> = iolist_to_binary(re:replace("zbaaz","(?<=b(?1))(a)","\\1kOqTqMsiTy\\1SG&d",[])),
- <<"zbaakOqTqMsiTyaSGadz">> = iolist_to_binary(re:replace("zbaaz","(?<=b(?1))(a)","\\1kOqTqMsiTy\\1SG&d",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=b(?1))(a)","\\1osY\\1treCMjxk&Af",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=b(?1))(a)","\\1osY\\1treCMjxk&Af",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","(?<=b(?1))(a)","ykA&qS&nno",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","(?<=b(?1))(a)","ykA&qS&nno",[global])),
- <<"baOKaGPxYz">> = iolist_to_binary(re:replace("baz","(?<X>a)(?<=b(?&X))","\\1OK&GPxY",[])),
- <<"baOKaGPxYz">> = iolist_to_binary(re:replace("baz","(?<X>a)(?<=b(?&X))","\\1OK&GPxY",[global])),
+ <<"YRKO">> = iolist_to_binary(re:replace("<abcd>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","YRKO",[extended])),
+ <<"YRKO">> = iolist_to_binary(re:replace("<abcd>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","YRKO",[extended,
+ global])),
+ <<"BraUcvnkvGpATS<abc <123> hij>jqC">> = iolist_to_binary(re:replace("<abc <123> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","BraUcvnkvGpATS&jqC",[extended])),
+ <<"BraUcvnkvGpATS<abc <123> hij>jqC">> = iolist_to_binary(re:replace("<abc <123> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","BraUcvnkvGpATS&jqC",[extended,
+ global])),
+ <<"<abc SvwukU<def>xY<def>tL<def>WM<def>johX hij>">> = iolist_to_binary(re:replace("<abc <def> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","SvwukU&xY&tL&WM\\1johX",[extended])),
+ <<"<abc SvwukU<def>xY<def>tL<def>WM<def>johX hij>">> = iolist_to_binary(re:replace("<abc <def> hij>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","SvwukU&xY&tL&WM\\1johX",[extended,
+ global])),
+ <<"nrGC<abc<>def>R">> = iolist_to_binary(re:replace("<abc<>def>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","nrGC&R",[extended])),
+ <<"nrGC<abc<>def>R">> = iolist_to_binary(re:replace("<abc<>def>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","nrGC&R",[extended,
+ global])),
+ <<"<abcqCRcTne<>iv<>sCXFrnd">> = iolist_to_binary(re:replace("<abc<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","qCRcTne&iv&sCXFrnd",[extended])),
+ <<"<abcqCRcTne<>iv<>sCXFrnd">> = iolist_to_binary(re:replace("<abc<>","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","qCRcTne&iv&sCXFrnd",[extended,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","\\1b&ult&hg\\1P",[extended])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","\\1b&ult&hg\\1P",[extended,
+ global])),
+ <<"<abc">> = iolist_to_binary(re:replace("<abc","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","tRwOvxXk\\1pyskS\\1n",[extended])),
+ <<"<abc">> = iolist_to_binary(re:replace("<abc","((< (?: (?(R) \\d++ | [^<>]*+) | (?2)) * >))","tRwOvxXk\\1pyskS\\1n",[extended,
+ global])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^a+(*FAIL)","gLGD",[])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^a+(*FAIL)","gLGD",[global])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?c+(*FAIL)","e\\1SW&\\1gEu\\1WBl",[])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?c+(*FAIL)","e\\1SW&\\1gEu\\1WBl",[global])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*PRUNE)c+(*FAIL)","Cy",[])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*PRUNE)c+(*FAIL)","Cy",[global])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*COMMIT)c+(*FAIL)","lCKqNoFrmqk",[])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*COMMIT)c+(*FAIL)","lCKqNoFrmqk",[global])),
+ <<"aaabcccaaabccc">> = iolist_to_binary(re:replace("aaabcccaaabccc","a+b?(*SKIP)c+(*FAIL)","gh\\1A&NTPGyR\\1C&",[])),
+ <<"aaabcccaaabccc">> = iolist_to_binary(re:replace("aaabcccaaabccc","a+b?(*SKIP)c+(*FAIL)","gh\\1A&NTPGyR\\1C&",[global])),
+ <<"IUaaaxxxxxxP">> = iolist_to_binary(re:replace("aaaxxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","IU&P",[])),
+ <<"IUaaaxxxxxxP">> = iolist_to_binary(re:replace("aaaxxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","IU&P",[global])),
+ <<"hdKDpy++++++">> = iolist_to_binary(re:replace("aaa++++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","hdKDpy",[])),
+ <<"hdKDpy++++++">> = iolist_to_binary(re:replace("aaa++++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","hdKDpy",[global])),
+ <<"nAXgVEbbbxxxxxhYFcyFVwuV">> = iolist_to_binary(re:replace("bbbxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","nAX\\1gVE&hYF\\1cy\\1FVwuV",[])),
+ <<"nAXgVEbbbxxxxxhYFcyFVwuV">> = iolist_to_binary(re:replace("bbbxxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","nAX\\1gVE&hYF\\1cy\\1FVwuV",[global])),
+ <<"jM+++++">> = iolist_to_binary(re:replace("bbb+++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","jM",[])),
+ <<"jM+++++">> = iolist_to_binary(re:replace("bbb+++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","jM",[global])),
+ <<"xqHG">> = iolist_to_binary(re:replace("cccxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","xqHG",[])),
+ <<"xqHG">> = iolist_to_binary(re:replace("cccxxxx","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","xqHG",[global])),
+ <<"GeWPQyGcccAhlBccccx++++">> = iolist_to_binary(re:replace("ccc++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","GeWPQyG&Ahl\\1Bc&x",[])),
+ <<"GeWPQyGcccAhlBccccx++++">> = iolist_to_binary(re:replace("ccc++++","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","GeWPQyG&Ahl\\1Bc&x",[global])),
+ <<"dNWERdddBmdddlSrdddddd">> = iolist_to_binary(re:replace("dddddddd","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","dNWE\\1R&Bm&\\1lSrd",[])),
+ <<"dNWERdddBmdddlSrdddddd">> = iolist_to_binary(re:replace("dddddddd","^(?:aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","dNWE\\1R&Bm&\\1lSrd",[global])),
+ <<"aaaxxxxxxaaaxxxxxxaaaxxxxxxXAFhdfF">> = iolist_to_binary(re:replace("aaaxxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","&\\1&XAFhdfF",[])),
+ <<"aaaxxxxxxaaaxxxxxxaaaxxxxxxXAFhdfF">> = iolist_to_binary(re:replace("aaaxxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","&\\1&XAFhdfF",[global])),
+ <<"BADWi++++++">> = iolist_to_binary(re:replace("aaa++++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","BADWi",[])),
+ <<"BADWi++++++">> = iolist_to_binary(re:replace("aaa++++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","BADWi",[global])),
+ <<"iGhbbbxxxxxY">> = iolist_to_binary(re:replace("bbbxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","iGh&Y",[])),
+ <<"iGhbbbxxxxxY">> = iolist_to_binary(re:replace("bbbxxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","iGh&Y",[global])),
+ <<"o+++++">> = iolist_to_binary(re:replace("bbb+++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","o",[])),
+ <<"o+++++">> = iolist_to_binary(re:replace("bbb+++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","o",[global])),
+ <<"cccxxxxYEHecccxxxxcccxxxxIOtAN">> = iolist_to_binary(re:replace("cccxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1YEHe\\1\\1IOtAN",[])),
+ <<"cccxxxxYEHecccxxxxcccxxxxIOtAN">> = iolist_to_binary(re:replace("cccxxxx","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","\\1YEHe\\1\\1IOtAN",[global])),
+ <<"RgcccpccccCrLGccccccGS++++">> = iolist_to_binary(re:replace("ccc++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","Rg\\1p&cCrLG\\1\\1GS",[])),
+ <<"RgcccpccccCrLGccccccGS++++">> = iolist_to_binary(re:replace("ccc++++","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","Rg\\1p&cCrLG\\1\\1GS",[global])),
+ <<"aJddddd">> = iolist_to_binary(re:replace("dddddddd","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","aJ",[])),
+ <<"aJddddd">> = iolist_to_binary(re:replace("dddddddd","^(aaa(*THEN)\\w{6}|bbb(*THEN)\\w{5}|ccc(*THEN)\\w{4}|\\w{3})","aJ",[global])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*THEN)c+(*FAIL)","O&n",[])),
+ <<"aaabccc">> = iolist_to_binary(re:replace("aaabccc","a+b?(*THEN)c+(*FAIL)","O&n",[global])),
+ <<"TxOFuVua">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","TxOFuVua",[extended])),
+ <<"TxOFuVua">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","TxOFuVua",[extended,
+ global])),
+ <<"SUX">> = iolist_to_binary(re:replace("ABX","(A (A|B(*ACCEPT)|C) D)(E)","SU",[extended])),
+ <<"SUX">> = iolist_to_binary(re:replace("ABX","(A (A|B(*ACCEPT)|C) D)(E)","SU",[extended,
+ global])),
+ <<"AADAADAADELrNAADnAADEnGvAADEaNIaWn">> = iolist_to_binary(re:replace("AADE","(A (A|B(*ACCEPT)|C) D)(E)","\\1\\1&LrN\\1n&nGv&aNIaWn",[extended])),
+ <<"AADAADAADELrNAADnAADEnGvAADEaNIaWn">> = iolist_to_binary(re:replace("AADE","(A (A|B(*ACCEPT)|C) D)(E)","\\1\\1&LrN\\1n&nGv&aNIaWn",[extended,
+ global])),
+ <<"ACDYODJodgCmmfKwfACD">> = iolist_to_binary(re:replace("ACDE","(A (A|B(*ACCEPT)|C) D)(E)","\\1YODJodgCmmfKwf\\1",[extended])),
+ <<"ACDYODJodgCmmfKwfACD">> = iolist_to_binary(re:replace("ACDE","(A (A|B(*ACCEPT)|C) D)(E)","\\1YODJodgCmmfKwf\\1",[extended,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(A (A|B(*ACCEPT)|C) D)(E)","N\\1FtqpFbrL\\1Uwr&u",[extended])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(A (A|B(*ACCEPT)|C) D)(E)","N\\1FtqpFbrL\\1Uwr&u",[extended,
+ global])),
+ <<"AD">> = iolist_to_binary(re:replace("AD","(A (A|B(*ACCEPT)|C) D)(E)","\\1A\\1QPFrGi",[extended])),
+ <<"AD">> = iolist_to_binary(re:replace("AD","(A (A|B(*ACCEPT)|C) D)(E)","\\1A\\1QPFrGi",[extended,
+ global])),
+ <<"xw1221OijBNT1221R12211221">> = iolist_to_binary(re:replace("1221","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","xw\\1OijBNT\\1R\\1\\1",[caseless])),
+ <<"xw1221OijBNT1221R12211221">> = iolist_to_binary(re:replace("1221","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","xw\\1OijBNT\\1R\\1\\1",[caseless,
+ global])),
+ <<"Satan, oscillate my metallic sonatas!lqABSOBSatan, oscillate my metallic sonatas!">> = iolist_to_binary(re:replace("Satan, oscillate my metallic sonatas!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","&\\1lqABSOB&",[caseless])),
+ <<"Satan, oscillate my metallic sonatas!lqABSOBSatan, oscillate my metallic sonatas!">> = iolist_to_binary(re:replace("Satan, oscillate my metallic sonatas!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","&\\1lqABSOB&",[caseless,
+ global])),
+ <<"fUpPJGcmtHgPTjp">> = iolist_to_binary(re:replace("A man, a plan, a canal: Panama!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","fUpPJGc\\1mtHgP\\1Tjp",[caseless])),
+ <<"fUpPJGcmtHgPTjp">> = iolist_to_binary(re:replace("A man, a plan, a canal: Panama!","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","fUpPJGc\\1mtHgP\\1Tjp",[caseless,
+ global])),
+ <<"Able was I ere I saw Elba.pQyfPUbHSt">> = iolist_to_binary(re:replace("Able was I ere I saw Elba.","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","&pQyfPUb\\1HSt",[caseless])),
+ <<"Able was I ere I saw Elba.pQyfPUbHSt">> = iolist_to_binary(re:replace("Able was I ere I saw Elba.","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","&pQyfPUb\\1HSt",[caseless,
+ global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","QItD\\1t&XKbLqmp",[caseless])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","QItD\\1t&XKbLqmp",[caseless,
+ global])),
+ <<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","HyrL&",[caseless])),
+ <<"The quick brown fox">> = iolist_to_binary(re:replace("The quick brown fox","^\\W*+(?:((.)\\W*+(?1)\\W*+\\2|)|((.)\\W*+(?3)\\W*+\\4|\\W*+.\\W*+))\\W*+$","HyrL&",[caseless,
+ global])),
+ <<"MUxDTa">> = iolist_to_binary(re:replace("a","^((.)(?1)\\2|.)$","MUxDT&",[])),
+ <<"MUxDTa">> = iolist_to_binary(re:replace("a","^((.)(?1)\\2|.)$","MUxDT&",[global])),
+ <<"sdabaq">> = iolist_to_binary(re:replace("aba","^((.)(?1)\\2|.)$","sd\\1q",[])),
+ <<"sdabaq">> = iolist_to_binary(re:replace("aba","^((.)(?1)\\2|.)$","sd\\1q",[global])),
+ <<"FQLjaabaaHLRNaabaaaabaat">> = iolist_to_binary(re:replace("aabaa","^((.)(?1)\\2|.)$","FQLj&HLRN\\1\\1t",[])),
+ <<"FQLjaabaaHLRNaabaaaabaat">> = iolist_to_binary(re:replace("aabaa","^((.)(?1)\\2|.)$","FQLj&HLRN\\1\\1t",[global])),
+ <<"dAayeabcdcbaBfabcdcbaUNI">> = iolist_to_binary(re:replace("abcdcba","^((.)(?1)\\2|.)$","dAaye\\1Bf&UNI",[])),
+ <<"dAayeabcdcbaBfabcdcbaUNI">> = iolist_to_binary(re:replace("abcdcba","^((.)(?1)\\2|.)$","dAaye\\1Bf&UNI",[global])),
+ <<"OpqaabaaqpQpqaabaaqpfkfGJxwpqaabaaqpxkmrGMpqaabaaqp">> = iolist_to_binary(re:replace("pqaabaaqp","^((.)(?1)\\2|.)$","O&Q\\1fkfGJxw&xkmrGM&",[])),
+ <<"OpqaabaaqpQpqaabaaqpfkfGJxwpqaabaaqpxkmrGMpqaabaaqp">> = iolist_to_binary(re:replace("pqaabaaqp","^((.)(?1)\\2|.)$","O&Q\\1fkfGJxw&xkmrGM&",[global])),
+ <<"bdVxablewasiereisawelbaYcoMDjqablewasiereisawelbafdablewasiereisawelbatinE">> = iolist_to_binary(re:replace("ablewasiereisawelba","^((.)(?1)\\2|.)$","bdVx&YcoMDjq&fd\\1tinE",[])),
+ <<"bdVxablewasiereisawelbaYcoMDjqablewasiereisawelbafdablewasiereisawelbatinE">> = iolist_to_binary(re:replace("ablewasiereisawelba","^((.)(?1)\\2|.)$","bdVx&YcoMDjq&fd\\1tinE",[global])),
+ <<"rhubarb">> = iolist_to_binary(re:replace("rhubarb","^((.)(?1)\\2|.)$","XD\\1&vY\\1SvD&NK&AfJ",[])),
+ <<"rhubarb">> = iolist_to_binary(re:replace("rhubarb","^((.)(?1)\\2|.)$","XD\\1&vY\\1SvD&NK&AfJ",[global])),
+ <<"the quick brown fox">> = iolist_to_binary(re:replace("the quick brown fox","^((.)(?1)\\2|.)$","MnEjDLxqRfD\\1dksvBNU",[])),
+ <<"the quick brown fox">> = iolist_to_binary(re:replace("the quick brown fox","^((.)(?1)\\2|.)$","MnEjDLxqRfD\\1dksvBNU",[global])),
+ <<"bSanz">> = iolist_to_binary(re:replace("baz","(a)(?<=b(?1))","S\\1n",[])),
+ <<"bSanz">> = iolist_to_binary(re:replace("baz","(a)(?<=b(?1))","S\\1n",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)(?<=b(?1))","I\\1&BaUakXjhOFhQy\\1kv",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)(?<=b(?1))","I\\1&BaUakXjhOFhQy\\1kv",[global])),
+ <<"caz">> = iolist_to_binary(re:replace("caz","(a)(?<=b(?1))","&x&&&cABhoecjW&D",[])),
+ <<"caz">> = iolist_to_binary(re:replace("caz","(a)(?<=b(?1))","&x&&&cABhoecjW&D",[global])),
+ <<"zbamBPamYeGJasagajz">> = iolist_to_binary(re:replace("zbaaz","(?<=b(?1))(a)","mBP\\1mYeGJ\\1s&g&j",[])),
+ <<"zbamBPamYeGJasagajz">> = iolist_to_binary(re:replace("zbaaz","(?<=b(?1))(a)","mBP\\1mYeGJ\\1s&g&j",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=b(?1))(a)","&y&R&ANqnrUXsC",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=b(?1))(a)","&y&R&ANqnrUXsC",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","(?<=b(?1))(a)","F&&lb\\1OEkErh\\1&s\\1T",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","(?<=b(?1))(a)","F&&lb\\1OEkErh\\1&s\\1T",[global])),
+ <<"basaBtugJSalfoIoaaz">> = iolist_to_binary(re:replace("baz","(?<X>a)(?<=b(?&X))","\\1s&BtugJS\\1lfoIo\\1a",[])),
+ <<"basaBtugJSalfoIoaaz">> = iolist_to_binary(re:replace("baz","(?<X>a)(?<=b(?&X))","\\1s&BtugJS\\1lfoIo\\1a",[global])),
+ <<"abcabcdfYwAHcFyJUBIKabcabcabcabcabcabc">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))\\1","&dfYwAHcFyJUBIK&&&",[])),
+ <<"abcabcdfYwAHcFyJUBIKabcabcabcabcabcabc">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))\\1","&dfYwAHcFyJUBIK&&&",[global])),
+ <<"defdefewRuSdefdefb">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))\\1","&ewRuS&b",[])),
+ <<"defdefewRuSdefdefb">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))\\1","&ewRuS&b",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))\\1","iOiPewDMrMw&Iy",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))\\1","iOiPewDMrMw&Iy",[global])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))\\1","rkSqOQ",[])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))\\1","rkSqOQ",[global])),
+ <<"defabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))\\1","V",[])),
+ <<"defabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))\\1","V",[global])),
ok.
run43() ->
- <<"abckIo">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))\\1","\\1kIo",[])),
- <<"abckIo">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))\\1","\\1kIo",[global])),
- <<"sdefdefUbl">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))\\1","s&Ubl",[])),
- <<"sdefdefUbl">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))\\1","s&Ubl",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))\\1","&m&bWQpRl",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))\\1","&m&bWQpRl",[global])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))\\1","qwUmfoHo&tN",[])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))\\1","qwUmfoHo&tN",[global])),
- <<"defabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))\\1","KGoYhhlYddcruQ&k",[])),
- <<"defabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))\\1","KGoYhhlYddcruQ&k",[global])),
- <<"PdYfAnnabcPxabcabcHvAQabcabcabcabcabcls">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))(?1)","PdYfAnn\\1Px&HvAQ&&\\1ls",[])),
- <<"PdYfAnnabcPxabcabcHvAQabcabcabcabcabcls">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))(?1)","PdYfAnn\\1Px&HvAQ&&\\1ls",[global])),
- <<"PAdefabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))(?1)","PA&",[])),
- <<"PAdefabc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))(?1)","PA&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))(?1)","Fqig",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))(?1)","Fqig",[global])),
- <<"defdef">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))(?1)","e&yLb\\1&\\1D\\1q\\1UcBtn&",[])),
- <<"defdef">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))(?1)","e&yLb\\1&\\1D\\1q\\1UcBtn&",[global])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))(?1)","&\\1\\1\\1atTuOfcyl\\1RO&y",[])),
- <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))(?1)","&\\1\\1\\1atTuOfcyl\\1RO&y",[global])),
- <<"ACBCSBCTCMoOD">> = iolist_to_binary(re:replace("ABCD","(?:(?1)|B)(A(*F)|C)","C&S&T\\1MoO",[])),
- <<"ACBCSBCTCMoOD">> = iolist_to_binary(re:replace("ABCD","(?:(?1)|B)(A(*F)|C)","C&S&T\\1MoO",[global])),
- <<"bD">> = iolist_to_binary(re:replace("CCD","(?:(?1)|B)(A(*F)|C)","b",[])),
- <<"bD">> = iolist_to_binary(re:replace("CCD","(?:(?1)|B)(A(*F)|C)","b",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*F)|C)","u&dbYn\\1jVvV&V\\1XC",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*F)|C)","u&dbYn\\1jVvV&V\\1XC",[global])),
- <<"CAD">> = iolist_to_binary(re:replace("CAD","(?:(?1)|B)(A(*F)|C)","UbDT\\1DjcdPh",[])),
- <<"CAD">> = iolist_to_binary(re:replace("CAD","(?:(?1)|B)(A(*F)|C)","UbDT\\1DjcdPh",[global])),
- <<"CCahPD">> = iolist_to_binary(re:replace("CCD","^(?:(?1)|B)(A(*F)|C)","&ahP",[])),
- <<"CCahPD">> = iolist_to_binary(re:replace("CCD","^(?:(?1)|B)(A(*F)|C)","&ahP",[global])),
- <<"IYJaGD">> = iolist_to_binary(re:replace("BCD","^(?:(?1)|B)(A(*F)|C)","IYJaG",[])),
- <<"IYJaGD">> = iolist_to_binary(re:replace("BCD","^(?:(?1)|B)(A(*F)|C)","IYJaG",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:(?1)|B)(A(*F)|C)","uckGWWHQG&ocJD\\1l\\1T",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:(?1)|B)(A(*F)|C)","uckGWWHQG&ocJD\\1l\\1T",[global])),
- <<"ABCD">> = iolist_to_binary(re:replace("ABCD","^(?:(?1)|B)(A(*F)|C)","qbEQn",[])),
- <<"ABCD">> = iolist_to_binary(re:replace("ABCD","^(?:(?1)|B)(A(*F)|C)","qbEQn",[global])),
- <<"CAD">> = iolist_to_binary(re:replace("CAD","^(?:(?1)|B)(A(*F)|C)","kVqFM&D",[])),
- <<"CAD">> = iolist_to_binary(re:replace("CAD","^(?:(?1)|B)(A(*F)|C)","kVqFM&D",[global])),
- <<"BAD">> = iolist_to_binary(re:replace("BAD","^(?:(?1)|B)(A(*F)|C)","nKcCWd\\1",[])),
- <<"BAD">> = iolist_to_binary(re:replace("BAD","^(?:(?1)|B)(A(*F)|C)","nKcCWd\\1",[global])),
- <<"mCJFixrmAAAPiiNWHD">> = iolist_to_binary(re:replace("AAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","mCJFixrm&APiiNWH",[])),
- <<"mCJFixrmAAAPiiNWHD">> = iolist_to_binary(re:replace("AAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","mCJFixrm&APiiNWH",[global])),
- <<"fjOtIXCc">> = iolist_to_binary(re:replace("ACD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","fjOtIXCc",[])),
- <<"fjOtIXCc">> = iolist_to_binary(re:replace("ACD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","fjOtIXCc",[global])),
- <<"KSgQhFSAnBABD">> = iolist_to_binary(re:replace("BAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","KSgQhFS\\1n&B",[])),
- <<"KSgQhFSAnBABD">> = iolist_to_binary(re:replace("BAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","KSgQhFS\\1n&B",[global])),
- <<"KdBHaAwVPBCDCGCsRCBCD">> = iolist_to_binary(re:replace("BCD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","KdBHaAwVP&\\1G\\1sRC&",[])),
- <<"KdBHaAwVPBCDCGCsRCBCD">> = iolist_to_binary(re:replace("BCD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","KdBHaAwVP&\\1G\\1sRC&",[global])),
- <<"iaomqEcFWGhoDBAAnBAiCX">> = iolist_to_binary(re:replace("BAX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","iaomqEcFWGhoD&\\1n&iC",[])),
- <<"iaomqEcFWGhoDBAAnBAiCX">> = iolist_to_binary(re:replace("BAX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","iaomqEcFWGhoD&\\1n&iC",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*ACCEPT)XX|C)D","S\\1&OO",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*ACCEPT)XX|C)D","S\\1&OO",[global])),
- <<"ACX">> = iolist_to_binary(re:replace("ACX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","F\\1&dqt",[])),
- <<"ACX">> = iolist_to_binary(re:replace("ACX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","F\\1&dqt",[global])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","(?:(?1)|B)(A(*ACCEPT)XX|C)D","bL\\1I",[])),
- <<"ABC">> = iolist_to_binary(re:replace("ABC","(?:(?1)|B)(A(*ACCEPT)XX|C)D","bL\\1I",[global])),
- <<"h">> = iolist_to_binary(re:replace("BAC","(?(DEFINE)(A))B(?1)C","\\1h",[])),
- <<"h">> = iolist_to_binary(re:replace("BAC","(?(DEFINE)(A))B(?1)C","\\1h",[global])),
- <<"EiDCVEGlgEGIr">> = iolist_to_binary(re:replace("BAAC","(?(DEFINE)((A)\\2))B(?1)C","E\\1iD\\1C\\1V\\1EG\\1lgEGIr",[])),
- <<"EiDCVEGlgEGIr">> = iolist_to_binary(re:replace("BAAC","(?(DEFINE)((A)\\2))B(?1)C","E\\1iD\\1C\\1V\\1EG\\1lgEGIr",[global])),
- <<"u(ab(cd)ef)(ab(cd)ef)v(ab(cd)ef)M">> = iolist_to_binary(re:replace("(ab(cd)ef)","(?<pn> \\( ( [^()]++ | (?&pn) )* \\) )","u&\\1v&M",[extended])),
- <<"u(ab(cd)ef)(ab(cd)ef)v(ab(cd)ef)M">> = iolist_to_binary(re:replace("(ab(cd)ef)","(?<pn> \\( ( [^()]++ | (?&pn) )* \\) )","u&\\1v&M",[extended,
- global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*SKIP)b|ac)","EhJBenWdk&&",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*SKIP)b|ac)","EhJBenWdk&&",[global])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*SKIP)b|ac)","DVmcudRK&vBXmqcVY",[])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*SKIP)b|ac)","DVmcudRK&vBXmqcVY",[global])),
- <<"qxyHbdqjab">> = iolist_to_binary(re:replace("ab","^(?=a(*PRUNE)b)","qxyH&bdqj",[])),
- <<"qxyHbdqjab">> = iolist_to_binary(re:replace("ab","^(?=a(*PRUNE)b)","qxyH&bdqj",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*PRUNE)b)","qDd\\1UHvpsMvHI\\1gEx&d",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*PRUNE)b)","qDd\\1UHvpsMvHI\\1gEx&d",[global])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*PRUNE)b)","mB\\1\\1R&\\1Ax",[])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*PRUNE)b)","mB\\1\\1R&\\1Ax",[global])),
- <<"FpGwac">> = iolist_to_binary(re:replace("ac","^(?=a(*ACCEPT)b)","Fp\\1Gw",[])),
- <<"FpGwac">> = iolist_to_binary(re:replace("ac","^(?=a(*ACCEPT)b)","Fp\\1Gw",[global])),
- <<"abCqbtkqunCIvDxbdMM">> = iolist_to_binary(re:replace("ab","(?>a\\Kb)","&Cq&t\\1kqunCIvDx&dMM",[])),
- <<"abCqbtkqunCIvDxbdMM">> = iolist_to_binary(re:replace("ab","(?>a\\Kb)","&Cq&t\\1kqunCIvDx&dMM",[global])),
- <<"aAk">> = iolist_to_binary(re:replace("ab","((?>a\\Kb))","Ak",[])),
- <<"aAk">> = iolist_to_binary(re:replace("ab","((?>a\\Kb))","Ak",[global])),
- <<"anKUUUFwaxNFjPabNJd">> = iolist_to_binary(re:replace("ab","(a\\Kb)","nKUUUFwaxNFjP\\1NJd",[])),
- <<"anKUUUFwaxNFjPabNJd">> = iolist_to_binary(re:replace("ab","(a\\Kb)","nKUUUFwaxNFjP\\1NJd",[global])),
- <<"acuYfxPcxoRKaceSXk">> = iolist_to_binary(re:replace("ac","^a\\Kcz|ac","&uYfxPcxoRK\\1\\1&eSXk",[])),
- <<"acuYfxPcxoRKaceSXk">> = iolist_to_binary(re:replace("ac","^a\\Kcz|ac","&uYfxPcxoRK\\1\\1&eSXk",[global])),
- <<"abCSFabuababvPlR">> = iolist_to_binary(re:replace("ab","(?>a\\Kbz|ab)","\\1&CSF&u&&vPlR",[])),
- <<"abCSFabuababvPlR">> = iolist_to_binary(re:replace("ab","(?>a\\Kbz|ab)","\\1&CSF&u&&vPlR",[global])),
- <<"aomXuCuVpjjUFcrWQIR">> = iolist_to_binary(re:replace("ab","^(?&t)(?(DEFINE)(?<t>a\\Kb))$","omXuCuVpjjUFcrW\\1QIR",[])),
- <<"aomXuCuVpjjUFcrWQIR">> = iolist_to_binary(re:replace("ab","^(?&t)(?(DEFINE)(?<t>a\\Kb))$","omXuCuVpjjUFcrW\\1QIR",[global])),
- <<"a(b)clxcg">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","&lx\\1g",[])),
- <<"a(b)clxcg">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","&lx\\1g",[global])),
- <<"dUeBGa(b(c)d)emKya(b(c)d)e">> = iolist_to_binary(re:replace("a(b(c)d)e","^([^()]|\\((?1)*\\))*$","dU\\1BG&mKy&",[])),
- <<"dUeBGa(b(c)d)emKya(b(c)d)e">> = iolist_to_binary(re:replace("a(b(c)d)e","^([^()]|\\((?1)*\\))*$","dU\\1BG&mKy&",[global])),
- <<"cP00f0uN">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","cP&\\1f&uN",[])),
- <<"cP00f0uN">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","cP&\\1f&uN",[global])),
- <<"pV00MD00p00haFc00MG00qG">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","pV\\1MD\\1p\\1haFc&MG&qG",[])),
- <<"pV00MD00p00haFc00MG00qG">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","pV\\1MD\\1p\\1haFc&MG&qG",[global])),
- <<"GdBC0000INu00000000Y0000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","GdBC&INu&&Y&",[])),
- <<"GdBC0000INu00000000Y0000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","GdBC&INu&&Y&",[global])),
+ <<"LfjQyR">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))(?1)","LfjQyR",[])),
+ <<"LfjQyR">> = iolist_to_binary(re:replace("abcabc","^(?|(abc)|(def))(?1)","LfjQyR",[global])),
+ <<"tWpTOWdefabcdefkdefabcYBc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))(?1)","tWpTOW&\\1k&YBc",[])),
+ <<"tWpTOWdefabcdefkdefabcYBc">> = iolist_to_binary(re:replace("defabc","^(?|(abc)|(def))(?1)","tWpTOW&\\1k&YBc",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))(?1)","&XvMpW",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?|(abc)|(def))(?1)","&XvMpW",[global])),
+ <<"defdef">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))(?1)","JS\\1AJl&S",[])),
+ <<"defdef">> = iolist_to_binary(re:replace("defdef","^(?|(abc)|(def))(?1)","JS\\1AJl&S",[global])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))(?1)","s&",[])),
+ <<"abcdef">> = iolist_to_binary(re:replace("abcdef","^(?|(abc)|(def))(?1)","s&",[global])),
+ <<"ACIMaBCCCrtBCLBSuRcqDCrD">> = iolist_to_binary(re:replace("ABCD","(?:(?1)|B)(A(*F)|C)","\\1IMa&\\1\\1rt&LBSuRcqDCr",[])),
+ <<"ACIMaBCCCrtBCLBSuRcqDCrD">> = iolist_to_binary(re:replace("ABCD","(?:(?1)|B)(A(*F)|C)","\\1IMa&\\1\\1rt&LBSuRcqDCr",[global])),
+ <<"oCCiCCCkCfarCUTFD">> = iolist_to_binary(re:replace("CCD","(?:(?1)|B)(A(*F)|C)","o&i&\\1k\\1far\\1UTF",[])),
+ <<"oCCiCCCkCfarCUTFD">> = iolist_to_binary(re:replace("CCD","(?:(?1)|B)(A(*F)|C)","o&i&\\1k\\1far\\1UTF",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*F)|C)","fR\\1POKy&h\\1tsX",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*F)|C)","fR\\1POKy&h\\1tsX",[global])),
+ <<"CAD">> = iolist_to_binary(re:replace("CAD","(?:(?1)|B)(A(*F)|C)","&hH\\1XGD\\1tfghlx\\1",[])),
+ <<"CAD">> = iolist_to_binary(re:replace("CAD","(?:(?1)|B)(A(*F)|C)","&hH\\1XGD\\1tfghlx\\1",[global])),
+ <<"CCePUJnkSD">> = iolist_to_binary(re:replace("CCD","^(?:(?1)|B)(A(*F)|C)","&ePUJnkS",[])),
+ <<"CCePUJnkSD">> = iolist_to_binary(re:replace("CCD","^(?:(?1)|B)(A(*F)|C)","&ePUJnkS",[global])),
+ <<"HDSBCbcCRNYiEPlVoYXD">> = iolist_to_binary(re:replace("BCD","^(?:(?1)|B)(A(*F)|C)","HDS&bc\\1RNYiEPlVoYX",[])),
+ <<"HDSBCbcCRNYiEPlVoYXD">> = iolist_to_binary(re:replace("BCD","^(?:(?1)|B)(A(*F)|C)","HDS&bc\\1RNYiEPlVoYX",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:(?1)|B)(A(*F)|C)","S",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:(?1)|B)(A(*F)|C)","S",[global])),
+ <<"ABCD">> = iolist_to_binary(re:replace("ABCD","^(?:(?1)|B)(A(*F)|C)","jMfVoww\\1ses&oWOL&yd",[])),
+ <<"ABCD">> = iolist_to_binary(re:replace("ABCD","^(?:(?1)|B)(A(*F)|C)","jMfVoww\\1ses&oWOL&yd",[global])),
+ <<"CAD">> = iolist_to_binary(re:replace("CAD","^(?:(?1)|B)(A(*F)|C)","QqHTIgCo\\1&\\1\\1iIlqX&O",[])),
+ <<"CAD">> = iolist_to_binary(re:replace("CAD","^(?:(?1)|B)(A(*F)|C)","QqHTIgCo\\1&\\1\\1iIlqX&O",[global])),
+ <<"BAD">> = iolist_to_binary(re:replace("BAD","^(?:(?1)|B)(A(*F)|C)","fBLv",[])),
+ <<"BAD">> = iolist_to_binary(re:replace("BAD","^(?:(?1)|B)(A(*F)|C)","fBLv",[global])),
+ <<"lyLDABYgvAD">> = iolist_to_binary(re:replace("AAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","lyLD\\1BYgv\\1",[])),
+ <<"lyLDABYgvAD">> = iolist_to_binary(re:replace("AAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","lyLD\\1BYgv\\1",[global])),
+ <<"RyACDCXACDqsCvwyCACDkyHc">> = iolist_to_binary(re:replace("ACD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","Ry&\\1X&qs\\1vwy\\1&kyHc",[])),
+ <<"RyACDCXACDqsCvwyCACDkyHc">> = iolist_to_binary(re:replace("ACD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","Ry&\\1X&qs\\1vwy\\1&kyHc",[global])),
+ <<"AuXMduD">> = iolist_to_binary(re:replace("BAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","\\1uXMdu",[])),
+ <<"AuXMduD">> = iolist_to_binary(re:replace("BAD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","\\1uXMdu",[global])),
+ <<"oTbEDv">> = iolist_to_binary(re:replace("BCD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","oTbEDv",[])),
+ <<"oTbEDv">> = iolist_to_binary(re:replace("BCD","(?:(?1)|B)(A(*ACCEPT)XX|C)D","oTbEDv",[global])),
+ <<"RBAelTeYBABAAX">> = iolist_to_binary(re:replace("BAX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","R&elTeY&&\\1",[])),
+ <<"RBAelTeYBABAAX">> = iolist_to_binary(re:replace("BAX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","R&elTeY&&\\1",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*ACCEPT)XX|C)D","&&X\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?:(?1)|B)(A(*ACCEPT)XX|C)D","&&X\\1",[global])),
+ <<"ACX">> = iolist_to_binary(re:replace("ACX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","\\1YnMw&&&\\1Nxi&Wfb",[])),
+ <<"ACX">> = iolist_to_binary(re:replace("ACX","(?:(?1)|B)(A(*ACCEPT)XX|C)D","\\1YnMw&&&\\1Nxi&Wfb",[global])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","(?:(?1)|B)(A(*ACCEPT)XX|C)D","eX\\1YNXkcuaal",[])),
+ <<"ABC">> = iolist_to_binary(re:replace("ABC","(?:(?1)|B)(A(*ACCEPT)XX|C)D","eX\\1YNXkcuaal",[global])),
+ <<"cpDBACdDivSoeWp">> = iolist_to_binary(re:replace("BAC","(?(DEFINE)(A))B(?1)C","cpD&dD\\1i\\1vSoeWp",[])),
+ <<"cpDBACdDivSoeWp">> = iolist_to_binary(re:replace("BAC","(?(DEFINE)(A))B(?1)C","cpD&dD\\1i\\1vSoeWp",[global])),
+ <<"HTBAAC">> = iolist_to_binary(re:replace("BAAC","(?(DEFINE)((A)\\2))B(?1)C","H\\1T&",[])),
+ <<"HTBAAC">> = iolist_to_binary(re:replace("BAAC","(?(DEFINE)((A)\\2))B(?1)C","H\\1T&",[global])),
+ <<"U(ab(cd)ef)Wy">> = iolist_to_binary(re:replace("(ab(cd)ef)","(?<pn> \\( ( [^()]++ | (?&pn) )* \\) )","U\\1Wy",[extended])),
+ <<"U(ab(cd)ef)Wy">> = iolist_to_binary(re:replace("(ab(cd)ef)","(?<pn> \\( ( [^()]++ | (?&pn) )* \\) )","U\\1Wy",[extended,
+ global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*SKIP)b|ac)","rGTH&RVHejd&k",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*SKIP)b|ac)","rGTH&RVHejd&k",[global])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*SKIP)b|ac)","\\1&GCt&D&Lja",[])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*SKIP)b|ac)","\\1&GCt&D&Lja",[global])),
+ <<"fQfwLkab">> = iolist_to_binary(re:replace("ab","^(?=a(*PRUNE)b)","f\\1QfwLk",[])),
+ <<"fQfwLkab">> = iolist_to_binary(re:replace("ab","^(?=a(*PRUNE)b)","f\\1QfwLk",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*PRUNE)b)","\\1yjrFT&QU\\1QP\\1&u",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?=a(*PRUNE)b)","\\1yjrFT&QU\\1QP\\1&u",[global])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*PRUNE)b)","&gpi\\1",[])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^(?=a(*PRUNE)b)","&gpi\\1",[global])),
+ <<"kQac">> = iolist_to_binary(re:replace("ac","^(?=a(*ACCEPT)b)","kQ",[])),
+ <<"kQac">> = iolist_to_binary(re:replace("ac","^(?=a(*ACCEPT)b)","kQ",[global])),
+ <<"ajbIblt">> = iolist_to_binary(re:replace("ab","(?>a\\Kb)","j&I&lt",[])),
+ <<"ajbIblt">> = iolist_to_binary(re:replace("ab","(?>a\\Kb)","j&I&lt",[global])),
+ <<"ajOfKabMbvu">> = iolist_to_binary(re:replace("ab","((?>a\\Kb))","jOfK\\1M&vu",[])),
+ <<"ajOfKabMbvu">> = iolist_to_binary(re:replace("ab","((?>a\\Kb))","jOfK\\1M&vu",[global])),
+ <<"aWbQSVababHodUgHSHnt">> = iolist_to_binary(re:replace("ab","(a\\Kb)","W&QSV\\1\\1HodUgHSHnt",[])),
+ <<"aWbQSVababHodUgHSHnt">> = iolist_to_binary(re:replace("ab","(a\\Kb)","W&QSV\\1\\1HodUgHSHnt",[global])),
+ <<"oyDWsqkcnuracWk">> = iolist_to_binary(re:replace("ac","^a\\Kcz|ac","oyDWsqkc\\1nur&\\1Wk",[])),
+ <<"oyDWsqkcnuracWk">> = iolist_to_binary(re:replace("ac","^a\\Kcz|ac","oyDWsqkc\\1nur&\\1Wk",[global])),
+ <<"drmFabyB">> = iolist_to_binary(re:replace("ab","(?>a\\Kbz|ab)","dr\\1mF&yB",[])),
+ <<"drmFabyB">> = iolist_to_binary(re:replace("ab","(?>a\\Kbz|ab)","dr\\1mF&yB",[global])),
+ <<"ajbVLbJkkPEEGEA">> = iolist_to_binary(re:replace("ab","^(?&t)(?(DEFINE)(?<t>a\\Kb))$","j\\1&VL&Jk\\1kPEE\\1G\\1E\\1A",[])),
+ <<"ajbVLbJkkPEEGEA">> = iolist_to_binary(re:replace("ab","^(?&t)(?(DEFINE)(?<t>a\\Kb))$","j\\1&VL&Jk\\1kPEE\\1G\\1E\\1A",[global])),
+ <<"Ua(b)c">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","U&",[])),
+ <<"Ua(b)c">> = iolist_to_binary(re:replace("a(b)c","^([^()]|\\((?1)*\\))*$","U&",[global])),
+ <<"a(b(c)d)eU">> = iolist_to_binary(re:replace("a(b(c)d)e","^([^()]|\\((?1)*\\))*$","&U",[])),
+ <<"a(b(c)d)eU">> = iolist_to_binary(re:replace("a(b(c)d)e","^([^()]|\\((?1)*\\))*$","&U",[global])),
+ <<"Wc00ens">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","Wc&\\1ens",[])),
+ <<"Wc00ens">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","Wc&\\1ens",[global])),
+ <<"ot">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","ot",[])),
+ <<"ot">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","ot",[global])),
+ <<"TKKhmnqB0000j0000hwMe000000000000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","TKKhmnqB&j\\1hwMe&&&",[])),
+ <<"TKKhmnqB0000j0000hwMe000000000000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))","TKKhmnqB&j\\1hwMe&&&",[global])),
+ <<"A0FKEFFLo0gFNc0ISDNV">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","A&FKEFFLo&gFNc&ISDNV",[])),
+ <<"A0FKEFFLo0gFNc0ISDNV">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","A&FKEFFLo&gFNc&ISDNV",[global])),
+ <<"gbEHUma0JEum0t0TGBi0">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","gbEHUma\\1JEum\\1t\\1TGBi",[])),
+ <<"gbEHUma0JEum0t0TGBigbEHUma0JEum0t0TGBi">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","gbEHUma\\1JEum\\1t\\1TGBi",[global])),
+ <<"Mfh0OrMhJ0C00sj0000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","Mfh&OrMhJ&C&\\1sj&",[])),
+ <<"Mfh0OrMhJ0C00sj0Mfh0OrMhJ0C00sj0Mfh0OrMhJ0C00sj0Mfh0OrMhJ0C00sj0">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","Mfh&OrMhJ&C&\\1sj&",[global])),
ok.
run44() ->
- <<"00RwFP">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","&&RwFP",[])),
- <<"00RwFP">> = iolist_to_binary(re:replace("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","&&RwFP",[global])),
- <<"TIRVuPlNk0">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","TIRVuPlNk",[])),
- <<"TIRVuPlNkTIRVuPlNk">> = iolist_to_binary(re:replace("00","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","TIRVuPlNk",[global])),
- <<"0IxIBm0KbqqiO000">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","&IxIBm&KbqqiO",[])),
- <<"0IxIBm0KbqqiO0IxIBm0KbqqiO0IxIBm0KbqqiO0IxIBm0KbqqiO">> = iolist_to_binary(re:replace("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))","&IxIBm&KbqqiO",[global])),
- <<"ACABX">> = iolist_to_binary(re:replace("ACABX","A(*COMMIT)(B|D)","\\1&&\\1KWXWa",[])),
- <<"ACABX">> = iolist_to_binary(re:replace("ACABX","A(*COMMIT)(B|D)","\\1&&\\1KWXWa",[global])),
- <<"ABCgPYRRqRBOrABCABCAHBQDEFG">> = iolist_to_binary(re:replace("ABCDEFG","(*COMMIT)(A|P)(B|P)(C|P)","&gPYRRqRBOr&&\\1HBQ",[])),
- <<"ABCgPYRRqRBOrABCABCAHBQDEFG">> = iolist_to_binary(re:replace("ABCDEFG","(*COMMIT)(A|P)(B|P)(C|P)","&gPYRRqRBOr&&\\1HBQ",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(*COMMIT)(A|P)(B|P)(C|P)","awq\\1dexeIK&rKgbPrqk",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(*COMMIT)(A|P)(B|P)(C|P)","awq\\1dexeIK&rKgbPrqk",[global])),
- <<"DEFGABC">> = iolist_to_binary(re:replace("DEFGABC","(*COMMIT)(A|P)(B|P)(C|P)","NRfdYIv\\1HtrT",[])),
- <<"DEFGABC">> = iolist_to_binary(re:replace("DEFGABC","(*COMMIT)(A|P)(B|P)(C|P)","NRfdYIv\\1HtrT",[global])),
- <<"jYabbbAGmvaabbbXabbbTAaixGp">> = iolist_to_binary(re:replace("abbb","(\\w+)(?>b(*COMMIT))\\w{2}","jY&AGmv\\1&X&TA\\1ixGp",[])),
- <<"jYabbbAGmvaabbbXabbbTAaixGp">> = iolist_to_binary(re:replace("abbb","(\\w+)(?>b(*COMMIT))\\w{2}","jY&AGmv\\1&X&TA\\1ixGp",[global])),
- <<"abbb">> = iolist_to_binary(re:replace("abbb","(\\w+)b(*COMMIT)\\w{2}","\\1mM",[])),
- <<"abbb">> = iolist_to_binary(re:replace("abbb","(\\w+)b(*COMMIT)\\w{2}","\\1mM",[global])),
- <<"bofPRc">> = iolist_to_binary(re:replace("bac","(?&t)(?#()(?(DEFINE)(?<t>a))","ofPR",[])),
- <<"bofPRc">> = iolist_to_binary(re:replace("bac","(?&t)(?#()(?(DEFINE)(?<t>a))","ofPR",[global])),
- <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?","&ItXS\\1Uh&ueLGo\\1AKJxK",[])),
- <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?","&ItXS\\1Uh&ueLGo\\1AKJxK",[global])),
- <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?","VnOG&\\1W",[])),
- <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?","VnOG&\\1W",[global])),
+ <<"ACABX">> = iolist_to_binary(re:replace("ACABX","A(*COMMIT)(B|D)","RuGESUvQDVqs",[])),
+ <<"ACABX">> = iolist_to_binary(re:replace("ACABX","A(*COMMIT)(B|D)","RuGESUvQDVqs",[global])),
+ <<"AABCQYABCchASpSgMsjmJDEFG">> = iolist_to_binary(re:replace("ABCDEFG","(*COMMIT)(A|P)(B|P)(C|P)","\\1&QY&ch\\1SpSgMsjmJ",[])),
+ <<"AABCQYABCchASpSgMsjmJDEFG">> = iolist_to_binary(re:replace("ABCDEFG","(*COMMIT)(A|P)(B|P)(C|P)","\\1&QY&ch\\1SpSgMsjmJ",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(*COMMIT)(A|P)(B|P)(C|P)","OnYL&y&\\1\\1YaeL&Rp&Bh",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(*COMMIT)(A|P)(B|P)(C|P)","OnYL&y&\\1\\1YaeL&Rp&Bh",[global])),
+ <<"DEFGABC">> = iolist_to_binary(re:replace("DEFGABC","(*COMMIT)(A|P)(B|P)(C|P)","oeob&",[])),
+ <<"DEFGABC">> = iolist_to_binary(re:replace("DEFGABC","(*COMMIT)(A|P)(B|P)(C|P)","oeob&",[global])),
+ <<"axGkabbbGcWn">> = iolist_to_binary(re:replace("abbb","(\\w+)(?>b(*COMMIT))\\w{2}","axGk&GcWn",[])),
+ <<"axGkabbbGcWn">> = iolist_to_binary(re:replace("abbb","(\\w+)(?>b(*COMMIT))\\w{2}","axGk&GcWn",[global])),
+ <<"abbb">> = iolist_to_binary(re:replace("abbb","(\\w+)b(*COMMIT)\\w{2}","lC\\1",[])),
+ <<"abbb">> = iolist_to_binary(re:replace("abbb","(\\w+)b(*COMMIT)\\w{2}","lC\\1",[global])),
+ <<"bRbYbpaRdHcFNHavc">> = iolist_to_binary(re:replace("bac","(?&t)(?#()(?(DEFINE)(?<t>a))","\\1RbYbp\\1&\\1R\\1dHcFNH&v\\1",[])),
+ <<"bRbYbpaRdHcFNHavc">> = iolist_to_binary(re:replace("bac","(?&t)(?#()(?(DEFINE)(?<t>a))","\\1RbYbp\\1&\\1R\\1dHcFNH&v\\1",[global])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?","C\\1&LrSNg",[])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(?>yes|no)(*THEN)(*F))?","C\\1&LrSNg",[global])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?","nLsXq",[])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?","nLsXq",[global])),
+ <<"ifJxMRlgahWwjbcUG">> = iolist_to_binary(re:replace("bc","b?(*SKIP)c","ifJxMRlgah\\1Wwj&U\\1G",[])),
+ <<"ifJxMRlgahWwjbcUG">> = iolist_to_binary(re:replace("bc","b?(*SKIP)c","ifJxMRlgah\\1Wwj&U\\1G",[global])),
+ <<"aFcoMMtM">> = iolist_to_binary(re:replace("abc","b?(*SKIP)c","FcoMMtM",[])),
+ <<"aFcoMMtM">> = iolist_to_binary(re:replace("abc","b?(*SKIP)c","FcoMMtM",[global])),
ok.
run45() ->
- <<"LVLUbcejbciMOvVvY">> = iolist_to_binary(re:replace("bc","b?(*SKIP)c","LV\\1LU&ej&iMOvVvY",[])),
- <<"LVLUbcejbciMOvVvY">> = iolist_to_binary(re:replace("bc","b?(*SKIP)c","LV\\1LU&ej&iMOvVvY",[global])),
- <<"aHUUUhKBfPpjU">> = iolist_to_binary(re:replace("abc","b?(*SKIP)c","\\1HUUUhKBf\\1P\\1pjU",[])),
- <<"aHUUUhKBfPpjU">> = iolist_to_binary(re:replace("abc","b?(*SKIP)c","\\1HUUUhKBf\\1P\\1pjU",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)bc","\\1F&mJF",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)bc","\\1F&mJF",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)b","P\\1EF",[])),
- <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)b","P\\1EF",[global])),
- <<"EiQojDQBehRidDoNAxxx">> = iolist_to_binary(re:replace("xxx","(?P<abn>(?P=abn)xxx|)+","EiQojDQBehRidDoNA",[])),
- <<"EiQojDQBehRidDoNAxEiQojDQBehRidDoNAxEiQojDQBehRidDoNAxEiQojDQBehRidDoNA">> = iolist_to_binary(re:replace("xxx","(?P<abn>(?P=abn)xxx|)+","EiQojDQBehRidDoNA",[global])),
- <<"akmvYT">> = iolist_to_binary(re:replace("aa","(?i:([^b]))(?1)","akmvYT",[])),
- <<"akmvYT">> = iolist_to_binary(re:replace("aa","(?i:([^b]))(?1)","akmvYT",[global])),
- <<"alaAraWMaaaAKIgQdaAOaF">> = iolist_to_binary(re:replace("aA","(?i:([^b]))(?1)","\\1l&r\\1WM\\1\\1&KIgQd&O\\1F",[])),
- <<"alaAraWMaaaAKIgQdaAOaF">> = iolist_to_binary(re:replace("aA","(?i:([^b]))(?1)","\\1l&r\\1WM\\1\\1&KIgQd&O\\1F",[global])),
- <<"*XAfh**hlh Failers">> = iolist_to_binary(re:replace("** Failers","(?i:([^b]))(?1)","\\1XAfh&hlh",[])),
- <<"*XAfh**hlh XAfh FhlhaXAfhaihlhlXAfhlehlhrXAfhrshlh">> = iolist_to_binary(re:replace("** Failers","(?i:([^b]))(?1)","\\1XAfh&hlh",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(?i:([^b]))(?1)","e\\1eCmoSn",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(?i:([^b]))(?1)","e\\1eCmoSn",[global])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:([^b]))(?1)","hiocPQeyl&&Nx\\1",[])),
- <<"aB">> = iolist_to_binary(re:replace("aB","(?i:([^b]))(?1)","hiocPQeyl&&Nx\\1",[global])),
- <<"Ba">> = iolist_to_binary(re:replace("Ba","(?i:([^b]))(?1)","Q\\1ImC\\1ihLTYkO",[])),
- <<"Ba">> = iolist_to_binary(re:replace("Ba","(?i:([^b]))(?1)","Q\\1ImC\\1ihLTYkO",[global])),
- <<"ba">> = iolist_to_binary(re:replace("ba","(?i:([^b]))(?1)","R\\1bTV\\1\\1",[])),
- <<"ba">> = iolist_to_binary(re:replace("ba","(?i:([^b]))(?1)","R\\1bTV\\1\\1",[global])),
- <<"mwO">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","mwO",[])),
- <<"mwO">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","mwO",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","EQl\\1AR",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","EQl\\1AR",[global])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","&yy\\1GJaXojFYo",[])),
- <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","&yy\\1GJaXojFYo",[global])),
- <<"WMarOaaaaaaXebFIbQKdmm">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*(?(DEFINE)(?<t>a))\\w$","\\1W\\1MarO&ebFIbQKdm\\1\\1m",[])),
- <<"WMarOaaaaaaXebFIbQKdmm">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*(?(DEFINE)(?<t>a))\\w$","\\1W\\1MarO&ebFIbQKdm\\1\\1m",[global])),
- <<"lWw">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*(?(DEFINE)(?<t>a))\\w$","lWw\\1",[])),
- <<"lWw">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*(?(DEFINE)(?<t>a))\\w$","lWw\\1",[global])),
- <<"IpraaaaXkaKXqwTNFSEgDP">> = iolist_to_binary(re:replace("aaaaX","^(a)*+(\\w)","Ipr&k\\1KXqwTNFSEgDP",[])),
- <<"IpraaaaXkaKXqwTNFSEgDP">> = iolist_to_binary(re:replace("aaaaX","^(a)*+(\\w)","Ipr&k\\1KXqwTNFSEgDP",[global])),
- <<"jnYLYhYZ">> = iolist_to_binary(re:replace("YZ","^(a)*+(\\w)","jn&L&\\1\\1hY",[])),
- <<"jnYLYhYZ">> = iolist_to_binary(re:replace("YZ","^(a)*+(\\w)","jn&L&\\1\\1hY",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)*+(\\w)","d\\1&ohvven\\1&P\\1\\1exSs",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)*+(\\w)","d\\1&ohvven\\1&P\\1\\1exSs",[global])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)*+(\\w)","biv&rxkne",[])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)*+(\\w)","biv&rxkne",[global])),
- <<"FVSRXhsNXQwYCX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)*+(\\w)","FVSR\\1hsN\\1QwYC\\1",[])),
- <<"FVSRXhsNXQwYCX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)*+(\\w)","FVSR\\1hsN\\1QwYC\\1",[global])),
- <<"MiyTnbYYLxIYkYvmDUZ">> = iolist_to_binary(re:replace("YZ","^(?:a)*+(\\w)","MiyTnb&&LxI\\1k\\1vmDU",[])),
- <<"MiyTnbYYLxIYkYvmDUZ">> = iolist_to_binary(re:replace("YZ","^(?:a)*+(\\w)","MiyTnb&&LxI\\1k\\1vmDU",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)*+(\\w)","&Ugr\\1y",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)*+(\\w)","&Ugr\\1y",[global])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)*+(\\w)","\\1\\1&Qbd\\1SyY&u",[])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)*+(\\w)","\\1\\1&Qbd\\1SyY&u",[global])),
- <<"uQsoweaaaaXLoVaaaaaXmpAeu">> = iolist_to_binary(re:replace("aaaaX","^(a)++(\\w)","uQsowe&LoVa&mpAeu",[])),
- <<"uQsoweaaaaXLoVaaaaaXmpAeu">> = iolist_to_binary(re:replace("aaaaX","^(a)++(\\w)","uQsowe&LoVa&mpAeu",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)++(\\w)","Nqxlkpdpkdkbt",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)++(\\w)","Nqxlkpdpkdkbt",[global])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)++(\\w)","rKpJsjRH&q",[])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)++(\\w)","rKpJsjRH&q",[global])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a)++(\\w)","\\1kUJik\\1c\\1d\\1wcEQVl",[])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a)++(\\w)","\\1kUJik\\1c\\1d\\1wcEQVl",[global])),
- <<"aaaaXaaaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)++(\\w)","&&",[])),
- <<"aaaaXaaaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)++(\\w)","&&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)++(\\w)","qJF",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)++(\\w)","qJF",[global])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)++(\\w)","Myqjwdc&SqVjwe\\1ab\\1x",[])),
- <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)++(\\w)","Myqjwdc&SqVjwe\\1ab\\1x",[global])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a)++(\\w)","pXmu",[])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a)++(\\w)","pXmu",[global])),
- <<"dKaaX">> = iolist_to_binary(re:replace("aaaaX","^(a)?+(\\w)","dK",[])),
- <<"dKaaX">> = iolist_to_binary(re:replace("aaaaX","^(a)?+(\\w)","dK",[global])),
- <<"QtZ">> = iolist_to_binary(re:replace("YZ","^(a)?+(\\w)","Qt",[])),
- <<"QtZ">> = iolist_to_binary(re:replace("YZ","^(a)?+(\\w)","Qt",[global])),
- <<"yaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)?+(\\w)","y",[])),
- <<"yaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)?+(\\w)","y",[global])),
- <<"knhrTYKYCYLYLHYZ">> = iolist_to_binary(re:replace("YZ","^(?:a)?+(\\w)","knhrT\\1K&C&L\\1LH\\1",[])),
- <<"knhrTYKYCYLYLHYZ">> = iolist_to_binary(re:replace("YZ","^(?:a)?+(\\w)","knhrT\\1K&C&L\\1LH\\1",[global])),
- <<"qaFxAasVdrHD">> = iolist_to_binary(re:replace("aaaaX","^(a){2,}+(\\w)","q\\1FxAasVdrHD",[])),
- <<"qaFxAasVdrHD">> = iolist_to_binary(re:replace("aaaaX","^(a){2,}+(\\w)","q\\1FxAasVdrHD",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a){2,}+(\\w)","Ce",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a){2,}+(\\w)","Ce",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a){2,}+(\\w)","Pr\\1pRjfic",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a){2,}+(\\w)","Pr\\1pRjfic",[global])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a){2,}+(\\w)","\\1qc&A\\1p\\1Ce",[])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a){2,}+(\\w)","\\1qc&A\\1p\\1Ce",[global])),
- <<"TomaaaaXfexyXrPgPChaaaaXUaaaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a){2,}+(\\w)","Tom&fexy\\1rPgPCh&U&",[])),
- <<"TomaaaaXfexyXrPgPChaaaaXUaaaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a){2,}+(\\w)","Tom&fexy\\1rPgPCh&U&",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a){2,}+(\\w)","QxuQNyMAkLj\\1N",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a){2,}+(\\w)","QxuQNyMAkLj\\1N",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(?:a){2,}+(\\w)","qs&d\\1p&DFpaHv",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^(?:a){2,}+(\\w)","qs&d\\1p&DFpaHv",[global])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a){2,}+(\\w)","&YUGUUNV&jklvBQ",[])),
- <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a){2,}+(\\w)","&YUGUUNV&jklvBQ",[global])),
- <<"kRhvBb">> = iolist_to_binary(re:replace("b","(a|)*(?1)b","kRhvB&",[])),
- <<"kRhvBb">> = iolist_to_binary(re:replace("b","(a|)*(?1)b","kRhvB&",[global])),
- <<"UabqY">> = iolist_to_binary(re:replace("ab","(a|)*(?1)b","U&qY",[])),
- <<"UabqY">> = iolist_to_binary(re:replace("ab","(a|)*(?1)b","U&qY",[global])),
- <<"vmyFiqvLaabXSeOYAObD">> = iolist_to_binary(re:replace("aab","(a|)*(?1)b","vmyFiqvL&XSeOYAObD",[])),
- <<"vmyFiqvLaabXSeOYAObD">> = iolist_to_binary(re:replace("aab","(a|)*(?1)b","vmyFiqvL&XSeOYAObD",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)++(?1)b","aYXyIdVfFghDXyBuUsnK",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)++(?1)b","aYXyIdVfFghDXyBuUsnK",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(a)++(?1)b","mJgf&UxblrhCqYENY",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(a)++(?1)b","mJgf&UxblrhCqYENY",[global])),
- <<"aab">> = iolist_to_binary(re:replace("aab","(a)++(?1)b","Nji&a",[])),
- <<"aab">> = iolist_to_binary(re:replace("aab","(a)++(?1)b","Nji&a",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)*+(?1)b","oFCeDPwP&kYedB",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)*+(?1)b","oFCeDPwP&kYedB",[global])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(a)*+(?1)b","&ws\\1adQnsr\\1NinVGyRsh",[])),
- <<"ab">> = iolist_to_binary(re:replace("ab","(a)*+(?1)b","&ws\\1adQnsr\\1NinVGyRsh",[global])),
- <<"aab">> = iolist_to_binary(re:replace("aab","(a)*+(?1)b","Sb&x&",[])),
- <<"aab">> = iolist_to_binary(re:replace("aab","(a)*+(?1)b","Sb&x&",[global])),
- <<"bQNe">> = iolist_to_binary(re:replace("b","(?1)(?:(b)){0}","&QNe",[])),
- <<"bQNe">> = iolist_to_binary(re:replace("b","(?1)(?:(b)){0}","&QNe",[global])),
- <<"KRfoo(bar(baz)+baz(bop))yTvP">> = iolist_to_binary(re:replace("foo(bar(baz)+baz(bop))","(foo ( \\( ((?:(?> [^()]+ )|(?2))*) \\) ) )","KR\\1yTvP",[extended])),
- <<"KRfoo(bar(baz)+baz(bop))yTvP">> = iolist_to_binary(re:replace("foo(bar(baz)+baz(bop))","(foo ( \\( ((?:(?> [^()]+ )|(?2))*) \\) ) )","KR\\1yTvP",[extended,
- global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)bc","K&KkIb\\1J\\1ADN\\1y",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)bc","K&KkIb\\1J\\1ADN\\1y",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)b","ug",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","(*SKIP)b","ug",[global])),
+ <<"IByJwJUuLMjxxx">> = iolist_to_binary(re:replace("xxx","(?P<abn>(?P=abn)xxx|)+","IByJwJUuLMj",[])),
+ <<"IByJwJUuLMjxIByJwJUuLMjxIByJwJUuLMjxIByJwJUuLMj">> = iolist_to_binary(re:replace("xxx","(?P<abn>(?P=abn)xxx|)+","IByJwJUuLMj",[global])),
+ <<"VPSaaaabCaadQCaaLaaBy">> = iolist_to_binary(re:replace("aa","(?i:([^b]))(?1)","VPS\\1&\\1bC&dQC&L&By",[])),
+ <<"VPSaaaabCaadQCaaLaaBy">> = iolist_to_binary(re:replace("aa","(?i:([^b]))(?1)","VPS\\1&\\1bC&dQC&L&By",[global])),
+ <<"yafgfEXSPbNaAHn">> = iolist_to_binary(re:replace("aA","(?i:([^b]))(?1)","y\\1fgfEXSPbN&Hn",[])),
+ <<"yafgfEXSPbNaAHn">> = iolist_to_binary(re:replace("aA","(?i:([^b]))(?1)","y\\1fgfEXSPbN&Hn",[global])),
+ <<"jtvi*CH**b Failers">> = iolist_to_binary(re:replace("** Failers","(?i:([^b]))(?1)","jtvi\\1CH&b",[])),
+ <<"jtvi*CH**bjtvi CH FbjtviaCHaibjtvilCHlebjtvirCHrsb">> = iolist_to_binary(re:replace("** Failers","(?i:([^b]))(?1)","jtvi\\1CH&b",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(?i:([^b]))(?1)","ufawxH&",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(?i:([^b]))(?1)","ufawxH&",[global])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:([^b]))(?1)","kJi\\1Q",[])),
+ <<"aB">> = iolist_to_binary(re:replace("aB","(?i:([^b]))(?1)","kJi\\1Q",[global])),
+ <<"Ba">> = iolist_to_binary(re:replace("Ba","(?i:([^b]))(?1)","JMtj&Suu\\1jXYqQqQYj",[])),
+ <<"Ba">> = iolist_to_binary(re:replace("Ba","(?i:([^b]))(?1)","JMtj&Suu\\1jXYqQqQYj",[global])),
+ <<"ba">> = iolist_to_binary(re:replace("ba","(?i:([^b]))(?1)","T\\1Qayl\\1T",[])),
+ <<"ba">> = iolist_to_binary(re:replace("ba","(?i:([^b]))(?1)","T\\1Qayl\\1T",[global])),
+ <<"lxmLDk">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","lxmLDk",[])),
+ <<"lxmLDk">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","lxmLDk",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","aFfF",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","aFfF",[global])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","QEtPA&\\1OwM",[])),
+ <<"aaaaaa">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*+(?(DEFINE)(?<t>a))\\w$","QEtPA&\\1OwM",[global])),
+ <<"SmAoeEyBaaaaaaXbwguE">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*(?(DEFINE)(?<t>a))\\w$","SmAoeEyB&bwguE",[])),
+ <<"SmAoeEyBaaaaaaXbwguE">> = iolist_to_binary(re:replace("aaaaaaX","^(?&t)*(?(DEFINE)(?<t>a))\\w$","SmAoeEyB&bwguE",[global])),
+ <<"Uaaaaaaxaaaaaaafp">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*(?(DEFINE)(?<t>a))\\w$","U&x&afp",[])),
+ <<"Uaaaaaaxaaaaaaafp">> = iolist_to_binary(re:replace("aaaaaa","^(?&t)*(?(DEFINE)(?<t>a))\\w$","U&x&afp",[global])),
+ <<"HaaaaXaaaaXadaaaaXaaaaXareQQQkMYOa">> = iolist_to_binary(re:replace("aaaaX","^(a)*+(\\w)","H&&\\1d&&\\1reQQQkMYO\\1",[])),
+ <<"HaaaaXaaaaXadaaaaXaaaaXareQQQkMYOa">> = iolist_to_binary(re:replace("aaaaX","^(a)*+(\\w)","H&&\\1d&&\\1reQQQkMYO\\1",[global])),
+ <<"bRpsdEYGFIGPlQJJvLZ">> = iolist_to_binary(re:replace("YZ","^(a)*+(\\w)","bRpsdE&GFIG\\1PlQJ\\1JvL",[])),
+ <<"bRpsdEYGFIGPlQJJvLZ">> = iolist_to_binary(re:replace("YZ","^(a)*+(\\w)","bRpsdE&GFIG\\1PlQJ\\1JvL",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)*+(\\w)","TEN&fs\\1AcOopKHNR&j",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)*+(\\w)","TEN&fs\\1AcOopKHNR&j",[global])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)*+(\\w)","mRufNYP&WdWMD",[])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)*+(\\w)","mRufNYP&WdWMD",[global])),
+ <<"TFRaaaaXfHXTvXEuMCNthKV">> = iolist_to_binary(re:replace("aaaaX","^(?:a)*+(\\w)","TFR&fH\\1Tv\\1EuMCNthKV",[])),
+ <<"TFRaaaaXfHXTvXEuMCNthKV">> = iolist_to_binary(re:replace("aaaaX","^(?:a)*+(\\w)","TFR&fH\\1Tv\\1EuMCNthKV",[global])),
+ <<"tkYFkuQZ">> = iolist_to_binary(re:replace("YZ","^(?:a)*+(\\w)","tk\\1FkuQ",[])),
+ <<"tkYFkuQZ">> = iolist_to_binary(re:replace("YZ","^(?:a)*+(\\w)","tk\\1FkuQ",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)*+(\\w)","kd\\1PEKSAAL&xu",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)*+(\\w)","kd\\1PEKSAAL&xu",[global])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)*+(\\w)","Lf",[])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)*+(\\w)","Lf",[global])),
+ <<"oaFjagULdV">> = iolist_to_binary(re:replace("aaaaX","^(a)++(\\w)","o\\1Fj\\1gULdV",[])),
+ <<"oaFjagULdV">> = iolist_to_binary(re:replace("aaaaX","^(a)++(\\w)","o\\1Fj\\1gULdV",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)++(\\w)","vpc",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a)++(\\w)","vpc",[global])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)++(\\w)","Bl",[])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(a)++(\\w)","Bl",[global])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a)++(\\w)","pW\\1&FBWdWw&np",[])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a)++(\\w)","pW\\1&FBWdWw&np",[global])),
+ <<"XGTXnaaaaXXYlwcXc">> = iolist_to_binary(re:replace("aaaaX","^(?:a)++(\\w)","\\1GT\\1n&\\1Ylwc\\1c",[])),
+ <<"XGTXnaaaaXXYlwcXc">> = iolist_to_binary(re:replace("aaaaX","^(?:a)++(\\w)","\\1GT\\1n&\\1Ylwc\\1c",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)++(\\w)","knydJYg\\1",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a)++(\\w)","knydJYg\\1",[global])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)++(\\w)","BY",[])),
+ <<"aaaa">> = iolist_to_binary(re:replace("aaaa","^(?:a)++(\\w)","BY",[global])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a)++(\\w)","&WnuGAP&RVIb\\1&g&",[])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a)++(\\w)","&WnuGAP&RVIb\\1&g&",[global])),
+ <<"abOaagwaaX">> = iolist_to_binary(re:replace("aaaaX","^(a)?+(\\w)","\\1bO&gw",[])),
+ <<"abOaagwaaX">> = iolist_to_binary(re:replace("aaaaX","^(a)?+(\\w)","\\1bO&gw",[global])),
+ <<"vfWlFqvTQcSsMBueZ">> = iolist_to_binary(re:replace("YZ","^(a)?+(\\w)","vfWlFqvTQcSsMBue",[])),
+ <<"vfWlFqvTQcSsMBueZ">> = iolist_to_binary(re:replace("YZ","^(a)?+(\\w)","vfWlFqvTQcSsMBue",[global])),
+ <<"gcDaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)?+(\\w)","gcD",[])),
+ <<"gcDaaX">> = iolist_to_binary(re:replace("aaaaX","^(?:a)?+(\\w)","gcD",[global])),
+ <<"AXYrLumLDPdeYhsZ">> = iolist_to_binary(re:replace("YZ","^(?:a)?+(\\w)","AX\\1rLumLDPde&hs",[])),
+ <<"AXYrLumLDPdeYhsZ">> = iolist_to_binary(re:replace("YZ","^(?:a)?+(\\w)","AX\\1rLumLDPde&hs",[global])),
+ <<"GbIoTYfSk">> = iolist_to_binary(re:replace("aaaaX","^(a){2,}+(\\w)","GbIoTYfSk",[])),
+ <<"GbIoTYfSk">> = iolist_to_binary(re:replace("aaaaX","^(a){2,}+(\\w)","GbIoTYfSk",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a){2,}+(\\w)","XIW&php\\1D&&uKhDB\\1fhy",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(a){2,}+(\\w)","XIW&php\\1D&&uKhDB\\1fhy",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a){2,}+(\\w)","eqY\\1Dr\\1luTHwQ",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(a){2,}+(\\w)","eqY\\1Dr\\1luTHwQ",[global])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a){2,}+(\\w)","DCSsYSA",[])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(a){2,}+(\\w)","DCSsYSA",[global])),
+ <<"sXOEXqrXNLjeIpAFEqS">> = iolist_to_binary(re:replace("aaaaX","^(?:a){2,}+(\\w)","sXOEXqr\\1NLjeIpAFEqS",[])),
+ <<"sXOEXqrXNLjeIpAFEqS">> = iolist_to_binary(re:replace("aaaaX","^(?:a){2,}+(\\w)","sXOEXqr\\1NLjeIpAFEqS",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a){2,}+(\\w)","RhG&SVJRvrSbFfks",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","^(?:a){2,}+(\\w)","RhG&SVJRvrSbFfks",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(?:a){2,}+(\\w)","VMSsQq&x",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^(?:a){2,}+(\\w)","VMSsQq&x",[global])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a){2,}+(\\w)","I&ofEGK\\1gk&y",[])),
+ <<"YZ">> = iolist_to_binary(re:replace("YZ","^(?:a){2,}+(\\w)","I&ofEGK\\1gk&y",[global])),
+ <<"bRSn">> = iolist_to_binary(re:replace("b","(a|)*(?1)b","\\1&RSn",[])),
+ <<"bRSn">> = iolist_to_binary(re:replace("b","(a|)*(?1)b","\\1&RSn",[global])),
+ <<"kOQDBCniDmabX">> = iolist_to_binary(re:replace("ab","(a|)*(?1)b","k\\1OQD\\1BCniDm&X",[])),
+ <<"kOQDBCniDmabX">> = iolist_to_binary(re:replace("ab","(a|)*(?1)b","k\\1OQD\\1BCniDm&X",[global])),
+ <<"DxcDd">> = iolist_to_binary(re:replace("aab","(a|)*(?1)b","DxcDd",[])),
+ <<"DxcDd">> = iolist_to_binary(re:replace("aab","(a|)*(?1)b","DxcDd",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)++(?1)b","VTtm\\1&qWBwH&TFG",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)++(?1)b","VTtm\\1&qWBwH&TFG",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(a)++(?1)b","cVqmxH",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(a)++(?1)b","cVqmxH",[global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(a)++(?1)b","VPevb\\1Il",[])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(a)++(?1)b","VPevb\\1Il",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)*+(?1)b","\\1KCKqqqW&OhQmC&c",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(a)*+(?1)b","\\1KCKqqqW&OhQmC&c",[global])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(a)*+(?1)b","\\1\\1AofrA\\1",[])),
+ <<"ab">> = iolist_to_binary(re:replace("ab","(a)*+(?1)b","\\1\\1AofrA\\1",[global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(a)*+(?1)b","YU&W&&&br&b&&T\\1&",[])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(a)*+(?1)b","YU&W&&&br&b&&T\\1&",[global])),
+ <<"ylblrGgeOFdq">> = iolist_to_binary(re:replace("b","(?1)(?:(b)){0}","yl&lrGgeOFdq",[])),
+ <<"ylblrGgeOFdq">> = iolist_to_binary(re:replace("b","(?1)(?:(b)){0}","yl&lrGgeOFdq",[global])),
+ <<"RVQfoo(bar(baz)+baz(bop))nWTFmuu">> = iolist_to_binary(re:replace("foo(bar(baz)+baz(bop))","(foo ( \\( ((?:(?> [^()]+ )|(?2))*) \\) ) )","RVQ&nWTFmuu",[extended])),
+ <<"RVQfoo(bar(baz)+baz(bop))nWTFmuu">> = iolist_to_binary(re:replace("foo(bar(baz)+baz(bop))","(foo ( \\( ((?:(?> [^()]+ )|(?2))*) \\) ) )","RVQ&nWTFmuu",[extended,
+ global])),
+ <<"SsABnABjAABWrFxABNxTAB">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Ss&n&jA&WrFx\\1NxT\\1",[extended])),
+ <<"SsABnABjAABWrFxABNxTAB">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Ss&n&jA&WrFx\\1NxT\\1",[extended,
+ global])),
ok.
run46() ->
- <<"Cfqx">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Cfqx",[extended])),
- <<"Cfqx">> = iolist_to_binary(re:replace("AB","(A (A|B(*ACCEPT)|C) D)(E)","Cfqx",[extended,
- global])),
- <<"abaaHraVohxea">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)","a&\\1Hr\\1Vohxe\\1",[])),
- <<"abaaHraVohxea">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)","a&\\1Hr\\1Vohxe\\1",[global])),
- <<"hEyjnxKIbWTujTtR">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)++","hEyjnxKIbWT\\1ujT\\1tR",[])),
- <<"hEyjnxKIbWTujTtR">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)++","hEyjnxKIbWT\\1ujT\\1tR",[global])),
- <<"oTgqSlaOSViBsWdYFa">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)++","oTgqSl\\1OSViBsWdYF\\1",[])),
- <<"oTgqSlaOSViBsWdYFa">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)++","oTgqSl\\1OSViBsWdYF\\1",[global])),
- <<"pATfIbaqPbaaOQbaSG">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc|d)","pATfI\\1&qP&aOQ&SG\\1",[])),
- <<"pATfIbaqPbaaOQbaSG">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc|d)","pATfI\\1&qP&aOQ&SG\\1",[global])),
- <<"bJYJaBVjnbvSceetle">> = iolist_to_binary(re:replace("beetle","(?:(b))++","bJYJaBVjn\\1vSc",[])),
- <<"bJYJaBVjnbvSceetle">> = iolist_to_binary(re:replace("beetle","(?:(b))++","bJYJaBVjn\\1vSc",[global])),
- <<"MEbqeMaqej">> = iolist_to_binary(re:replace("a","(?(?=(a(*ACCEPT)z))a)","MEbqeM\\1qej",[])),
- <<"MEbqeMaqejMEbqeMqej">> = iolist_to_binary(re:replace("a","(?(?=(a(*ACCEPT)z))a)","MEbqeM\\1qej",[global])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)+ab","&",[])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)+ab","&",[global])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)++ab","O&\\1shXpvDpv&VVC",[])),
- <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)++ab","O&\\1shXpvDpv&VVC",[global])),
- <<"RARockgammon">> = iolist_to_binary(re:replace("backgammon","(?(DEFINE)(a))?b(?1)","RARo\\1",[])),
- <<"RARockgammon">> = iolist_to_binary(re:replace("backgammon","(?(DEFINE)(a))?b(?1)","RARo\\1",[global])),
- <<"wlgVxP
+ <<"oykaGJTnwyJ">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)","oyk\\1GJTnwyJ",[])),
+ <<"oykaGJTnwyJ">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)","oyk\\1GJTnwyJ",[global])),
+ <<"rP">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)++","r\\1P",[])),
+ <<"rP">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)++","r\\1P",[global])),
+ <<"mVYabaiTtvcE">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)++","mVY\\1&iTtvcE",[])),
+ <<"mVYabaiTtvcE">> = iolist_to_binary(re:replace("ba","\\A.*?(a|bc)++","mVY\\1&iTtvcE",[global])),
+ <<"LbassxlIODjbanukQ">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc|d)","L&ssxlIODj&n\\1\\1ukQ",[])),
+ <<"LbassxlIODjbanukQ">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc|d)","L&ssxlIODj&n\\1\\1ukQ",[global])),
+ <<"aPbcQmbYueetle">> = iolist_to_binary(re:replace("beetle","(?:(b))++","aPbcQm&Yu",[])),
+ <<"aPbcQmbYueetle">> = iolist_to_binary(re:replace("beetle","(?:(b))++","aPbcQm&Yu",[global])),
+ <<"Gaqa">> = iolist_to_binary(re:replace("a","(?(?=(a(*ACCEPT)z))a)","G\\1q&",[])),
+ <<"GaqaGq">> = iolist_to_binary(re:replace("a","(?(?=(a(*ACCEPT)z))a)","G\\1q&",[global])),
+ <<"aaaabjQnJbiaaaabtUxBujcSC">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)+ab","&jQnJbi&tUxBujcSC",[])),
+ <<"aaaabjQnJbiaaaabtUxBujcSC">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)+ab","&jQnJbi&tUxBujcSC",[global])),
+ <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)++ab","DNWp&\\1",[])),
+ <<"aaaab">> = iolist_to_binary(re:replace("aaaab","^(a)(?1)++ab","DNWp&\\1",[global])),
+ <<"FbaUCbajUSvbabLskbVFDSRckgammon">> = iolist_to_binary(re:replace("backgammon","(?(DEFINE)(a))?b(?1)","F&UC&jUSv&bLskbVFDSR",[])),
+ <<"FbaUCbajUSvbabLskbVFDSRckgammon">> = iolist_to_binary(re:replace("backgammon","(?(DEFINE)(a))?b(?1)","F&UC&jUSv&bLskbVFDSR",[global])),
+ <<"x
def">> = iolist_to_binary(re:replace("abc
-def","^\\N+","wlgVxP",[])),
- <<"wlgVxP
+def","^\\N+","x",[])),
+ <<"x
def">> = iolist_to_binary(re:replace("abc
-def","^\\N+","wlgVxP",[global])),
- <<"G
+def","^\\N+","x",[global])),
+ <<"uvwVXabc
def">> = iolist_to_binary(re:replace("abc
-def","^\\N{1,}","G",[])),
- <<"G
+def","^\\N{1,}","uv\\1wVX\\1&",[])),
+ <<"uvwVXabc
def">> = iolist_to_binary(re:replace("abc
-def","^\\N{1,}","G",[global])),
- <<"Iocde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|(?R)b)","Io",[])),
- <<"Iocde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|(?R)b)","Io",[global])),
- <<"kXRsqrvOjaaaaanNXFFUcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|((?R))b)","kXRsqrvOja\\1nNXFFU",[])),
- <<"kXRsqrvOjaaaaanNXFFUcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|((?R))b)","kXRsqrvOja\\1nNXFFU",[global])),
- <<"QNpwCPcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R)a+|(?1)b))","QNpwCP",[])),
- <<"QNpwCPcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R)a+|(?1)b))","QNpwCP",[global])),
- <<"QcDpPOcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R1)a+|(?1)b))","QcDpPO",[])),
- <<"QcDpPOcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R1)a+|(?1)b))","QcDpPO",[global])),
- <<"hIv">> = iolist_to_binary(re:replace("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","\\1hIv",[])),
- <<"hIv">> = iolist_to_binary(re:replace("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","\\1hIv",[global])),
- <<"bHaeaxaaAF">> = iolist_to_binary(re:replace("ba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","H&\\1eax&&AF",[])),
- <<"bHaeaxaaAF">> = iolist_to_binary(re:replace("ba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","H&\\1eax&&AF",[global])),
- <<"bbyaRYN">> = iolist_to_binary(re:replace("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","y&RYN",[])),
- <<"bbyaRYN">> = iolist_to_binary(re:replace("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","y&RYN",[global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b) c","y\\1YaiS",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b) c","y\\1YaiS",[extended,
- global])),
+def","^\\N{1,}","uv\\1wVX\\1&",[global])),
+ <<"aXqaaaabqcaaaabhUBcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|(?R)b)","aXq&qc&hUB",[])),
+ <<"aXqaaaabqcaaaabhUBcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|(?R)b)","aXq&qc&hUB",[global])),
+ <<"aaaabdaaaaBaaaabXbaaaaefaaaaOwsSNUSdKcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|((?R))b)","&d\\1B&Xb\\1ef\\1OwsSNUSdK",[])),
+ <<"aaaabdaaaaBaaaabXbaaaaefaaaaOwsSNUSdKcde">> = iolist_to_binary(re:replace("aaaabcde","(?(R)a+|((?R))b)","&d\\1B&Xb\\1ef\\1OwsSNUSdK",[global])),
+ <<"YRaaaabaaaabaVaaaabaaaabjPdaaaabaaaabjaaaabmaaaabKMmcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R)a+|(?1)b))","YR&\\1aV\\1\\1jPd\\1\\1j&m&KMm",[])),
+ <<"YRaaaabaaaabaVaaaabaaaabjPdaaaabaaaabjaaaabmaaaabKMmcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R)a+|(?1)b))","YR&\\1aV\\1\\1jPd\\1\\1j&m&KMm",[global])),
+ <<"CKJwaLFaaaabMsaaaabaaaabaaaabLrcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R1)a+|(?1)b))","CKJwaLF&Ms&\\1\\1Lr",[])),
+ <<"CKJwaLFaaaabMsaaaabaaaabaaaabLrcde">> = iolist_to_binary(re:replace("aaaabcde","((?(R1)a+|(?1)b))","CKJwaLF&Ms&\\1\\1Lr",[global])),
+ <<"eaMVQRJEeaaaVaBfXaaa">> = iolist_to_binary(re:replace("aaa","((?(R)a|(?1)))*","e\\1MVQRJEe&V\\1BfX&",[])),
+ <<"eaMVQRJEeaaaVaBfXaaaeMVQRJEeVBfX">> = iolist_to_binary(re:replace("aaa","((?(R)a|(?1)))*","e\\1MVQRJEe&V\\1BfX&",[global])),
+ <<"MakJwuACGqDMaaaaaUnx">> = iolist_to_binary(re:replace("aaa","((?(R)a|(?1)))+","M\\1kJwuACGqDM\\1&aUnx",[])),
+ <<"MakJwuACGqDMaaaaaUnx">> = iolist_to_binary(re:replace("aaa","((?(R)a|(?1)))+","M\\1kJwuACGqDM\\1&aUnx",[global])),
+ <<"h">> = iolist_to_binary(re:replace("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","h",[])),
+ <<"h">> = iolist_to_binary(re:replace("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","h",[global])),
+ <<"bRCaBnaanS">> = iolist_to_binary(re:replace("ba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","RC&Bn&\\1\\1&nS",[])),
+ <<"bRCaBnaanS">> = iolist_to_binary(re:replace("ba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","RC&Bn&\\1\\1&nS",[global])),
+ <<"bbaagaaxOODdgKqaOJ">> = iolist_to_binary(re:replace("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","a\\1&g&&xOODd\\1g\\1Kq&\\1OJ",[])),
+ <<"bbaagaaxOODdgKqaOJ">> = iolist_to_binary(re:replace("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))","a\\1&g&&xOODd\\1g\\1Kq&\\1OJ",[global])),
ok.
run47() ->
- <<"LababMabJVX">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F)) c","L\\1\\1M\\1JVX",[extended])),
- <<"LababMabJVX">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F)) c","L\\1\\1M\\1JVX",[extended,
- global])),
- <<"jBPevabLaabcWNWjnnaabcpgwaabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) | (*F) ) c","jBPev\\1L&WNWjnn&pgw&",[extended])),
- <<"jBPevabLaabcWNWjnnaabcpgwaabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) | (*F) ) c","jBPev\\1L&WNWjnn&pgw&",[extended,
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b) c","TsVxnH\\1",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b) c","TsVxnH\\1",[extended,
+ global])),
+ <<"aknaabcabababsabaabcxIQjWA">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F)) c","akn&\\1\\1\\1s\\1&xIQjWA",[extended])),
+ <<"aknaabcabababsabaabcxIQjWA">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F)) c","akn&\\1\\1\\1s\\1&xIQjWA",[extended,
+ global])),
+ <<"F">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) | (*F) ) c","F",[extended])),
+ <<"F">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) | (*F) ) c","F",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) ) c","bITLs\\1MJKk\\1\\1m",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) ) c","bITLs\\1MJKk\\1\\1m",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b) c","u&IJDM\\1WAKII&G\\1hn",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b) c","u&IJDM\\1WAKII&G\\1hn",[extended,
+ global])),
+ <<"KPwyWqtephaabccFNSg">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F)) c","KPwy\\1Wqteph&cFN\\1Sg\\1",[extended])),
+ <<"KPwyWqtephaabccFNSg">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F)) c","KPwy\\1Wqteph&cFN\\1Sg\\1",[extended,
global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) ) c","GOxmfDqgi",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b) ) c","GOxmfDqgi",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b) c","H\\1mWytdK\\1",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b) c","H\\1mWytdK\\1",[extended,
+ <<"HHvvo">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) | (*F) ) c","HHvvo",[extended])),
+ <<"HHvvo">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) | (*F) ) c","HHvvo",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) ) c","QVIA\\1d",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) ) c","QVIA\\1d",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b) c","qjrOI&&nRtGbf",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b) c","qjrOI&&nRtGbf",[extended,
+ global])),
+ <<"w">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b|(*F)) c","w",[extended])),
+ <<"w">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b|(*F)) c","w",[extended,
+ global])),
+ <<"keXPouTAhaabcXevPvyjQT">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) | (*F) ) c","keXPouTAh&XevPvyjQT",[extended])),
+ <<"keXPouTAhaabcXevPvyjQT">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) | (*F) ) c","keXPouTAh&XevPvyjQT",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) ) c","&Rj&sfrR",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) ) c","&Rj&sfrR",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b)++ c","\\1prYdoWF\\1MgrcQIUdFSO",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b)++ c","\\1prYdoWF\\1MgrcQIUdFSO",[extended,
+ global])),
+ <<"MOaabcnbyBabtGHNao">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F))++ c","MO&nbyB\\1tGHNao",[extended])),
+ <<"MOaabcnbyBabtGHNao">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F))++ c","MO&nbyB\\1tGHNao",[extended,
+ global])),
+ <<"yxJFsgWaabchb">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ | (*F) )++ c","yxJFsgW&hb",[extended])),
+ <<"yxJFsgWaabchb">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ | (*F) )++ c","yxJFsgW&hb",[extended,
+ global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ )++ c","EmmhY&&",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ )++ c","EmmhY&&",[extended,
global])),
- <<"bpmBlFODKYLa">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F)) c","bpmBlFO\\1DKYLa",[extended])),
- <<"bpmBlFODKYLa">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F)) c","bpmBlFO\\1DKYLa",[extended,
- global])),
- <<"JjdAaabcVAKJYnJUNmb">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) | (*F) ) c","JjdA&VAKJYnJUN\\1mb",[extended])),
- <<"JjdAaabcVAKJYnJUNmb">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) | (*F) ) c","JjdA&VAKJYnJUN\\1mb",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) ) c","th\\1Srp\\1LGEBK",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b) ) c","th\\1Srp\\1LGEBK",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b) c","ukgQQVa\\1qLglPHKE",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b) c","ukgQQVa\\1qLglPHKE",[extended,
- global])),
- <<"PVXXt">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b|(*F)) c","PVXXt",[extended])),
- <<"PVXXt">> = iolist_to_binary(re:replace("aabc","^.*? (?>a(*THEN)b|(*F)) c","PVXXt",[extended,
- global])),
- <<"XNnaabcsJeaabciijbma">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) | (*F) ) c","XNn&sJe&iijbma",[extended])),
- <<"XNnaabcsJeaabciijbma">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) | (*F) ) c","XNn&sJe&iijbma",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) ) c","CtO\\1VdQgHMA&JMp",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?> (?>a(*THEN)b) ) c","CtO\\1VdQgHMA&JMp",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b)++ c","AAl\\1s\\1MAOnKUxaX",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b)++ c","AAl\\1s\\1MAOnKUxaX",[extended,
- global])),
- <<"iaabcpWabNRGraabct">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F))++ c","i&pW\\1NRGr&t",[extended])),
- <<"iaabcpWabNRGraabct">> = iolist_to_binary(re:replace("aabc","^.*? (a(*THEN)b|(*F))++ c","i&pW\\1NRGr&t",[extended,
- global])),
- <<"aabcqfVFpeSPlabMdablfKabP">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ | (*F) )++ c","&qfVFpeSPl\\1Md\\1lfK\\1P",[extended])),
- <<"aabcqfVFpeSPlabMdablfKabP">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ | (*F) )++ c","&qfVFpeSPl\\1Md\\1lfK\\1P",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ )++ c","b\\1de\\1",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? ( (a(*THEN)b)++ )++ c","b\\1de\\1",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b)++ c","&\\1&MQR\\1u\\1SGG&\\1SpJ",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b)++ c","&\\1&MQR\\1u\\1SGG&\\1SpJ",[extended,
- global])),
ok.
run48() ->
- <<"SaabcjaKGAOmOgHE">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F))++ c","S&\\1jaKGAOmOgHE",[extended])),
- <<"SaabcjaKGAOmOgHE">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F))++ c","S&\\1jaKGAOmOgHE",[extended,
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b)++ c","RD",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b)++ c","RD",[extended,
+ global])),
+ <<"HVPtJaabckhaabcTDNQFaabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F))++ c","HVPtJ&k\\1\\1h&TDNQ\\1F&",[extended])),
+ <<"HVPtJaabckhaabcTDNQFaabc">> = iolist_to_binary(re:replace("aabc","^.*? (?:a(*THEN)b|(*F))++ c","HVPtJ&k\\1\\1h&TDNQ\\1F&",[extended,
+ global])),
+ <<"GYWUPwD">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c","GYWUPwD",[extended])),
+ <<"GYWUPwD">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c","GYWUPwD",[extended,
global])),
- <<"VvLaabclAtFq">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c","VvL&lAtFq",[extended])),
- <<"VvLaabclAtFq">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ | (*F) )++ c","VvL&lAtFq",[extended,
- global])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ )++ c","Mg&",[extended])),
- <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ )++ c","Mg&",[extended,
- global])),
- <<"prdTVmJacpUmv">> = iolist_to_binary(re:replace("ac","^(?(?=a(*THEN)b)ab|ac)","prdT\\1VmJ&pUmv",[])),
- <<"prdTVmJacpUmv">> = iolist_to_binary(re:replace("ac","^(?(?=a(*THEN)b)ab|ac)","prdT\\1VmJ&pUmv",[global])),
- <<"ba">> = iolist_to_binary(re:replace("ba","^.*?(?(?=a)a|b(*THEN)c)","wa",[])),
- <<"ba">> = iolist_to_binary(re:replace("ba","^.*?(?(?=a)a|b(*THEN)c)","wa",[global])),
- <<"JLcpcbaPX">> = iolist_to_binary(re:replace("ba","^.*?(?:(?(?=a)a|b(*THEN)c)|d)","JLcpc&PX",[])),
- <<"JLcpcbaPX">> = iolist_to_binary(re:replace("ba","^.*?(?:(?(?=a)a|b(*THEN)c)|d)","JLcpc&PX",[global])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^.*?(?(?=a)a(*THEN)b|c)","P\\1eLsoy&h",[])),
- <<"ac">> = iolist_to_binary(re:replace("ac","^.*?(?(?=a)a(*THEN)b|c)","P\\1eLsoy&h",[global])),
- <<"aaQkbjSmrabIabc">> = iolist_to_binary(re:replace("aabc","^.*(?=a(*THEN)b)","&&Q\\1kbjSmr&\\1bI",[])),
- <<"aaQkbjSmrabIabc">> = iolist_to_binary(re:replace("aabc","^.*(?=a(*THEN)b)","&&Q\\1kbjSmr&\\1bI",[global])),
- <<"xascDcHDAWsCEkjCgcd">> = iolist_to_binary(re:replace("xacd","(?<=a(*ACCEPT)b)c","s\\1&D&HDAWsCEkjC\\1g&",[])),
- <<"xascDcHDAWsCEkjCgcd">> = iolist_to_binary(re:replace("xacd","(?<=a(*ACCEPT)b)c","s\\1&D&HDAWsCEkjC\\1g&",[global])),
- <<"xaTcalxCpPaREWFWqwSqLed">> = iolist_to_binary(re:replace("xacd","(?<=(a(*ACCEPT)b))c","T&\\1lxCpP\\1REWFWqwSqLe",[])),
- <<"xaTcalxCpPaREWFWqwSqLed">> = iolist_to_binary(re:replace("xacd","(?<=(a(*ACCEPT)b))c","T&\\1lxCpP\\1REWFWqwSqLe",[global])),
- <<"xababKJXd">> = iolist_to_binary(re:replace("xabcd","(?<=(a(*COMMIT)b))c","\\1KJX",[])),
- <<"xababKJXd">> = iolist_to_binary(re:replace("xabcd","(?<=(a(*COMMIT)b))c","\\1KJX",[global])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=(a(*COMMIT)b))c","caxcMW&&uQRuH",[])),
- <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=(a(*COMMIT)b))c","caxcMW&&uQRuH",[global])),
- <<"xacd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*COMMIT)b))c","FOAJ",[])),
- <<"xacd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*COMMIT)b))c","FOAJ",[global])),
- <<"xkklXcAWOSApWPhcsCd">> = iolist_to_binary(re:replace("xcd","(?<!a(*FAIL)b)c","kklX&AWOSApWPhcsC",[])),
- <<"xkklXcAWOSApWPhcsCd">> = iolist_to_binary(re:replace("xcd","(?<!a(*FAIL)b)c","kklX&AWOSApWPhcsC",[global])),
- <<"aEd">> = iolist_to_binary(re:replace("acd","(?<!a(*FAIL)b)c","E",[])),
- <<"aEd">> = iolist_to_binary(re:replace("acd","(?<!a(*FAIL)b)c","E",[global])),
- <<"xabXbpgbspePmyaYAcaQfd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*PRUNE)b)c","XbpgbspePmyaYA&a\\1Qf\\1",[])),
- <<"xabXbpgbspePmyaYAcaQfd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*PRUNE)b)c","XbpgbspePmyaYA&a\\1Qf\\1",[global])),
- <<"xabLEAOaSIPRfaaJd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*SKIP)b)c","LEAO\\1a\\1SIPRfaaJ",[])),
- <<"xabLEAOaSIPRfaaJd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*SKIP)b)c","LEAO\\1a\\1SIPRfaaJ",[global])),
- <<"xabaUocAdcnXoUlbd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*THEN)b)c","aUocAdcnXoUlb",[])),
- <<"xabaUocAdcnXoUlbd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*THEN)b)c","aUocAdcnXoUlb",[global])),
- <<"nkbGaaSijewUabcdnMG">> = iolist_to_binary(re:replace("abcd","(a)(?2){2}(.)","nkbG\\1aSijewU&nMG",[])),
- <<"nkbGaaSijewUabcdnMG">> = iolist_to_binary(re:replace("abcd","(a)(?2){2}(.)","nkbG\\1aSijewU&nMG",[global])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ )++ c","f\\1\\1Ek&r\\1\\1&",[extended])),
+ <<"aabc">> = iolist_to_binary(re:replace("aabc","^.*? (?: (?:a(*THEN)b)++ )++ c","f\\1\\1Ek&r\\1\\1&",[extended,
+ global])),
+ <<"taclqoaJUC">> = iolist_to_binary(re:replace("ac","^(?(?=a(*THEN)b)ab|ac)","t&lqoaJUC",[])),
+ <<"taclqoaJUC">> = iolist_to_binary(re:replace("ac","^(?(?=a(*THEN)b)ab|ac)","t&lqoaJUC",[global])),
+ <<"ba">> = iolist_to_binary(re:replace("ba","^.*?(?(?=a)a|b(*THEN)c)","Vh\\1CaWxBWkPj&",[])),
+ <<"ba">> = iolist_to_binary(re:replace("ba","^.*?(?(?=a)a|b(*THEN)c)","Vh\\1CaWxBWkPj&",[global])),
+ <<"keB">> = iolist_to_binary(re:replace("ba","^.*?(?:(?(?=a)a|b(*THEN)c)|d)","keB",[])),
+ <<"keB">> = iolist_to_binary(re:replace("ba","^.*?(?:(?(?=a)a|b(*THEN)c)|d)","keB",[global])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^.*?(?(?=a)a(*THEN)b|c)","&hGHyUT",[])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","^.*?(?(?=a)a(*THEN)b|c)","&hGHyUT",[global])),
+ <<"aalwRkdRudOgViabc">> = iolist_to_binary(re:replace("aabc","^.*(?=a(*THEN)b)","\\1\\1&al\\1\\1wRkdRudO\\1gVi",[])),
+ <<"aalwRkdRudOgViabc">> = iolist_to_binary(re:replace("aabc","^.*(?=a(*THEN)b)","\\1\\1&al\\1\\1wRkdRudO\\1gVi",[global])),
+ <<"xaBjvlyeNRakKKdd">> = iolist_to_binary(re:replace("xacd","(?<=a(*ACCEPT)b)c","Bj\\1vlyeNRa\\1kKKd",[])),
+ <<"xaBjvlyeNRakKKdd">> = iolist_to_binary(re:replace("xacd","(?<=a(*ACCEPT)b)c","Bj\\1vlyeNRa\\1kKKd",[global])),
+ <<"xahwEupkaeaicd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*ACCEPT)b))c","hwEupk\\1e\\1i&",[])),
+ <<"xahwEupkaeaicd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*ACCEPT)b))c","hwEupk\\1e\\1i&",[global])),
+ <<"xabTIskAGiopxbaboXHqhd">> = iolist_to_binary(re:replace("xabcd","(?<=(a(*COMMIT)b))c","TIskAGiopxb\\1oXHqh",[])),
+ <<"xabTIskAGiopxbaboXHqhd">> = iolist_to_binary(re:replace("xabcd","(?<=(a(*COMMIT)b))c","TIskAGiopxb\\1oXHqh",[global])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=(a(*COMMIT)b))c","&kSi\\1u\\1nbm",[])),
+ <<"** Failers">> = iolist_to_binary(re:replace("** Failers","(?<=(a(*COMMIT)b))c","&kSi\\1u\\1nbm",[global])),
+ <<"xacd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*COMMIT)b))c","W\\1\\1kCqBlt&Hi\\1YuyKE",[])),
+ <<"xacd">> = iolist_to_binary(re:replace("xacd","(?<=(a(*COMMIT)b))c","W\\1\\1kCqBlt&Hi\\1YuyKE",[global])),
+ <<"xlBhbKjcSd">> = iolist_to_binary(re:replace("xcd","(?<!a(*FAIL)b)c","l\\1\\1\\1Bhb\\1Kj&S",[])),
+ <<"xlBhbKjcSd">> = iolist_to_binary(re:replace("xcd","(?<!a(*FAIL)b)c","l\\1\\1\\1Bhb\\1Kj&S",[global])),
+ <<"aTnbXLTid">> = iolist_to_binary(re:replace("acd","(?<!a(*FAIL)b)c","Tn\\1bXLTi\\1",[])),
+ <<"aTnbXLTid">> = iolist_to_binary(re:replace("acd","(?<!a(*FAIL)b)c","Tn\\1bXLTi\\1",[global])),
+ <<"xabiSd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*PRUNE)b)c","i\\1\\1S",[])),
+ <<"xabiSd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*PRUNE)b)c","i\\1\\1S",[global])),
+ <<"xabPPMbccnlcFnbcFteud">> = iolist_to_binary(re:replace("xabcd","(?<=a(*SKIP)b)c","PPMb&&nl&FnbcFteu",[])),
+ <<"xabPPMbccnlcFnbcFteud">> = iolist_to_binary(re:replace("xabcd","(?<=a(*SKIP)b)c","PPMb&&nl&FnbcFteu",[global])),
+ <<"xabVUmuVjd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*THEN)b)c","V\\1UmuVj",[])),
+ <<"xabVUmuVjd">> = iolist_to_binary(re:replace("xabcd","(?<=a(*THEN)b)c","V\\1UmuVj",[global])),
ok.
run49() ->
- <<"hello world SintestMnKXO">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1?)test","Sin&MnKXO",[])),
- <<"hello world SintestMnKXO">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1?)test","Sin&MnKXO",[global])),
- <<"hello world test">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1+)test","EqY&e&Np",[])),
- <<"hello world test">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1+)test","EqY&e&Np",[global])),
- <<"aacnRTVpYnGmPcIyAaacWH">> = iolist_to_binary(re:replace("aac","(a(*COMMIT)b){0}a(?1)|aac","\\1&n\\1RTVpYnGmPcIyA&WH",[])),
- <<"aacnRTVpYnGmPcIyAaacWH">> = iolist_to_binary(re:replace("aac","(a(*COMMIT)b){0}a(?1)|aac","\\1&n\\1RTVpYnGmPcIyA&WH",[global])),
- <<"saacAdlboHVPY">> = iolist_to_binary(re:replace("aac","((?:a?)*)*c","s&\\1Adlb\\1oHVPY",[])),
- <<"saacAdlboHVPY">> = iolist_to_binary(re:replace("aac","((?:a?)*)*c","s&\\1Adlb\\1oHVPY",[global])),
- <<"PQFQipl">> = iolist_to_binary(re:replace("aac","((?>a?)*)*c","\\1PQF\\1Qipl",[])),
- <<"PQFQipl">> = iolist_to_binary(re:replace("aac","((?>a?)*)*c","\\1PQF\\1Qipl",[global])),
- <<"aOSwgH">> = iolist_to_binary(re:replace("aba","(?>.*?a)(?<=ba)","OSwg\\1H",[])),
- <<"aOSwgH">> = iolist_to_binary(re:replace("aba","(?>.*?a)(?<=ba)","OSwg\\1H",[global])),
- <<"UL">> = iolist_to_binary(re:replace("aba","(?:.*?a)(?<=ba)","UL",[])),
- <<"UL">> = iolist_to_binary(re:replace("aba","(?:.*?a)(?<=ba)","UL",[global])),
- <<"akGFFqTULiWlebdQv">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","kGFFqTU\\1Li\\1\\1Wl\\1ebdQv",[])),
- <<"akGFFqTULiWlebdQv">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","kGFFqTU\\1Li\\1\\1Wl\\1ebdQv",[global])),
- <<"aXPTFWMMabnvLRLXcgs">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","XP\\1T\\1FWMM&nvLRL\\1Xcgs",[dotall])),
- <<"aXPTFWMMabnvLRLXcgs">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","XP\\1T\\1FWMM&nvLRL\\1Xcgs",[dotall,
- global])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^a(*PRUNE)b","kTbd&d\\1IUxwe",[dotall])),
- <<"aab">> = iolist_to_binary(re:replace("aab","^a(*PRUNE)b","kTbd&d\\1IUxwe",[dotall,
- global])),
- <<"atVababo">> = iolist_to_binary(re:replace("aab",".*?a(*SKIP)b","\\1tV&&o",[])),
- <<"atVababo">> = iolist_to_binary(re:replace("aab",".*?a(*SKIP)b","\\1tV&&o",[global])),
- <<"aWeRyiVpKsDiabnl">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","WeR\\1yiVpKsDi&nl\\1",[dotall])),
- <<"aWeRyiVpKsDiabnl">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","WeR\\1yiVpKsDi&nl\\1",[dotall,
- global])),
- <<"aUabbhWWOF">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","U&bhWWOF\\1",[])),
- <<"aUabbhWWOF">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","U&bhWWOF\\1",[global])),
+ <<"fQabcdabcdjOmbrqfabcdAbBVYaRO">> = iolist_to_binary(re:replace("abcd","(a)(?2){2}(.)","fQ&&jOmbrqf&AbBVY\\1RO",[])),
+ <<"fQabcdabcdjOmbrqfabcdAbBVYaRO">> = iolist_to_binary(re:replace("abcd","(a)(?2){2}(.)","fQ&&jOmbrqf&AbBVY\\1RO",[global])),
+ <<"hello world yxxigMcOStestrk">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1?)test","yxxigMcOS&rk",[])),
+ <<"hello world yxxigMcOStestrk">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1?)test","yxxigMcOS&rk",[global])),
+ <<"hello world test">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1+)test","dx\\1giHSx&BeV&E",[])),
+ <<"hello world test">> = iolist_to_binary(re:replace("hello world test","(another)?(\\1+)test","dx\\1giHSx&BeV&E",[global])),
+ <<"DwfaacPJXaacSN">> = iolist_to_binary(re:replace("aac","(a(*COMMIT)b){0}a(?1)|aac","Dwf&PJX\\1\\1&SN",[])),
+ <<"DwfaacPJXaacSN">> = iolist_to_binary(re:replace("aac","(a(*COMMIT)b){0}a(?1)|aac","Dwf&PJX\\1\\1&SN",[global])),
+ <<"lQ">> = iolist_to_binary(re:replace("aac","((?:a?)*)*c","l\\1Q",[])),
+ <<"lQ">> = iolist_to_binary(re:replace("aac","((?:a?)*)*c","l\\1Q",[global])),
+ <<"mytQYMtByQalFhPaqAF">> = iolist_to_binary(re:replace("aac","((?>a?)*)*c","\\1mytQYMtByQalFhPaqAF",[])),
+ <<"mytQYMtByQalFhPaqAF">> = iolist_to_binary(re:replace("aac","((?>a?)*)*c","\\1mytQYMtByQalFhPaqAF",[global])),
+ <<"aJcbatLdoGHtuOHxJ">> = iolist_to_binary(re:replace("aba","(?>.*?a)(?<=ba)","Jc&tLdoGHt\\1uOHxJ",[])),
+ <<"aJcbatLdoGHtuOHxJ">> = iolist_to_binary(re:replace("aba","(?>.*?a)(?<=ba)","Jc&tLdoGHt\\1uOHxJ",[global])),
+ <<"jnJTr">> = iolist_to_binary(re:replace("aba","(?:.*?a)(?<=ba)","jnJTr",[])),
+ <<"jnJTr">> = iolist_to_binary(re:replace("aba","(?:.*?a)(?<=ba)","jnJTr",[global])),
+ <<"aSSoEg">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","SS\\1\\1oE\\1g",[])),
+ <<"aSSoEg">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","SS\\1\\1oE\\1g",[global])),
+ <<"aOdJuWtvQ">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","OdJuWtvQ",[dotall])),
+ <<"aOdJuWtvQ">> = iolist_to_binary(re:replace("aab",".*?a(*PRUNE)b","OdJuWtvQ",[dotall,
+ global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^a(*PRUNE)b","u\\1oO\\1B\\1\\1",[dotall])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","^a(*PRUNE)b","u\\1oO\\1B\\1\\1",[dotall,
+ global])),
+ <<"aUtmYVcabmqfPDm">> = iolist_to_binary(re:replace("aab",".*?a(*SKIP)b","\\1UtmYVc\\1&mq\\1fPDm",[])),
+ <<"aUtmYVcabmqfPDm">> = iolist_to_binary(re:replace("aab",".*?a(*SKIP)b","\\1UtmYVc\\1&mq\\1fPDm",[global])),
+ <<"amg">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","m\\1g",[dotall])),
+ <<"amg">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","m\\1g",[dotall,
+ global])),
ok.
run50() ->
- <<"aab">> = iolist_to_binary(re:replace("aab","(?>^a)b","l",[dotall])),
- <<"aab">> = iolist_to_binary(re:replace("aab","(?>^a)b","l",[dotall,
- global])),
- <<"alphabetabcdeY">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*?)(?<=(abcd)|(wxyz))","eY",[])),
- <<"alphabetabcdeY">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*?)(?<=(abcd)|(wxyz))","eY",[global])),
- <<"endingwxyzmUXcfh">> = iolist_to_binary(re:replace("endingwxyz","(?>.*?)(?<=(abcd)|(wxyz))","mUX&cf\\1\\1h",[])),
- <<"endingwxyzmUXcfh">> = iolist_to_binary(re:replace("endingwxyz","(?>.*?)(?<=(abcd)|(wxyz))","mUX&cf\\1\\1h",[global])),
- <<"alphabetabcddalphabetabcdHPabcdycalphabetabcdalphabetabcdabcdAsalphabetabcdnalphabetabcd">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd)|(wxyz))","&d&HP\\1yc&&\\1As&n&",[])),
- <<"alphabetabcddalphabetabcdHPabcdycalphabetabcdalphabetabcdabcdAsalphabetabcdnalphabetabcddHPabcdycabcdAsn">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd)|(wxyz))","&d&HP\\1yc&&\\1As&n&",[global])),
- <<"nuJausendingwxyzRQmendingwxyzxY">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd)|(wxyz))","nuJaus&RQm&xY",[])),
- <<"nuJausendingwxyzRQmendingwxyzxYnuJausRQmxY">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd)|(wxyz))","nuJaus&RQm&xY",[global])),
- <<"abcdfooxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*)foo","tW\\1",[])),
- <<"abcdfooxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*)foo","tW\\1",[global])),
- <<"abcdfooVDUixyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*?)foo","&VDUi",[])),
- <<"abcdfooVDUixyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*?)foo","&VDUi",[global])),
- <<"acxmMn">> = iolist_to_binary(re:replace("ac","(?:(a(*PRUNE)b)){0}(?:(?1)|ac)","&\\1xmMn",[])),
- <<"acxmMn">> = iolist_to_binary(re:replace("ac","(?:(a(*PRUNE)b)){0}(?:(?1)|ac)","&\\1xmMn",[global])),
- <<"PvKHsAacacQ">> = iolist_to_binary(re:replace("ac","(?:(a(*SKIP)b)){0}(?:(?1)|ac)","P\\1vKHsA&&Q",[])),
- <<"PvKHsAacacQ">> = iolist_to_binary(re:replace("ac","(?:(a(*SKIP)b)){0}(?:(?1)|ac)","P\\1vKHsA&&Q",[global])),
- <<"aa">> = iolist_to_binary(re:replace("aa","(?<=(*SKIP)ac)a","g",[])),
- <<"aa">> = iolist_to_binary(re:replace("aa","(?<=(*SKIP)ac)a","g",[global])),
- <<"aakcebaaaacgyaaaaceWGsoCOKKn">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)b|a+c","kceb&gy&eWG\\1soCOKKn",[])),
- <<"aakcebaaaacgyaaaaceWGsoCOKKn">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)b|a+c","kceb&gy&eWG\\1soCOKKn",[global])),
- <<"aaMwmkmaaaacTVDJaaaacSHIqUKYU">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*PRUNE)b|a+c","Mwmk\\1m&TVDJ&SHIqUKYU",[])),
- <<"aaMwmkmaaaacTVDJaaaacSHIqUKYU">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*PRUNE)b|a+c","Mwmk\\1m&TVDJ&SHIqUKYU",[global])),
- <<"aaaaaacWXE">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP:N)(*PRUNE)b|a+c","&WXE",[])),
- <<"aaaaaacWXE">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP:N)(*PRUNE)b|a+c","&WXE",[global])),
- <<"aalIbneaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c","\\1lI\\1b\\1ne&",[])),
- <<"aalIbneaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c","\\1lI\\1b\\1ne&",[global])),
- <<"aauaaaacUCgqIctaaaacOCUYF">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*PRUNE)b|a+c","u&UCg\\1qIct&O\\1CU\\1\\1YF",[])),
- <<"aauaaaacUCgqIctaaaacOCUYF">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*PRUNE)b|a+c","u&UCg\\1qIct&O\\1CU\\1\\1YF",[global])),
+ <<"aPabRwBtwCmcabVfNbs">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","P&RwBtwCmc&VfNb\\1\\1s",[])),
+ <<"aPabRwBtwCmcabVfNbs">> = iolist_to_binary(re:replace("aab","(?>.*?a)b","P&RwBtwCmc&VfNb\\1\\1s",[global])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(?>^a)b","a\\1a",[dotall])),
+ <<"aab">> = iolist_to_binary(re:replace("aab","(?>^a)b","a\\1a",[dotall,
+ global])),
+ <<"alphabetabcdQVHlseDxWoyVop">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*?)(?<=(abcd)|(wxyz))","QVHlseDxWoyVop",[])),
+ <<"alphabetabcdQVHlseDxWoyVop">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*?)(?<=(abcd)|(wxyz))","QVHlseDxWoyVop",[global])),
+ <<"endingwxyzvOEVceUN">> = iolist_to_binary(re:replace("endingwxyz","(?>.*?)(?<=(abcd)|(wxyz))","vOE\\1VceUN&",[])),
+ <<"endingwxyzvOEVceUN">> = iolist_to_binary(re:replace("endingwxyz","(?>.*?)(?<=(abcd)|(wxyz))","vOE\\1VceUN&",[global])),
+ <<"VaQAuabcdDRalphabetabcdGQKSabcdMbhX">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd)|(wxyz))","VaQAu\\1DR&GQKS\\1MbhX",[])),
+ <<"VaQAuabcdDRalphabetabcdGQKSabcdMbhXVaQAuabcdDRGQKSabcdMbhX">> = iolist_to_binary(re:replace("alphabetabcd","(?>.*)(?<=(abcd)|(wxyz))","VaQAu\\1DR&GQKS\\1MbhX",[global])),
+ <<"Lendingwxyz">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd)|(wxyz))","L\\1&",[])),
+ <<"LendingwxyzL">> = iolist_to_binary(re:replace("endingwxyz","(?>.*)(?<=(abcd)|(wxyz))","L\\1&",[global])),
+ <<"abcdfooxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*)foo","O\\1",[])),
+ <<"abcdfooxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*)foo","O\\1",[global])),
+ <<"abcdEDLXMxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*?)foo","EDLXM",[])),
+ <<"abcdEDLXMxyz">> = iolist_to_binary(re:replace("abcdfooxyz","(?>.*?)foo","EDLXM",[global])),
+ <<"KacvfWficUMXYUhCR">> = iolist_to_binary(re:replace("ac","(?:(a(*PRUNE)b)){0}(?:(?1)|ac)","K&vfWficUMXYUhCR",[])),
+ <<"KacvfWficUMXYUhCR">> = iolist_to_binary(re:replace("ac","(?:(a(*PRUNE)b)){0}(?:(?1)|ac)","K&vfWficUMXYUhCR",[global])),
+ <<"lVNcLhkqs">> = iolist_to_binary(re:replace("ac","(?:(a(*SKIP)b)){0}(?:(?1)|ac)","lVNcLhkqs",[])),
+ <<"lVNcLhkqs">> = iolist_to_binary(re:replace("ac","(?:(a(*SKIP)b)){0}(?:(?1)|ac)","lVNcLhkqs",[global])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","(?<=(*SKIP)ac)a","WA\\1ysWU",[])),
+ <<"aa">> = iolist_to_binary(re:replace("aa","(?<=(*SKIP)ac)a","WA\\1ysWU",[global])),
+ <<"aaHvYt">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)b|a+c","Hv\\1Yt",[])),
+ <<"aaHvYt">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)b|a+c","Hv\\1Yt",[global])),
+ <<"aamkEaaaaclOsMTmDx">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*PRUNE)b|a+c","mkE&lOsM\\1TmDx",[])),
+ <<"aamkEaaaaclOsMTmDx">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*PRUNE)b|a+c","mkE&lOsM\\1TmDx",[global])),
+ <<"aarTnFhwuaaaacOCC">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP:N)(*PRUNE)b|a+c","rTn\\1Fhwu\\1&OCC",[])),
+ <<"aarTnFhwuaaaacOCC">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP:N)(*PRUNE)b|a+c","rTn\\1Fhwu\\1&OCC",[global])),
+ <<"aaWgwMatYijEPVVhET">> = iolist_to_binary(re:replace("aaaaaac","aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c","WgwMatYijEPVVhET",[])),
+ <<"aaWgwMatYijEPVVhET">> = iolist_to_binary(re:replace("aaaaaac","aaaa(*:N)a(*SKIP:N)(*PRUNE)b|a+c","WgwMatYijEPVVhET",[global])),
+ <<"aaDFldiXfsqAoaaaacgyaaaacaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*PRUNE)b|a+c","DFl\\1diXfsqAo&gy&&",[])),
+ <<"aaDFldiXfsqAoaaaacgyaaaacaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*PRUNE)b|a+c","DFl\\1diXfsqAo&gy&&",[global])),
ok.
run51() ->
- <<"aaaaaKQacStnP">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)b|a+c","K\\1Q&St\\1nP",[])),
- <<"aaaaaKQacStnP">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)b|a+c","K\\1Q&St\\1nP",[global])),
- <<"aaaaaYggUuQGacfRtKLJ">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*SKIP)b|a+c","YggUu\\1QG&\\1fRtKL\\1\\1J\\1",[])),
- <<"aaaaaYggUuQGacfRtKLJ">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*SKIP)b|a+c","YggUu\\1QG&\\1fRtKL\\1\\1J\\1",[global])),
- <<"aaaaa">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*SKIP)b|a+c","\\1",[])),
- <<"aaaaa">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*SKIP)b|a+c","\\1",[global])),
- <<"aaaaaU">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*SKIP)b|a+c","U",[])),
- <<"aaaaaU">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*SKIP)b|a+c","U",[global])),
- <<"aaaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)b|a+c","kAM",[])),
- <<"aaaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)b|a+c","kAM",[global])),
- <<"VvCwaaaaaacLKWgIbVKGB">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)b|a+c","VvCw&LKWgIbVKGB",[])),
- <<"VvCwaaaaaacLKWgIbVKGB">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)b|a+c","VvCw&LKWgIbVKGB",[global])),
- <<"abvTAmJ">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*THEN)b|a+c","abvTA\\1mJ",[])),
- <<"abvTAmJ">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*THEN)b|a+c","abvTA\\1mJ",[global])),
- <<"phVmoxx">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*THEN)b|a+c","phVm\\1oxx",[])),
- <<"phVmoxx">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*THEN)b|a+c","phVm\\1oxx",[global])),
- <<"GdHapg">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*THEN)b|a+c","Gd\\1Hapg",[])),
- <<"GdHapg">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*THEN)b|a+c","Gd\\1Hapg",[global])),
+ <<"aaaaaacacLQGPDsBacWqi">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)b|a+c","&&LQG\\1\\1PDsB&W\\1qi",[])),
+ <<"aaaaaacacLQGPDsBacWqi">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)b|a+c","&&LQG\\1\\1PDsB&W\\1qi",[global])),
+ <<"aaaaaqFvS">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*SKIP)b|a+c","qFvS",[])),
+ <<"aaaaaqFvS">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*SKIP)b|a+c","qFvS",[global])),
+ <<"aaaaaxduXkuthyKkfDvdGK">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*SKIP)b|a+c","xduXkuthyK\\1kfDvdGK",[])),
+ <<"aaaaaxduXkuthyKkfDvdGK">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)(*SKIP)b|a+c","xduXkuthyK\\1kfDvdGK",[global])),
+ <<"aaaaaT">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*SKIP)b|a+c","T",[])),
+ <<"aaaaaT">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*SKIP)b|a+c","T",[global])),
+ <<"aaaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)b|a+c","tK\\1X\\1ycVaGLc\\1RU\\1&",[])),
+ <<"aaaaaac">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)b|a+c","tK\\1X\\1ycVaGLc\\1RU\\1&",[global])),
+ <<"iVaaaaaackkBjFkaaaaaacmlfslVAM">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)b|a+c","iV&kkBjFk&mlfslVAM",[])),
+ <<"iVaaaaaackkBjFkaaaaaacmlfslVAM">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*THEN)b|a+c","iV&kkBjFk&mlfslVAM",[global])),
+ <<"o">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*THEN)b|a+c","o",[])),
+ <<"o">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*SKIP)(*THEN)b|a+c","o",[global])),
+ <<"wLxnFkaaaaaacAX">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*THEN)b|a+c","wLxnF\\1k&AX",[])),
+ <<"wLxnFkaaaaaacAX">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*PRUNE)(*THEN)b|a+c","wLxnF\\1k&AX",[global])),
+ <<"RkcioItaaaaaacT">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*THEN)b|a+c","Rk\\1cioI\\1t&T",[])),
+ <<"RkcioItaaaaaacT">> = iolist_to_binary(re:replace("aaaaaac","aaaaa(*COMMIT)(*THEN)b|a+c","Rk\\1cioI\\1t&T",[global])),
ok.
run52() ->
- <<"aaaaa">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+","\\1",[])),
- <<"aaaaa">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+","\\1",[global])),
- <<"aaaaaQvaOuCaBoHYMapab">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","\\1Qv&\\1OuC&BoHYM&pab",[])),
- <<"aaaaaQvaOuCaBoHYMapab">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","\\1Qv&\\1OuC&BoHYM&pab",[global])),
- <<"aauaaaa">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+","u&",[])),
- <<"aauaaaa">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+","u&",[global])),
- <<"aaaaaTLn">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","TLn\\1",[])),
- <<"aaaaaTLn">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","TLn\\1",[global])),
- <<"aaaacEITBRXepyL">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c","&EITBRXepyL\\1",[])),
- <<"aaaacEITBRXepyL">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c","&EITBRXepyL\\1",[global])),
- <<"aaaMSacMdGgSm">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c","\\1MS&MdGg\\1Sm",[])),
- <<"aaaMSacMdGgSm">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c","\\1MS&MdGg\\1Sm",[global])),
- <<"aaKCBrjuDaackaactRB">> = iolist_to_binary(re:replace("aaaac","aaa(*PRUNE:A)a(*SKIP:A)b|a+c","KCBrjuD&k&t\\1RB",[])),
- <<"aaKCBrjuDaackaactRB">> = iolist_to_binary(re:replace("aaaac","aaa(*PRUNE:A)a(*SKIP:A)b|a+c","KCBrjuD&k&t\\1RB",[global])),
- <<"aaaKWuEddO">> = iolist_to_binary(re:replace("aaaac","aaa(*MARK:A)a(*SKIP:A)b|a+c","KWuEddO",[])),
- <<"aaaKWuEddO">> = iolist_to_binary(re:replace("aaaac","aaa(*MARK:A)a(*SKIP:A)b|a+c","KWuEddO",[global])),
- <<"QSDGhNmLAsnYtCIuka">> = iolist_to_binary(re:replace("ba",".?(a|b(*THEN)c)","QSDGhNmLAsnYtCIuka",[])),
- <<"QSDGhNmLAsnYtCIuka">> = iolist_to_binary(re:replace("ba",".?(a|b(*THEN)c)","QSDGhNmLAsnYtCIuka",[global])),
- <<"tARW">> = iolist_to_binary(re:replace("abc","(a(*COMMIT)b)c|abd","tARW",[])),
- <<"tARW">> = iolist_to_binary(re:replace("abc","(a(*COMMIT)b)c|abd","tARW",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(a(*COMMIT)b)c|abd","THra\\1QsHhH&NqVcHjK\\1",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(a(*COMMIT)b)c|abd","THra\\1QsHhH&NqVcHjK\\1",[global])),
- <<"eJabcbgg">> = iolist_to_binary(re:replace("abc","(?=a(*COMMIT)b)abc|abd","\\1eJ&\\1bgg",[])),
- <<"eJabcbgg">> = iolist_to_binary(re:replace("abc","(?=a(*COMMIT)b)abc|abd","\\1eJ&\\1bgg",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(?=a(*COMMIT)b)abc|abd","&",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(?=a(*COMMIT)b)abc|abd","&",[global])),
- <<"SJjtxKabcE">> = iolist_to_binary(re:replace("abc","(?>a(*COMMIT)b)c|abd","SJjt\\1xK&E",[])),
- <<"SJjtxKabcE">> = iolist_to_binary(re:replace("abc","(?>a(*COMMIT)b)c|abd","SJjt\\1xK&E",[global])),
- <<"nCO">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","\\1nCO",[])),
- <<"nCO">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","\\1nCO",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a(?=b(*COMMIT)c)[^d]|abd","sicBOgC",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","a(?=b(*COMMIT)c)[^d]|abd","sicBOgC",[global])),
- <<"OIc">> = iolist_to_binary(re:replace("abc","a(?=b(*COMMIT)c)[^d]|abd","OI",[])),
- <<"OIc">> = iolist_to_binary(re:replace("abc","a(?=b(*COMMIT)c)[^d]|abd","OI",[global])),
- <<"cBnM">> = iolist_to_binary(re:replace("abd","a(?=bc).|abd","cBnM",[])),
- <<"cBnM">> = iolist_to_binary(re:replace("abd","a(?=bc).|abd","cBnM",[global])),
- <<"uwVabvc">> = iolist_to_binary(re:replace("abc","a(?=bc).|abd","\\1uwV&v",[])),
- <<"uwVabvc">> = iolist_to_binary(re:replace("abc","a(?=bc).|abd","\\1uwV&v",[global])),
- <<"abceabd">> = iolist_to_binary(re:replace("abceabd","a(?>b(*COMMIT)c)d|abd","ON\\1oJApWbhJ&h\\1SDD",[])),
- <<"abceabd">> = iolist_to_binary(re:replace("abceabd","a(?>b(*COMMIT)c)d|abd","ON\\1oJApWbhJ&h\\1SDD",[global])),
- <<"abceabdFDcsKjWRPJwG">> = iolist_to_binary(re:replace("abceabd","a(?>bc)d|abd","&FDcsK\\1jWRPJwG",[])),
- <<"abceabdFDcsKjWRPJwG">> = iolist_to_binary(re:replace("abceabd","a(?>bc)d|abd","&FDcsK\\1jWRPJwG",[global])),
- <<"fTabdENuYeMabdK">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","fT&ENuY\\1eM&K",[])),
- <<"fTabdENuYeMabdK">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","fT&ENuY\\1eM&K",[global])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)c)d|abd","vbE",[])),
- <<"abd">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)c)d|abd","vbE",[global])),
- <<"iKqJ">> = iolist_to_binary(re:replace("ac","((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))","iKq\\1J",[])),
- <<"iKqJ">> = iolist_to_binary(re:replace("ac","((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))","iKq\\1J",[global])),
+ <<"aaaaaWSYDaO">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+","WSYDaO",[])),
+ <<"aaaaaWSYDaO">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*PRUNE:m)(*SKIP:m)m|a+","WSYDaO",[global])),
+ <<"aaaaaWAaddaTedlmqyrPY">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","WA\\1&dd\\1&TedlmqyrPY",[])),
+ <<"aaaaaWAaddaTedlmqyrPY">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:m)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","WA\\1&dd\\1&TedlmqyrPY",[global])),
+ <<"aaJwaaaataaaaaaaaJ">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+","Jw&t&&J",[])),
+ <<"aaJwaaaataaaaaaaaJ">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*PRUNE:m)(*SKIP:m)m|a+","Jw&t&&J",[global])),
+ <<"aaaaawaeihCejEsBaGR">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","wae\\1ih\\1Ce\\1jEsBaG\\1R",[])),
+ <<"aaaaawaeihCejEsBaGR">> = iolist_to_binary(re:replace("aaaaaa","aaaaa(*:n)(*MARK:m)(*PRUNE)(*SKIP:m)m|a+","wae\\1ih\\1Ce\\1jEsBaG\\1R",[global])),
+ <<"aavaacNX">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c","v&\\1NX",[])),
+ <<"aavaacNX">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*PRUNE:A)a(*SKIP:A)b|a+c","v&\\1NX",[global])),
+ <<"aaapmNFtwlMXJwfQ">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c","pmNFtwlMXJ\\1wfQ",[])),
+ <<"aaapmNFtwlMXJwfQ">> = iolist_to_binary(re:replace("aaaac","a(*MARK:A)aa(*MARK:A)a(*SKIP:A)b|a+c","pmNFtwlMXJ\\1wfQ",[global])),
+ <<"aaEaacnKG">> = iolist_to_binary(re:replace("aaaac","aaa(*PRUNE:A)a(*SKIP:A)b|a+c","E&nKG",[])),
+ <<"aaEaacnKG">> = iolist_to_binary(re:replace("aaaac","aaa(*PRUNE:A)a(*SKIP:A)b|a+c","E&nKG",[global])),
+ <<"aaaEmXmYyXMvMPacsIUnacb">> = iolist_to_binary(re:replace("aaaac","aaa(*MARK:A)a(*SKIP:A)b|a+c","E\\1mXmY\\1yXMvMP&sIUn&b",[])),
+ <<"aaaEmXmYyXMvMPacsIUnacb">> = iolist_to_binary(re:replace("aaaac","aaa(*MARK:A)a(*SKIP:A)b|a+c","E\\1mXmY\\1yXMvMP&sIUn&b",[global])),
+ <<"sctyVa">> = iolist_to_binary(re:replace("ba",".?(a|b(*THEN)c)","sctyV\\1",[])),
+ <<"sctyVa">> = iolist_to_binary(re:replace("ba",".?(a|b(*THEN)c)","sctyV\\1",[global])),
+ <<"abcEabcyEabLepBwabcDne">> = iolist_to_binary(re:replace("abc","(a(*COMMIT)b)c|abd","&E&yE\\1LepBw&Dne",[])),
+ <<"abcEabcyEabLepBwabcDne">> = iolist_to_binary(re:replace("abc","(a(*COMMIT)b)c|abd","&E&yE\\1LepBw&Dne",[global])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","(a(*COMMIT)b)c|abd","EnmKFsm&",[])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","(a(*COMMIT)b)c|abd","EnmKFsm&",[global])),
+ <<"pXGcB">> = iolist_to_binary(re:replace("abc","(?=a(*COMMIT)b)abc|abd","pXGcB",[])),
+ <<"pXGcB">> = iolist_to_binary(re:replace("abc","(?=a(*COMMIT)b)abc|abd","pXGcB",[global])),
+ <<"yqRflvWfdabd">> = iolist_to_binary(re:replace("abd","(?=a(*COMMIT)b)abc|abd","yqR\\1flvW\\1fd&",[])),
+ <<"yqRflvWfdabd">> = iolist_to_binary(re:replace("abd","(?=a(*COMMIT)b)abc|abd","yqR\\1flvW\\1fd&",[global])),
+ <<"caqabcfAabcVd">> = iolist_to_binary(re:replace("abc","(?>a(*COMMIT)b)c|abd","caq&fA&Vd",[])),
+ <<"caqabcfAabcVd">> = iolist_to_binary(re:replace("abc","(?>a(*COMMIT)b)c|abd","caq&fA&Vd",[global])),
+ <<"BYnSX">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","BY\\1nSX",[])),
+ <<"BYnSX">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","BY\\1nSX",[global])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a(?=b(*COMMIT)c)[^d]|abd","d\\1h\\1&",[])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","a(?=b(*COMMIT)c)[^d]|abd","d\\1h\\1&",[global])),
+ <<"rYJdMtasqc">> = iolist_to_binary(re:replace("abc","a(?=b(*COMMIT)c)[^d]|abd","rYJd\\1Mtasq\\1",[])),
+ <<"rYJdMtasqc">> = iolist_to_binary(re:replace("abc","a(?=b(*COMMIT)c)[^d]|abd","rYJd\\1Mtasq\\1",[global])),
+ <<"o">> = iolist_to_binary(re:replace("abd","a(?=bc).|abd","o\\1",[])),
+ <<"o">> = iolist_to_binary(re:replace("abd","a(?=bc).|abd","o\\1",[global])),
+ <<"WSUNxSjyjPQXxic">> = iolist_to_binary(re:replace("abc","a(?=bc).|abd","W\\1SUNxSjyjPQXxi",[])),
+ <<"WSUNxSjyjPQXxic">> = iolist_to_binary(re:replace("abc","a(?=bc).|abd","W\\1SUNxSjyjPQXxi",[global])),
+ <<"abceabd">> = iolist_to_binary(re:replace("abceabd","a(?>b(*COMMIT)c)d|abd","iF",[])),
+ <<"abceabd">> = iolist_to_binary(re:replace("abceabd","a(?>b(*COMMIT)c)d|abd","iF",[global])),
+ <<"abceoxabdvpqchabdcfPpHmTC">> = iolist_to_binary(re:replace("abceabd","a(?>bc)d|abd","ox&vpq\\1ch&cfPpHmTC",[])),
+ <<"abceoxabdvpqchabdcfPpHmTC">> = iolist_to_binary(re:replace("abceabd","a(?>bc)d|abd","ox&vpq\\1ch&cfPpHmTC",[global])),
+ <<"EPsAiuAXGag">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","EPsAiuAXGag",[])),
+ <<"EPsAiuAXGag">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)b)c|abd","EPsAiuAXGag",[global])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)c)d|abd","iTR\\1KirHaAm\\1u&L",[])),
+ <<"abd">> = iolist_to_binary(re:replace("abd","(?>a(*COMMIT)c)d|abd","iTR\\1KirHaAm\\1u&L",[global])),
+ <<"hopmrj">> = iolist_to_binary(re:replace("ac","((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))","hopm\\1\\1\\1rj",[])),
+ <<"hopmrj">> = iolist_to_binary(re:replace("ac","((?=a(*COMMIT)b)ab|ac){0}(?:(?1)|a(c))","hopm\\1\\1\\1rj",[global])),
ok.
run53() ->
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","YQRU&",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","YQRU&",[global])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a)?(?(1)a|b)+$","SLSciT&&F",[])),
- <<"a">> = iolist_to_binary(re:replace("a","^(a)?(?(1)a|b)+$","SLSciT&&F",[global])),
- <<"aIbCe">> = iolist_to_binary(re:replace("ab","(?=a\\Kb)ab","IbCe",[])),
- <<"aIbCe">> = iolist_to_binary(re:replace("ab","(?=a\\Kb)ab","IbCe",[global])),
- <<"KWEhxbu">> = iolist_to_binary(re:replace("ac","(?!a\\Kb)ac","KWEhxbu",[])),
- <<"KWEhxbu">> = iolist_to_binary(re:replace("ac","(?!a\\Kb)ac","KWEhxbu",[global])),
- <<"abObpVTjlSnifUCddjn">> = iolist_to_binary(re:replace("abcd","^abc(?<=b\\Kc)d","ObpV\\1TjlSnifUCddjn",[])),
- <<"abObpVTjlSnifUCddjn">> = iolist_to_binary(re:replace("abcd","^abc(?<=b\\Kc)d","ObpV\\1TjlSnifUCddjn",[global])),
- <<"lljlodkrbhYabcdXWQwLIT">> = iolist_to_binary(re:replace("abcd","^abc(?<!b\\Kq)d","llj\\1lodkrbhY&XWQwLIT",[])),
- <<"lljlodkrbhYabcdXWQwLIT">> = iolist_to_binary(re:replace("abcd","^abc(?<!b\\Kq)d","llj\\1lodkrbhY&XWQwLIT",[global])),
- <<"abcdabcdabcdHLqtQeabcdEabcdJHiabcdP">> = iolist_to_binary(re:replace("abcd","^((abc|abcx)(*THEN)y|abcd)","&&\\1HLqtQe&E\\1JHi\\1P",[])),
- <<"abcdabcdabcdHLqtQeabcdEabcdJHiabcdP">> = iolist_to_binary(re:replace("abcd","^((abc|abcx)(*THEN)y|abcd)","&&\\1HLqtQe&E\\1JHi\\1P",[global])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((abc|abcx)(*THEN)y|abcd)","NtVKEpoSj\\1\\1o\\1ESK",[])),
- <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((abc|abcx)(*THEN)y|abcd)","NtVKEpoSj\\1\\1o\\1ESK",[global])),
- <<"abcxy">> = iolist_to_binary(re:replace("abcxy","^((abc|abcx)(*THEN)y|abcd)","Jj\\1XL&TAaD",[])),
- <<"abcxy">> = iolist_to_binary(re:replace("abcxy","^((abc|abcx)(*THEN)y|abcd)","Jj\\1XL&TAaD",[global])),
- <<"yes">> = iolist_to_binary(re:replace("yes","^((yes|no)(*THEN)(*F))?","fA&L\\1bxmA\\1bu\\1w\\1Lh",[])),
- <<"yes">> = iolist_to_binary(re:replace("yes","^((yes|no)(*THEN)(*F))?","fA&L\\1bxmA\\1bu\\1w\\1Lh",[global])),
- <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|ac)ac|ac","uuCjDlLQYP",[])),
- <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|ac)ac|ac","uuCjDlLQYP",[global])),
- <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|(ac)) ac | (a)c","\\1W&y&PeDCK\\1cDLtO",[extended])),
- <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|(ac)) ac | (a)c","\\1W&y&PeDCK\\1cDLtO",[extended,
- global])),
- <<"bnWqWn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*THEN)a)bn|bnn)","&WqW",[])),
- <<"bnWqWn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*THEN)a)bn|bnn)","&WqW",[global])),
- <<"PGnTXLBnIbnbnbnePKbnn">> = iolist_to_binary(re:replace("bnn","(?!b(*SKIP)a)bn|bnn","PGnTXLBnI&&&e\\1PK&",[])),
- <<"PGnTXLBnIbnbnbnePKbnn">> = iolist_to_binary(re:replace("bnn","(?!b(*SKIP)a)bn|bnn","PGnTXLBnI&&&e\\1PK&",[global])),
- <<"iMn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*SKIP)a)bn|bnn)","\\1iM",[])),
- <<"iMn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*SKIP)a)bn|bnn)","\\1iM",[global])),
- <<"gcbnaxAn">> = iolist_to_binary(re:replace("bnn","(?!b(*PRUNE)a)bn|bnn","\\1gc&ax\\1\\1A",[])),
- <<"gcbnaxAn">> = iolist_to_binary(re:replace("bnn","(?!b(*PRUNE)a)bn|bnn","\\1gc&ax\\1\\1A",[global])),
- <<"dAtbnrKybneTLNeBcn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*PRUNE)a)bn|bnn)","dAt&rKy&eTLNeBc",[])),
- <<"dAtbnrKybneTLNeBcn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*PRUNE)a)bn|bnn)","dAt&rKy&eTLNeBc",[global])),
- <<"vXn">> = iolist_to_binary(re:replace("bnn","(?!b(*COMMIT)a)bn|bnn","vX",[])),
- <<"vXn">> = iolist_to_binary(re:replace("bnn","(?!b(*COMMIT)a)bn|bnn","vX",[global])),
- <<"EUadjhULxavkwOtGbnqrPn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*COMMIT)a)bn|bnn)","EUadjhULxavkwOtG&qrP",[])),
- <<"EUadjhULxavkwOtGbnqrPn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*COMMIT)a)bn|bnn)","EUadjhULxavkwOtG&qrP",[global])),
- <<"bnn">> = iolist_to_binary(re:replace("bnn","(?=b(*SKIP)a)bn|bnn","Fw",[])),
- <<"bnn">> = iolist_to_binary(re:replace("bnn","(?=b(*SKIP)a)bn|bnn","Fw",[global])),
- <<"JgfYWGl">> = iolist_to_binary(re:replace("bnn","(?=b(*THEN)a)bn|bnn","Jgf\\1Y\\1W\\1Gl\\1",[])),
- <<"JgfYWGl">> = iolist_to_binary(re:replace("bnn","(?=b(*THEN)a)bn|bnn","Jgf\\1Y\\1W\\1Gl\\1",[global])),
- <<"SacJCiWoykVpvXacd">> = iolist_to_binary(re:replace("acd","(?!a(*SKIP)b)..","S&JCiWoykVpvX\\1&",[])),
- <<"SacJCiWoykVpvXacd">> = iolist_to_binary(re:replace("acd","(?!a(*SKIP)b)..","S&JCiWoykVpvX\\1&",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","G&aHbV\\1y&\\1&KV\\1\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^(a)?(?(1)a|b)+$","G&aHbV\\1y&\\1&KV\\1\\1",[global])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a)?(?(1)a|b)+$","vJmS\\1lM\\1yq\\1F&T",[])),
+ <<"a">> = iolist_to_binary(re:replace("a","^(a)?(?(1)a|b)+$","vJmS\\1lM\\1yq\\1F&T",[global])),
+ <<"abROgE">> = iolist_to_binary(re:replace("ab","(?=a\\Kb)ab","&RO\\1gE",[])),
+ <<"abROgE">> = iolist_to_binary(re:replace("ab","(?=a\\Kb)ab","&RO\\1gE",[global])),
+ <<"AVraX">> = iolist_to_binary(re:replace("ac","(?!a\\Kb)ac","AVraX",[])),
+ <<"AVraX">> = iolist_to_binary(re:replace("ac","(?!a\\Kb)ac","AVraX",[global])),
+ <<"abrftocdgfVofMMeQcd">> = iolist_to_binary(re:replace("abcd","^abc(?<=b\\Kc)d","rfto&gfVofMM\\1eQ&",[])),
+ <<"abrftocdgfVofMMeQcd">> = iolist_to_binary(re:replace("abcd","^abc(?<=b\\Kc)d","rfto&gfVofMM\\1eQ&",[global])),
+ <<"NHQVjk">> = iolist_to_binary(re:replace("abcd","^abc(?<!b\\Kq)d","N\\1HQVjk",[])),
+ <<"NHQVjk">> = iolist_to_binary(re:replace("abcd","^abc(?<!b\\Kq)d","N\\1HQVjk",[global])),
+ <<"GLeLtFYabcdabcdgLpecJf">> = iolist_to_binary(re:replace("abcd","^((abc|abcx)(*THEN)y|abcd)","GLeLtFY\\1\\1gLpecJf",[])),
+ <<"GLeLtFYabcdabcdgLpecJf">> = iolist_to_binary(re:replace("abcd","^((abc|abcx)(*THEN)y|abcd)","GLeLtFY\\1\\1gLpecJf",[global])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((abc|abcx)(*THEN)y|abcd)","wcL\\1",[])),
+ <<"*** Failers">> = iolist_to_binary(re:replace("*** Failers","^((abc|abcx)(*THEN)y|abcd)","wcL\\1",[global])),
+ <<"abcxy">> = iolist_to_binary(re:replace("abcxy","^((abc|abcx)(*THEN)y|abcd)","RUVUoonAhCsbWrFjwfb",[])),
+ <<"abcxy">> = iolist_to_binary(re:replace("abcxy","^((abc|abcx)(*THEN)y|abcd)","RUVUoonAhCsbWrFjwfb",[global])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","^((yes|no)(*THEN)(*F))?","&ymEfDG&",[])),
+ <<"yes">> = iolist_to_binary(re:replace("yes","^((yes|no)(*THEN)(*F))?","&ymEfDG&",[global])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|ac)ac|ac","VWaTi",[])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|ac)ac|ac","VWaTi",[global])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|(ac)) ac | (a)c","QYq&",[extended])),
+ <<"ac">> = iolist_to_binary(re:replace("ac","(?=a(*COMMIT)b|(ac)) ac | (a)c","QYq&",[extended,
+ global])),
+ <<"CRAbnGGrAbnXLfMKFAn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*THEN)a)bn|bnn)","CRA&G\\1G\\1r\\1A&XLfMKFA",[])),
+ <<"CRAbnGGrAbnXLfMKFAn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*THEN)a)bn|bnn)","CRA&G\\1G\\1r\\1A&XLfMKFA",[global])),
+ <<"pn">> = iolist_to_binary(re:replace("bnn","(?!b(*SKIP)a)bn|bnn","p",[])),
+ <<"pn">> = iolist_to_binary(re:replace("bnn","(?!b(*SKIP)a)bn|bnn","p",[global])),
+ <<"avnuwGVQnbbnMn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*SKIP)a)bn|bnn)","avnuw\\1\\1GVQ\\1nb&M",[])),
+ <<"avnuwGVQnbbnMn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*SKIP)a)bn|bnn)","avnuw\\1\\1GVQ\\1nb&M",[global])),
+ <<"dbJHbnQmNvUjn">> = iolist_to_binary(re:replace("bnn","(?!b(*PRUNE)a)bn|bnn","dbJH&QmNvU\\1j",[])),
+ <<"dbJHbnQmNvUjn">> = iolist_to_binary(re:replace("bnn","(?!b(*PRUNE)a)bn|bnn","dbJH&QmNvU\\1j",[global])),
+ <<"CjOjn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*PRUNE)a)bn|bnn)","\\1CjOj",[])),
+ <<"CjOjn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*PRUNE)a)bn|bnn)","\\1CjOj",[global])),
+ <<"KpYyerFiCpuOn">> = iolist_to_binary(re:replace("bnn","(?!b(*COMMIT)a)bn|bnn","KpYyerF\\1iCpuO",[])),
+ <<"KpYyerFiCpuOn">> = iolist_to_binary(re:replace("bnn","(?!b(*COMMIT)a)bn|bnn","KpYyerF\\1iCpuO",[global])),
+ <<"YmcadBbnnCCREKHHXlMoHn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*COMMIT)a)bn|bnn)","YmcadB&nCCREKHHXlMoH",[])),
+ <<"YmcadBbnnCCREKHHXlMoHn">> = iolist_to_binary(re:replace("bnn","(?(?!b(*COMMIT)a)bn|bnn)","YmcadB&nCCREKHHXlMoH",[global])),
+ <<"bnn">> = iolist_to_binary(re:replace("bnn","(?=b(*SKIP)a)bn|bnn","OvTfjYJC\\1XmGdYVUwWCW",[])),
+ <<"bnn">> = iolist_to_binary(re:replace("bnn","(?=b(*SKIP)a)bn|bnn","OvTfjYJC\\1XmGdYVUwWCW",[global])),
+ <<"FDbNbagbnngDbDDd">> = iolist_to_binary(re:replace("bnn","(?=b(*THEN)a)bn|bnn","FDbNbag&gDbDDd",[])),
+ <<"FDbNbagbnngDbDDd">> = iolist_to_binary(re:replace("bnn","(?=b(*THEN)a)bn|bnn","FDbNbag&gDbDDd",[global])),
ok.
run54() ->
- <<"CxbMac">> = iolist_to_binary(re:replace("ac","^(?(?!a(*SKIP)b))","&Cxb&M",[])),
- <<"CxbMac">> = iolist_to_binary(re:replace("ac","^(?(?!a(*SKIP)b))","&Cxb&M",[global])),
- <<"OceGNacoaFRboacPKd">> = iolist_to_binary(re:replace("acd","^(?!a(*PRUNE)b)..","OceGN&o\\1aF\\1Rb\\1o&PK",[])),
- <<"OceGNacoaFRboacPKd">> = iolist_to_binary(re:replace("acd","^(?!a(*PRUNE)b)..","OceGN&o\\1aF\\1Rb\\1o&PK",[global])),
- <<"ysd">> = iolist_to_binary(re:replace("acd","(?!a(*PRUNE)b)..","ys",[])),
- <<"ysd">> = iolist_to_binary(re:replace("acd","(?!a(*PRUNE)b)..","ys",[global])),
- <<"nba">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)","n\\1\\1&",[])),
- <<"nba">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)","n\\1\\1&",[global])),
- <<"CDEeCDYuCDCDb">> = iolist_to_binary(re:replace("CD","^(A(*THEN)B|C(*THEN)D)","&Ee\\1Yu\\1\\1b",[])),
- <<"CDEeCDYuCDCDb">> = iolist_to_binary(re:replace("CD","^(A(*THEN)B|C(*THEN)D)","&Ee\\1Yu\\1\\1b",[global])),
- <<"AYtnukv">> = iolist_to_binary(re:replace("1234","^\\d*\\w{4}","AYtn\\1ukv",[])),
- <<"AYtnukv">> = iolist_to_binary(re:replace("1234","^\\d*\\w{4}","AYtn\\1ukv",[global])),
- <<"123">> = iolist_to_binary(re:replace("123","^\\d*\\w{4}","oGBqK\\1EWY&VbHw\\1ue&",[])),
- <<"123">> = iolist_to_binary(re:replace("123","^\\d*\\w{4}","oGBqK\\1EWY&VbHw\\1ue&",[global])),
- <<"LhHvlYGR">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","\\1LhHvlYGR",[])),
- <<"LhHvlYGR">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","\\1LhHvlYGR",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","S\\1wy&o\\1v&ST",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","S\\1wy&o\\1v&ST",[global])),
- <<"aaaagQaaaalwFSxFUL">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","\\1\\1\\1&gQ&lwFSxFU\\1L",[caseless])),
- <<"aaaagQaaaalwFSxFUL">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","\\1\\1\\1&gQ&lwFSxFU\\1L",[caseless,
+ <<"sachjxkMNacCQoCXVcd">> = iolist_to_binary(re:replace("acd","(?!a(*SKIP)b)..","s&hjxkMN&CQoCXVc",[])),
+ <<"sachjxkMNacCQoCXVcd">> = iolist_to_binary(re:replace("acd","(?!a(*SKIP)b)..","s&hjxkMN&CQoCXVc",[global])),
+ <<"RdrPCVLRILnac">> = iolist_to_binary(re:replace("ac","^(?(?!a(*SKIP)b))","RdrPCVLR&ILn\\1",[])),
+ <<"RdrPCVLRILnac">> = iolist_to_binary(re:replace("ac","^(?(?!a(*SKIP)b))","RdrPCVLR&ILn\\1",[global])),
+ <<"bKbacacMacacHkactlacTd">> = iolist_to_binary(re:replace("acd","^(?!a(*PRUNE)b)..","bKb\\1&&M&&Hk&tl&T",[])),
+ <<"bKbacacMacacHkactlacTd">> = iolist_to_binary(re:replace("acd","^(?!a(*PRUNE)b)..","bKb\\1&&M&&Hk&tl&T",[global])),
+ <<"acgUOdBxWpud">> = iolist_to_binary(re:replace("acd","(?!a(*PRUNE)b)..","&gUO\\1dB\\1\\1x\\1\\1\\1Wpu",[])),
+ <<"acgUOdBxWpud">> = iolist_to_binary(re:replace("acd","(?!a(*PRUNE)b)..","&gUO\\1dB\\1\\1x\\1\\1\\1Wpu",[global])),
+ <<"CbaXhvafbabaFbadgban">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)","C&Xhvaf&\\1&\\1\\1F&dg&n",[])),
+ <<"CbaXhvafbabaFbadgban">> = iolist_to_binary(re:replace("ba","\\A.*?(?:a|bc)","C&Xhvaf&\\1&\\1\\1F&dg&n",[global])),
+ <<"VCDF">> = iolist_to_binary(re:replace("CD","^(A(*THEN)B|C(*THEN)D)","V\\1F",[])),
+ <<"VCDF">> = iolist_to_binary(re:replace("CD","^(A(*THEN)B|C(*THEN)D)","V\\1F",[global])),
+ <<"TN1234">> = iolist_to_binary(re:replace("1234","^\\d*\\w{4}","\\1TN&\\1",[])),
+ <<"TN1234">> = iolist_to_binary(re:replace("1234","^\\d*\\w{4}","\\1TN&\\1",[global])),
+ <<"123">> = iolist_to_binary(re:replace("123","^\\d*\\w{4}","A\\1oHKKl\\1\\1OsT\\1Q",[])),
+ <<"123">> = iolist_to_binary(re:replace("123","^\\d*\\w{4}","A\\1oHKKl\\1\\1OsT\\1Q",[global])),
+ <<"nVISfRINBaChaaaaaaaaaaaaiab">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","nVISfRI\\1NBaC\\1h&&&iab",[])),
+ <<"nVISfRINBaChaaaaaaaaaaaaiab">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","nVISfRI\\1NBaC\\1h&&&iab",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","u&ip\\1ip\\1\\1yi&\\1b&V",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","u&ip\\1ip\\1\\1yi&\\1b&V",[global])),
+ <<"wAjTGXoySgBSd">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","wAjTGXoySgBSd",[caseless])),
+ <<"wAjTGXoySgBSd">> = iolist_to_binary(re:replace("aaaa","^[^b]*\\w{4}","wAjTGXoySgBSd",[caseless,
+ global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","cHIJOeNBWAOX",[caseless])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","cHIJOeNBWAOX",[caseless,
+ global])),
+ <<"aaaawbaaaaaaaagaaaa">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","&wb&&g&",[])),
+ <<"aaaawbaaaaaaaagaaaa">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","&wb&&g&",[global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","XSEM&",[])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","XSEM&",[global])),
+ <<"QmAqwBScoVE">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","QmAqwBScoV\\1\\1E",[caseless])),
+ <<"QmAqwBScoVE">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","QmAqwBScoV\\1\\1E",[caseless,
+ global])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","OMTiwdqw",[caseless])),
+ <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","OMTiwdqw",[caseless,
+ global])),
+ <<"1 IN SOA non-sp1 non-sp2(ITgBp1 IN SOA non-sp1 non-sp2(BJFr1PT1">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","&ITgBp&BJFr\\1PT\\1",[])),
+ <<"1 IN SOA non-sp1 non-sp2(ITgBp1 IN SOA non-sp1 non-sp2(BJFr1PT1">> = iolist_to_binary(re:replace("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$","&ITgBp&BJFr\\1PT\\1",[global])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","^A\\xZ","SV\\1ASuT\\1",[])),
+ <<"AZ">> = iolist_to_binary(re:replace("AZ","^A\\xZ","SV\\1ASuT\\1",[global])),
+ <<"eTO">> = iolist_to_binary(re:replace("ASB","^A\\o{123}B","eTO",[])),
+ <<"eTO">> = iolist_to_binary(re:replace("ASB","^A\\o{123}B","eTO",[global])),
+ <<"HAJaaaabw">> = iolist_to_binary(re:replace("aaaab"," ^ a + + b $ ","HAJ&w\\1",[extended])),
+ <<"HAJaaaabw">> = iolist_to_binary(re:replace("aaaab"," ^ a + + b $ ","HAJ&w\\1",[extended,
+ global])),
+ <<"EMvXhBG">> = iolist_to_binary(re:replace("aaaab"," ^ a + #comment
+ + b $ ","EMvXhBG",[extended])),
+ <<"EMvXhBG">> = iolist_to_binary(re:replace("aaaab"," ^ a + #comment
+ + b $ ","EMvXhBG",[extended,global])),
+ <<"rWaaaablOQEcegVcvQpr">> = iolist_to_binary(re:replace("aaaab"," ^ a + #comment
+ #comment
+ + b $ ","r\\1W&lOQEcegVcvQp\\1r",[extended])),
+ <<"rWaaaablOQEcegVcvQpr">> = iolist_to_binary(re:replace("aaaab"," ^ a + #comment
+ #comment
+ + b $ ","r\\1W&lOQEcegVcvQp\\1r",[extended,global])),
+ ok.
+run55() ->
+ <<"JABcaaaabT">> = iolist_to_binary(re:replace("aaaab"," ^ (?> a + ) b $ ","JABc&T",[extended])),
+ <<"JABcaaaabT">> = iolist_to_binary(re:replace("aaaab"," ^ (?> a + ) b $ ","JABc&T",[extended,
+ global])),
+ <<"aaaanEIdwsaaaabaaaaYo">> = iolist_to_binary(re:replace("aaaab"," ^ ( a + ) + + \\w $ ","\\1nEIdws&\\1Yo",[extended])),
+ <<"aaaanEIdwsaaaabaaaaYo">> = iolist_to_binary(re:replace("aaaab"," ^ ( a + ) + + \\w $ ","\\1nEIdws&\\1Yo",[extended,
global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","SfymhPOH",[caseless])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^[^b]*\\w{4}","SfymhPOH",[caseless,
- global])),
- <<"HTMLYQhAQNJHaaaaJKAva">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","HTM\\1L\\1YQhAQNJH&JKAva",[])),
- <<"HTMLYQhAQNJHaaaaJKAva">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","HTM\\1L\\1YQhAQNJH&JKAva",[global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","bfScQRcKYl&\\1&\\1&Aq&C",[])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","bfScQRcKYl&\\1&\\1&Aq&C",[global])),
- <<"aaaadgKVePEaaaaqdlcK">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","&dgKVePE&qdl\\1cK",[caseless])),
- <<"aaaadgKVePEaaaaqdlcK">> = iolist_to_binary(re:replace("aaaa","^a*\\w{4}","&dgKVePE&qdl\\1cK",[caseless,
- global])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","ncXKavCFttF",[caseless])),
- <<"aaa">> = iolist_to_binary(re:replace("aaa","^a*\\w{4}","ncXKavCFttF",[caseless,
- global])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc","w&d",[])),
+ <<"acb">> = iolist_to_binary(re:replace("acb","(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc","w&d",[global])),
+ <<"sprnh\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]*+|\\\"\\\")*+\\\")++","sp\\1rnh",[])),
+ <<"sprnh\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]*+|\\\"\\\")*+\\\")++","sp\\1rnh",[global])),
+ <<"NON QUOTED \"QUOT\"\"ED\" AFTER hDhrDNON QUOTED \"QUOT\"\"ED\" AFTER Lif\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")*+\\\")++","&h\\1DhrD&\\1Lif",[])),
+ <<"NON QUOTED \"QUOT\"\"ED\" AFTER hDhrDNON QUOTED \"QUOT\"\"ED\" AFTER Lif\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")*+\\\")++","&h\\1DhrD&\\1Lif",[global])),
+ <<"FFjeNON QUOTED \"QUOT\"\"ED\" AFTER FNON QUOTED \"QUOT\"\"ED\" AFTER evYb\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")++\\\")++","FF\\1je&F&ev\\1Yb",[])),
+ <<"FFjeNON QUOTED \"QUOT\"\"ED\" AFTER FNON QUOTED \"QUOT\"\"ED\" AFTER evYb\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")++\\\")++","FF\\1je&F&ev\\1Yb",[global])),
+ <<"lkNON QUOTED \"QUOT\"\"ED\" AFTER NON QUOTED \"QUOT\"\"ED\" AFTER ep\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A([^\\\"1]++|[\\\"2]([^\\\"3]*+|[\\\"4][\\\"5])*+[\\\"6])++","lk&&ep",[])),
+ <<"lkNON QUOTED \"QUOT\"\"ED\" AFTER NON QUOTED \"QUOT\"\"ED\" AFTER ep\"NOT MATCHED">> = iolist_to_binary(re:replace("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A([^\\\"1]++|[\\\"2]([^\\\"3]*+|[\\\"4][\\\"5])*+[\\\"6])++","lk&&ep",[global])),
+ <<"QwrEsgmHnPVatesUBtesNt test">> = iolist_to_binary(re:replace("test test","^\\w+(?>\\s*)(?<=\\w)","QwrEs\\1g\\1m\\1HnPVa&UB&N",[])),
+ <<"QwrEsgmHnPVatesUBtesNt test">> = iolist_to_binary(re:replace("test test","^\\w+(?>\\s*)(?<=\\w)","QwrEs\\1g\\1m\\1HnPVa&UB&N",[global])),
+ <<"QnwXYs">> = iolist_to_binary(re:replace("acl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","QnwXYs",[])),
+ <<"QnwXYs">> = iolist_to_binary(re:replace("acl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","QnwXYs",[global])),
+ <<"pJjRpVdTtnNitYwRL">> = iolist_to_binary(re:replace("bdl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","pJjRp\\1VdTtnNitYw\\1RL",[])),
+ <<"pJjRpVdTtnNitYwRL">> = iolist_to_binary(re:replace("bdl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","pJjRp\\1VdTtnNitYw\\1RL",[global])),
+ <<"atdlHdlPdlUHuXIoBk">> = iolist_to_binary(re:replace("adl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","t&H&P&UHuXIoBk",[])),
+ <<"atdlHdlPdlUHuXIoBk">> = iolist_to_binary(re:replace("adl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","t&H&P&UHuXIoBk",[global])),
+ <<"bcpmlSoBl">> = iolist_to_binary(re:replace("bcl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","pm&SoB&",[])),
+ <<"bcpmlSoBl">> = iolist_to_binary(re:replace("bcl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l","pm&SoB&",[global])),
+ <<"vbIJ abcy">> = iolist_to_binary(re:replace(" abc","\\sabc","vbIJ&y",[])),
+ <<"vbIJ abcy">> = iolist_to_binary(re:replace(" abc","\\sabc","vbIJ&y",[global])),
+ <<"wY">> = iolist_to_binary(re:replace("aa]]","[\\Qa]\\E]+","wY",[])),
+ <<"wY">> = iolist_to_binary(re:replace("aa]]","[\\Qa]\\E]+","wY",[global])),
+ <<"y">> = iolist_to_binary(re:replace("aa]]","[\\Q]a\\E]+","y",[])),
+ <<"y">> = iolist_to_binary(re:replace("aa]]","[\\Q]a\\E]+","y",[global])),
+ <<"iaARIM1234abcd">> = iolist_to_binary(re:replace("1234abcd","(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))","iaARIM",[])),
+ <<"iaARIM1iaARIM2iaARIM3iaARIM4iaARIMiaARIM">> = iolist_to_binary(re:replace("1234abcd","(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))","iaARIM",[global])),
+ ok.
+run56() ->
+ <<"bGBRdcc">> = iolist_to_binary(re:replace("baaaaaaaaac","(?1)(?#?'){8}(a)","GBRdc",[])),
+ <<"bGBRdcc">> = iolist_to_binary(re:replace("baaaaaaaaac","(?1)(?#?'){8}(a)","GBRdc",[global])),
+ <<"PqUuuXKRgsccvHSabcd">> = iolist_to_binary(re:replace("abcd","(?|(\\k'Pm')|(?'Pm'))","PqUuuXKRgsc&\\1cvHS\\1",[])),
+ <<"PqUuuXKRgsccvHSaPqUuuXKRgsccvHSbPqUuuXKRgsccvHScPqUuuXKRgsccvHSdPqUuuXKRgsccvHS">> = iolist_to_binary(re:replace("abcd","(?|(\\k'Pm')|(?'Pm'))","PqUuuXKRgsc&\\1cvHS\\1",[global])),
+ <<" MumdPEeFred:099">> = iolist_to_binary(re:replace(" Fred:099","(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\\s])","\\1&M&umdPE&e",[])),
+ <<" MumdPEeFred:099">> = iolist_to_binary(re:replace(" Fred:099","(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\\s])","\\1&M&umdPE&e",[global])),
+ <<" ugxGKrBXEcHyG">> = iolist_to_binary(re:replace(" X","(?=.*X)X$","ugxGKrB&EcHyG",[])),
+ <<" ugxGKrBXEcHyG">> = iolist_to_binary(re:replace(" X","(?=.*X)X$","ugxGKrB&EcHyG",[global])),
ok.
diff --git a/lib/stdlib/test/re_testoutput1_split_test.erl b/lib/stdlib/test/re_testoutput1_split_test.erl
index b39cb53a55..8218cd9bd2 100644
--- a/lib/stdlib/test/re_testoutput1_split_test.erl
+++ b/lib/stdlib/test/re_testoutput1_split_test.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -80,6 +80,8 @@ run() ->
run52(),
run53(),
run54(),
+ run55(),
+ run56(),
ok.
run0() ->
<<"">> = iolist_to_binary(join(re:split("the quick brown fox","the quick brown fox",[trim]))),
@@ -441,10 +443,10 @@ run0() ->
<<"babababc">> = iolist_to_binary(join(re:split("babababc","^(ba|b*){1,2}?bc",[{parts,
2}]))),
<<"babababc">> = iolist_to_binary(join(re:split("babababc","^(ba|b*){1,2}?bc",[]))),
- <<"">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[\\c{\\c:",[trim]))),
- <<":">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[\\c{\\c:",[{parts,
- 2}]))),
- <<":">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[\\c{\\c:",[]))),
+ <<"">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[;\\c:",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[;\\c:",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split(";z","^\\ca\\cA\\c[;\\c:",[]))),
<<":thing">> = iolist_to_binary(join(re:split("athing","^[ab\\]cde]",[trim]))),
<<":thing">> = iolist_to_binary(join(re:split("athing","^[ab\\]cde]",[{parts,
2}]))),
@@ -22978,24 +22980,24 @@ def","abc$",[]))),
<<"abc">> = iolist_to_binary(join(re:split("abc","(abc)\\1000",[{parts,
2}]))),
<<"abc">> = iolist_to_binary(join(re:split("abc","(abc)\\1000",[]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[trim]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[{parts,
- 2}]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[trim]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[{parts,
- 2}]))),
- <<"abc81">> = iolist_to_binary(join(re:split("abc81","abc\\81",[]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[trim]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[{parts,
- 2}]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[trim]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[{parts,
- 2}]))),
- <<"abc91">> = iolist_to_binary(join(re:split("abc91","abc\\91",[]))),
+ <<":A:B:C:D:E:F:G:H:I">> = iolist_to_binary(join(re:split("ABCDEFGHIHI","^(A)(B)(C)(D)(E)(F)(G)(H)(I)\\8\\9$",[trim]))),
+ <<":A:B:C:D:E:F:G:H:I:">> = iolist_to_binary(join(re:split("ABCDEFGHIHI","^(A)(B)(C)(D)(E)(F)(G)(H)(I)\\8\\9$",[{parts,
+ 2}]))),
+ <<":A:B:C:D:E:F:G:H:I:">> = iolist_to_binary(join(re:split("ABCDEFGHIHI","^(A)(B)(C)(D)(E)(F)(G)(H)(I)\\8\\9$",[]))),
ok.
run6() ->
+ <<"">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[]))),
+ <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[A\\8B\\9C]+$",[trim]))),
+ <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[A\\8B\\9C]+$",[{parts,
+ 2}]))),
+ <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[A\\8B\\9C]+$",[]))),
+ <<"">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("A8B9C","^[A\\8B\\9C]+$",[]))),
<<":a:b:c:d:e:f:g:h:i:j:k:l">> = iolist_to_binary(join(re:split("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123",[trim]))),
<<":a:b:c:d:e:f:g:h:i:j:k:l:">> = iolist_to_binary(join(re:split("abcdefghijkllS","(a)(b)(c)(d)(e)(f)(g)(h)(i)(j)(k)(l)\\12\\123",[{parts,
2}]))),
@@ -23170,6 +23172,8 @@ ccc","[^a]+",[]))),
<<"aaaaaaa">> = iolist_to_binary(join(re:split("aaaaaaa","(a)\\1{8,}",[{parts,
2}]))),
<<"aaaaaaa">> = iolist_to_binary(join(re:split("aaaaaaa","(a)\\1{8,}",[]))),
+ ok.
+run7() ->
<<"aaaa">> = iolist_to_binary(join(re:split("aaaabcd","[^a]",[trim]))),
<<"aaaa:cd">> = iolist_to_binary(join(re:split("aaaabcd","[^a]",[{parts,
2}]))),
@@ -23178,8 +23182,6 @@ ccc","[^a]+",[]))),
<<"aa:abcd">> = iolist_to_binary(join(re:split("aaAabcd","[^a]",[{parts,
2}]))),
<<"aa:a:::">> = iolist_to_binary(join(re:split("aaAabcd","[^a]",[]))),
- ok.
-run7() ->
<<"aaaa">> = iolist_to_binary(join(re:split("aaaabcd","[^a]",[caseless,
trim]))),
<<"aaaa:cd">> = iolist_to_binary(join(re:split("aaaabcd","[^a]",[caseless,
@@ -23294,12 +23296,12 @@ run7() ->
<<":I have 2 numbers: :53147:">> = iolist_to_binary(join(re:split("I have 2 numbers: 53147","(.*)\\b(\\d+)$",[{parts,
2}]))),
<<":I have 2 numbers: :53147:">> = iolist_to_binary(join(re:split("I have 2 numbers: 53147","(.*)\\b(\\d+)$",[]))),
+ ok.
+run8() ->
<<":I have 2 numbers: :53147">> = iolist_to_binary(join(re:split("I have 2 numbers: 53147","(.*\\D)(\\d+)$",[trim]))),
<<":I have 2 numbers: :53147:">> = iolist_to_binary(join(re:split("I have 2 numbers: 53147","(.*\\D)(\\d+)$",[{parts,
2}]))),
<<":I have 2 numbers: :53147:">> = iolist_to_binary(join(re:split("I have 2 numbers: 53147","(.*\\D)(\\d+)$",[]))),
- ok.
-run8() ->
<<":C123">> = iolist_to_binary(join(re:split("ABC123","^\\D*(?!123)",[trim]))),
<<":C123">> = iolist_to_binary(join(re:split("ABC123","^\\D*(?!123)",[{parts,
2}]))),
@@ -23581,6 +23583,8 @@ no",".*\\.gif",[multiline,{parts,2}]))),
no">> = iolist_to_binary(join(re:split("borfle
bib.gif
no",".*\\.gif",[multiline]))),
+ ok.
+run9() ->
<<":
no">> = iolist_to_binary(join(re:split("borfle
bib.gif
@@ -23593,8 +23597,6 @@ no",".*\\.gif",[dotall,{parts,2}]))),
no">> = iolist_to_binary(join(re:split("borfle
bib.gif
no",".*\\.gif",[dotall]))),
- ok.
-run9() ->
<<":
no">> = iolist_to_binary(join(re:split("borfle
bib.gif
@@ -23893,6 +23895,8 @@ B","(?ms)^.*B",[trim]))),
B","(?ms)^.*B",[{parts,2}]))),
<<":">> = iolist_to_binary(join(re:split("abc
B","(?ms)^.*B",[]))),
+ ok.
+run10() ->
<<"abc
">> = iolist_to_binary(join(re:split("abc
B","(?ms)^B",[trim]))),
@@ -23902,8 +23906,6 @@ B","(?ms)^B",[{parts,2}]))),
<<"abc
:">> = iolist_to_binary(join(re:split("abc
B","(?ms)^B",[]))),
- ok.
-run10() ->
<<"">> = iolist_to_binary(join(re:split("B","(?s)B$",[trim]))),
<<":">> = iolist_to_binary(join(re:split("B","(?s)B$",[{parts,
2}]))),
@@ -24063,6 +24065,8 @@ b","a[^a]b",[dotall,trim]))),
b","a[^a]b",[dotall,{parts,2}]))),
<<":">> = iolist_to_binary(join(re:split("a
b","a[^a]b",[dotall]))),
+ ok.
+run11() ->
<<"">> = iolist_to_binary(join(re:split("acb","a.b",[dotall,
trim]))),
<<":">> = iolist_to_binary(join(re:split("acb","a.b",[dotall,
@@ -24075,8 +24079,6 @@ b","a.b",[dotall,trim]))),
b","a.b",[dotall,{parts,2}]))),
<<":">> = iolist_to_binary(join(re:split("a
b","a.b",[dotall]))),
- ok.
-run11() ->
<<":a">> = iolist_to_binary(join(re:split("bac","^(b+?|a){1,2}?c",[trim]))),
<<":a:">> = iolist_to_binary(join(re:split("bac","^(b+?|a){1,2}?c",[{parts,
2}]))),
@@ -24319,12 +24321,12 @@ zzz","\\Aabc\\z",[multiline]))),
<<":">> = iolist_to_binary(join(re:split("aaab","(?>a+)b",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("aaab","(?>a+)b",[]))),
+ ok.
+run12() ->
<<":aaab">> = iolist_to_binary(join(re:split("aaab","((?>a+)b)",[trim]))),
<<":aaab:">> = iolist_to_binary(join(re:split("aaab","((?>a+)b)",[{parts,
2}]))),
<<":aaab:">> = iolist_to_binary(join(re:split("aaab","((?>a+)b)",[]))),
- ok.
-run12() ->
<<":aaa">> = iolist_to_binary(join(re:split("aaab","(?>(a+))b",[trim]))),
<<":aaa:">> = iolist_to_binary(join(re:split("aaab","(?>(a+))b",[{parts,
2}]))),
@@ -24725,6 +24727,8 @@ run12() ->
<<"ab">> = iolist_to_binary(join(re:split("ab","^(a)?(?(1)a|b)+$",[{parts,
2}]))),
<<"ab">> = iolist_to_binary(join(re:split("ab","^(a)?(?(1)a|b)+$",[]))),
+ ok.
+run13() ->
<<"">> = iolist_to_binary(join(re:split("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$",[trim]))),
<<":">> = iolist_to_binary(join(re:split("abc:","^(?(?=abc)\\w{3}:|\\d\\d)$",[{parts,
2}]))),
@@ -24745,8 +24749,6 @@ run12() ->
<<"xyz">> = iolist_to_binary(join(re:split("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$",[{parts,
2}]))),
<<"xyz">> = iolist_to_binary(join(re:split("xyz","^(?(?=abc)\\w{3}:|\\d\\d)$",[]))),
- ok.
-run13() ->
<<"">> = iolist_to_binary(join(re:split("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$",[trim]))),
<<":">> = iolist_to_binary(join(re:split("abc:","^(?(?!abc)\\d\\d|\\w{3}:)$",[{parts,
2}]))),
@@ -25075,6 +25077,8 @@ run13() ->
<<":bcde">> = iolist_to_binary(join(re:split("aaabcde","(?>a*)*",[{parts,
2}]))),
<<":b:c:d:e:">> = iolist_to_binary(join(re:split("aaabcde","(?>a*)*",[]))),
+ ok.
+run14() ->
<<"">> = iolist_to_binary(join(re:split("aaaaa","((?>a*))*",[trim]))),
<<"::">> = iolist_to_binary(join(re:split("aaaaa","((?>a*))*",[{parts,
2}]))),
@@ -25083,8 +25087,6 @@ run13() ->
<<"::bbaa">> = iolist_to_binary(join(re:split("aabbaa","((?>a*))*",[{parts,
2}]))),
<<"::b::b::">> = iolist_to_binary(join(re:split("aabbaa","((?>a*))*",[]))),
- ok.
-run14() ->
<<"a::a::a::a::a">> = iolist_to_binary(join(re:split("aaaaa","((?>a*?))*",[trim]))),
<<"a::aaaa">> = iolist_to_binary(join(re:split("aaaaa","((?>a*?))*",[{parts,
2}]))),
@@ -25519,12 +25521,12 @@ bar","(?<=foo\\n)^bar",[multiline]))),
<<"abq">> = iolist_to_binary(join(re:split("abq","ab+bc",[{parts,
2}]))),
<<"abq">> = iolist_to_binary(join(re:split("abq","ab+bc",[]))),
+ ok.
+run15() ->
<<"">> = iolist_to_binary(join(re:split("abbbbc","ab+bc",[trim]))),
<<":">> = iolist_to_binary(join(re:split("abbbbc","ab+bc",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("abbbbc","ab+bc",[]))),
- ok.
-run15() ->
<<"">> = iolist_to_binary(join(re:split("abbbbc","ab{1,}bc",[trim]))),
<<":">> = iolist_to_binary(join(re:split("abbbbc","ab{1,}bc",[{parts,
2}]))),
@@ -25645,12 +25647,12 @@ run15() ->
<<":">> = iolist_to_binary(join(re:split("ace","a[b-d]e",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("ace","a[b-d]e",[]))),
+ ok.
+run16() ->
<<"a">> = iolist_to_binary(join(re:split("aac","a[b-d]",[trim]))),
<<"a:">> = iolist_to_binary(join(re:split("aac","a[b-d]",[{parts,
2}]))),
<<"a:">> = iolist_to_binary(join(re:split("aac","a[b-d]",[]))),
- ok.
-run16() ->
<<"">> = iolist_to_binary(join(re:split("a-","a[-b]",[trim]))),
<<":">> = iolist_to_binary(join(re:split("a-","a[-b]",[{parts,
2}]))),
@@ -25819,12 +25821,12 @@ run16() ->
<<"1">> = iolist_to_binary(join(re:split("1","\\D",[{parts,
2}]))),
<<"1">> = iolist_to_binary(join(re:split("1","\\D",[]))),
+ ok.
+run17() ->
<<"">> = iolist_to_binary(join(re:split("a","[\\w]",[trim]))),
<<":">> = iolist_to_binary(join(re:split("a","[\\w]",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("a","[\\w]",[]))),
- ok.
-run17() ->
<<"">> = iolist_to_binary(join(re:split("-","[\\W]",[trim]))),
<<":">> = iolist_to_binary(join(re:split("-","[\\W]",[{parts,
2}]))),
@@ -25941,12 +25943,12 @@ run17() ->
<<":b:">> = iolist_to_binary(join(re:split("ab","(a+|b)+",[{parts,
2}]))),
<<":b:">> = iolist_to_binary(join(re:split("ab","(a+|b)+",[]))),
+ ok.
+run18() ->
<<":b">> = iolist_to_binary(join(re:split("ab","(a+|b){1,}",[trim]))),
<<":b:">> = iolist_to_binary(join(re:split("ab","(a+|b){1,}",[{parts,
2}]))),
<<":b:">> = iolist_to_binary(join(re:split("ab","(a+|b){1,}",[]))),
- ok.
-run18() ->
<<":a::b">> = iolist_to_binary(join(re:split("ab","(a+|b)?",[trim]))),
<<":a:b">> = iolist_to_binary(join(re:split("ab","(a+|b)?",[{parts,
2}]))),
@@ -26023,12 +26025,12 @@ run18() ->
<<":bc:d:">> = iolist_to_binary(join(re:split("abcd","a([bc]*)(c*d)",[{parts,
2}]))),
<<":bc:d:">> = iolist_to_binary(join(re:split("abcd","a([bc]*)(c*d)",[]))),
+ ok.
+run19() ->
<<":bc:d">> = iolist_to_binary(join(re:split("abcd","a([bc]+)(c*d)",[trim]))),
<<":bc:d:">> = iolist_to_binary(join(re:split("abcd","a([bc]+)(c*d)",[{parts,
2}]))),
<<":bc:d:">> = iolist_to_binary(join(re:split("abcd","a([bc]+)(c*d)",[]))),
- ok.
-run19() ->
<<":b:cd">> = iolist_to_binary(join(re:split("abcd","a([bc]*)(c+d)",[trim]))),
<<":b:cd:">> = iolist_to_binary(join(re:split("abcd","a([bc]*)(c+d)",[{parts,
2}]))),
@@ -26137,12 +26139,12 @@ run19() ->
<<":">> = iolist_to_binary(join(re:split("ac","a[-]?c",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("ac","a[-]?c",[]))),
+ ok.
+run20() ->
<<":abc">> = iolist_to_binary(join(re:split("abcabc","(abc)\\1",[trim]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","(abc)\\1",[{parts,
2}]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","(abc)\\1",[]))),
- ok.
-run20() ->
<<":abc">> = iolist_to_binary(join(re:split("abcabc","([a-c]*)\\1",[trim]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","([a-c]*)\\1",[{parts,
2}]))),
@@ -26323,6 +26325,8 @@ run20() ->
{parts,
2}]))),
<<"ABBBBC">> = iolist_to_binary(join(re:split("ABBBBC","ab{4,5}?bc",[caseless]))),
+ ok.
+run21() ->
<<"">> = iolist_to_binary(join(re:split("ABBC","ab??bc",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("ABBC","ab??bc",[caseless,
@@ -26335,8 +26339,6 @@ run20() ->
{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("ABC","ab??bc",[caseless]))),
- ok.
-run21() ->
<<"">> = iolist_to_binary(join(re:split("ABC","ab{0,1}?bc",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("ABC","ab{0,1}?bc",[caseless,
@@ -26493,14 +26495,14 @@ run21() ->
{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("A]","a]",[caseless]))),
+ ok.
+run22() ->
<<"">> = iolist_to_binary(join(re:split("A]B","a[]]b",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("A]B","a[]]b",[caseless,
{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("A]B","a[]]b",[caseless]))),
- ok.
-run22() ->
<<"">> = iolist_to_binary(join(re:split("AED","a[^bc]d",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("AED","a[^bc]d",[caseless,
@@ -26660,14 +26662,14 @@ run22() ->
{parts,
2}]))),
<<":B:">> = iolist_to_binary(join(re:split("AB","(a+|b)+",[caseless]))),
+ ok.
+run23() ->
<<":B">> = iolist_to_binary(join(re:split("AB","(a+|b){1,}",[caseless,
trim]))),
<<":B:">> = iolist_to_binary(join(re:split("AB","(a+|b){1,}",[caseless,
{parts,
2}]))),
<<":B:">> = iolist_to_binary(join(re:split("AB","(a+|b){1,}",[caseless]))),
- ok.
-run23() ->
<<":A::B">> = iolist_to_binary(join(re:split("AB","(a+|b)?",[caseless,
trim]))),
<<":A:B">> = iolist_to_binary(join(re:split("AB","(a+|b)?",[caseless,
@@ -26776,14 +26778,14 @@ run23() ->
{parts,
2}]))),
<<":BC:">> = iolist_to_binary(join(re:split("ABC","a([bc]*)c*",[caseless]))),
+ ok.
+run24() ->
<<":BC:D">> = iolist_to_binary(join(re:split("ABCD","a([bc]*)(c*d)",[caseless,
trim]))),
<<":BC:D:">> = iolist_to_binary(join(re:split("ABCD","a([bc]*)(c*d)",[caseless,
{parts,
2}]))),
<<":BC:D:">> = iolist_to_binary(join(re:split("ABCD","a([bc]*)(c*d)",[caseless]))),
- ok.
-run24() ->
<<":BC:D">> = iolist_to_binary(join(re:split("ABCD","a([bc]+)(c*d)",[caseless,
trim]))),
<<":BC:D:">> = iolist_to_binary(join(re:split("ABCD","a([bc]+)(c*d)",[caseless,
@@ -26934,14 +26936,14 @@ run24() ->
{parts,
2}]))),
<<":A:B:">> = iolist_to_binary(join(re:split("(A, B)","\\((.*), (.*)\\)",[caseless]))),
+ ok.
+run25() ->
<<"">> = iolist_to_binary(join(re:split("ABCD","abcd",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("ABCD","abcd",[caseless,
{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("ABCD","abcd",[caseless]))),
- ok.
-run25() ->
<<":BC">> = iolist_to_binary(join(re:split("ABCD","a(bc)d",[caseless,
trim]))),
<<":BC:">> = iolist_to_binary(join(re:split("ABCD","a(bc)d",[caseless,
@@ -27030,12 +27032,12 @@ run25() ->
<<":b:e">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,6}?(.)",[{parts,
2}]))),
<<":b:e">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,6}?(.)",[]))),
+ ok.
+run26() ->
<<":e">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,7}(.)",[trim]))),
<<":e:">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,7}(.)",[{parts,
2}]))),
<<":e:">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,7}(.)",[]))),
- ok.
-run26() ->
<<":b:e">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,7}?(.)",[trim]))),
<<":b:e">> = iolist_to_binary(join(re:split("acdbcdbe","a(?:b|c|d){5,7}?(.)",[{parts,
2}]))),
@@ -27160,12 +27162,12 @@ run26() ->
<<"c::">> = iolist_to_binary(join(re:split("cab","(a)*ab",[{parts,
2}]))),
<<"c::">> = iolist_to_binary(join(re:split("cab","(a)*ab",[]))),
+ ok.
+run27() ->
<<"">> = iolist_to_binary(join(re:split("ab","(?:(?i)a)b",[trim]))),
<<":">> = iolist_to_binary(join(re:split("ab","(?:(?i)a)b",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("ab","(?:(?i)a)b",[]))),
- ok.
-run27() ->
<<":a">> = iolist_to_binary(join(re:split("ab","((?i)a)b",[trim]))),
<<":a:">> = iolist_to_binary(join(re:split("ab","((?i)a)b",[{parts,
2}]))),
@@ -27272,6 +27274,8 @@ run27() ->
{parts,
2}]))),
<<":a:">> = iolist_to_binary(join(re:split("aB","((?-i)a)b",[caseless]))),
+ ok.
+run28() ->
<<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","(?:(?-i)a)b",[caseless,
trim]))),
<<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","(?:(?-i)a)b",[caseless,
@@ -27290,8 +27294,6 @@ run27() ->
{parts,
2}]))),
<<"AB">> = iolist_to_binary(join(re:split("AB","(?:(?-i)a)b",[caseless]))),
- ok.
-run28() ->
<<"">> = iolist_to_binary(join(re:split("ab","(?-i:a)b",[caseless,
trim]))),
<<":">> = iolist_to_binary(join(re:split("ab","(?-i:a)b",[caseless,
@@ -27426,14 +27428,14 @@ B","((?s-i:a.))b",[caseless]))),
<<":">> = iolist_to_binary(join(re:split("aaac","^a(?#xxx){3}c",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("aaac","^a(?#xxx){3}c",[]))),
+ ok.
+run29() ->
<<"">> = iolist_to_binary(join(re:split("aaac","^a (?#xxx) (?#yyy) {3}c",[extended,
trim]))),
<<":">> = iolist_to_binary(join(re:split("aaac","^a (?#xxx) (?#yyy) {3}c",[extended,
{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("aaac","^a (?#xxx) (?#yyy) {3}c",[extended]))),
- ok.
-run29() ->
<<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","(?<![cd])b",[trim]))),
<<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","(?<![cd])b",[{parts,
2}]))),
@@ -27686,12 +27688,12 @@ c","((?m)^b)",[]))),
<<"::">> = iolist_to_binary(join(re:split("a","(x)?(?(1)b|a)",[{parts,
2}]))),
<<"::">> = iolist_to_binary(join(re:split("a","(x)?(?(1)b|a)",[]))),
+ ok.
+run30() ->
<<"">> = iolist_to_binary(join(re:split("a","()?(?(1)b|a)",[trim]))),
<<"::">> = iolist_to_binary(join(re:split("a","()?(?(1)b|a)",[{parts,
2}]))),
<<"::">> = iolist_to_binary(join(re:split("a","()?(?(1)b|a)",[]))),
- ok.
-run30() ->
<<"">> = iolist_to_binary(join(re:split("a","()?(?(1)a|b)",[trim]))),
<<"::">> = iolist_to_binary(join(re:split("a","()?(?(1)a|b)",[{parts,
2}]))),
@@ -28074,6 +28076,8 @@ b","b\\z",[]))),
<<"123999foo">> = iolist_to_binary(join(re:split("123999foo","(?<=\\d{3}(?!999)...)foo",[{parts,
2}]))),
<<"123999foo">> = iolist_to_binary(join(re:split("123999foo","(?<=\\d{3}(?!999)...)foo",[]))),
+ ok.
+run32() ->
<<"123abc">> = iolist_to_binary(join(re:split("123abcfoo","(?<=\\d{3}...)(?<!999)foo",[trim]))),
<<"123abc:">> = iolist_to_binary(join(re:split("123abcfoo","(?<=\\d{3}...)(?<!999)foo",[{parts,
2}]))),
@@ -28090,8 +28094,6 @@ b","b\\z",[]))),
<<"123999foo">> = iolist_to_binary(join(re:split("123999foo","(?<=\\d{3}...)(?<!999)foo",[{parts,
2}]))),
<<"123999foo">> = iolist_to_binary(join(re:split("123999foo","(?<=\\d{3}...)(?<!999)foo",[]))),
- ok.
-run32() ->
<<":::abcd: xyz">> = iolist_to_binary(join(re:split("<a href=abcd xyz","<a[\\s]+href[\\s]*=[\\s]* # find <a href=
([\\\"\\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\\s]+)) # if quote found, match up to next matching
@@ -28305,26 +28307,6 @@ run32() ->
<<":bbab">> = iolist_to_binary(join(re:split("abbab","a*",[{parts,
2}]))),
<<":b:b:b:">> = iolist_to_binary(join(re:split("abbab","a*",[]))),
- <<":bcde">> = iolist_to_binary(join(re:split("abcde","^[a-\\d]",[trim]))),
- <<":bcde">> = iolist_to_binary(join(re:split("abcde","^[a-\\d]",[{parts,
- 2}]))),
- <<":bcde">> = iolist_to_binary(join(re:split("abcde","^[a-\\d]",[]))),
- <<":things">> = iolist_to_binary(join(re:split("-things","^[a-\\d]",[trim]))),
- <<":things">> = iolist_to_binary(join(re:split("-things","^[a-\\d]",[{parts,
- 2}]))),
- <<":things">> = iolist_to_binary(join(re:split("-things","^[a-\\d]",[]))),
- <<":digit">> = iolist_to_binary(join(re:split("0digit","^[a-\\d]",[trim]))),
- <<":digit">> = iolist_to_binary(join(re:split("0digit","^[a-\\d]",[{parts,
- 2}]))),
- <<":digit">> = iolist_to_binary(join(re:split("0digit","^[a-\\d]",[]))),
- <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[a-\\d]",[trim]))),
- <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[a-\\d]",[{parts,
- 2}]))),
- <<"*** Failers">> = iolist_to_binary(join(re:split("*** Failers","^[a-\\d]",[]))),
- <<"bcdef">> = iolist_to_binary(join(re:split("bcdef","^[a-\\d]",[trim]))),
- <<"bcdef">> = iolist_to_binary(join(re:split("bcdef","^[a-\\d]",[{parts,
- 2}]))),
- <<"bcdef">> = iolist_to_binary(join(re:split("bcdef","^[a-\\d]",[]))),
<<":bcde">> = iolist_to_binary(join(re:split("abcde","^[\\d-a]",[trim]))),
<<":bcde">> = iolist_to_binary(join(re:split("abcde","^[\\d-a]",[{parts,
2}]))),
@@ -28360,24 +28342,24 @@ run32() ->
<<">:
<">> = iolist_to_binary(join(re:split(">
<","[[:blank:]]+",[]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","[\\s]+",[trim]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","[\\s]+",[{parts,2}]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","[\\s]+",[]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","\\s+",[trim]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","\\s+",[{parts,2}]))),
- <<">: <">> = iolist_to_binary(join(re:split(">
+ <<">:<">> = iolist_to_binary(join(re:split(">
<","\\s+",[]))),
- <<"ab">> = iolist_to_binary(join(re:split("ab","a b",[extended,
+ <<"">> = iolist_to_binary(join(re:split("ab","a b",[extended,
trim]))),
- <<"ab">> = iolist_to_binary(join(re:split("ab","a b",[extended,
+ <<":">> = iolist_to_binary(join(re:split("ab","a b",[extended,
{parts,
2}]))),
- <<"ab">> = iolist_to_binary(join(re:split("ab","a b",[extended]))),
+ <<":">> = iolist_to_binary(join(re:split("ab","a b",[extended]))),
<<"a
:b">> = iolist_to_binary(join(re:split("a
xb","(?!\\A)x",[multiline,trim]))),
@@ -29577,10 +29559,6 @@ run37() ->
","[\\x00-\\xff\\s]+",[{parts,2}]))),
<<":">> = iolist_to_binary(join(re:split("
","[\\x00-\\xff\\s]+",[]))),
- <<"">> = iolist_to_binary(join(re:split("?","^\\c",[trim]))),
- <<":">> = iolist_to_binary(join(re:split("?","^\\c",[{parts,
- 2}]))),
- <<":">> = iolist_to_binary(join(re:split("?","^\\c",[]))),
<<"abc">> = iolist_to_binary(join(re:split("abc","(abc)\\1",[caseless,
trim]))),
<<"abc">> = iolist_to_binary(join(re:split("abc","(abc)\\1",[caseless,
@@ -29845,10 +29823,6 @@ run39() ->
<<"::c">> = iolist_to_binary(join(re:split("bc","(?=(a))??.",[{parts,
2}]))),
<<"::::">> = iolist_to_binary(join(re:split("bc","(?=(a))??.",[]))),
- <<"::ckgammon">> = iolist_to_binary(join(re:split("backgammon","^(?=(a)){0}b(?1)",[trim]))),
- <<"::ckgammon">> = iolist_to_binary(join(re:split("backgammon","^(?=(a)){0}b(?1)",[{parts,
- 2}]))),
- <<"::ckgammon">> = iolist_to_binary(join(re:split("backgammon","^(?=(a)){0}b(?1)",[]))),
<<":b">> = iolist_to_binary(join(re:split("abd","^(?=(?1))?[az]([abc])d",[trim]))),
<<":b:">> = iolist_to_binary(join(re:split("abd","^(?=(?1))?[az]([abc])d",[{parts,
2}]))),
@@ -30002,8 +29976,6 @@ c","(?<=a\\v)c",[]))),
<<"X:X">> = iolist_to_binary(join(re:split("XcccddYX","(?(?=c)c|d)*+Y",[{parts,
2}]))),
<<"X:X">> = iolist_to_binary(join(re:split("XcccddYX","(?(?=c)c|d)*+Y",[]))),
- ok.
-run40() ->
<<":aaa">> = iolist_to_binary(join(re:split("aaaaaaa","^(a{2,3}){2,}+a",[trim]))),
<<":aaa:">> = iolist_to_binary(join(re:split("aaaaaaa","^(a{2,3}){2,}+a",[{parts,
2}]))),
@@ -30020,6 +29992,8 @@ run40() ->
<<"aaaaaaaaa">> = iolist_to_binary(join(re:split("aaaaaaaaa","^(a{2,3}){2,}+a",[{parts,
2}]))),
<<"aaaaaaaaa">> = iolist_to_binary(join(re:split("aaaaaaaaa","^(a{2,3}){2,}+a",[]))),
+ ok.
+run40() ->
<<"** Failers">> = iolist_to_binary(join(re:split("** Failers","^(a{2,3})++a",[trim]))),
<<"** Failers">> = iolist_to_binary(join(re:split("** Failers","^(a{2,3})++a",[{parts,
2}]))),
@@ -30177,10 +30151,6 @@ AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c",[]))),
<<"foo:foobar:">> = iolist_to_binary(join(re:split("foobarbaz","(foo\\Kbar)baz",[{parts,
2}]))),
<<"foo:foobar:">> = iolist_to_binary(join(re:split("foobarbaz","(foo\\Kbar)baz",[]))),
- <<":ab:b:XXXX">> = iolist_to_binary(join(re:split("ababababbbabZXXXX","^(a(b))\\1\\g1\\g{1}\\g-1\\g{-1}\\g{-02}Z",[trim]))),
- <<":ab:b:XXXX">> = iolist_to_binary(join(re:split("ababababbbabZXXXX","^(a(b))\\1\\g1\\g{1}\\g-1\\g{-1}\\g{-02}Z",[{parts,
- 2}]))),
- <<":ab:b:XXXX">> = iolist_to_binary(join(re:split("ababababbbabZXXXX","^(a(b))\\1\\g1\\g{1}\\g-1\\g{-1}\\g{-02}Z",[]))),
<<":tom">> = iolist_to_binary(join(re:split("tom-tom","(?<A>tom|bon)-\\g{A}",[trim]))),
<<":tom:">> = iolist_to_binary(join(re:split("tom-tom","(?<A>tom|bon)-\\g{A}",[{parts,
2}]))),
@@ -30213,8 +30183,6 @@ AAA NNN ","\\v*X\\v?Y\\v+Z\\V*\\x0a\\V+\\x0b\\V{2,3}\\x0c",[]))),
<<"xyzabc">> = iolist_to_binary(join(re:split("xyzabc","(?|(abc)|(xyz))\\1",[{parts,
2}]))),
<<"xyzabc">> = iolist_to_binary(join(re:split("xyzabc","(?|(abc)|(xyz))\\1",[]))),
- ok.
-run41() ->
<<":abc">> = iolist_to_binary(join(re:split("abcabc","(?|(abc)|(xyz))(?1)",[trim]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","(?|(abc)|(xyz))(?1)",[{parts,
2}]))),
@@ -30231,6 +30199,8 @@ run41() ->
<<"xyzxyz">> = iolist_to_binary(join(re:split("xyzxyz","(?|(abc)|(xyz))(?1)",[{parts,
2}]))),
<<"xyzxyz">> = iolist_to_binary(join(re:split("xyzxyz","(?|(abc)|(xyz))(?1)",[]))),
+ ok.
+run41() ->
<<":a:b:c:d:Y">> = iolist_to_binary(join(re:split("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)",[trim]))),
<<":a:b:c:d:Y:">> = iolist_to_binary(join(re:split("XYabcdY","^X(?5)(a)(?|(b)|(q))(c)(d)(Y)",[{parts,
2}]))),
@@ -30428,8 +30398,6 @@ run41() ->
<<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(join(re:split("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)",[{parts,
2}]))),
<<"((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa">> = iolist_to_binary(join(re:split("((()aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa","\\(([^()]++|\\([^()]+\\))+\\)",[]))),
- ok.
-run42() ->
<<":c">> = iolist_to_binary(join(re:split("abc","^([^()]|\\((?1)*\\))*$",[trim]))),
<<":c:">> = iolist_to_binary(join(re:split("abc","^([^()]|\\((?1)*\\))*$",[{parts,
2}]))),
@@ -30450,6 +30418,8 @@ run42() ->
<<"a(b(c)d">> = iolist_to_binary(join(re:split("a(b(c)d","^([^()]|\\((?1)*\\))*$",[{parts,
2}]))),
<<"a(b(c)d">> = iolist_to_binary(join(re:split("a(b(c)d","^([^()]|\\((?1)*\\))*$",[]))),
+ ok.
+run42() ->
<<":3">> = iolist_to_binary(join(re:split(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$",[trim]))),
<<":3:">> = iolist_to_binary(join(re:split(">abc>123<xyz<","^>abc>([^()]|\\((?1)*\\))*<xyz<$",[{parts,
2}]))),
@@ -30798,8 +30768,6 @@ run42() ->
<<"b:a:z">> = iolist_to_binary(join(re:split("baz","(?<X>a)(?<=b(?&X))",[{parts,
2}]))),
<<"b:a:z">> = iolist_to_binary(join(re:split("baz","(?<X>a)(?<=b(?&X))",[]))),
- ok.
-run43() ->
<<":abc">> = iolist_to_binary(join(re:split("abcabc","^(?|(abc)|(def))\\1",[trim]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","^(?|(abc)|(def))\\1",[{parts,
2}]))),
@@ -30820,6 +30788,8 @@ run43() ->
<<"defabc">> = iolist_to_binary(join(re:split("defabc","^(?|(abc)|(def))\\1",[{parts,
2}]))),
<<"defabc">> = iolist_to_binary(join(re:split("defabc","^(?|(abc)|(def))\\1",[]))),
+ ok.
+run43() ->
<<":abc">> = iolist_to_binary(join(re:split("abcabc","^(?|(abc)|(def))(?1)",[trim]))),
<<":abc:">> = iolist_to_binary(join(re:split("abcabc","^(?|(abc)|(def))(?1)",[{parts,
2}]))),
@@ -30994,8 +30964,6 @@ run43() ->
<<":0000:0:">> = iolist_to_binary(join(re:split("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))",[{parts,
2}]))),
<<":0000:0:">> = iolist_to_binary(join(re:split("0000","(?P<L1>(?P<L2>0)(?P>L1)|(?P>L2))",[]))),
- ok.
-run44() ->
<<":0:0">> = iolist_to_binary(join(re:split("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))",[trim]))),
<<":0:0:">> = iolist_to_binary(join(re:split("0","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))",[{parts,
2}]))),
@@ -31008,6 +30976,8 @@ run44() ->
<<":0:0:000">> = iolist_to_binary(join(re:split("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))",[{parts,
2}]))),
<<":0:0::0:0::0:0::0:0:">> = iolist_to_binary(join(re:split("0000","(?P<L1>(?P<L2>0)|(?P>L2)(?P>L1))",[]))),
+ ok.
+run44() ->
<<"ACABX">> = iolist_to_binary(join(re:split("ACABX","A(*COMMIT)(B|D)",[trim]))),
<<"ACABX">> = iolist_to_binary(join(re:split("ACABX","A(*COMMIT)(B|D)",[{parts,
2}]))),
@@ -31044,8 +31014,6 @@ run44() ->
<<"yes">> = iolist_to_binary(join(re:split("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?",[{parts,
2}]))),
<<"yes">> = iolist_to_binary(join(re:split("yes","(?>(*COMMIT)(yes|no)(*THEN)(*F))?",[]))),
- ok.
-run45() ->
<<"">> = iolist_to_binary(join(re:split("bc","b?(*SKIP)c",[trim]))),
<<":">> = iolist_to_binary(join(re:split("bc","b?(*SKIP)c",[{parts,
2}]))),
@@ -31054,6 +31022,8 @@ run45() ->
<<"a:">> = iolist_to_binary(join(re:split("abc","b?(*SKIP)c",[{parts,
2}]))),
<<"a:">> = iolist_to_binary(join(re:split("abc","b?(*SKIP)c",[]))),
+ ok.
+run45() ->
<<"a">> = iolist_to_binary(join(re:split("a","(*SKIP)bc",[trim]))),
<<"a">> = iolist_to_binary(join(re:split("a","(*SKIP)bc",[{parts,
2}]))),
@@ -31272,14 +31242,14 @@ run45() ->
{parts,
2}]))),
<<":foo(bar(baz)+baz(bop)):(bar(baz)+baz(bop)):bar(baz)+baz(bop):">> = iolist_to_binary(join(re:split("foo(bar(baz)+baz(bop))","(foo ( \\( ((?:(?> [^()]+ )|(?2))*) \\) ) )",[extended]))),
- ok.
-run46() ->
<<":AB:B">> = iolist_to_binary(join(re:split("AB","(A (A|B(*ACCEPT)|C) D)(E)",[extended,
trim]))),
<<":AB:B::">> = iolist_to_binary(join(re:split("AB","(A (A|B(*ACCEPT)|C) D)(E)",[extended,
{parts,
2}]))),
<<":AB:B::">> = iolist_to_binary(join(re:split("AB","(A (A|B(*ACCEPT)|C) D)(E)",[extended]))),
+ ok.
+run46() ->
<<":a">> = iolist_to_binary(join(re:split("ba","\\A.*?(a|bc)",[trim]))),
<<":a:">> = iolist_to_binary(join(re:split("ba","\\A.*?(a|bc)",[{parts,
2}]))),
@@ -31350,6 +31320,14 @@ def","^\\N{1,}",[]))),
<<":aaaab:cde">> = iolist_to_binary(join(re:split("aaaabcde","((?(R1)a+|(?1)b))",[{parts,
2}]))),
<<":aaaab:cde">> = iolist_to_binary(join(re:split("aaaabcde","((?(R1)a+|(?1)b))",[]))),
+ <<":a">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))*",[trim]))),
+ <<":a:">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))*",[{parts,
+ 2}]))),
+ <<":a:">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))*",[]))),
+ <<":a">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))+",[trim]))),
+ <<":a:">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))+",[{parts,
+ 2}]))),
+ <<":a:">> = iolist_to_binary(join(re:split("aaa","((?(R)a|(?1)))+",[]))),
<<"">> = iolist_to_binary(join(re:split("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))",[trim]))),
<<"::">> = iolist_to_binary(join(re:split("a","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))",[{parts,
2}]))),
@@ -31362,14 +31340,14 @@ def","^\\N{1,}",[]))),
<<"bb::">> = iolist_to_binary(join(re:split("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))",[{parts,
2}]))),
<<"bb::">> = iolist_to_binary(join(re:split("bba","(?>(?&t)c|(?&t))(?(DEFINE)(?<t>a|b(*PRUNE)c))",[]))),
+ ok.
+run47() ->
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (a(*THEN)b) c",[extended,
trim]))),
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (a(*THEN)b) c",[extended,
{parts,
2}]))),
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (a(*THEN)b) c",[extended]))),
- ok.
-run47() ->
<<":ab">> = iolist_to_binary(join(re:split("aabc","^.*? (a(*THEN)b|(*F)) c",[extended,
trim]))),
<<":ab:">> = iolist_to_binary(join(re:split("aabc","^.*? (a(*THEN)b|(*F)) c",[extended,
@@ -31460,14 +31438,14 @@ run47() ->
{parts,
2}]))),
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? ( (a(*THEN)b)++ )++ c",[extended]))),
+ ok.
+run48() ->
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (?:a(*THEN)b)++ c",[extended,
trim]))),
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (?:a(*THEN)b)++ c",[extended,
{parts,
2}]))),
<<"aabc">> = iolist_to_binary(join(re:split("aabc","^.*? (?:a(*THEN)b)++ c",[extended]))),
- ok.
-run48() ->
<<"">> = iolist_to_binary(join(re:split("aabc","^.*? (?:a(*THEN)b|(*F))++ c",[extended,
trim]))),
<<":">> = iolist_to_binary(join(re:split("aabc","^.*? (?:a(*THEN)b|(*F))++ c",[extended,
@@ -31546,12 +31524,12 @@ run48() ->
<<"xab:d">> = iolist_to_binary(join(re:split("xabcd","(?<=a(*THEN)b)c",[{parts,
2}]))),
<<"xab:d">> = iolist_to_binary(join(re:split("xabcd","(?<=a(*THEN)b)c",[]))),
+ ok.
+run49() ->
<<":a:d">> = iolist_to_binary(join(re:split("abcd","(a)(?2){2}(.)",[trim]))),
<<":a:d:">> = iolist_to_binary(join(re:split("abcd","(a)(?2){2}(.)",[{parts,
2}]))),
<<":a:d:">> = iolist_to_binary(join(re:split("abcd","(a)(?2){2}(.)",[]))),
- ok.
-run49() ->
<<"hello world ">> = iolist_to_binary(join(re:split("hello world test","(another)?(\\1?)test",[trim]))),
<<"hello world :::">> = iolist_to_binary(join(re:split("hello world test","(another)?(\\1?)test",[{parts,
2}]))),
@@ -31606,12 +31584,12 @@ run49() ->
{parts,
2}]))),
<<"a:">> = iolist_to_binary(join(re:split("aab","(?>.*?a)b",[dotall]))),
+ ok.
+run50() ->
<<"a">> = iolist_to_binary(join(re:split("aab","(?>.*?a)b",[trim]))),
<<"a:">> = iolist_to_binary(join(re:split("aab","(?>.*?a)b",[{parts,
2}]))),
<<"a:">> = iolist_to_binary(join(re:split("aab","(?>.*?a)b",[]))),
- ok.
-run50() ->
<<"aab">> = iolist_to_binary(join(re:split("aab","(?>^a)b",[dotall,
trim]))),
<<"aab">> = iolist_to_binary(join(re:split("aab","(?>^a)b",[dotall,
@@ -31898,12 +31876,12 @@ run53() ->
<<":">> = iolist_to_binary(join(re:split("bnn","(?=b(*THEN)a)bn|bnn",[{parts,
2}]))),
<<":">> = iolist_to_binary(join(re:split("bnn","(?=b(*THEN)a)bn|bnn",[]))),
+ ok.
+run54() ->
<<":d">> = iolist_to_binary(join(re:split("acd","(?!a(*SKIP)b)..",[trim]))),
<<":d">> = iolist_to_binary(join(re:split("acd","(?!a(*SKIP)b)..",[{parts,
2}]))),
<<":d">> = iolist_to_binary(join(re:split("acd","(?!a(*SKIP)b)..",[]))),
- ok.
-run54() ->
<<"ac">> = iolist_to_binary(join(re:split("ac","^(?(?!a(*SKIP)b))",[trim]))),
<<"ac">> = iolist_to_binary(join(re:split("ac","^(?(?!a(*SKIP)b))",[{parts,
2}]))),
@@ -31972,4 +31950,125 @@ run54() ->
{parts,
2}]))),
<<"aaa">> = iolist_to_binary(join(re:split("aaa","^a*\\w{4}",[caseless]))),
+ <<":1:non-sp1:non-sp2">> = iolist_to_binary(join(re:split("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$",[trim]))),
+ <<":1:non-sp1:non-sp2:">> = iolist_to_binary(join(re:split("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$",[{parts,
+ 2}]))),
+ <<":1:non-sp1:non-sp2:">> = iolist_to_binary(join(re:split("1 IN SOA non-sp1 non-sp2(","^(\\d+)\\s+IN\\s+SOA\\s+(\\S+)\\s+(\\S+)\\s*\\(\\s*$",[]))),
+ <<"AZ">> = iolist_to_binary(join(re:split("AZ","^A\\xZ",[trim]))),
+ <<"AZ">> = iolist_to_binary(join(re:split("AZ","^A\\xZ",[{parts,
+ 2}]))),
+ <<"AZ">> = iolist_to_binary(join(re:split("AZ","^A\\xZ",[]))),
+ <<"">> = iolist_to_binary(join(re:split("ASB","^A\\o{123}B",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split("ASB","^A\\o{123}B",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("ASB","^A\\o{123}B",[]))),
+ <<"">> = iolist_to_binary(join(re:split("aaaab"," ^ a + + b $ ",[extended,
+ trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + + b $ ",[extended,
+ {parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + + b $ ",[extended]))),
+ <<"">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ + b $ ",[extended,trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ + b $ ",[extended,{parts,2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ + b $ ",[extended]))),
+ <<"">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ #comment
+ + b $ ",[extended,trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ #comment
+ + b $ ",[extended,{parts,2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ a + #comment
+ #comment
+ + b $ ",[extended]))),
+ ok.
+run55() ->
+ <<"">> = iolist_to_binary(join(re:split("aaaab"," ^ (?> a + ) b $ ",[extended,
+ trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ (?> a + ) b $ ",[extended,
+ {parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aaaab"," ^ (?> a + ) b $ ",[extended]))),
+ <<":aaaa">> = iolist_to_binary(join(re:split("aaaab"," ^ ( a + ) + + \\w $ ",[extended,
+ trim]))),
+ <<":aaaa:">> = iolist_to_binary(join(re:split("aaaab"," ^ ( a + ) + + \\w $ ",[extended,
+ {parts,
+ 2}]))),
+ <<":aaaa:">> = iolist_to_binary(join(re:split("aaaab"," ^ ( a + ) + + \\w $ ",[extended]))),
+ <<"acb">> = iolist_to_binary(join(re:split("acb","(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc",[trim]))),
+ <<"acb">> = iolist_to_binary(join(re:split("acb","(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc",[{parts,
+ 2}]))),
+ <<"acb">> = iolist_to_binary(join(re:split("acb","(?:x|(?:(xx|yy)+|x|x|x|x|x)|a|a|a)bc",[]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]*+|\\\"\\\")*+\\\")++",[trim]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]*+|\\\"\\\")*+\\\")++",[{parts,
+ 2}]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]*+|\\\"\\\")*+\\\")++",[]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")*+\\\")++",[trim]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")*+\\\")++",[{parts,
+ 2}]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")*+\\\")++",[]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")++\\\")++",[trim]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")++\\\")++",[{parts,
+ 2}]))),
+ <<":\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A(?:[^\\\"]++|\\\"(?:[^\\\"]++|\\\"\\\")++\\\")++",[]))),
+ <<": AFTER ::\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A([^\\\"1]++|[\\\"2]([^\\\"3]*+|[\\\"4][\\\"5])*+[\\\"6])++",[trim]))),
+ <<": AFTER ::\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A([^\\\"1]++|[\\\"2]([^\\\"3]*+|[\\\"4][\\\"5])*+[\\\"6])++",[{parts,
+ 2}]))),
+ <<": AFTER ::\"NOT MATCHED">> = iolist_to_binary(join(re:split("NON QUOTED \"QUOT\"\"ED\" AFTER \"NOT MATCHED","\\A([^\\\"1]++|[\\\"2]([^\\\"3]*+|[\\\"4][\\\"5])*+[\\\"6])++",[]))),
+ <<":t test">> = iolist_to_binary(join(re:split("test test","^\\w+(?>\\s*)(?<=\\w)",[trim]))),
+ <<":t test">> = iolist_to_binary(join(re:split("test test","^\\w+(?>\\s*)(?<=\\w)",[{parts,
+ 2}]))),
+ <<":t test">> = iolist_to_binary(join(re:split("test test","^\\w+(?>\\s*)(?<=\\w)",[]))),
+ <<":a">> = iolist_to_binary(join(re:split("acl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[trim]))),
+ <<":a::">> = iolist_to_binary(join(re:split("acl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[{parts,
+ 2}]))),
+ <<":a::">> = iolist_to_binary(join(re:split("acl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[]))),
+ <<"::b">> = iolist_to_binary(join(re:split("bdl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[trim]))),
+ <<"::b:">> = iolist_to_binary(join(re:split("bdl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[{parts,
+ 2}]))),
+ <<"::b:">> = iolist_to_binary(join(re:split("bdl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[]))),
+ <<"a">> = iolist_to_binary(join(re:split("adl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[trim]))),
+ <<"a:::">> = iolist_to_binary(join(re:split("adl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[{parts,
+ 2}]))),
+ <<"a:::">> = iolist_to_binary(join(re:split("adl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[]))),
+ <<"bc">> = iolist_to_binary(join(re:split("bcl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[trim]))),
+ <<"bc:::">> = iolist_to_binary(join(re:split("bcl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[{parts,
+ 2}]))),
+ <<"bc:::">> = iolist_to_binary(join(re:split("bcl","(?P<Name>a)?(?P<Name2>b)?(?(<Name>)c|d)*l",[]))),
+ <<"">> = iolist_to_binary(join(re:split(" abc","\\sabc",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split(" abc","\\sabc",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split(" abc","\\sabc",[]))),
+ <<"">> = iolist_to_binary(join(re:split("aa]]","[\\Qa]\\E]+",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aa]]","[\\Qa]\\E]+",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aa]]","[\\Qa]\\E]+",[]))),
+ <<"">> = iolist_to_binary(join(re:split("aa]]","[\\Q]a\\E]+",[trim]))),
+ <<":">> = iolist_to_binary(join(re:split("aa]]","[\\Q]a\\E]+",[{parts,
+ 2}]))),
+ <<":">> = iolist_to_binary(join(re:split("aa]]","[\\Q]a\\E]+",[]))),
+ <<"1::::::2::::::3::::::4:abcd:abcd">> = iolist_to_binary(join(re:split("1234abcd","(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))",[trim]))),
+ <<"1::::::234abcd">> = iolist_to_binary(join(re:split("1234abcd","(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))",[{parts,
+ 2}]))),
+ <<"1::::::2::::::3::::::4:abcd:abcd::::">> = iolist_to_binary(join(re:split("1234abcd","(?:((abcd))|(((?:(?:(?:(?:abc|(?:abcdef))))b)abcdefghi)abc)|((*ACCEPT)))",[]))),
+ ok.
+run56() ->
+ <<"b:a:c">> = iolist_to_binary(join(re:split("baaaaaaaaac","(?1)(?#?'){8}(a)",[trim]))),
+ <<"b:a:c">> = iolist_to_binary(join(re:split("baaaaaaaaac","(?1)(?#?'){8}(a)",[{parts,
+ 2}]))),
+ <<"b:a:c">> = iolist_to_binary(join(re:split("baaaaaaaaac","(?1)(?#?'){8}(a)",[]))),
+ <<"a::b::c::d">> = iolist_to_binary(join(re:split("abcd","(?|(\\k'Pm')|(?'Pm'))",[trim]))),
+ <<"a::bcd">> = iolist_to_binary(join(re:split("abcd","(?|(\\k'Pm')|(?'Pm'))",[{parts,
+ 2}]))),
+ <<"a::b::c::d::">> = iolist_to_binary(join(re:split("abcd","(?|(\\k'Pm')|(?'Pm'))",[]))),
+ <<" :Fred:099">> = iolist_to_binary(join(re:split(" Fred:099","(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\\s])",[trim]))),
+ <<" :Fred:099">> = iolist_to_binary(join(re:split(" Fred:099","(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\\s])",[{parts,
+ 2}]))),
+ <<" :Fred:099">> = iolist_to_binary(join(re:split(" Fred:099","(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[,;:])(?=.{8,16})(?!.*[\\s])",[]))),
+ <<" ">> = iolist_to_binary(join(re:split(" X","(?=.*X)X$",[trim]))),
+ <<" :">> = iolist_to_binary(join(re:split(" X","(?=.*X)X$",[{parts,
+ 2}]))),
+ <<" :">> = iolist_to_binary(join(re:split(" X","(?=.*X)X$",[]))),
ok.
diff --git a/lib/stdlib/test/run_pcre_tests.erl b/lib/stdlib/test/run_pcre_tests.erl
index b62674d6e0..205a7e4946 100644
--- a/lib/stdlib/test/run_pcre_tests.erl
+++ b/lib/stdlib/test/run_pcre_tests.erl
@@ -389,6 +389,9 @@ stru([]) ->
[];
stru([{_,<<>>}|T]) ->
stru(T);
+stru([{_Line,<<"< forbid ", _Rest/binary>>}|T0]) ->
+ %% We do not handle lockout of modifiers from the tests...
+ stru(T0);
stru([{Line,<<Ch,Re0/binary>>}|T0]) ->
{T,Re} = find_rest_re(Ch,[{Line,Re0}|T0]),
{NewRe,<< Ch, Options/binary >>} = end_of_re(Ch,Re),
diff --git a/lib/stdlib/test/shell_SUITE.erl b/lib/stdlib/test/shell_SUITE.erl
index 4864bc3d72..56002dda25 100644
--- a/lib/stdlib/test/shell_SUITE.erl
+++ b/lib/stdlib/test/shell_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2004-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2004-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -30,7 +30,8 @@
progex_bit_syntax/1, progex_records/1,
progex_lc/1, progex_funs/1,
otp_5990/1, otp_6166/1, otp_6554/1,
- otp_7184/1, otp_7232/1, otp_8393/1, otp_10302/1, otp_13719/1]).
+ otp_7184/1, otp_7232/1, otp_8393/1, otp_10302/1, otp_13719/1,
+ otp_14285/1]).
-export([ start_restricted_from_shell/1,
start_restricted_on_command_line/1,restricted_local/1]).
@@ -91,7 +92,7 @@ groups() ->
progex_funs]},
{tickets, [],
[otp_5990, otp_6166, otp_6554, otp_7184,
- otp_7232, otp_8393, otp_10302, otp_13719]}].
+ otp_7232, otp_8393, otp_10302, otp_13719, otp_14285]}].
init_per_suite(Config) ->
Config.
@@ -2824,6 +2825,22 @@ otp_13719(Config) when is_list(Config) ->
file:delete(File),
ok.
+otp_14285(Config) ->
+ {ok,Node} = start_node(shell_suite_helper_4,
+ "-pa "++proplists:get_value(priv_dir,Config)++
+ " +pc unicode"),
+ Test1 =
+ <<"begin
+ io:setopts([{encoding,utf8}]),
+ [1024] = atom_to_list('\\x{400}'),
+ rd('\\x{400}', {'\\x{400}' = '\\x{400}'}),
+ ok = rl('\\x{400}')
+ end.">>,
+ "-record('\x{400}',{'\x{400}' = '\x{400}'}).\nok.\n" =
+ t({Node,Test1}),
+ test_server:stop_node(Node),
+ ok.
+
scan(B) ->
F = fun(Ts) ->
case erl_parse:parse_term(Ts) of
diff --git a/lib/stdlib/test/tar_SUITE.erl b/lib/stdlib/test/tar_SUITE.erl
index d6b6d3f80c..76fa760fa8 100644
--- a/lib/stdlib/test/tar_SUITE.erl
+++ b/lib/stdlib/test/tar_SUITE.erl
@@ -20,12 +20,14 @@
-module(tar_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, borderline/1, atomic/1, long_names/1,
+ init_per_group/2, end_per_group/2,
+ init_per_testcase/2,
+ borderline/1, atomic/1, long_names/1,
create_long_names/1, bad_tar/1, errors/1, extract_from_binary/1,
extract_from_binary_compressed/1, extract_filtered/1,
extract_from_open_file/1, symlinks/1, open_add_close/1, cooked_compressed/1,
memory/1,unicode/1,read_other_implementations/1,
- sparse/1, init/1]).
+ sparse/1, init/1, leading_slash/1, dotdot/1]).
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/include/file.hrl").
@@ -39,7 +41,7 @@ all() ->
extract_filtered,
symlinks, open_add_close, cooked_compressed, memory, unicode,
read_other_implementations,
- sparse,init].
+ sparse,init,leading_slash,dotdot].
groups() ->
[].
@@ -56,6 +58,9 @@ init_per_group(_GroupName, Config) ->
end_per_group(_GroupName, Config) ->
Config.
+init_per_testcase(_Case, Config) ->
+ Ports = ordsets:from_list(erlang:ports()),
+ [{ports,Ports}|Config].
%% Test creating, listing and extracting one file from an archive,
%% multiple times with different file sizes. Also check that the file
@@ -85,7 +90,7 @@ borderline(Config) when is_list(Config) ->
%% Clean up.
delete_files([TempDir]),
- ok.
+ verify_ports(Config).
borderline_test(Size, TempDir) ->
io:format("Testing size ~p", [Size]),
@@ -270,7 +275,7 @@ atomic(Config) when is_list(Config) ->
%% Clean up.
delete_files([Tar1,Tar2,Tar3,Tar4|Names]),
- ok.
+ verify_ports(Config).
%% Returns a sequence of characters.
@@ -304,7 +309,9 @@ long_names(Config) when is_list(Config) ->
DataDir = proplists:get_value(data_dir, Config),
Long = filename:join(DataDir, "long_names.tar"),
run_in_short_tempdir(Config,
- fun() -> do_long_names(Long) end).
+ fun() -> do_long_names(Long) end),
+ verify_ports(Config).
+
do_long_names(Long) ->
%% Try table/2 and extract/2.
@@ -336,7 +343,8 @@ do_long_names(Long) ->
%% Creates a tar file from a deep directory structure (filenames are
%% longer than 100 characters).
create_long_names(Config) when is_list(Config) ->
- run_in_short_tempdir(Config, fun create_long_names/0).
+ run_in_short_tempdir(Config, fun create_long_names/0),
+ verify_ports(Config).
create_long_names() ->
{ok,Dir} = file:get_cwd(),
@@ -383,7 +391,7 @@ bad_tar(Config) when is_list(Config) ->
try_bad("bad_octal", invalid_tar_checksum, Config),
try_bad("bad_too_short", eof, Config),
try_bad("bad_even_shorter", eof, Config),
- ok.
+ verify_ports(Config).
try_bad(Name0, Reason, Config) ->
%% Intentionally no macros here.
@@ -433,7 +441,7 @@ errors(Config) when is_list(Config) ->
%% Clean up.
delete_files([GoodTar,BadTar]),
- ok.
+ verify_ports(Config).
try_error(M, F, A, Error) ->
io:format("Trying ~p:~p(~p)", [M, F, A]),
@@ -483,7 +491,7 @@ extract_from_binary(Config) when is_list(Config) ->
%% Clean up.
delete_files([ExtractDir]),
- ok.
+ verify_ports(Config).
extract_from_binary_compressed(Config) when is_list(Config) ->
%% Test extracting a compressed tar archive from a binary.
@@ -516,7 +524,7 @@ extract_from_binary_compressed(Config) when is_list(Config) ->
%% Clean up the rest.
delete_files([ExtractDir]),
- ok.
+ verify_ports(Config).
%% Test extracting a tar archive from a binary.
extract_filtered(Config) when is_list(Config) ->
@@ -537,7 +545,7 @@ extract_filtered(Config) when is_list(Config) ->
%% Clean up.
delete_files([ExtractDir]),
- ok.
+ verify_ports(Config).
%% Test extracting a tar archive from an open file.
extract_from_open_file(Config) when is_list(Config) ->
@@ -562,7 +570,7 @@ extract_from_open_file(Config) when is_list(Config) ->
%% Clean up.
delete_files([ExtractDir]),
- ok.
+ verify_ports(Config).
%% Test that archives containing symlinks can be created and extracted.
symlinks(Config) when is_list(Config) ->
@@ -581,6 +589,7 @@ symlinks(Config) when is_list(Config) ->
%% Clean up.
delete_files([Dir]),
+ verify_ports(Config),
Res.
make_symlink(Path, Link) ->
@@ -697,7 +706,8 @@ init(Config) when is_list(Config) ->
ok = erl_tar:add(Tar, FileOne, []),
ok = erl_tar:close(Tar),
{ok, [FileOne]} = erl_tar:table(TarOne),
- ok.
+
+ verify_ports(Config).
file_op_bad(_) ->
throw({error, should_never_be_called}).
@@ -751,7 +761,7 @@ open_add_close(Config) when is_list(Config) ->
delete_files(["oac_file","oac_small","oac_big",Dir,AnotherDir,ADir]),
- ok.
+ verify_ports(Config).
oac_files() ->
Files = [{"oac_file", 1459, $x},
@@ -782,7 +792,8 @@ cooked_compressed(Config) when is_list(Config) ->
%% Clean up.
delete_files([filename:join(PrivDir, "ddll_SUITE_data")]),
- ok.
+
+ verify_ports(Config).
%% Test that an archive can be created directly from binaries and
%% that an archive can be extracted into binaries.
@@ -810,13 +821,15 @@ memory(Config) when is_list(Config) ->
%% Clean up.
ok = delete_files([Name1,Name2]),
- ok.
+
+ verify_ports(Config).
read_other_implementations(Config) when is_list(Config) ->
DataDir = proplists:get_value(data_dir, Config),
Files = ["v7.tar", "gnu.tar", "bsd.tar",
"star.tar", "pax_mtime.tar"],
- do_read_other_implementations(Files, DataDir).
+ do_read_other_implementations(Files, DataDir),
+ verify_ports(Config).
do_read_other_implementations([], _DataDir) ->
ok;
@@ -836,7 +849,8 @@ sparse(Config) when is_list(Config) ->
Sparse01 = "sparse01.tar",
Sparse10Empty = "sparse10_empty.tar",
Sparse10 = "sparse10.tar",
- do_sparse([Sparse01Empty, Sparse01, Sparse10Empty, Sparse10], DataDir, PrivDir).
+ do_sparse([Sparse01Empty, Sparse01, Sparse10Empty, Sparse10], DataDir, PrivDir),
+ verify_ports(Config).
do_sparse([], _DataDir, _PrivDir) ->
ok;
@@ -906,6 +920,39 @@ unicode_create_files() ->
[]
end].
+leading_slash(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dir = filename:join(PrivDir, ?FUNCTION_NAME),
+ TarFile = filename:join(Dir, "leading_slash.tar"),
+ ok = filelib:ensure_dir(TarFile),
+ {ok,Fd} = erl_tar:open(TarFile, [write]),
+ TarMemberName = "e/d/c/b/a_member",
+ TarMemberNameAbs = "/" ++ TarMemberName,
+ Contents = <<"contents\n">>,
+ ok = erl_tar:add(Fd, Contents, TarMemberNameAbs, [verbose]),
+ ok = erl_tar:close(Fd),
+
+ ok = erl_tar:extract(TarFile, [{cwd,Dir}]),
+
+ {ok,Contents} = file:read_file(filename:join(Dir, TarMemberName)),
+ ok.
+
+dotdot(Config) ->
+ PrivDir = proplists:get_value(priv_dir, Config),
+ Dir = filename:join(PrivDir, ?FUNCTION_NAME),
+ ok = file:make_dir(Dir),
+ Tar = filename:join(Dir, "dotdot.tar"),
+ {ok,Fd} = erl_tar:open(Tar, [write]),
+ BeamFile = code:which(?MODULE),
+ ok = erl_tar:add(Fd, BeamFile, "a/./../../some_file", []),
+ ok = erl_tar:close(Fd),
+
+ {error,{_,unsafe_path=Error}} = erl_tar:extract(Tar, [{cwd,Dir}]),
+ false = filelib:is_regular(filename:join(PrivDir, "some_file")),
+ io:format("~s\n", [erl_tar:format_error(Error)]),
+
+ ok.
+
%% Delete the given list of files.
delete_files([]) -> ok;
delete_files([Item|Rest]) ->
@@ -994,3 +1041,14 @@ is_ustar(File) ->
$g -> false;
_ -> true
end.
+
+
+verify_ports(Config) ->
+ PortsBefore = proplists:get_value(ports, Config),
+ PortsAfter = ordsets:from_list(erlang:ports()),
+ case ordsets:subtract(PortsAfter, PortsBefore) of
+ [] ->
+ ok;
+ [_|_]=Rem ->
+ error({leaked_ports,Rem})
+ end.
diff --git a/lib/stdlib/vsn.mk b/lib/stdlib/vsn.mk
index e67cb9b08d..f7bd21472c 100644
--- a/lib/stdlib/vsn.mk
+++ b/lib/stdlib/vsn.mk
@@ -1 +1 @@
-STDLIB_VSN = 3.2
+STDLIB_VSN = 3.3
diff --git a/lib/syntax_tools/src/erl_prettypr.erl b/lib/syntax_tools/src/erl_prettypr.erl
index 378d69095d..40ddd2b22a 100644
--- a/lib/syntax_tools/src/erl_prettypr.erl
+++ b/lib/syntax_tools/src/erl_prettypr.erl
@@ -452,7 +452,7 @@ lay_2(Node, Ctxt) ->
text(erl_syntax:variable_literal(Node));
atom ->
- text(erl_syntax:atom_literal(Node));
+ text(erl_syntax:atom_literal(Node, Ctxt#ctxt.encoding));
integer ->
text(erl_syntax:integer_literal(Node));
diff --git a/lib/syntax_tools/src/erl_syntax.erl b/lib/syntax_tools/src/erl_syntax.erl
index 4347cc46c1..9b2b503762 100644
--- a/lib/syntax_tools/src/erl_syntax.erl
+++ b/lib/syntax_tools/src/erl_syntax.erl
@@ -139,6 +139,7 @@
is_atom/2,
atom_value/1,
atom_literal/1,
+ atom_literal/2,
atom_name/1,
attribute/1,
attribute/2,
@@ -1841,7 +1842,7 @@ char_literal(Node) ->
%% @doc Returns the literal string represented by a `char'
%% node. This includes the leading "`$'" character.
%% Depending on the encoding a character beyond 255 will be escaped
-%% ('latin1') or copied as is ('utf8').
+%% (`latin1') or copied as is (`utf8').
%%
%% @see char/1
@@ -1944,7 +1945,7 @@ string_literal(Node) ->
%% @doc Returns the literal string represented by a `string'
%% node. This includes surrounding double-quote characters.
%% Depending on the encoding characters beyond 255 will be escaped
-%% ('latin1') or copied as is ('utf8').
+%% (`latin1') or copied as is (`utf8').
%%
%% @see string/1
@@ -1965,6 +1966,7 @@ string_literal(Node, latin1) ->
%% @see atom_value/1
%% @see atom_name/1
%% @see atom_literal/1
+%% @see atom_literal/2
%% @see is_atom/2
%% type(Node) = atom
@@ -2037,6 +2039,7 @@ atom_name(Node) ->
%% =====================================================================
%% @doc Returns the literal string represented by an `atom'
%% node. This includes surrounding single-quote characters if necessary.
+%% Characters beyond 255 will be escaped.
%%
%% Note that e.g. the result of `atom("x\ny")' represents
%% any and all of `'x\ny'', `'x\12y'',
@@ -2048,8 +2051,24 @@ atom_name(Node) ->
-spec atom_literal(syntaxTree()) -> string().
atom_literal(Node) ->
- io_lib:write_atom(atom_value(Node)).
+ atom_literal(Node, latin1).
+
+%% =====================================================================
+%% @doc Returns the literal string represented by an `atom'
+%% node. This includes surrounding single-quote characters if necessary.
+%% Depending on the encoding a character beyond 255 will be escaped
+%% (`latin1') or copied as is (`utf8').
+%%
+%% @see atom/1
+%% @see atom_literal/1
+%% @see string/1
+atom_literal(Node, utf8) ->
+ io_lib:write_atom(atom_value(Node));
+atom_literal(Node, unicode) ->
+ io_lib:write_atom(atom_value(Node));
+atom_literal(Node, latin1) ->
+ io_lib:write_atom_as_latin1(atom_value(Node)).
%% =====================================================================
%% @equiv map_expr(none, Fields)
diff --git a/lib/tools/doc/src/notes.xml b/lib/tools/doc/src/notes.xml
index 415f1b8516..af20200d49 100644
--- a/lib/tools/doc/src/notes.xml
+++ b/lib/tools/doc/src/notes.xml
@@ -31,6 +31,21 @@
</header>
<p>This document describes the changes made to the Tools application.</p>
+<section><title>Tools 2.9.1</title>
+
+ <section><title>Improvements and New Features</title>
+ <list>
+ <item>
+ <p>
+ Improved edoc support in emacs mode.</p>
+ <p>
+ Own Id: OTP-14217 Aux Id: PR-1282 </p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Tools 2.9</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/tools/emacs/erldoc.el b/lib/tools/emacs/erldoc.el
index e1fd661348..348800f880 100644
--- a/lib/tools/emacs/erldoc.el
+++ b/lib/tools/emacs/erldoc.el
@@ -407,7 +407,7 @@ up the indexing."
(defvar erldoc-user-guides nil)
(defvar erldoc-missing-user-guides
- '("compiler" "hipe" "kernel" "os_mon" "parsetools" "typer")
+ '("compiler" "hipe" "kernel" "os_mon" "parsetools")
"List of standard Erlang applications with no user guides.")
;; Search in `code:lib_dir/0' using find LIB_DIR -type f -name
@@ -417,7 +417,7 @@ up the indexing."
"runtime_tools" "sasl" "snmp"
"ssl" "test_server"
("ssh" . "SSH") ("stdlib" . "STDLIB")
- ("hipe" . "HiPE") ("typer" . "TypEr"))
+ ("hipe" . "HiPE"))
"List of applications that come with a manual.")
(defun erldoc-user-guide-chapters (user-guide)
diff --git a/lib/tools/src/lcnt.erl b/lib/tools/src/lcnt.erl
index 23d66b084e..864d62f6c5 100644
--- a/lib/tools/src/lcnt.erl
+++ b/lib/tools/src/lcnt.erl
@@ -698,19 +698,47 @@ stats2record([{{File,Line},{Tries,Colls,{S,Ns,N}}}|Stats]) ->
nt = N} | stats2record(Stats)];
stats2record([]) -> [].
+
clean_id_creation(Id) when is_pid(Id) ->
Bin = term_to_binary(Id),
- <<H:3/binary, L:16, Node:L/binary, Ids:8/binary, _Creation/binary>> = Bin,
- Bin2 = list_to_binary([H, bytes16(L), Node, Ids, 0]),
+ <<H:3/binary, Rest/binary>> = Bin,
+ <<131, PidTag, AtomTag>> = H,
+ LL = atomlen_bits(AtomTag),
+ CL = creation_bits(PidTag),
+ <<L:LL, Node:L/binary, Ids:8/binary, _Creation/binary>> = Rest,
+ Bin2 = list_to_binary([H, <<L:LL>>, Node, Ids, <<0:CL>>]),
binary_to_term(Bin2);
clean_id_creation(Id) when is_port(Id) ->
Bin = term_to_binary(Id),
- <<H:3/binary, L:16, Node:L/binary, Ids:4/binary, _Creation/binary>> = Bin,
- Bin2 = list_to_binary([H, bytes16(L), Node, Ids, 0]),
+ <<H:3/binary, Rest/binary>> = Bin,
+ <<131, PortTag, AtomTag>> = H,
+ LL = atomlen_bits(AtomTag),
+ CL = creation_bits(PortTag),
+ <<L:LL, Node:L/binary, Ids:4/binary, _Creation/binary>> = Rest,
+ Bin2 = list_to_binary([H, <<L:LL>>, Node, Ids, <<0:CL>>]),
binary_to_term(Bin2);
clean_id_creation(Id) ->
Id.
+-define(PID_EXT, $g).
+-define(NEW_PID_EXT, $X).
+-define(PORT_EXT, $f).
+-define(NEW_PORT_EXT, $Y).
+-define(ATOM_EXT, $d).
+-define(SMALL_ATOM_EXT, $s).
+-define(ATOM_UTF8_EXT, $v).
+-define(SMALL_ATOM_UTF8_EXT, $w).
+
+atomlen_bits(?ATOM_EXT) -> 16;
+atomlen_bits(?SMALL_ATOM_EXT) -> 8;
+atomlen_bits(?ATOM_UTF8_EXT) -> 16;
+atomlen_bits(?SMALL_ATOM_UTF8_EXT) -> 8.
+
+creation_bits(?PID_EXT) -> 8;
+creation_bits(?NEW_PID_EXT) -> 32;
+creation_bits(?PORT_EXT) -> 8;
+creation_bits(?NEW_PORT_EXT) -> 32.
+
%% serializer
state_default(Field) -> proplists:get_value(Field, state2list(#state{})).
@@ -936,12 +964,24 @@ strings([S|Ss], Out) -> strings(Ss, Out ++ term2string("~ts", [S])).
term2string({M,F,A}) when is_atom(M), is_atom(F), is_integer(A) -> term2string("~p:~p/~p", [M,F,A]);
term2string(Term) when is_port(Term) ->
% ex #Port<6442.816>
- <<_:3/binary, L:16, Node:L/binary, Ids:32, _/binary>> = term_to_binary(Term),
- term2string("#Port<~s.~w>", [Node, Ids]);
+ case term_to_binary(Term) of
+ <<_:2/binary, ?SMALL_ATOM_UTF8_EXT, L:8, Node:L/binary, Ids:32, _/binary>> ->
+ term2string("#Port<~ts.~w>", [Node, Ids]);
+ <<_:2/binary, ?ATOM_UTF8_EXT, L:16, Node:L/binary, Ids:32, _/binary>> ->
+ term2string("#Port<~ts.~w>", [Node, Ids]);
+ <<_:2/binary, ?ATOM_EXT, L:16, Node:L/binary, Ids:32, _/binary>> ->
+ term2string("#Port<~s.~w>", [Node, Ids])
+ end;
term2string(Term) when is_pid(Term) ->
% ex <0.80.0>
- <<_:3/binary, L:16, Node:L/binary, Ids:32, Serial:32, _/binary>> = term_to_binary(Term),
- term2string("<~s.~w.~w>", [Node, Ids, Serial]);
+ case term_to_binary(Term) of
+ <<_:2/binary, ?SMALL_ATOM_UTF8_EXT, L:8, Node:L/binary, Ids:32, Serial:32, _/binary>> ->
+ term2string("<~ts.~w.~w>", [Node, Ids, Serial]);
+ <<_:2/binary, ?ATOM_UTF8_EXT, L:16, Node:L/binary, Ids:32, Serial:32, _/binary>> ->
+ term2string("<~ts.~w.~w>", [Node, Ids, Serial]);
+ <<_:2/binary, ?ATOM_EXT, L:16, Node:L/binary, Ids:32, Serial:32, _/binary>> ->
+ term2string("<~s.~w.~w>", [Node, Ids, Serial])
+ end;
term2string(Term) -> term2string("~w", [Term]).
term2string(Format, Terms) -> lists:flatten(io_lib:format(Format, Terms)).
diff --git a/lib/tools/src/make.erl b/lib/tools/src/make.erl
index 60695febb4..0363dee02d 100644
--- a/lib/tools/src/make.erl
+++ b/lib/tools/src/make.erl
@@ -290,11 +290,12 @@ coerce_2_list(X) when is_atom(X) ->
coerce_2_list(X) ->
X.
-%%% If you an include file is found with a modification
+%%% If an include file is found with a modification
%%% time larger than the modification time of the object
%%% file, return true. Otherwise return false.
check_includes(File, IncludePath, ObjMTime) ->
- Path = [filename:dirname(File)|IncludePath],
+ {ok,Cwd} = file:get_cwd(),
+ Path = [Cwd,filename:dirname(File)|IncludePath],
case epp:open(File, Path, []) of
{ok, Epp} ->
check_includes2(Epp, File, ObjMTime);
diff --git a/lib/tools/src/tools.app.src b/lib/tools/src/tools.app.src
index 4c7dd24006..17b1d06686 100644
--- a/lib/tools/src/tools.app.src
+++ b/lib/tools/src/tools.app.src
@@ -41,7 +41,6 @@
]
},
{runtime_dependencies, ["stdlib-3.1","runtime_tools-1.8.14",
- "kernel-3.0","inets-5.10","erts-7.0",
- "compiler-5.0"]}
+ "kernel-3.0","erts-7.0","compiler-5.0"]}
]
}.
diff --git a/lib/tools/test/Makefile b/lib/tools/test/Makefile
index 84c4e56aff..fe65d1484d 100644
--- a/lib/tools/test/Makefile
+++ b/lib/tools/test/Makefile
@@ -52,8 +52,8 @@ RELSYSDIR = $(RELEASE_PATH)/tools_test
# ----------------------------------------------------
# FLAGS
# ----------------------------------------------------
-ERL_MAKE_FLAGS +=
-ERL_COMPILE_FLAGS += -I$(ERL_TOP)/lib/percept/include
+ERL_MAKE_FLAGS +=
+ERL_COMPILE_FLAGS +=
EBIN = .
diff --git a/lib/tools/test/make_SUITE.erl b/lib/tools/test/make_SUITE.erl
index 2a94ead329..2db5c6844a 100644
--- a/lib/tools/test/make_SUITE.erl
+++ b/lib/tools/test/make_SUITE.erl
@@ -19,11 +19,7 @@
%%
-module(make_SUITE).
--export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
- init_per_group/2,end_per_group/2, make_all/1, make_files/1, emake_opts/1]).
--export([otp_6057_init/1,
- otp_6057_a/1, otp_6057_b/1, otp_6057_c/1,
- otp_6057_end/1]).
+-compile(export_all).
-include_lib("common_test/include/ct.hrl").
@@ -40,7 +36,8 @@
suite() -> [{ct_hooks,[ts_install_cth]}].
all() ->
- [make_all, make_files, emake_opts, {group, otp_6057}].
+ [make_all, make_files, recompile_on_changed_include,
+ emake_opts, {group, otp_6057}].
groups() ->
[{otp_6057,[],[otp_6057_a, otp_6057_b,
@@ -86,6 +83,41 @@ make_files(Config) when is_list(Config) ->
ensure_no_messages(),
ok.
+recompile_on_changed_include(Config) ->
+ Current = prepare_data_dir(Config),
+
+ Files = [test_incl1,"incl_src/test_incl2"],
+ up_to_date = make:files(Files),
+ ok = ensure_exists([test_incl1,test_incl2]),
+
+ {ok, FileInfo11} = file:read_file_info("test_incl1.beam"),
+ Date11 = FileInfo11#file_info.mtime,
+ {ok, FileInfo21} = file:read_file_info("test_incl2.beam"),
+ Date21 = FileInfo21#file_info.mtime,
+ timer:sleep(2000),
+
+ %% Touch the include file
+ {ok,Bin} = file:read_file("test_incl.hrl"),
+ ok = file:delete("test_incl.hrl"),
+ ok = file:write_file("test_incl.hrl",Bin),
+
+ up_to_date = make:files(Files),
+
+ {ok, FileInfo12} = file:read_file_info("test_incl1.beam"),
+ case FileInfo12#file_info.mtime of
+ Date11 -> ct:fail({"file not recompiled", "test_incl1.beam"});
+ _Date12 -> ok
+ end,
+ {ok, FileInfo22} = file:read_file_info("test_incl2.beam"),
+ case FileInfo22#file_info.mtime of
+ Date21 -> ct:fail({"file not recompiled", "test_incl2.beam"});
+ _Date22 -> ok
+ end,
+
+ file:set_cwd(Current),
+ ensure_no_messages(),
+ ok.
+
emake_opts(Config) when is_list(Config) ->
Current = prepare_data_dir(Config),
diff --git a/lib/tools/test/make_SUITE_data/incl_src/test_incl2.erl b/lib/tools/test/make_SUITE_data/incl_src/test_incl2.erl
new file mode 100644
index 0000000000..d0db98c19a
--- /dev/null
+++ b/lib/tools/test/make_SUITE_data/incl_src/test_incl2.erl
@@ -0,0 +1,9 @@
+-module(test_incl2).
+-compile(export_all).
+-include("test_incl.hrl").
+
+f1() ->
+ ?d.
+
+f2() ->
+ true.
diff --git a/lib/tools/test/make_SUITE_data/test_incl.hrl b/lib/tools/test/make_SUITE_data/test_incl.hrl
new file mode 100644
index 0000000000..3a1bcfadd0
--- /dev/null
+++ b/lib/tools/test/make_SUITE_data/test_incl.hrl
@@ -0,0 +1 @@
+-define(d,"defined").
diff --git a/lib/tools/test/make_SUITE_data/test_incl1.erl b/lib/tools/test/make_SUITE_data/test_incl1.erl
new file mode 100644
index 0000000000..4a1dd0e73d
--- /dev/null
+++ b/lib/tools/test/make_SUITE_data/test_incl1.erl
@@ -0,0 +1,9 @@
+-module(test_incl1).
+-compile(export_all).
+-include("test_incl.hrl").
+
+f1() ->
+ ?d.
+
+f2() ->
+ true.
diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl
index f308ea1204..b8e7113595 100644
--- a/lib/tools/test/xref_SUITE.erl
+++ b/lib/tools/test/xref_SUITE.erl
@@ -89,11 +89,11 @@ init_per_suite(Conf) when is_list(Conf) ->
DataDir = ?datadir,
PrivDir = ?privdir,
CopyDir = fname(PrivDir, "datacopy"),
+ ok = file:make_dir(CopyDir),
TarFile = fname(PrivDir, "datacopy.tgz"),
- {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
- ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
- ok = erl_tar:close(Tar),
- ok = erl_tar:extract(TarFile, [compressed]),
+ ok = file:set_cwd(DataDir),
+ ok = erl_tar:create(TarFile, ["."], [compressed]),
+ ok = erl_tar:extract(TarFile, [compressed, {cwd,CopyDir}]),
ok = file:delete(TarFile),
[{copy_dir, CopyDir}|Conf].
diff --git a/lib/tools/vsn.mk b/lib/tools/vsn.mk
index 07bc39f76e..f60da27c44 100644
--- a/lib/tools/vsn.mk
+++ b/lib/tools/vsn.mk
@@ -1 +1 @@
-TOOLS_VSN = 2.9
+TOOLS_VSN = 2.9.1
diff --git a/lib/typer/Makefile b/lib/typer/Makefile
deleted file mode 100644
index bd1b6458a8..0000000000
--- a/lib/typer/Makefile
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2006-2016. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# %CopyrightEnd%
-#
-#=============================================================================
-#
-# File: lib/typer/Makefile
-# Authors: Bingwen He, Tobias Lindahl, and Kostis Sagonas
-#
-#=============================================================================
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-#
-# Macros
-#
-
-SUB_DIRECTORIES = src doc/src
-
-include vsn.mk
-VSN = $(TYPER_VSN)
-
-SPECIAL_TARGETS =
-
-#
-# Default Subdir Targets
-#
-include $(ERL_TOP)/make/otp_subdir.mk
-
diff --git a/lib/typer/RELEASE_NOTES b/lib/typer/RELEASE_NOTES
deleted file mode 100644
index d91a815ee9..0000000000
--- a/lib/typer/RELEASE_NOTES
+++ /dev/null
@@ -1,22 +0,0 @@
-==============================================================================
- Major features, additions and changes between Typer versions
- (in reversed chronological order)
-==============================================================================
-
-Version 0.9 (in Erlang/OTP R14B02)
-----------------------------------
- - Major rewrite; all code has been cleaned up and placed in one file.
- The only reason why this is not version 1.0 yet is that there is no proper
- documentation for typer which can be displayed in the www.erlang.org site.
- - Added ability to receive the set of exported types and report unknown ones.
- - Better handling of overloaded contracts; especially erroneous ones on which
- typer does not crash anymore.
- - Fixed problem that caused typer to hang when given a file whose module name
- did not correspond to the file name.
- - Added two undocumented options that may come very handy when trying to
- understand why typer reports some particular set of types for the functions
- in a module. These options are mainly for typer developers at this point,
- but may become documented in some future version.
-
-Older versions
---------------
diff --git a/lib/typer/doc/Makefile b/lib/typer/doc/Makefile
deleted file mode 100644
index 1015ca78eb..0000000000
--- a/lib/typer/doc/Makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2006-2016. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# %CopyrightEnd%
-#
-SHELL=/bin/sh
-
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-clean:
- -rm -f *.html edoc-info stylesheet.css erlang.png
-
-distclean: clean
-realclean: clean
-
-# ----------------------------------------------------
-# Special Build Targets
-# ----------------------------------------------------
-
-
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
diff --git a/lib/typer/doc/html/.gitignore b/lib/typer/doc/html/.gitignore
deleted file mode 100644
index e69de29bb2..0000000000
--- a/lib/typer/doc/html/.gitignore
+++ /dev/null
diff --git a/lib/typer/doc/pdf/.gitignore b/lib/typer/doc/pdf/.gitignore
deleted file mode 100644
index e69de29bb2..0000000000
--- a/lib/typer/doc/pdf/.gitignore
+++ /dev/null
diff --git a/lib/typer/doc/src/Makefile b/lib/typer/doc/src/Makefile
deleted file mode 100644
index 3724a2e4d1..0000000000
--- a/lib/typer/doc/src/Makefile
+++ /dev/null
@@ -1,118 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2006-2016. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# %CopyrightEnd%
-#
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-# ----------------------------------------------------
-# Application version
-# ----------------------------------------------------
-include ../../vsn.mk
-VSN=$(TYPER_VSN)
-APPLICATION=typer
-
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/lib/$(APPLICATION)-$(VSN)
-
-# ----------------------------------------------------
-# Target Specs
-# ----------------------------------------------------
-XML_APPLICATION_FILES = ref_man.xml
-XML_REF3_FILES =
-
-XML_PART_FILES = part_notes.xml
-XML_CHAPTER_FILES = notes.xml
-
-BOOK_FILES = book.xml
-
-XML_FILES = \
- $(BOOK_FILES) $(XML_CHAPTER_FILES) \
- $(XML_PART_FILES) $(XML_REF3_FILES) $(XML_APPLICATION_FILES)
-
-GIF_FILES =
-
-# ----------------------------------------------------
-
-HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \
- $(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html)
-
-INFO_FILE = ../../info
-EXTRA_FILES = \
- $(DEFAULT_GIF_FILES) \
- $(DEFAULT_HTML_FILES) \
- $(XML_REF3_FILES:%.xml=$(HTMLDIR)/%.html) \
- $(XML_CHAPTER_FILES:%.xml=$(HTMLDIR)/%.html)
-
-MAN3_FILES = $(XML_REF3_FILES:%.xml=$(MAN3DIR)/%.3)
-
-HTML_REF_MAN_FILE = $(HTMLDIR)/index.html
-
-TOP_PDF_FILE = $(PDFDIR)/$(APPLICATION)-$(VSN).pdf
-
-# ----------------------------------------------------
-# FLAGS
-# ----------------------------------------------------
-XML_FLAGS +=
-
-# ----------------------------------------------------
-# Targets
-# ----------------------------------------------------
-$(HTMLDIR)/%.gif: %.gif
- $(INSTALL_DATA) $< $@
-
-docs: pdf html man
-
-$(TOP_PDF_FILE): $(XML_FILES)
-
-pdf: $(TOP_PDF_FILE)
-
-html: gifs $(HTML_REF_MAN_FILE)
-
-man: $(MAN3_FILES)
-
-gifs: $(GIF_FILES:%=$(HTMLDIR)/%)
-
-debug opt:
-
-clean clean_docs:
- rm -rf $(HTMLDIR)/*
- rm -f $(MAN3DIR)/*
- rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
- rm -f errs core *~
-
-distclean: clean
-realclean: clean
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
-
-release_docs_spec: docs
- $(INSTALL_DIR) "$(RELSYSDIR)/doc/pdf"
- $(INSTALL_DATA) $(TOP_PDF_FILE) "$(RELSYSDIR)/doc/pdf"
- $(INSTALL_DIR) "$(RELSYSDIR)/doc/html"
- $(INSTALL_DATA) $(HTMLDIR)/* \
- "$(RELSYSDIR)/doc/html"
- $(INSTALL_DATA) $(INFO_FILE) "$(RELSYSDIR)"
-
-
-release_spec:
diff --git a/lib/typer/doc/src/book.xml b/lib/typer/doc/src/book.xml
deleted file mode 100644
index 20da44ae04..0000000000
--- a/lib/typer/doc/src/book.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE book SYSTEM "book.dtd">
-
-<book xmlns:xi="http://www.w3.org/2001/XInclude">
- <header titlestyle="normal">
- <copyright>
- <year>2006</year><year>2016</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- </legalnotice>
-
- <title>TypEr</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <pagetext></pagetext>
- <preamble>
- </preamble>
- <pagetext>TypEr</pagetext>
- <applications>
- <xi:include href="ref_man.xml"/>
- </applications>
- <releasenotes>
- <xi:include href="notes.xml"/>
- </releasenotes>
-</book>
-
diff --git a/lib/typer/doc/src/fascicules.xml b/lib/typer/doc/src/fascicules.xml
deleted file mode 100644
index b15610fa8b..0000000000
--- a/lib/typer/doc/src/fascicules.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE fascicules SYSTEM "fascicules.dtd">
-
-<fascicules>
- <fascicule file="part_notes" href="part_notes_frame.html" entry="yes">
- Release Notes
- </fascicule>
- <fascicule file="" href="../../../../doc/print.html" entry="no">
- Off-Print
- </fascicule>
-</fascicules>
-
diff --git a/lib/typer/doc/src/notes.xml b/lib/typer/doc/src/notes.xml
deleted file mode 100644
index 9ef5ca1c70..0000000000
--- a/lib/typer/doc/src/notes.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE chapter SYSTEM "chapter.dtd">
-
-<chapter>
- <header>
- <copyright>
- <year>2014</year><year>2016</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- </legalnotice>
-
- <title>TypEr Release Notes</title>
- <prepared>otp_appnotes</prepared>
- <docno>nil</docno>
- <date>nil</date>
- <rev>nil</rev>
- <file>notes.xml</file>
- </header>
- <p>This document describes the changes made to TypEr.</p>
-
-<section><title>TypEr 0.9.11</title>
-
- <section><title>Improvements and New Features</title>
- <list>
- <item>
- <p>
- Internal changes</p>
- <p>
- Own Id: OTP-13551</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>TypEr 0.9.10</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>Fix a bug that could result in a crash when printing
- warnings onto standard error. </p>
- <p>
- Own Id: OTP-13010</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>TypEr 0.9.9</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p> Properly extract annotations from core code. </p>
- <p>
- Own Id: OTP-12727</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>TypEr 0.9.8</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p> The name of a compiler option has been fixed in the
- Makefile. </p>
- <p>
- Own Id: OTP-11996</p>
- </item>
- </list>
- </section>
-
-</section>
-
-<section><title>TypEr 0.9.7</title>
-
- <section><title>Fixed Bugs and Malfunctions</title>
- <list>
- <item>
- <p>
- Added initial documentation framework for TypEr.</p>
- <p>
- Own Id: OTP-11860</p>
- </item>
- </list>
- </section>
-
-</section>
-
-
-
-</chapter>
-
diff --git a/lib/typer/doc/src/part_notes.xml b/lib/typer/doc/src/part_notes.xml
deleted file mode 100644
index 3234f0903e..0000000000
--- a/lib/typer/doc/src/part_notes.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE part SYSTEM "part.dtd">
-
-<part xmlns:xi="http://www.w3.org/2001/XInclude">
- <header>
- <copyright>
- <year>2006</year><year>2016</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- </legalnotice>
-
- <title>TypEr Release Notes</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- </header>
- <description>
- <p><em>TypEr</em></p>
- </description>
- <xi:include href="notes.xml"/>
-</part>
-
diff --git a/lib/typer/doc/src/ref_man.xml b/lib/typer/doc/src/ref_man.xml
deleted file mode 100644
index c793207443..0000000000
--- a/lib/typer/doc/src/ref_man.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE application SYSTEM "application.dtd">
-
-<application xmlns:xi="http://www.w3.org/2001/XInclude">
- <header>
- <copyright>
- <year>2014</year><year>2016</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- </legalnotice>
-
- <title>TypEr</title>
- <prepared></prepared>
- <docno></docno>
- <date></date>
- <rev></rev>
- <file>ref_man.xml</file>
- </header>
- <description>
- </description>
- <xi:include href="typer_app.xml"/>
-</application>
-
diff --git a/lib/typer/doc/src/typer_app.xml b/lib/typer/doc/src/typer_app.xml
deleted file mode 100644
index d52df5d0da..0000000000
--- a/lib/typer/doc/src/typer_app.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE appref SYSTEM "appref.dtd">
-
-<appref>
- <header>
- <copyright>
- <year>2014</year><year>2016</year>
- <holder>Ericsson AB. All Rights Reserved.</holder>
- </copyright>
- <legalnotice>
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- </legalnotice>
-
- <title>TypEr</title>
- <prepared></prepared>
- <responsible></responsible>
- <docno></docno>
- <approved></approved>
- <checked></checked>
- <date></date>
- <rev></rev>
- <file>typer.xml</file>
- </header>
- <app>TypEr</app>
- <appsummary>The TypEr Application</appsummary>
- <description>
- <p>An Erlang/OTP application that shows type information
- for Erlang modules to the user. Additionally, it can
- annotate the code of files with such type information.</p>
- </description>
-
-</appref>
-
diff --git a/lib/typer/ebin/.gitignore b/lib/typer/ebin/.gitignore
deleted file mode 100644
index e69de29bb2..0000000000
--- a/lib/typer/ebin/.gitignore
+++ /dev/null
diff --git a/lib/typer/info b/lib/typer/info
deleted file mode 100644
index 5145fbcfff..0000000000
--- a/lib/typer/info
+++ /dev/null
@@ -1,2 +0,0 @@
-group: tools
-short: TypEr
diff --git a/lib/typer/src/Makefile b/lib/typer/src/Makefile
deleted file mode 100644
index 6c5d8b0726..0000000000
--- a/lib/typer/src/Makefile
+++ /dev/null
@@ -1,111 +0,0 @@
-#
-# %CopyrightBegin%
-#
-# Copyright Ericsson AB 2006-2016. All Rights Reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# %CopyrightEnd%
-#
-#=============================================================================
-#
-# File: lib/typer/src/Makefile
-# Authors: Kostis Sagonas
-#
-#=============================================================================
-
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-# ----------------------------------------------------
-# Application version
-# ----------------------------------------------------
-include ../vsn.mk
-VSN=$(TYPER_VSN)
-
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/lib/typer-$(VSN)
-
-# ----------------------------------------------------
-# Orientation information -- find dialyzer's dir
-# ----------------------------------------------------
-DIALYZER_DIR = $(ERL_TOP)/lib/dialyzer
-
-# ----------------------------------------------------
-# Target Specs
-# ----------------------------------------------------
-MODULES = typer
-
-HRL_FILES=
-ERL_FILES= $(MODULES:%=%.erl)
-INSTALL_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR)) $(APP_TARGET) $(APPUP_TARGET)
-TARGET_FILES= $(INSTALL_FILES)
-
-APP_FILE= typer.app
-APP_SRC= $(APP_FILE).src
-APP_TARGET= $(EBIN)/$(APP_FILE)
-
-APPUP_FILE= typer.appup
-APPUP_SRC= $(APPUP_FILE).src
-APPUP_TARGET= $(EBIN)/$(APPUP_FILE)
-
-# ----------------------------------------------------
-# FLAGS
-# ----------------------------------------------------
-ERL_COMPILE_FLAGS += +warn_export_vars +warn_untyped_record +warn_missing_spec
-
-# ----------------------------------------------------
-# Targets
-# ----------------------------------------------------
-
-debug opt: $(TARGET_FILES)
-
-docs:
-
-clean:
- rm -f $(TARGET_FILES)
- rm -f core
-
-# ----------------------------------------------------
-# Special Build Targets
-# ----------------------------------------------------
-
-$(EBIN)/typer.$(EMULATOR): typer.erl ../vsn.mk Makefile
- $(erlc_verbose)erlc -W $(ERL_COMPILE_FLAGS) -DVSN="\"v$(VSN)\"" -o$(EBIN) typer.erl
-
-$(APP_TARGET): $(APP_SRC) ../vsn.mk
- $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
-
-$(APPUP_TARGET): $(APPUP_SRC) ../vsn.mk
- $(vsn_verbose)sed -e 's;%VSN%;$(VSN);' $< > $@
-
-# ---------------------------------------------------------------------
-# dependencies
-# ---------------------------------------------------------------------
-
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
-
-release_spec: opt
- $(INSTALL_DIR) "$(RELSYSDIR)/src"
- $(INSTALL_DATA) $(ERL_FILES) $(HRL_FILES) $(YRL_FILES) \
- "$(RELSYSDIR)/src"
- $(INSTALL_DIR) "$(RELSYSDIR)/ebin"
- $(INSTALL_DATA) $(INSTALL_FILES) "$(RELSYSDIR)/ebin"
-
-release_docs_spec:
diff --git a/lib/typer/src/typer.app.src b/lib/typer/src/typer.app.src
deleted file mode 100644
index e0be937cc3..0000000000
--- a/lib/typer/src/typer.app.src
+++ /dev/null
@@ -1,11 +0,0 @@
-% This is an -*- erlang -*- file.
-
-{application, typer,
- [{description, "TYPe annotator for ERlang programs, version %VSN%"},
- {vsn, "%VSN%"},
- {modules, [typer]},
- {registered, []},
- {applications, [compiler, dialyzer, hipe, kernel, stdlib]},
- {env, []},
- {runtime_dependencies, ["stdlib-3.0","kernel-5.0","hipe-3.15.4","erts-8.0",
- "dialyzer-3.1","compiler-7.0"]}]}.
diff --git a/lib/typer/src/typer.appup.src b/lib/typer/src/typer.appup.src
deleted file mode 100644
index 3b7464a97c..0000000000
--- a/lib/typer/src/typer.appup.src
+++ /dev/null
@@ -1,22 +0,0 @@
-%% -*- erlang -*-
-%% %CopyrightBegin%
-%%
-%% Copyright Ericsson AB 2014-2016. All Rights Reserved.
-%%
-%% Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% %CopyrightEnd%
-{"%VSN%",
- [{<<".*">>,[{restart_application, typer}]}],
- [{<<".*">>,[{restart_application, typer}]}]
-}.
diff --git a/lib/typer/test/Makefile b/lib/typer/test/Makefile
deleted file mode 100644
index fb5570d9f0..0000000000
--- a/lib/typer/test/Makefile
+++ /dev/null
@@ -1,65 +0,0 @@
-include $(ERL_TOP)/make/target.mk
-include $(ERL_TOP)/make/$(TARGET)/otp.mk
-
-# ----------------------------------------------------
-# Target Specs
-# ----------------------------------------------------
-
-MODULES= \
- typer_SUITE
-
-ERL_FILES= $(MODULES:%=%.erl)
-
-TARGET_FILES= $(MODULES:%=$(EBIN)/%.$(EMULATOR))
-INSTALL_PROGS= $(TARGET_FILES)
-
-EMAKEFILE=Emakefile
-
-# ----------------------------------------------------
-# Release directory specification
-# ----------------------------------------------------
-RELSYSDIR = $(RELEASE_PATH)/typer_test
-
-# ----------------------------------------------------
-# FLAGS
-# ----------------------------------------------------
-
-ERL_MAKE_FLAGS +=
-ERL_COMPILE_FLAGS +=
-
-EBIN = .
-
-# ----------------------------------------------------
-# Targets
-# ----------------------------------------------------
-
-make_emakefile:
- $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) $(MODULES) \
- > $(EMAKEFILE)
- $(ERL_TOP)/make/make_emakefile $(ERL_COMPILE_FLAGS) -o$(EBIN) '*_SUITE_make' \
- >> $(EMAKEFILE)
-
-tests debug opt: make_emakefile
- erl $(ERL_MAKE_FLAGS) -make
-
-clean:
- rm -f $(EMAKEFILE)
- rm -f $(TARGET_FILES) $(GEN_FILES)
- rm -f core
-
-docs:
-
-# ----------------------------------------------------
-# Release Target
-# ----------------------------------------------------
-include $(ERL_TOP)/make/otp_release_targets.mk
-
-release_spec: opt
-
-release_tests_spec: make_emakefile
- $(INSTALL_DIR) "$(RELSYSDIR)"
- $(INSTALL_DATA) $(EMAKEFILE) $(ERL_FILES) "$(RELSYSDIR)"
- $(INSTALL_DATA) typer.spec "$(RELSYSDIR)"
- chmod -R u+w "$(RELSYSDIR)"
-
-release_docs_spec:
diff --git a/lib/typer/test/typer.spec b/lib/typer/test/typer.spec
deleted file mode 100644
index 79f51b6781..0000000000
--- a/lib/typer/test/typer.spec
+++ /dev/null
@@ -1 +0,0 @@
-{suites,"../typer_test",all}.
diff --git a/lib/typer/test/typer_SUITE.erl b/lib/typer/test/typer_SUITE.erl
deleted file mode 100644
index 25f0229640..0000000000
--- a/lib/typer/test/typer_SUITE.erl
+++ /dev/null
@@ -1,57 +0,0 @@
-%% ``Licensed under the Apache License, Version 2.0 (the "License");
-%% you may not use this file except in compliance with the License.
-%% You may obtain a copy of the License at
-%%
-%% http://www.apache.org/licenses/LICENSE-2.0
-%%
-%% Unless required by applicable law or agreed to in writing, software
-%% distributed under the License is distributed on an "AS IS" BASIS,
-%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-%% See the License for the specific language governing permissions and
-%% limitations under the License.
-%%
-%% The Initial Developer of the Original Code is Ericsson Utvecklings AB.
-%% Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings
-%% AB. All Rights Reserved.''
-%%
--module(typer_SUITE).
-
--compile([export_all]).
--include_lib("common_test/include/ct.hrl").
-
-suite() ->
- [{ct_hooks, [ts_install_cth]}].
-
-all() ->
- case application:ensure_all_started(typer) of
- {ok, Apps} ->
- [application:stop(App) || App <- lists:reverse(Apps)],
- [app, appup];
- _ ->
- [appup]
- end.
-
-groups() ->
- [].
-
-init_per_suite(Config) ->
- Config.
-
-end_per_suite(_Config) ->
- ok.
-
-init_per_group(_GroupName, Config) ->
- Config.
-
-end_per_group(_GroupName, Config) ->
- Config.
-
-app() ->
- [{doc, "Test that the typer app file is ok"}].
-app(Config) when is_list(Config) ->
- ok = ?t:app_test(typer).
-
-appup() ->
- [{doc, "Test that the typer appup file is ok"}].
-appup(Config) when is_list(Config) ->
- ok = ?t:appup_test(typer).
diff --git a/lib/typer/vsn.mk b/lib/typer/vsn.mk
deleted file mode 100644
index ed12e067c1..0000000000
--- a/lib/typer/vsn.mk
+++ /dev/null
@@ -1 +0,0 @@
-TYPER_VSN = 0.9.11
diff --git a/lib/wx/c_src/wxe_impl.cpp b/lib/wx/c_src/wxe_impl.cpp
index 0d2da5d4a7..05d56667ab 100644
--- a/lib/wx/c_src/wxe_impl.cpp
+++ b/lib/wx/c_src/wxe_impl.cpp
@@ -128,7 +128,7 @@ bool WxeApp::OnInit()
delayed_cleanup = new wxList;
wxe_ps_init2();
- // wxIdleEvent::SetMode(wxIDLE_PROCESS_SPECIFIED); // Hmm printpreview doesn't work in 2.9 with this
+ wxIdleEvent::SetMode(wxIDLE_PROCESS_SPECIFIED);
Connect(wxID_ANY, wxEVT_IDLE, (wxObjectEventFunction) (wxEventFunction) &WxeApp::idle);
Connect(CREATE_PORT, wxeEVT_META_COMMAND,(wxObjectEventFunction) (wxEventFunction) &WxeApp::newMemEnv);
@@ -200,7 +200,8 @@ void WxeApp::OnAssertFailure(const wxChar *file, int line, const wxChar *cfunc,
// Called by wx thread
void WxeApp::idle(wxIdleEvent& event) {
event.Skip(true);
- dispatch_cmds();
+ if(dispatch_cmds())
+ event.RequestMore();
}
/* ************************************************************
@@ -233,14 +234,15 @@ void handle_event_callback(ErlDrvPort port, ErlDrvTermData process)
}
}
-void WxeApp::dispatch_cmds()
+int WxeApp::dispatch_cmds()
{
+ int more = 0;
if(wxe_status != WXE_INITIATED)
- return;
+ return more;
recurse_level++;
// fprintf(stderr, "\r\ndispatch_normal %d\r\n", recurse_level);fflush(stderr);
wxe_queue->cb_start = 0;
- dispatch(wxe_queue);
+ more = dispatch(wxe_queue);
// fprintf(stderr, "\r\ndispatch_done %d\r\n", recurse_level);fflush(stderr);
recurse_level--;
@@ -262,12 +264,14 @@ void WxeApp::dispatch_cmds()
delete event;
}
}
+ return more;
}
int WxeApp::dispatch(wxeFifo * batch)
{
int ping = 0;
int blevel = 0;
+ int wait = 0; // Let event handling generate events sometime
wxeCommand *event;
erl_drv_mutex_lock(wxe_batch_locker_m);
while(true) {
@@ -275,10 +279,10 @@ int WxeApp::dispatch(wxeFifo * batch)
erl_drv_mutex_unlock(wxe_batch_locker_m);
switch(event->op) {
case WXE_BATCH_END:
- {--blevel; }
+ if(blevel>0) blevel--;
break;
case WXE_BATCH_BEGIN:
- {blevel++; }
+ blevel++;
break;
case WXE_DEBUG_PING:
// When in debugger we don't want to hang waiting for a BATCH_END
@@ -293,7 +297,7 @@ int WxeApp::dispatch(wxeFifo * batch)
memcpy(cb_buff, event->buffer, event->len);
}
event->Delete();
- return blevel;
+ return 1;
default:
if(event->op < OPENGL_START) {
// fprintf(stderr, " c %d (%d) \r\n", event->op, blevel);
@@ -307,13 +311,15 @@ int WxeApp::dispatch(wxeFifo * batch)
erl_drv_mutex_lock(wxe_batch_locker_m);
batch->Cleanup();
}
- if(blevel <= 0) {
+ if(blevel <= 0 || wait > 3) {
erl_drv_mutex_unlock(wxe_batch_locker_m);
- return blevel;
+ if(blevel > 0) return 1; // We are still in a batch but we can let wx check for events
+ else return 0;
}
// sleep until something happens
- //fprintf(stderr, "%s:%d sleep %d %d\r\n", __FILE__, __LINE__, batch->m_n, blevel);fflush(stderr);
+ // fprintf(stderr, "%s:%d sleep %d %d %d\r\n", __FILE__, __LINE__, batch->m_n, blevel, wait);fflush(stderr);
wxe_needs_signal = 1;
+ wait += 1;
while(batch->m_n == 0) {
erl_drv_cond_wait(wxe_batch_locker_c, wxe_batch_locker_m);
}
diff --git a/lib/wx/c_src/wxe_impl.h b/lib/wx/c_src/wxe_impl.h
index 57dac997ab..68f5deb336 100644
--- a/lib/wx/c_src/wxe_impl.h
+++ b/lib/wx/c_src/wxe_impl.h
@@ -73,7 +73,7 @@ public:
void wxe_dispatch(wxeCommand& event);
void idle(wxIdleEvent& event);
- void dispatch_cmds();
+ int dispatch_cmds();
void dummy_close(wxEvent& Ev);
bool sendevent(wxEvent *event);
diff --git a/lib/wx/examples/demo/demo.erl b/lib/wx/examples/demo/demo.erl
index 8b7412017a..0258202a67 100644
--- a/lib/wx/examples/demo/demo.erl
+++ b/lib/wx/examples/demo/demo.erl
@@ -243,6 +243,9 @@ handle_event(#wx{id = Id,
%% If you are going to printout mainly text it is easier if
%% you generate HTML code and use a wxHtmlEasyPrint
%% instead of using DCs
+
+ %% Printpreview doesn't work in >2.9 without this
+ wxIdleEvent:setMode(?wxIDLE_PROCESS_ALL),
Module = "ex_" ++ wxListBox:getStringSelection(State#state.selector) ++ ".erl",
HEP = wxHtmlEasyPrinting:new([{name, "Print"},
{parentWindow, State#state.win}]),
diff --git a/lib/wx/src/wxe_master.erl b/lib/wx/src/wxe_master.erl
index e17a3327ac..913bf4d41b 100644
--- a/lib/wx/src/wxe_master.erl
+++ b/lib/wx/src/wxe_master.erl
@@ -82,8 +82,14 @@ init_port(SilentStart) ->
%% Initalizes the opengl library
%%--------------------------------------------------------------------
init_opengl() ->
- GLLib = wxe_util:wxgl_dl(),
- wxe_util:call(?WXE_INIT_OPENGL, <<(list_to_binary(GLLib))/binary, 0:8>>).
+ case get(wx_init_opengl) of
+ true -> {ok, "already initialized"};
+ _ ->
+ GLLib = wxe_util:wxgl_dl(),
+ Res = wxe_util:call(?WXE_INIT_OPENGL, <<(list_to_binary(GLLib))/binary, 0:8>>),
+ element(1, Res) =:= ok andalso put(wx_init_opengl, true),
+ Res
+ end.
%%--------------------------------------------------------------------
%% Fetch early messages, hack to get start up args on mac
diff --git a/lib/xmerl/doc/src/notes.xml b/lib/xmerl/doc/src/notes.xml
index 12e64537ed..652560f60c 100644
--- a/lib/xmerl/doc/src/notes.xml
+++ b/lib/xmerl/doc/src/notes.xml
@@ -32,6 +32,61 @@
<p>This document describes the changes made to the Xmerl application.</p>
+<section><title>Xmerl 1.3.13</title>
+
+ <section><title>Fixed Bugs and Malfunctions</title>
+ <list>
+ <item>
+ <p>
+ The namespace_conformant option in xmerl_scan did not
+ work when parsing documents without explicit XML
+ namespace declaration.</p>
+ <p>
+ Own Id: OTP-14139</p>
+ </item>
+ <item>
+ <p> Fix a "well-formedness" bug in the XML Sax parser so
+ it returns an error if there are something more in the
+ file after the matching document. If one using the
+ xmerl_sax_parser:stream() a rest is allowed which then
+ can be sent to a new call of xmerl_sax_parser:stream() to
+ parse next document. </p> <p> This is done to be
+ compliant with XML conformance tests. </p>
+ <p>
+ Own Id: OTP-14211</p>
+ </item>
+ <item>
+ <p> Fixed compiler and dialyzer warnings in the XML SAX
+ parser. </p>
+ <p>
+ Own Id: OTP-14212</p>
+ </item>
+ <item>
+ <p> Change how to interpret end of document in the XML
+ SAX parser to comply with Tim Brays comment on the
+ standard. This makes it possible to handle more than one
+ doc on a stream, the standard makes it impossible to know
+ when the document is ended without waiting for the next
+ document (and not always even that). </p> <p> Tim Brays
+ comment: </p> <p> Trailing "Misc"<br/> The fact that
+ you're allowed some trailing junk after the root element,
+ I decided (but unfortunately too late) is a real design
+ error in XML. If I'm writing a network client, I'm
+ probably going to close the link as soon as a I see the
+ root element end-tag, and not depend on the other end
+ closing it down properly.<br/> Furthermore, if I want to
+ send a succession of XML documents over a network link,
+ if I find a processing instruction after a root element,
+ is it a trailer on the previous document, or part of the
+ prolog of the next? </p>
+ <p>
+ Own Id: OTP-14213</p>
+ </item>
+ </list>
+ </section>
+
+</section>
+
<section><title>Xmerl 1.3.12</title>
<section><title>Fixed Bugs and Malfunctions</title>
diff --git a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
index 2b9b37b5f3..f3470b2809 100644
--- a/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_base.erlsrc
@@ -145,10 +145,11 @@ parse_dtd(Xml, State) ->
%% [1] document ::= prolog element Misc*
%%----------------------------------------------------------------------
parse_document(Rest, State) when is_record(State, xmerl_sax_parser_state) ->
- {Rest1, State1} = parse_xml_decl(Rest, State),
+ {Rest1, State1} = parse_byte_order_mark(Rest, State),
{Rest2, State2} = parse_misc(Rest1, State1, true),
{ok, Rest2, State2}.
+?PARSE_BYTE_ORDER_MARK(Bytes, State).
%%----------------------------------------------------------------------
%% Function: parse_xml_decl(Rest, State) -> Result
@@ -159,15 +160,8 @@ parse_document(Rest, State) when is_record(State, xmerl_sax_parser_state) ->
%% [22] prolog ::= XMLDecl? Misc* (doctypedecl Misc*)?
%% [23] XMLDecl ::= '<?xml' VersionInfo EncodingDecl? SDDecl? S? '?>'
%%----------------------------------------------------------------------
--dialyzer({[no_fail_call, no_match], parse_xml_decl/2}).
parse_xml_decl(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_xml_decl/2);
-parse_xml_decl(?BYTE_ORDER_MARK_1, State) ->
- cf(?BYTE_ORDER_MARK_1, State, fun parse_xml_decl/2);
-parse_xml_decl(?BYTE_ORDER_MARK_2, State) ->
- cf(?BYTE_ORDER_MARK_2, State, fun parse_xml_decl/2);
-parse_xml_decl(?BYTE_ORDER_MARK_REST(Rest), State) ->
- cf(Rest, State, fun parse_xml_decl/2);
parse_xml_decl(?STRING("<") = Bytes, State) ->
cf(Bytes, State, fun parse_xml_decl/2);
parse_xml_decl(?STRING("<?") = Bytes, State) ->
@@ -179,31 +173,19 @@ parse_xml_decl(?STRING("<?xm") = Bytes, State) ->
parse_xml_decl(?STRING("<?xml") = Bytes, State) ->
cf(Bytes, State, fun parse_xml_decl/2);
parse_xml_decl(?STRING_REST("<?xml", Rest1), State) ->
- parse_xml_decl_1(Rest1, State);
-parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
- case unicode:characters_to_list(Bytes, Enc) of
- {incomplete, _, _} ->
- cf(Bytes, State, fun parse_xml_decl/2);
- {error, _Encoded, _Rest} ->
- ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])));
- _ ->
- parse_prolog(Bytes, State)
- end;
-parse_xml_decl(Bytes, State) ->
- parse_prolog(Bytes, State).
-
+ parse_xml_decl_rest(Rest1, State);
+?PARSE_XML_DECL(Bytes, State).
-parse_xml_decl_1(?STRING_UNBOUND_REST(C, Rest) = Bytes, State) ->
+parse_xml_decl_rest(?STRING_UNBOUND_REST(C, Rest) = Bytes, State) ->
if
?is_whitespace(C) ->
{_XmlAttributes, Rest1, State1} = parse_version_info(Rest, State, []),
- %State2 = event_callback({processingInstruction, "xml", XmlAttributes}, State1),% The XML decl. should not be reported as a PI
parse_prolog(Rest1, State1);
true ->
parse_prolog(?STRING_REST("<?xml", Bytes), State)
end;
-parse_xml_decl_1(Bytes, State) ->
- unicode_incomplete_check([Bytes, State, fun parse_xml_decl_1/2], undefined).
+parse_xml_decl_rest(Bytes, State) ->
+ unicode_incomplete_check([Bytes, State, fun parse_xml_decl_rest/2], undefined).
@@ -225,8 +207,6 @@ parse_prolog(?STRING_REST("<?", Rest), State) ->
parse_prolog(Rest1, State1);
{endDocument, Rest1, State1} ->
parse_prolog(Rest1, State1)
- % IValue = ?TO_INPUT_FORMAT("<?"),
- % {?APPEND_STRING(IValue, Rest1), State1}
end;
parse_prolog(?STRING_REST("<!", Rest), State) ->
parse_prolog_1(Rest, State);
@@ -239,7 +219,6 @@ parse_prolog(Bytes, State) ->
unicode_incomplete_check([Bytes, State, fun parse_prolog/2],
"expecting < or whitespace").
-
parse_prolog_1(?STRING_EMPTY, State) ->
cf(?STRING_EMPTY, State, fun parse_prolog_1/2);
parse_prolog_1(?STRING("D") = Bytes, State) ->
@@ -1232,7 +1211,6 @@ send_character_event(_, true, String, State) ->
%% Description: Parse whitespaces.
%% [3] S ::= (#x20 | #x9 | #xD | #xA)+
%%----------------------------------------------------------------------
--dialyzer({no_fail_call, whitespace/3}).
whitespace(?STRING_EMPTY, State, Acc) ->
case cf(?STRING_EMPTY, State, Acc, fun whitespace/3) of
{?STRING_EMPTY, State} ->
@@ -1258,16 +1236,7 @@ whitespace(?STRING_REST("\r", Rest), State, Acc) ->
whitespace(Rest, State#xmerl_sax_parser_state{line_no=N+1}, [?lf |Acc]);
whitespace(?STRING_UNBOUND_REST(C, Rest), State, Acc) when ?is_whitespace(C) ->
whitespace(Rest, State, [C|Acc]);
-whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
- {lists:reverse(Acc), Bytes, State};
-whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_binary(Bytes) ->
- case unicode:characters_to_list(Bytes, Enc) of
- {incomplete, _, _} ->
- cf(Bytes, State, Acc, fun whitespace/3);
- {error, _Encoded, _Rest} ->
- ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])))
- end.
-
+?WHITESPACE(Bytes, State, Acc).
%%----------------------------------------------------------------------
%% Function: parse_reference(Rest, State, HaveToExist) -> Result
@@ -1390,7 +1359,6 @@ parse_pe_reference_1(Bytes, State, Name) ->
"missing ; after reference " ++ Name).
-
%%----------------------------------------------------------------------
%% Function: insert_reference(Reference, State) -> Result
%% Parameters: Reference = string()
@@ -1406,7 +1374,6 @@ insert_reference({Name, Type, Value}, Table) ->
end.
-
%%----------------------------------------------------------------------
%% Function: look_up_reference(Reference, State) -> Result
%% Parameters: Reference = string()
@@ -1721,7 +1688,7 @@ handle_external_entity({http, Url}, State) ->
++ file:format_error(Reason));
{ok, FD} ->
{?STRING_EMPTY, EntityState} =
- parse_external_entity_1(<<>>,
+ parse_external_entity_byte_order_mark(<<>>,
State#xmerl_sax_parser_state{continuation_state=FD,
current_location=filename:dirname(Url),
entity=filename:basename(Url),
@@ -1737,6 +1704,8 @@ handle_external_entity({http, Url}, State) ->
handle_external_entity({Tag, _Url}, State) ->
?fatal_error(State, "Unsupported URI type: " ++ atom_to_list(Tag)).
+?PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State).
+
%%----------------------------------------------------------------------
%% Function : parse_external_entity_1(Rest, State) -> Result
%% Parameters: Rest = string() | binary()
@@ -1744,7 +1713,6 @@ handle_external_entity({Tag, _Url}, State) ->
%% Result : {Rest, State}
%% Description: Parse the external entity.
%%----------------------------------------------------------------------
--dialyzer({[no_fail_call, no_match], parse_external_entity_1/2}).
parse_external_entity_1(?STRING_EMPTY, #xmerl_sax_parser_state{file_type=Type} = State) ->
case catch cf(?STRING_EMPTY, State, fun parse_external_entity_1/2) of
{Rest, State1} when is_record(State1, xmerl_sax_parser_state) ->
@@ -1754,12 +1722,6 @@ parse_external_entity_1(?STRING_EMPTY, #xmerl_sax_parser_state{file_type=Type} =
Other ->
throw(Other)
end;
-parse_external_entity_1(?BYTE_ORDER_MARK_1, State) ->
- cf(?BYTE_ORDER_MARK_1, State, fun parse_external_entity_1/2);
-parse_external_entity_1(?BYTE_ORDER_MARK_2, State) ->
- cf(?BYTE_ORDER_MARK_2, State, fun parse_external_entity_1/2);
-parse_external_entity_1(?BYTE_ORDER_MARK_REST(Rest), State) ->
- parse_external_entity_1(Rest, State);
parse_external_entity_1(?STRING("<") = Bytes, State) ->
cf(Bytes, State, fun parse_external_entity_1/2);
parse_external_entity_1(?STRING("<?") = Bytes, State) ->
diff --git a/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc b/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
index 961806bf4c..6e59347fb8 100644
--- a/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_latin1.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,8 +34,36 @@
-define(APPEND_STRING(Rest, New), <<Rest/binary, New/binary>>).
-define(TO_INPUT_FORMAT(Val), unicode:characters_to_binary(Val, unicode, latin1)).
-%% STRING_REST and STRING_UNBOUND_REST is only different in the list case
-define(STRING_UNBOUND_REST(MatchChar, Rest), <<MatchChar, Rest/binary>>).
--define(BYTE_ORDER_MARK_1, undefined_bom1).
--define(BYTE_ORDER_MARK_2, undefined_bom2).
--define(BYTE_ORDER_MARK_REST(Rest), <<undefined, Rest/binary>>).
+
+-define(PARSE_BYTE_ORDER_MARK(Bytes, State),
+ parse_byte_order_mark(Bytes, State) ->
+ parse_xml_decl(Bytes, State)).
+
+-define(PARSE_XML_DECL(Bytes, State),
+ parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])));
+ _ ->
+ parse_prolog(Bytes, State)
+ end;
+ parse_xml_decl(Bytes, State) ->
+ parse_prolog(Bytes, State)).
+
+-define(WHITESPACE(Bytes, State, Acc),
+ whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
+ {lists:reverse(Acc), Bytes, State};
+ whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, Acc, fun whitespace/3);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])))
+ end).
+
+-define(PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State),
+ parse_external_entity_byte_order_mark(Bytes, State) ->
+ parse_external_entity_1(Bytes, State)).
diff --git a/lib/xmerl/src/xmerl_sax_parser_list.erlsrc b/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
index 624a621d92..6a4435b1d9 100644
--- a/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_list.erlsrc
@@ -36,6 +36,19 @@
%% In the list case we can't use a '++' when matchin against an unbound variable
-define(STRING_UNBOUND_REST(MatchChar, Rest), [MatchChar | Rest]).
--define(BYTE_ORDER_MARK_1, undefined_bom1).
--define(BYTE_ORDER_MARK_2, undefined_bom2).
--define(BYTE_ORDER_MARK_REST(Rest), [undefined|Rest]).
+
+-define(PARSE_BYTE_ORDER_MARK(Bytes, State),
+ parse_byte_order_mark(Bytes, State) ->
+ parse_xml_decl(Bytes, State)).
+
+-define(PARSE_XML_DECL(Bytes, State),
+ parse_xml_decl(Bytes, State) ->
+ parse_prolog(Bytes, State)).
+
+-define(WHITESPACE(Bytes, State, Acc),
+ whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
+ {lists:reverse(Acc), Bytes, State}).
+
+-define(PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State),
+ parse_external_entity_byte_order_mark(Bytes, State) ->
+ parse_external_entity_1(Bytes, State)).
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
index ff84ece97a..ec89024729 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf16be.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,8 +34,50 @@
-define(APPEND_STRING(Rest, New), <<Rest/binary, New/binary>>).
-define(TO_INPUT_FORMAT(Val), unicode:characters_to_binary(Val, unicode, {utf16, big})).
-%% STRING_REST and STRING_UNBOUND_REST is only different in the list case
-define(STRING_UNBOUND_REST(MatchChar, Rest), <<MatchChar/big-utf16, Rest/binary>>).
--define(BYTE_ORDER_MARK_1, undefined_bom1).
--define(BYTE_ORDER_MARK_2, <<16#FE>>).
+-define(BYTE_ORDER_MARK_1, <<16#FE>>).
-define(BYTE_ORDER_MARK_REST(Rest), <<16#FE, 16#FF, Rest/binary>>).
+
+-define(PARSE_BYTE_ORDER_MARK(Bytes, State),
+ parse_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_xml_decl(Rest, State);
+ parse_byte_order_mark(Bytes, State) ->
+ parse_xml_decl(Bytes, State)).
+
+-define(PARSE_XML_DECL(Bytes, State),
+ parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])));
+ _ ->
+ parse_prolog(Bytes, State)
+ end;
+ parse_xml_decl(Bytes, State) ->
+ parse_prolog(Bytes, State)).
+
+-define(WHITESPACE(Bytes, State, Acc),
+ whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
+ {lists:reverse(Acc), Bytes, State};
+ whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, Acc, fun whitespace/3);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])))
+ end).
+
+-define(PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State),
+ parse_external_entity_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_external_entity_1(Rest, State);
+ parse_external_entity_byte_order_mark(Bytes, State) ->
+ parse_external_entity_1(Bytes, State)).
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
index a330fce8d0..566333a045 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf16le.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,8 +34,50 @@
-define(APPEND_STRING(Rest, New), <<Rest/binary, New/binary>>).
-define(TO_INPUT_FORMAT(Val), unicode:characters_to_binary(Val, unicode, {utf16, little})).
-%% STRING_REST and STRING_UNBOUND_REST is only different in the list case
-define(STRING_UNBOUND_REST(MatchChar, Rest), <<MatchChar/little-utf16, Rest/binary>>).
--define(BYTE_ORDER_MARK_1, undefined_bom1).
--define(BYTE_ORDER_MARK_2, <<16#FF>>).
+-define(BYTE_ORDER_MARK_1, <<16#FF>>).
-define(BYTE_ORDER_MARK_REST(Rest), <<16#FF, 16#FE, Rest/binary>>).
+
+-define(PARSE_BYTE_ORDER_MARK(Bytes, State),
+ parse_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_xml_decl(Rest, State);
+ parse_byte_order_mark(Bytes, State) ->
+ parse_xml_decl(Bytes, State)).
+
+-define(PARSE_XML_DECL(Bytes, State),
+ parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])));
+ _ ->
+ parse_prolog(Bytes, State)
+ end;
+ parse_xml_decl(Bytes, State) ->
+ parse_prolog(Bytes, State)).
+
+-define(WHITESPACE(Bytes, State, Acc),
+ whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
+ {lists:reverse(Acc), Bytes, State};
+ whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, Acc, fun whitespace/3);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])))
+ end).
+
+-define(PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State),
+ parse_external_entity_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_external_entity_1(Rest, State);
+ parse_external_entity_byte_order_mark(Bytes, State) ->
+ parse_external_entity_1(Bytes, State)).
diff --git a/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc b/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
index d46d60d237..f41d06d013 100644
--- a/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
+++ b/lib/xmerl/src/xmerl_sax_parser_utf8.erlsrc
@@ -2,7 +2,7 @@
%%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2017. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -34,11 +34,55 @@
-define(APPEND_STRING(Rest, New), <<Rest/binary, New/binary>>).
-define(TO_INPUT_FORMAT(Val), unicode:characters_to_binary(Val, unicode, utf8)).
-
-%% STRING_REST and STRING_UNBOUND_REST is only different in the list case
-define(STRING_UNBOUND_REST(MatchChar, Rest), <<MatchChar/utf8, Rest/binary>>).
-define(BYTE_ORDER_MARK_1, <<16#EF>>).
-define(BYTE_ORDER_MARK_2, <<16#EF, 16#BB>>).
-define(BYTE_ORDER_MARK_REST(Rest), <<16#EF, 16#BB, 16#BF, Rest/binary>>).
+-define(PARSE_BYTE_ORDER_MARK(Bytes, State),
+ parse_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_2, State) ->
+ cf(?BYTE_ORDER_MARK_2, State, fun parse_byte_order_mark/2);
+ parse_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_xml_decl(Rest, State);
+ parse_byte_order_mark(Bytes, State) ->
+ parse_xml_decl(Bytes, State)).
+
+-define(PARSE_XML_DECL(Bytes, State),
+ parse_xml_decl(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, fun parse_xml_decl/2);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])));
+ _ ->
+ parse_prolog(Bytes, State)
+ end;
+ parse_xml_decl(Bytes, State) ->
+ parse_prolog(Bytes, State)).
+
+-define(WHITESPACE(Bytes, State, Acc),
+ whitespace(?STRING_UNBOUND_REST(_C, _) = Bytes, State, Acc) ->
+ {lists:reverse(Acc), Bytes, State};
+ whitespace(Bytes, #xmerl_sax_parser_state{encoding=Enc} = State, Acc) when is_binary(Bytes) ->
+ case unicode:characters_to_list(Bytes, Enc) of
+ {incomplete, _, _} ->
+ cf(Bytes, State, Acc, fun whitespace/3);
+ {error, _Encoded, _Rest} ->
+ ?fatal_error(State, lists:flatten(io_lib:format("Bad character, not in ~p\n", [Enc])))
+ end).
+-define(PARSE_EXTERNAL_ENTITY_BYTE_ORDER_MARK(Bytes, State),
+ parse_external_entity_byte_order_mark(?STRING_EMPTY, State) ->
+ cf(?STRING_EMPTY, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_1, State) ->
+ cf(?BYTE_ORDER_MARK_1, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_2, State) ->
+ cf(?BYTE_ORDER_MARK_2, State, fun parse_external_entity_byte_order_mark/2);
+ parse_external_entity_byte_order_mark(?BYTE_ORDER_MARK_REST(Rest), State) ->
+ parse_external_entity_1(Rest, State);
+ parse_external_entity_byte_order_mark(Bytes, State) ->
+ parse_external_entity_1(Bytes, State)).
diff --git a/lib/xmerl/vsn.mk b/lib/xmerl/vsn.mk
index 95adaa5bb0..1515a4e37d 100644
--- a/lib/xmerl/vsn.mk
+++ b/lib/xmerl/vsn.mk
@@ -1 +1 @@
-XMERL_VSN = 1.3.12
+XMERL_VSN = 1.3.13