Regex: Difference between revisions

From DWIKI
Tony (talk | contribs)
m Match IP address
Tony (talk | contribs)
Tag: wikieditor
 
(One intermediate revision by the same user not shown)
Line 8: Line 8:
*https://regex101.com/
*https://regex101.com/


=Syntax=
==(?:)==
Non-capturing group, so creating a back-reference


=Tools=
=Tools=
Line 20: Line 24:
==Match IP address==
==Match IP address==
  '\d{1,3}[-x.]\d{1,3}[-x.]\d{1,3}'
  '\d{1,3}[-x.]\d{1,3}[-x.]\d{1,3}'
==Replace one or more spaces==
's/\s\s*/FOO/g'

Latest revision as of 15:10, 19 September 2025

Regular expressions

Links


Syntax

(?:)

Non-capturing group, so creating a back-reference

Tools

  • txt2regex

ZZ

pcre


FAQ

Match IP address

'\d{1,3}[-x.]\d{1,3}[-x.]\d{1,3}'


Replace one or more spaces

's/\s\s*/FOO/g'