Jump to content

Java Regex Help Needed


Recommended Posts

Posted

Hi,

I need a small help reg Java RegEx. I have a file with some text. I need to find out if the below line exists in the file or not.
The thing is the text in red changes frequently, i want to build regEx pattern which checks for the text in blue and ignores the text in red.

[color=#0000cd][b]less/multilocale/slot3_es_es.css|[/b][/color][b][color=#ff0000]9b678b9b4ad0434c337a1817b7a33a7a[/color][color=#0000cd]|/css/popstarApp_es_ES.less[/color][/b]



Kindly help.....

Posted

[quote name='raj_523' timestamp='1348525484' post='1302533263']
Hi,

I need a small help reg Java RegEx. I have a file with some text. I need to find out if the below line exists in the file or not.
The thing is the text in red changes frequently, i want to build regEx pattern which checks for the text in blue and ignores the text in red.

[color=#0000cd][b]less/multilocale/slot3_es_es.css|[/b][/color][b][color=#ff0000]9b678b9b4ad0434c337a1817b7a33a7a[/color][color=#0000cd]|/css/popstarApp_es_ES.less[/color][/b]



Kindly help.....
[/quote]

Use '\S+' to match for non-white space characters

[code]

String regexString = "less/multilocale/slot3_es_es.css|9b678b9b4ad0434c337a1817b7a33a7a|/css/popstarApp_es_ES.less";

System.out.println(regexString.matches("less/multilocale/slot3_es_es.css\\S+/css/popstarApp_es_ES.less"));
[/code]

×
×
  • Create New...