Font
[thread]5625[/thread]

Erklärung zu Regulärem Ausdruck



<< >> 4 entries, 1 page
SirLant
 2003-08-17 22:40
#56379 #56379
User since
2003-08-04
516 articles
BenutzerIn
[default_avatar]
Was macht dieser Ausdruck?
Ich weiß nur, dass er die aktuelle url holt und diese auf etwas prüft,aber auf was?Anschließend weißt er sie $url_prefix zu, mehr weiß ich nicht :(

Code (perl): (dl )
(&#36url_prefix = url ()) =~ s|[^/]*&#36||;
--Programming today is a race between Software Enginers striving to build bigger and better idiot-proof Programs,
and the Universe trying to produce bigger and better idiots.
So far, the Universe is winning!
DS
 2003-08-17 23:00
#56380 #56380
User since
2003-08-04
247 articles
BenutzerIn
[default_avatar]
Er löscht alle Zeichen am Ende, die nicht nicht "/" sind, d.h. aus http://irgendwas.test/aaaaa/blablabla.endung wird z.B. http://irgendwas.test/aaaaa/.
SirLant
 2003-08-17 23:07
#56381 #56381
User since
2003-08-04
516 articles
BenutzerIn
[default_avatar]
Achso, danke :)
--Programming today is a race between Software Enginers striving to build bigger and better idiot-proof Programs,
and the Universe trying to produce bigger and better idiots.
So far, the Universe is winning!
kabel
 2003-08-17 23:44
#56382 #56382
User since
2003-08-04
704 articles
BenutzerIn
[default_avatar]
hint, hint ;)

Quote
kabel@linux:~> perl
use YAPE::Regex::Explain;
print YAPE::Regex::Explain->new ('[^/]*$')->explain ();

The regular expression:

( ?-imsx:[^/]*$ )

matches as follows:

NODE EXPLANATION
----------------------------------------------------------------------
(?-imsx: group, but do not capture (case-sensitive)
(with ^ and $ matching normally) (with . not
matching \n) (matching whitespace and #
normally):
----------------------------------------------------------------------
[^/]* any character except: '/' (0 or more times
(matching the most amount possible))
----------------------------------------------------------------------
$ before an optional \n, and the end of the
string
----------------------------------------------------------------------
) end of grouping
----------------------------------------------------------------------
kabel@linux:~>
-- stefan
<< >> 4 entries, 1 page



View all threads created 2003-08-17 22:40.