Very simple regex

Andy Pieters mailings at vlaamse-kern.com
Wed Jun 8 14:01:56 UTC 2005


Hi

Example search string 

(^.*)[x]{2,}(.*$)

This will match any sentence that contains more then one consecutive x
Look at the parenteses. Those are match placeholders  

Example replace string

\1x\2

Will replace the found sentence with (^.*) linestart folowed by any character, 
folowed by one x, folowed by any character and lineend.

HTH

Kind regards


Andy

Test input

I have xxxxxxxx apples

Test output

I have x apples

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-----
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C++++$(+++) UL++++>++++$ P-(+)>++
L+++>++++$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>++++$@ h++(*) r-->++ y--()>++++
-- ---END GEEK CODE BLOCK------
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20050608/d7959556/attachment-0002.bin 


More information about the users mailing list