Regular expressions are a pain. Jan Goyvaerts’ RegEx Reference helps.
In a related tip, the following will eliminate any non-numeric components in a string: ereg_replace(“[^0-9]”, “”, $string) . I guess I’ll have to admit that I’d not used the exclusion operator before (the carrot immediately following a square bracket). Now I know.
tags: ereg_replace, exclusion operator, php, regex, regex reference, regular expressions
Posted June 28, 2005 by Casey Bisson
Categories: Technology. Tags: ereg_replace, exclusion operator, php, regex, regex reference, regular expressions.
1 Comment(s)
Comments RSS
TrackBack Identifier URI
Leave a comment
User contributed tags for this post:
regex exclusion (203) - regex non numeric (119) - regexp exclusion (105) - regex reference (65) - php regex reference (62) - javascript ereg (55) - regex carrot (53) - regex numeric (50) - php regex numeric (42) - php regexp reference (40) - regular expression exclusion (38) - php regexp numeric (35) - regex hungry (34) - regexp hungry (33) - javascript eregi (31) - regexp reference (31) - regex numerical (31) - regex (25) - regexp numeric (25) - regular expression hungry (25) - sex film com (24) - regular expressions exclusion (23) - php regex operator (20) - php regex operators (19) - regexp numerical (19) - ereg javascript (19) - regular expression non numeric (18) - non numeric regex (17) - regex nonnumeric (16) - regex for numeric (16) - regexp non numeric (16) - ereg reference (16) - regex exclusions (15) - java string strip non numeric (13) - php regexp operators (13) - javascript ereg_replace (13) - RegEx non-numeric (13) - regular expressions (12) - sms film com (11) - php regex non numeric (11) - php regex back reference (11) - regular expressions hungry (11) - numeric regex (11) - java regex numeric (11) - regex money (11) - php regex exclusion (10) - not operator in preg_replace (9) - mysql replace regex (9) - mysql regexp not operator (9) - regular expressions exclusions (9) - exclusion in regular expressions (9) - exclusion regex (9) - regular expression string exclusion (9) - regex exclusion string (9) - regex replace non numeric (9) - mysql regex replace (9) - exclusion operator (8) - sms regex (8) - regular expressions non numeric (8) - preg replace non numeric (8) - regexp string exclusion (8) - regular expression remove non numeric (8) - numeric regexp (8) - php regular expression remove javascript (8) - perl regex hungry (8) - iphone preg_replace (8) - money regex (8) - java remove brackets (7) - javascript regexp money (7) - regular expression numerical (7) - numerical regex (7) - php ereg replace non numeric (7) - java regex reference (7) - php remove javascript (7) - regular expression carrot (7) - mysql regexp replace (7) - regexp money (7) - exclusion regex java (6) - javascript regular expression money (6) - ereg replace (6) - php regex (6) - regular expression reference (6) - php non numeric regular expression (6) - regular expression non numeric string (6) - regex numeric php (6) - non numeric regular expression (6) - regular expressions carrot (6) - php ereg carrot (6) - F (6) - hungry regular expressions (6) - eregi javascript (6) - javascript regex non numeric (6) - java regexp numeric (6) - MySQL replace regexp (6) - regex string exclusion (6) - java replace bracket (6) - regex remove url (6) - Regular Expression non-numeric (6) - mysql regexp email (5) - regexp for numeric (5) - regex numeric string (5) - regular expressions numeric (5) - php carrot operator (5) - php preg replace non numeric (5) - php numeric regex (5) - php regular expression exclusion (5) - fat film com (5) - numeric Regular Expression (5) - reg exp numeric (5) - regex non numeric string (5) - Regular expression sms (5) - regex for non numeric (5) - regex non numerical (5) - regex remove brackets (5) - php regexp tag (5) - hungry regex (5) - java regex non-numeric (5) - php replace regexp non-numeric (4) - K fee advert (4) - meaning of on an sms (4) - regex reference php (4) - regularexpressions (4) - numeric php regexp (4) - RegEx SMS (4) - php ereg replace regular expression back reference (4) - php regex back references (4) - ereg replace non numeric (4) - php regex is numeric (4) - regex php non numeric (4) - php regular expressions hungry (4) - regular expression NONNUMERIC (4) - regexp for non numeric (4) - php replace non numeric (4) - mysql regex numeric (4) - regexp exclusion string (4) - regexp numeric PHP (4) - regular expression exclusion string (4) - regexp non numerical (4) - regular expression exclusion operator (4) - mysql regular expression replace (4) - php regex remove javascript (4) - regular expression remove brackets (4) - regexp javascript money (4) - javascript strip brackets (4) - money regex Javascript (4) - php regex remove (4) - regex javascript not operator (4) - java regex bracket (4) - javascript regex numeric (4) - php regular expression not operator (4) -
Do you have code to remove javascript from stript using PHP?
Can you help my, please?