Regex Notes
Regex Notes
A. JavaScript
=============
re1.test("string")
"string".search(re1);
Replacing a pattern:
B. C#
=====
C. PHP
======
<?php
preg_match('/(foo)(bar)(baz)/', 'foobarbaz', $matches, PREG_OFFSET_CAPTURE);
print_r($matches);
?>
D. Python 3
===========
There is a module re, containing, i.a., a function compile() and the Pattern
class.
Pattern objects can be created by:
pattern = compile("pattern")
"([a-z])\1" <- two adjoint identical lowercase letters: aa, bb, cc, ...
There is more of that and there are some `dialects', but the above should be
sufficient to you...