Returned 3 Results for "regex" Ordered By Relevance

references and grouped searches in textpad regex [relevance: 4.57]


2007-10-16 Digg! icurtain Delcious icurtain Technorati icurtain


when you group searches in the textpad regex editor you have to escape the grouping brackets with a backslash otherwise it searches them as literal characters

for example:
\([0-9]\) will search for any number 0-9
but if you omit the the escape slash it will look for (1) for example


Simple Regex replace in java and Striptags [relevance: 4]


2007-08-20 Digg! icurtain Delcious icurtain Technorati icurtain


replacing two chars using an or (pipes)

String p = "text to search.. through with = and , and ^

regex

";

System.out.println("result: "+ p.replaceAll(",|=", "") );

if you want to strip all the tags out you can use:

System.out.println("p: "+ p.replaceAll("\\W", " ") );

note.. that will strip spaces too hence we are replacing with " "

to strip tags properly and remove what's between them use

System.out.println("p: "+ p.replaceAll("<[^>]+>", "") );


Useful Regex for CSV to SQL [relevance: 3.79]


2008-03-07 Digg! icurtain Delcious icurtain Technorati icurtain


As a point of reference

how to convert a comma delimited file to an SQL insert
Assuming your data is the following

'key','value','0'
'key','value','1'

In notepad++ the syntax for search and replace would be as follows:
search: ('[^']+','[^']+','[^']+')
replace: (\1)
syntax varies depending on the flavour of regex

which can then have an insert statement added and...:
insert into table (key_value, value_blah, personal_id)
values
('key','value','0')
('key','value','1')

deleteing columns in Textpad
INSERT INTO "IB_RESOURCE_MESSAGE" (IB_MESSAGE_ID,IB_VALUE,IB_KEY,IB_BUNDLE_ID) VALUES (0,'Welcome #{identity.username}','loginSucceeded',0)

to delete the first value column (1, .... use the following
([0-9]+,
the plus will search for recurring instances of the pattern [0-9]