Regular Expressions 101

Save & Share

Flavor

  • PCRE2 (PHP >=7.3)
  • PCRE (PHP <7.3)
  • ECMAScript (JavaScript)
  • Python
  • Golang
  • Java 8
  • .NET 7.0 (C#)
  • Rust
  • Regex Flavor Guide

Function

  • Match
  • Substitution
  • List
  • Unit Tests

Tools

Sponsors
There are currently no sponsors. Become a sponsor today!
An explanation of your regex will be automatically generated as you type.
Detailed match information will be displayed here automatically.
  • All Tokens
  • Common Tokens
  • General Tokens
  • Anchors
  • Meta Sequences
  • Quantifiers
  • Group Constructs
  • Character Classes
  • Flags/Modifiers
  • Substitution
  • A single character of: a, b or c
    [abc]
  • A character except: a, b or c
    [^abc]
  • A character in the range: a-z
    [a-z]
  • A character not in the range: a-z
    [^a-z]
  • A character in the range: a-z or A-Z
    [a-zA-Z]
  • Any single character
    .
  • Alternate - match either a or b
    a|b
  • Any whitespace character
    \s
  • Any non-whitespace character
    \S
  • Any digit
    \d
  • Any non-digit
    \D
  • Any word character
    \w
  • Any non-word character
    \W
  • Non-capturing group
    (?:...)
  • Capturing group
    (...)
  • Zero or one of a
    a?
  • Zero or more of a
    a*
  • One or more of a
    a+
  • Exactly 3 of a
    a{3}
  • 3 or more of a
    a{3,}
  • Between 3 and 6 of a
    a{3,6}
  • Start of string
    ^
  • End of string
    $
  • A word boundary
    \b
  • Non-word boundary
    \B

Regular Expression

/
/
sg

Test String

Code Generator

Generated Code

import java.util.regex.Matcher; import java.util.regex.Pattern; public class Example { public static void main(String[] args) { final String regex = "(?P<changelog>(?=What)(What's new in (?P<version>[^\\n\\s\\(]+).+?)(?=What|$))"; final String string = "What's new in 6.33 (2015-Nov-06 12:49):\n\n" + "*) dns - initial fix for situation when dynamic dns servers could disappear;\n" + "*) winbox - dropped support for winbox v3.0beta and v3.0rc (use winbox v3.0);\n" + "*) dhcpv6 - various improvement and fixes for dhcp-pd client and ippool6;\n" + "*) defconf - fixed rare situation where configuration was only partially loaded;\n" + "*) net - fix possible never ending loop when bad CDP discovery packet is received;\n" + "*) log - make default disk file name to reside in flash dir if it exists;\n" + "*) romon - change port list to be not ordered in export;\n" + "*) capsman - limit number of simultaneous DTLS handshakes;\n" + "*) capsman - fixed memory leak on CAP joining CAPsMAN when ssld is used;\n" + "*) winbox - added allow-fast-path to eoip, gre & ipip;\n" + "*) winbox - do not show power-cycle properties on non poe ports;\n" + "*) l2tp: implemented PPPoE over L2TP in LNS mode, RFC3817;\n" + "*) webfig - some of the setting were shifted to the right;\n" + "*) packages - allow to reinstall from bundle to separate packages & vice versa;\n" + "*) packages - prefer out of bundle packages when both of them are installed;\n" + "*) packages - fix a problem of upgrading bundle package to non bundled ones;\n" + "*) ipsec - force flow cache validation once in 1h;\n" + "*) winbox - make sure that all setting names get shown in full;\n" + "*) winbox - added poe power-cycle-ping settings to ethernet interfaces;\n" + "*) ppp - handle properly case were ppp client is given same address for local & remote end;\n" + "*) winbox - added vlan-mode & vlan-id to virtual-ap interface;\n" + "*) winbox - added timeout column to ipv6 address lists;\n" + "*) winbox - show SFP Tx/Rx Power properly;\n" + "*) winbox - added min-links to bonding interface;\n" + "*) winbox - do not show health menu on RB951Ui-2HnD;\n" + "*) winbox - added support for Login-Timeout & MAC-Auth-Mode in hotspot;\n" + "*) cerm - added option to disable crl download in '/certificate settings';\n" + "*) winbox - make user ssh key import work again;\n" + "*) webfig - make \"Copy to Access List\" work in CAPsMAN Registration Table;\n" + "*) userman - fix report generation problem which could result in some users being skipped from it;\n" + "*) winbox - fix to allow cpu-port as mirror-target\n" + "*) proxy - error.html parsing enhancement to improve performance\n" + "*) CCR1072 - improve ether1 performance under heavy load\n" + "*) routerboard - indicate RouterBOOT type in /system routerboard print;\n" + "*) mpls - properly use mpls mtu for routes;\n" + "*) cerm - fix key description for signed certificates;\n" + "*) trafflow - report flow addresses in v1 and v5 without NAT awareness;\n" + "*) hotspot - add mac-auth-mode setting for mac-as-passwd option;\n" + "*) hotspot - add login-timeout setting to force login for unauth hosts;\n" + "*) auto-upgrade - fixed auto upgrade for smipsbe;\n" + "*) dns - do not create duplicate entries for same dynamic dns server addresses;\n" + "*) ipsec - fix set on multiple policies which could result in adding non existent dynamic policies to the list;\n" + "*) email - allow server to be specified as fqdn which is resolved on each send;\n" + "*) fastpath - eoip,gre,ipip tunnels support fastpath (new per tunnel setting \"allow-fast-path\");\n" + "*) ppp, pptp, l2tp, pppoe - fix ppp compression related crashes;\n" + "*) cerm - also accept downloaded CRLs in PEM format;\n" + "*) userman - added 'history clear' to allow flushing undo history, which may take up significant amount of memory for huge databases with hundreds of users;\n" + "*) health - fix voltage for CRS109, CRS112 and CRS210 if powered from external adapter;\n" + "*) userman - added phone number support to signup form;\n" + "*) ip pool6 - try to acquire the same prefix if info matches recently freed;\n" + "*) ipsec - fix transport mode ph2 ID ports when policy selects specific ip protocol on initiator;\n" + "*) ipsec - use local-address for phase 1 matching and initiation;\n" + "*) route - fixed crash on removing route that was aggregated;\n" + "*) ipsec - fix replay window, was accidentally disabled since version 6.30;\n" + "*) ssh - allow host key import/export;\n" + "*) ssh - use 2048bit RSA host key when strong-crypto enabled;\n" + "*) ssh - support RSA keys for user authentication;\n" + "*) wlan - improved WMM-PowerSave support in wireless-cm2 package;\n" + "*) pptp & l2tp - fixed problem where android client could not connect if both dns names were not provided (was broken since v6.30);\n" + "*) auto-upgrade - added ability to select which versions to select when upgrading;\n" + "*) quickset - fixed HomeAP mode;\n" + "*) lte - improved modem identification to better support multiple identical modems;\n" + "*) snmp - fix system scripts table;\n" + "*) tunnels - eoip,eoipv6,gre,gre6,ipip,ipipv6,6to4 tunnels now support dns name as remote address;\n" + "*) fastpath - active mac-winbox or mac-telnet session no longer suspends fastpath;\n" + "*) fastpath - added per interface fastpath counters;\n" + "*) fastpath - added trafflow support in basic ipv4 and fasttrack ipv4 fastpath;\n" + "*) ppp - added on-up & on-down scripts to ppp profile;\n" + "*) winbox - allow to specify dns name in all the tunnels;\n" + "*) pppoe - added support for MTU > 1492 on PPPoE;\n" + "*) cerm - fix scep server certificate-reply degenerate PKCS#7 signed-data content;\n" + "*) ppp-client - added default channels for Alcatel OneTouch L100V;\n" + "*) defconf - fix for boards that had bridge with only wlan ports;\n" + "*) ovpn: support OpenWRT ovpn clients (or any other with enable-small option enabled);\n" + "*) cerm - use certificate file name for imported cert name;\n" + "*) fetch - fixed error message when error code 200 was received;\n" + "*) cerm - rebuild crl for local ca if crl file does not exist;\n" + "*) winbox - make directed broadcasts work for neighbor discovery;\n" + "*) upnp: automatically adjust mappings to new external ip change;\n" + "*) ppp - added ppp interface to upnp internals/externals if requested;\n" + "*) ppp - when adding ipv6 default route use user provided distance;\n" + "*) userman - allow to correctly enable CoA on router;\n" + "*) cerm - show crl nextupdate time;\n" + "*) ppp - added CoA support to PPPoE, PPTP & L2TP (Mikrotik-Recv-Limit, Mikrotik-Xmit-Limit, Mikrotik-Rate-Limit, Ascend-Data-Rate, Ascend-XMit-Rate, Session-Timeout);\n" + "*) ppp - added new option under \"ppp aaa\" - \"use-circuit-id-in-nas-port-id\";\n" + "*) userman - refresh active sessions/users view dynamically;\n" + "*) package - added version tag and show everywhere alongside of version number;\n" + "*) wlan - improved 802.11 protocol single connection TCP performance for ac chipset with cm2 package.\n\n" + "What's new in 6.32.2 (2015-Sep-17 15:20):\n\n" + "*) cerm - guard template from parallel use\n" + "*) mipsle - fixed missing second level menu in CLI;\n" + "*) sstp - avoid routing loops on client when adding default route;\n" + "*) sstp - fixed problem where sometimes sstp ip addresses were invalid;\n" + "*) switch - fixed bogus log messages about excessive broadcasts/multicasts on master-port;\n" + "*) tftp - fix request file name reading from packet\n" + "*) pptp encryption - better handling for out-of-order packets;\n" + "*) ethernet - added support for new ASIX USB Ethernet dongles;\n" + "*) CAPsMAN - fix 100% CPU usage when trying to upgrade RouterOS on CAP;\n" + "*) upgrade - fixed default configuration export;\n" + "*) ppp - fixed ppp interface stuck in not running state;\n" + "*) ipsec - fixed kernel failure when packets were not ordered on first call;\n" + "*) upnp - randomize action urls to fix \"filet-o-firewall\" vulnerability;\n" + "*) RB532/RB564 - fixed no link after ethernet disable/enable;\n" + "*) romon - fixed default configuration export;\n" + "*) tile - fixed occasional deadlock on module unload;\n" + "*) mesh - fix router lock-up when interface is added/removed;\n" + "*) ipsec - fix sockaddr buf size on id generation for ipv6 address;\n" + "*) health - show correct voltage for CRS109,CRS112,CRS210 when powered through PSU and show voltage up to 27V when powered through PoE;\n" + "*) email - resolve server address;\n" + "*) snmp - show firmware upgrade info;\n" + "*) upgrade - report status in check-for-updates.\n\n" + "What's new in 6.32.1 (2015-Sep-07 13:03):\n\n" + "*) RB911/912 - fixed lock-up;\n" + "*) RB493G - fixed reboot loop;\n" + "*) firewall - do not lose firewall mangle rules on start-up;\n" + "*) defconf - fix default configuration for routers without wireless package.\n\n" + "What's new in 6.32 (2015-Aug-31 14:47):\n\n" + "*) trafflow - added support for IPv6 targets;\n" + "*) switch - fixed port flapping on switch ports of RB750, RB750UP, RB751U-2HnD and RB951-2N (introduced in 6.31)\n" + "*) ipsec - added compatibility option skip-peer-id-check;\n" + "*) flash - fix kernel failure (exposed by 6.31);\n" + "*) bridge firewall - add ipv6 src/dst addr, ip protocol, src/dst port matching to bridge firewall;\n" + "*) RB911/RB912 - fix SPI bus lock after fast led blink;\n" + "*) ipsec - fix potential memory leak;\n" + "*) bridge firewall - vlan matchers support service tag - 0x88a8;\n" + "*) ippool6 - try to acquire the same prefix if info matches recently freed;\n" + "*) crs switch - allow to unset port learn-limit, new default is unset to allow more than 1023 hosts per port;\n" + "*) x86 - fixed 32bit multi-cpu kernel support;\n" + "*) chr - add hotspot,btest,traffgen support;\n" + "*) revised change that caused reboot by watchdog problems introduced in v6.31;\n" + "*) ipsec - use local-address for phase 1 matching and initiation;\n" + "*) ipsec - fix transport mode ph2 ID ports when policy selects specific ip protocol on initiator;\n" + "*) certificates -fixed bug where crl stopped working after a while;\n" + "*) ip accounting - fixed kernel crash;\n" + "*) snmp - fix system scripts get;\n" + "*) hotspot - ignore PoD remote requests if no HotSpot configured;\n" + "*) hotspot - fix kernel failure when www plugin aborts on broken html source;\n" + "*) torch - add invert filter for src/dst/src6/dst6 addresses ;\n" + "*) bonding - add min_links property for 802.3ad mode;\n" + "*) snmp - get vlan speed from master interface;\n" + "*) hotspot - fix html-directory path on small flash devices;\n" + "*) mipsbe - make system shutdown work again;\n" + "*) lcd - fixed parallel port LCD display support on multi-cpu x86;\n" + "*) bridge - fixed use-ip-firewall-for-vlan in setups with multiple bridges;\n" + "*) ipv6 - fixed DHCP-PD client skips some steps when renewing lease;\n" + "*) upnp - fixed protocol port selection for upnp protocol comunications;\n" + "*) firewall - fixed limit and dst-limit options.\n" + "*) winbox - fixed wireless interface l2mtu (VirtualAP and WDS interface creation in winbox)\n" + "*) winbox - fixed multiple firewall rule moving in Winbox 2\n" + "*) simple queues - restrict all changes in dynamic simple queues\n\n" + "What's new in 6.31 (2015-Aug-14 15:42):\n\n" + "*) check-for-update - added ability to select versions channel to check\n" + "(bugfix, current, RC or development)\n" + "*) demo mode of Cloud Hosted Router (CHR) added\n" + "*) chr - added x86_64 image for use in virtual environments\n" + "*) chr - added support for VMware SCSI virtual disks\n" + "*) chr - added support for VMware vmxnet3 network card\n" + "*) chr - added support for HyperV SCSI disks\n" + "*) chr - added support for HyperV Ethernet interfaces\n" + "*) chr - added support for virtio disks\n" + "*) fixed occasional interface resetting on CRS switches\n" + "*) fixed ethernet stopping on RB NetMetal / SXTG-5HPacD 10Mbit and 100Mbit links\n" + "*) ipsec - fixed crash in when gcm encryption was used\n" + "*) ipsec - allow to set peer address as \"::/0\"\n" + "*) ipsec - fixed empty sa-src address on acquire in tun mode\n" + "*) ipsec - show proposal info in export ipsec section\n" + "*) ipsec - preserve port wildcard when generating policy without port override\n" + "*) ipsec - fixed replay window, was accidentally disabled since version 6.30;\n" + "*) certificate manager - fixed memory leak\n" + "*) ssh - allow host key import/export\n" + "*) ssh - use 2048bit RSA host key when strong-crypto enabled\n" + "*) ssh - support RSA keys for user authentication\n" + "*) conntrack - fixed problem with manual connection removal\n" + "*) conntrack - added tcp-max-retrans-timeout and tcp-unacked-timeout\n" + "*) wireless - implemented l2mtu update if wireless-cm2 is enabled\n" + "*) wireless - improved WMM-PowerSave support in wireless-cm2 package\n" + "*) mpls - better multicore support for VPLS ingress/egress\n" + "*) ovpn - better multicore support for interface initialization/authentication/creation.\n" + "*) mesh - performance improvement\n" + "*) pptp & l2tp - fixed problem where android client could not connect if both dns names were not provided (was broken since v6.30)\n" + "*) user-manager - fixed username was not shown in /tool user-manager user\n" + "*) user-manager - fixed zoom for user-manager homepage when mobile devices used\n" + "*) winbox - restrict change dynamic interface fields\n" + "*) winbox - also hide passphrase in CAPsMAN with \"Hide Password\"\n" + "*) winbox - restrict reversed ranges in dst-port under firewall\n" + "*) quickset - fixed HomeAP mode\n" + "*) lcd - added LCD package for all architectures (for serial port LCD modules)\n" + "*) lcd - fixed crash (and 100% cpu usage) when interface gets removed from \"stats-all\" screen\n" + "*) tool fetch - fixed incomplete ftp download\n" + "*) tool fetch - don't trim [t]ftp leading slashes\n" + "*) proxy - adjust time according to time-zone settings in proxy cache contents.\n" + "*) bridge fastpath - fixed updating bridge FDB on receive (could cause TX traffic flooding on all bridge ports)\n" + "*) bonding fastpath - fixed possible crash when bonding master was also a bridge port\n" + "*) route - fixed crash on removing route that was aggregated\n" + "*) romon - fixed crash on SACKed tx segments\n" + "*) lte - improved modem identification to better support multiple identical modems\n" + "*) snmp - fixed system scripts table\n" + "*) traffic flow - fixed dynamic input/output interface reporting\n" + "*) ipv6 dhcp-relay - fixed problem loading configuration\n\n" + "known issue:\n" + "*) Dynamic DNS servers can disappear when \"allow-remote-requests\" are not enabled\n\n" + "What's new in 6.30 (2015-Jul-08 09:07):\n\n" + "*) wireless - added WMM power save suport for mobile devices;\n" + "*) firewall - sip helper improved, large packets no longer dropped;\n" + "*) fixed encryption 'out of order' problem on SMP systems;\n" + "*) email - fix sending multiple consecutive emails;\n" + "*) fixed router lockup on leap seconds with installed ntp package;\n" + "*) ccr - made hardware watchdog work again (was broken since v6.26);\n" + "*) console - allow users with 'policy' policy to change script owner;\n" + "*) icmp - use receive interface address when responding with icmp errors;\n" + "*) ipsec - fail ph2 negitioation when initiator proposed key length\n" + " does not match proposal configuration;\n" + "*) timezone - updated timezone information to 2015e release;\n" + "*) ssh - added option '/ip ssh stong-crypto'\n" + "*) wireless - improve ac radio coexistence with other wireless clients, optimized \n" + " transmit times to not interfere with other devices;\n" + "*) console - values of $\".id\", $\".nextid\" and $\".dead\" are avaliable for\n" + " use in 'print where' expressions;\n" + "*) console - ':execute' command now accepts script source in \"{}\" braces,\n" + " like '/system scripts add source=' does;\n" + "*) console - ':execute' command now returns internal number of running job,\n" + " that can be used to check and stop execution. For example:\n" + " :local j [:execute {/interface print follow where [:log info \"$name\"]}]\n" + " :delay 10s\n" + " :do { /system script job remove $j } on-error={}\n" + "*) console - firewall 'print' commands now show all entries including\n" + " dynamic, 'all' argument now has no effect;\n" + "*) ipsec - increase replay window to 128;\n" + "*) fixed file transfer on devices with large RAM memory;\n" + "*) pptp - fixed \"encryption got out of sync\" problem;\n" + "*) ppp - disable vj tcp header compression;\n" + "*) api - reduce api tcp connection keepalive delay to 30 seconds,\n" + " will timeout idle connections in about 5 minutes;\n" + "*) pptp & l2tp & sstp client: support the case were server issues its tunnel\n" + " ip address the same as its public one;\n" + "*) removed wireless package from routeros bundle package,\n" + " new wireless-fp is left in place and wireless-cm2 added as option;\n" + "*) pptp & l2tp client: when adding default route, add special exception route for\n" + " a tunnel itself (no need to add it manually anymore);\n" + "*) improved connection list: added connection packet/byte counters,\n" + " added separate counters for fasttrack, added current rate display,\n" + " added flag wheather connection is fasttracked/srcnated/dstnated,\n" + " removed 2048 connection entry limit;\n" + "*) tunnels - eoip, eoipv6, gre,gre6, ipip, ipipv6, 6to4 tunnels\n" + " have new property - ipsec-secret - for easy setup of ipsec\n" + " encryption and authentication;\n" + "*) firewall - added ipsec-policy matcher to check wheather packet\n" + " was/will be ipsec processed or not;\n" + "*) possibility to disable route cache - improves DDOS attack\n" + " handling performance up to 2x (note that ipv4 fastpath depends on route cache);\n" + "*) fasttrack - added dummy firewall rule in filter and mangle tables\n" + " to show packets/bytes that get processed in fasttrack and bypass firewall;\n" + "*) fastpath - vlan interfaces support fastpath;\n" + "*) fastpath - partial support for bonding interfaces (rx only);\n" + "*) fastpath - vrrp interfaces support fastpath;\n" + "*) fixed memory leak on CCR devices (introduced in 6.28);\n" + "*) lte - improved modem identification to better support multiple identical modems;\n" + "*) snmp - fix system scripts table;\n\n" + "What's new in 6.29 (2015-May-27 11:19):\n\n" + "*) ssh server - use custom generated DH primes when possible;\n" + "*) ipsec - allow to specify custom IP address for my_id parameter;\n" + "*) ovpn server - use subnet topology in ip mode if netmask is provided (makes android & ios \n" + " clients work);\n" + "*) console - allow '-' characters in unknown command argument names;\n" + "*) snmp - fix rare bug when some OIDs where skipped;\n" + "*) ssh - added aes-ctr cipher support;\n" + "*) mesh - fixed kernel crash;\n" + "*) ipv4 fasttrack fastpath - accelerates connection tracking and nat for marked\n" + " connections (more than 5x performance improvement compared to regular slow\n" + " path conntrack/nat) - currently limited to TCP/UDP only;\n" + "*) added ~fasttrack-connection~ firewall action in filter/mangle tables for marking\n" + " connections as fasttrack;\n" + "*) added fastpath support for bridge interfaces - packets received and transmitted\n" + " on bridge interface can go fastpath (previously only bridge forwarded packets\n" + " could go fastpath);\n" + "*) packets now can go half-fastpath - if input interface supports fastpath and\n" + " packet gets forwarded in fastpath but output interface does not support fastpath\n" + " or has interface queue other than only-hw-queue packet gets converted\n" + " to slow path only at the dst interface transmit time;\n" + "*) trafflow: add natted addrs/ports to ipv4 flow info;\n" + "*) tilegx: enable autoneg for sfp ports in netinstall;\n" + "*) health - fix voltage on some RB4xx;\n" + "*) romon - fix 100% CPU usage;\n" + "*) romon - moved under tools menu in console;\n" + "*) email - store hostname for consistency;\n" + "*) vrrp - do not reset interface when no interesting config changes;\n" + "*) fixed async. ppp server;\n" + "*) sstp - fixed router lockup.\n" + "*) queue tree: some queues would stop working after some configuration changes;\n" + "*) fixed CRS226 10G ports could lose link (introduced in 6.28);\n" + "*) fixed FREAK vulnerability in SSL & TLS;\n" + "*) firewall - fixed sector writes rising starting since 6.28;\n" + "*) improved support for new hEX lite;\n\n" + "What's new in 6.28 (2015-Apr-15 15:18):\n\n" + "*) email - increase server greeting timeout to 60s;\n" + "*) lte - ZTE MF823 may loose configuration;\n" + "*) userman - update paypal root certificate;\n" + "*) timezone - updated timezone information to 2015b release;\n" + "*) cm2 - fixed capsman v2 100% CPU and other stability improvements;\n" + "*) route - using ldp could cause connected routes with\n" + " invalid interface nexthop;\n" + "*) added support for SiS 190/191 PCI Ethernet adapter;\n" + "*) made metarouter work on boards with 802.11ac support or usb LTE;\n" + "*) sstp server - allow ADH only when no certificate set;\n" + "*) make fat32 disk formatting support disks bigger than 134GiB;\n" + "*) fixed tunnels - could crash when clamp-tcp-mss was enabled;\n" + "*) added basic counters for ipv4/bridge fast path, also show status wether fast\n" + " path is active at all;\n" + "*) trafflow: - fixed crash on disable;\n" + "*) pppoe over eoip - fixed crash with large packets;\n" + "*) tilegx - fixed memory leak when queue settings are changed;\n" + "*) ar9888 - fixed crash when hw reports invalid rate;\n" + "*) console - fixed \"in\" operator in console;\n" + "*) console - make \"/system package update print\" work again.\n" + "*) tile - rare situation when CCR devices failed to auto-negotiate ethernet link (introduced in v6.25);\n" + "*) dhcpv4 client - it is now possible to unset default clientid and hostname options\n" + "*) initial RoMon (Router Management Overlay Network) support added.\n\n" + "What's new in 6.27 (2015-Feb-11 13:24):\n\n" + "*) console - added 'comment' parameter for '/system script'\n" + "*) api - return sentences can have property \".section\" that groups values\n" + " from commands such as \"monitor\", \"traceroute\",\n" + " \"print\" (with non-zero 'interval' value);\n" + "*) cloud - add time zone detection feature \"/system clock time-zone-autodetect\";\n" + "*) cloud - rename \"/ip cloud enabled\" to \"/ip cloud ddns-enabled\";\n" + "*) cloud - make \"/ip cloud update-time\" independent from \"/ip cloud ddns-enabled\"\n" + "*) cloud - when setting \"/ip cloud ddns-enabled\" to \"no\" router will send\n" + " message to server to disable DNS name for this routerboard;\n" + "*) cloud - \"/ip cloud force-update\" command now will work also when\n" + " \"/ip cloud ddns-enabled = no\". usefull if user wants to disable DDNS;\n" + "*) RB4xxGL - improved ethernet throughput (less dropped packets);\n" + "*) RouterBOARD - fixed health reporting;\n" + "*) check-installation: fixed wrong kernel crc on powerpc boards\n" + "*) watchdog: fix software watchdog for x86\n" + "*) ssh - check conn state before sending disconnect message;\n" + "*) ipsec - fixed crash that happened in specific situation;"; final Pattern pattern = Pattern.compile(regex, Pattern.DOTALL); final Matcher matcher = pattern.matcher(string); while (matcher.find()) { System.out.println("Full match: " + matcher.group(0)); for (int i = 1; i <= matcher.groupCount(); i++) { System.out.println("Group " + i + ": " + matcher.group(i)); } } } }

Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Java, please visit: https://docs.oracle.com/javase/7/docs/api/java/util/regex/Pattern.html