Multiple Regular Expression

L

lltaylor

Hello All,

I am writing a regex scanning app, I want to allow the user to be able
to enter multiple regular expressions.

Is there a way I can search for all the regular expressions in one
pass (of my file or direcotry) or do I have to instantiate a regex
object for each regular expression, ideally I need this to be done
dynamically.

Any suggestion would be appreciated.

Thnaks

Lloyd
 
J

John Davison

lltaylor said:
Hello All,

I am writing a regex scanning app, I want to allow the user to be able
to enter multiple regular expressions.

Is there a way I can search for all the regular expressions in one
pass (of my file or direcotry) or do I have to instantiate a regex
object for each regular expression, ideally I need this to be done
dynamically.

Any suggestion would be appreciated.

Thnaks

Lloyd

You can try grouping the regular expressions and separate them with a |

For example, [a-z]* and [0-9]* might become
([a-z]*)|([0-9]*)

But you might want to try to compile each one first and make sure they
are well-formed before concatenating them like that.

John
 

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

Similar Threads

regular expression 1
regular expression(Regex) 6
Regular Expression Matches 9
Regex internal caching or what? 4
regular expression 7
Regular Expression in C# 3
Regular expression 5
Regular Expressions Question 8

Top