variables is regexp

M

Manlio Perillo

Hi.
It would be nice to have the possibility to define variables inside
regexp.

Ad example:
(?$identifier=regexp) for defining variables
(?$identifier) for accessing variables.


Thanks and regards Manlio Perillo
 
R

Richie Hindle

[Manlio]
It would be nice to have the possibility to define variables inside
regexp.

Ad example:
(?$identifier=regexp) for defining variables
(?$identifier) for accessing variables.

You can, using (?P<name>regex) to define them and (?P=name) to access them.
Here's my favourite example of regular expression abuse, using them to find
prime numbers:
2
3
5
7
11
....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,655
Latest member
eizareri

Latest Threads

Top