0

How do I replace the XML expression

'

with

'

?

The problem is that the text is divided in multiple formats for the characters:

\n   -  10 13
& \n apos;
&a \n pos;

I did the following regular expression, and it works in RegexBuddy (JGsoft flavor).

&(\r?\n?a)(\r?\n?p)(\r?\n?o)(\r?\n?s)(\r?\n?;)

I tried to translate that to the UltraEdit format

&^{^p^}^{a^}^{^p^}^{o^}^{^p^}^{s^}^{^p^}^{;^}

but it doesn't work.

The documentation of UltraEdit says:

^{A^}^{B^}  (A|B)   Matches expression A OR B

Reference http://www.ultraedit.com/support/tutorials_power_tips/ultraedit/regular_expressions.html

What am I doing wrong?

2
  • Are you saying that you have files where HTML identities are split across lines? For example, ' might be &a⏎ followed by pos;⏎ on the next line? o.O That is highly unusual. What produced such a (to be frank, broken) file?
    – Synetech
    Jun 8, 2012 at 18:38
  • you first question, yes. second question SQL Server generate xml schemas with FOR XML PATH in this case. Jun 8, 2012 at 19:20

1 Answer 1

0

It seems that UltraEdit's single- and multi-line handling of regex is spotty/non-standard.

You could try setting the regex mode to Perl or Unix and using your original expression.

Also, if you copy-pasted your UE expression to the question instead of typing it manually and making a typo, then it is incorrect. You are checking for &\na\no\ns\n; instead of &\na\np\no\ns\n; (you forgot the literal p). It should be

&^{^p^}^{a^}^{^p^}^{p^}^{o^}^{^p^}^{s^}^{^p^}^{;^}
2
  • yes, i write wrong the expression. Jun 8, 2012 at 22:21
  • I'm not sure what you mean. Are you saying that you already tried the UE regex expression I included in my answer (with the ^pp)? If you already tried that and it still did not work, then try changing the regex mode and use your original expression.
    – Synetech
    Jun 8, 2012 at 23:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .