473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

Regex Problem with Database Data (Unicode?)

Hello,

I'm using the following Rexex function to strip HTML tags from text:

return Regex.Replace(text, "<.*?>", String.Empty);

If I set text manually to something like "<b>test</b>" then it correctly returns "test".

But ... if I have a field in the database with the same input value, it returns it unmodified.

I'm guessing that the DB value might be Unicode? If so, how can I get the regex expression to work?

Also, is there a way the regex expression could be extended to also cover Encoded Html?

Thanks!
Apr 8 '08 #1
1 1031
Not sure what was causing it, but now it's working fine!
Apr 14 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: marek | last post by:
trying this example to make print MatchObject reference. Fails (prints None). Does anybody know where I am wrong? # -*- coding: cp1251 -*- import re # pattern in Ukrainian ('привіт') p = ...
6
by: Xah Lee | last post by:
how to represent the unicode "em space" in regex? e.g. i want do something like this: fracture=re.split(r'\342371*\|\342371*',myline,re.U) Xah xah@xahlee.org ∑ http://xahlee.org/
2
by: John Perks and Sarah Mount | last post by:
I have to split some identifiers that are casedLikeThis into their component words. In this instance I can safely use to represent uppercase, but what pattern should I use if I wanted it to work...
7
by: bill tie | last post by:
I'd appreciate it if you could advise. 1. How do I replace "\" (backslash) with anything? 2. Suppose I want to replace (a) every occurrence of characters "a", "b", "c", "d" with "x", (b)...
7
by: Mike Labosh | last post by:
I have the following System.Text.RegularExpressions.Regex that is supposed to remove this predefined list of garbage characters from contact names that come in on import files : Dim...
7
by: Dennis Gearon | last post by:
If I've read everything right, in order to get: multiple languages on a site with the functionality of ALL of: REGEX LIKE Correctly sorted text
3
by: Pascal | last post by:
bonjour hello I would like to trim a string of all its white spaces so i used myString.trim() but it doesn't work as supposed : unsecable space are remaining in the middle of my string... i...
3
by: sophie_newbie | last post by:
Hi, I want to store python text strings that characters like "é" "Č" in a mysql varchar text field. Now my problem is that mysql does not seem to accept these characters. I'm wondering if there...
2
by: christopher taylor | last post by:
hello python-list! the other day, i was trying to match unicode character sequences that looked like this: \\uAD0X... my issue, is that the pattern i used was returning:
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.