Skip to main content
Add PHP syntax highlighting
Source Link
Benjamin Loison
  • 5.8k
  • 4
  • 20
  • 37

In computer science, an alphanumeric value often means the first character is not a number, but it is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under PHP:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 
$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

Or take

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

In computer science, an alphanumeric value often means the first character is not a number, but it is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under PHP:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

Or take

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

In computer science, an alphanumeric value often means the first character is not a number, but it is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under PHP:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

Or take

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

Active reading [<https://en.wikipedia.org/wiki/Computer_science> <https://en.wiktionary.org/wiki/alphanumeric#Adjective> <https://en.wikipedia.org/wiki/PHP>].
Source Link
Peter Mortensen
  • 31.4k
  • 22
  • 110
  • 134

In Computer Sciencecomputer science, an Alphanumericalphanumeric value often means the first character is not a number, but it is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under phpPHP:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

orOr take this

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

In Computer Science, an Alphanumeric value often means the first character is not a number but is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under php:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

or take this

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

In computer science, an alphanumeric value often means the first character is not a number, but it is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under PHP:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

Or take

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

Removed arrogant remarks. Very good answer but needn't express an opinion.
Source Link

I take a correct cracked at it.

Remember inIn Computer Science, an Alphanumeric value often means the first character is not a number but is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_). Tested

Here is how you would do that:

Tested under php:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

or take this

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

I take a correct cracked at it.

Remember in Computer Science, an Alphanumeric value means the first character is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_). Tested under php:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

or take this

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

In Computer Science, an Alphanumeric value often means the first character is not a number but is an alphabet or underscore. Thereafter the character can be 0-9, A-Z, a-z, or underscore (_).

Here is how you would do that:

Tested under php:

$regex = '/^[A-Za-z_][A-Za-z\d_]*$/' 

or take this

^[A-Za-z_][A-Za-z\d_]*$ 

and place it in your development language.

formatting
Source Link
Zsolt Botykai
  • 52k
  • 14
  • 90
  • 111
Loading
Source Link
Loading