0

The text:
<form action="ajaxa/login" method="post" class="odf_ajax loading_image_left" data-target="ajax_login_form">

The regex (to find the form's action):
$regex = '/<form.+?action="(.+?)"/i';

The expected result:
Array (2): [0] => '<form action="ajaxa/login"', [1] => 'ajaxa/login'

The actual result:
Array (1): [0] => 'ajaxa/login'

Can anyone help me explain why this regex is not returning the expected result?

Sidenote: If I remove the "<" from the start of the regex, it does return the expected result (without the "<", of course).

Edited by minitauros

1
Contributor
1
Reply
14
Views
3 Years
Discussion Span
Last Post by minitauros
2

Damn I'm such a dumbass, wasn't using htmlentities() so the <form part was recognized as HTML and therefore not printed to the screen. Sorry! This thread may be deleted, locked, etc. but I can't find a way to do so myself.

Votes + Comments
Do not delete it, it might help someone :-)
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.