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
Related:
Posted June 28, 2005 by Casey
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 (197) - regex non numeric (107) - regexp exclusion (97) - regex reference (63) - php regex reference (61) - regex numeric (50) - javascript ereg (47) - regex carrot (40) - php regexp reference (39) - php regex numeric (39) - regular expression exclusion (35) - php regexp numeric (33) - regexp reference (31) - regexp hungry (28) - regex numerical (28) - javascript eregi (26) - sex film com (24) - regexp numeric (24) - regex hungry (23) - regular expression hungry (22) - regular expressions exclusion (21) - php regex operator (20) - regexp numerical (19) - regex (17) - ereg javascript (17) - php regex operators (16) - regular expression non numeric (16) - regex exclusions (15) - non numeric regex (14) - regexp non numeric (14) - java string strip non numeric (13) - regex for numeric (13) - ereg reference (13) - regular expressions (12) - regex nonnumeric (12) - sms film com (11) - php regex non numeric (11) - php regex back reference (11) - numeric regex (11) - javascript ereg_replace (11) - regex money (11) - php regex exclusion (10) - php regexp operators (10) - not operator in preg_replace (9) - mysql regexp not operator (9) - regular expressions exclusions (9) - exclusion in regular expressions (9) - exclusion regex (9) - regular expressions hungry (9) - exclusion operator (8) - regular expression string exclusion (8) - regex exclusion string (8) - regular expressions non numeric (8) - preg replace non numeric (8) - regex replace non numeric (8) - php regular expression remove javascript (8) - RegEx non-numeric (8) - sms regex (7) - regular expression numerical (7) - regular expression remove non numeric (7) - mysql regex replace (7) - perl regex hungry (7) - regular expression carrot (7) - java remove brackets (6) - exclusion regex java (6) - javascript regexp money (6) - ereg replace (6) - php regex (6) - regular expression reference (6) - php non numeric regular expression (6) - regular expression non numeric string (6) - regexp string exclusion (6) - non numeric regular expression (6) - regular expressions carrot (6) - php ereg replace non numeric (6) - php ereg carrot (6) - F (6) - hungry regular expressions (6) - numeric regexp (6) - iphone preg_replace (6) - java replace bracket (6) - regex remove url (6) - php remove javascript (6) - mysql replace regex (5) - regexp for numeric (5) - regex numeric string (5) - regular expressions numeric (5) - php carrot operator (5) - regex numeric php (5) - php preg replace non numeric (5) - php regular expression exclusion (5) - numerical regex (5) - fat film com (5) - numeric Regular Expression (5) - reg exp numeric (5) - regex non numeric string (5) - eregi javascript (5) - money regex (5) - php regexp tag (5) - php replace regexp non-numeric (4) - mysql regexp email (4) - K fee advert (4) - meaning of on an sms (4) - regex reference php (4) - regularexpressions (4) - numeric php regexp (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 numeric regex (4) - php regular expressions hungry (4) - regular expression NONNUMERIC (4) - regexp for non numeric (4) - php replace non numeric (4) - regexp exclusion string (4) - regexp non numerical (4) - Regular expression sms (4) - regex non numerical (4) - mysql regular expression replace (4) - regex remove brackets (4) - javascript regex non numeric (4) - java regex numeric (4) - java regex reference (4) - regexp javascript money (4) - money regex Javascript (4) - php regex remove (4) - regex javascript not operator (4) - javascript regex numeric (4) - preg_replace remove javascript (4) - javascript regex isnumeric (3) - javascript regular expression money (3) - javascript regex strip non-numerics (3) - exclusion in regexp (3) - regular expressions reference (3) - Regex carrot operator (3) - carrot operator (3) - reference php regex (3) - php regexp hungry (3) - PHP regular expression reference (3) - Regular Expression for SMS (3) - php regular expression numeric (3) - exclusion in regex (3) - php regexp numerical string (3) - php regex hungry (3) - regex 2 (3) - php regular expressions exclusion (3) - regexp for non numeric string (3) - regex reference exclusion (3) -
Do you have code to remove javascript from stript using PHP?
Can you help my, please?