|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Generate all possible maches from a regular expression.Hi!
i have set of over 100+ regular expressions, instead of checking user input against these regex i want to store all possible matches in a database and search against them. like if a regex is "what is your (home|office|cell|mobile) phone number" will match against 1. what is your home phone number 2. what is your office phone number 3. what is your cell phone number 4. what is your mobile phone number i want to generate this list from the above mentioned regex. pls. guide. regards Mac Use RegExMatches instead of RegExMatch
-- Show quoteHide quote<mac.sp***@hotmail.com> wrote in message news:1137578353.574860.46770@g14g2000cwa.googlegroups.com... > Hi! > i have set of over 100+ regular expressions, instead of checking user > input against these regex i want to store all possible matches in a > database and search against them. > > like if a regex is > "what is your (home|office|cell|mobile) phone number" > will match against > 1. what is your home phone number > 2. what is your office phone number > 3. what is your cell phone number > 4. what is your mobile phone number > > i want to generate this list from the above mentioned regex. > pls. guide. > > regards > Mac > thanks for replying!
pls. read the problem again...i want to generate the possible matches from regex...means i want to generate all sentences which will match against the given regex. mac.sp***@hotmail.com wrote:
> Hi! I don't believe there is any built-in way of doing this. A very quick> i have set of over 100+ regular expressions, instead of checking user > input against these regex i want to store all possible matches in a > database and search against them. google doesn't turn up anyone who's done this already. The theory is straightforward enough: create the matching finite state machine, then recursively enumerate everything it produces. Maybe looking for some online CS course notes might produce something. btw, what do you want to return if the input regex is "a+" ? -- Larry Lard Replies to group please thanks Larry!
yes i know it won't cover all the regex but i've finite number of regex with finite possibilities only. the whole point is to optimize the search. i found http://perso.wanadoo.fr/joseph.rezeau/eao/developpement/expandRegexpToString.htm#Generating but it is not of much help. anybody ? <mac.sp***@hotmail.com> wrote in message
news:1137578353.574860.46770@g14g2000cwa.googlegroups.com... what is your [hocm][ofe][mflb][ile]* phone number> Hi! > i have set of over 100+ regular expressions, instead of checking user > input against these regex i want to store all possible matches in a > database and search against them. > > like if a regex is > "what is your (home|office|cell|mobile) phone number" > will match against > 1. what is your home phone number > 2. what is your office phone number > 3. what is your cell phone number > 4. what is your mobile phone number
MsgBox("test") no msg box?
How do I schedule events for execution ? How to check datatable.select How do menu list with one check Type 'OleDbConnection' no define Getting the hWnd of an IE window from an NT service Variable that holds the record count of a result set? looping through datareader Question on Dataset navigation vb.net Disable Datagrid Cell Based On Initial Value |
|||||||||||||||||||||||