![]() |
PHP Regular Expression: Matching All Possible Characters
Using regular expressions in php is there a special character or a simple way of writing an regular expression which can match any possible characters in a string, without having to write all the possible combinations of the string, for example if you wanted to match a string which can contain all the possible characters.
|
Your question is nonsensical. What is the definition of "all possible characters"? In the extreme, it is every possible value that can be generated by a particular number of bits. This means that ANYTHING matches.
Restricting the set is purely a language/cultural issue. |
sorry i'm terrible at explaining myself
string1 = sitename string2 = message And if i was given the two strings concatenated: sitenameauthor Now the sitename and message can contain any printable character, how would i go about seperating these two strings. to obtain the site name I thought of doing: :
/http:\/\/ww\.[Aa-Zz0\-9 and then all the other printable characters]*/ |
Well, a site name can't have just any printable character. There are specifications.
It would be easier to put a separator of some kind so you can just explode it or split it or something. But if you want to keep it like that, you can check based on tlds. Also, with regular expressions, any character is represented by a dot: . :
^.*$ matches anything |
| All times are GMT -5. The time now is 3:03 PM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC