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).

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.

commented: Do not delete it, it might help someone :-) +9
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.